/* =========================================================
   HEROICA · Prototipo de RPG de hábitos
   ========================================================= */

:root {
  --bg: #070a12;
  --panel: rgba(18, 24, 39, 0.74);
  --panel-solid: #111827;
  --panel-2: #0e1524;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f4efe3;
  --muted: #96a0b5;
  --muted-2: #6f7a90;
  --gold: #eec27f;
  --gold-2: #c9934f;
  --gold-dim: rgba(238, 194, 127, 0.14);
  --red: #ff6b76;
  --red-dim: rgba(255, 107, 118, 0.14);
  --green: #78d6a6;
  --green-dim: rgba(120, 214, 166, 0.13);
  --accent: #e8b86a;
  --accent-soft: rgba(232, 184, 106, 0.16);
  --radius: 20px;
  --radius-sm: 13px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --display: "Cinzel", "Times New Roman", serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-class="explorador"] {
  --accent: #5fe0c0;
  --accent-soft: rgba(95, 224, 192, 0.15);
}
body[data-class="sabio"] {
  --accent: #93a5ff;
  --accent-soft: rgba(147, 165, 255, 0.15);
}
body[data-class="sanador"] {
  --accent: #ff9fbe;
  --accent-soft: rgba(255, 159, 190, 0.15);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: 0.01em;
}

svg {
  display: block;
}

::selection {
  background: var(--accent);
  color: #0a0d15;
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #070a12;
}
::-webkit-scrollbar-thumb {
  background: #222c42;
  border-radius: 20px;
  border: 2px solid #070a12;
}
::-webkit-scrollbar-thumb:hover {
  background: #33405c;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Ambient background ---------- */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 16% -8%, rgba(43, 61, 110, 0.55) 0%, transparent 62%),
    radial-gradient(780px 480px at 92% 2%, rgba(79, 40, 91, 0.42) 0%, transparent 58%),
    radial-gradient(700px 500px at 60% 110%, rgba(25, 60, 58, 0.25) 0%, transparent 60%);
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */

.app {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(14, 19, 32, 0.9) 0%, rgba(8, 11, 19, 0.94) 100%);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 6px 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: #17110a;
  background: linear-gradient(145deg, #f6d79f, var(--gold-2));
  box-shadow: 0 8px 24px rgba(201, 147, 79, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.brand-text {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: 0.18em;
  color: var(--gold);
  line-height: 1.15;
}

.brand-text small {
  display: block;
  font-family: var(--body);
  font-size: 8.5px;
  letter-spacing: 0.11em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-top: 4px;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.nav-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}

.nav-btn.is-active {
  color: var(--text);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 24%, transparent);
}

.nav-btn.is-active svg {
  stroke: var(--accent);
}

.nav-dot {
  margin-left: auto;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  opacity: 0;
}

.nav-btn.is-active .nav-dot {
  opacity: 1;
}

.rail-hero {
  margin-top: 2px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008));
}

.rail-avatar {
  position: relative;
  width: 78px;
  height: 92px;
  margin: -4px auto 4px;
}

.avatar-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.av-shadow {
  fill: #000;
  opacity: 0.5;
}
.av-cloak {
  fill: color-mix(in srgb, var(--accent) 16%, #0b0f1a);
  stroke: color-mix(in srgb, var(--accent) 24%, transparent);
  stroke-width: 1.5;
}
.av-cloak-inner {
  fill: #090c14;
  stroke: color-mix(in srgb, var(--accent) 30%, transparent);
  stroke-width: 1.2;
}
.av-hood {
  fill: color-mix(in srgb, var(--accent) 44%, #0b0f1a);
  stroke: color-mix(in srgb, var(--accent) 65%, transparent);
  stroke-width: 1.5;
}
.av-face {
  fill: #070a12;
}
.av-eye {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 76%, white);
  stroke-width: 2.4;
  stroke-linecap: round;
  filter: drop-shadow(0 0 5px var(--accent));
}
.av-rune {
  fill: color-mix(in srgb, var(--accent) 75%, white);
  opacity: 0.85;
}
.av-line {
  fill: none;
  stroke: color-mix(in srgb, var(--accent) 42%, transparent);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.av-gem {
  fill: var(--accent);
  filter: drop-shadow(0 0 7px var(--accent));
}
.av-spark {
  fill: var(--accent);
  opacity: 0.65;
}

.rail-level {
  position: absolute;
  right: -6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  border-radius: 999px;
  background: #0b0f1a;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 0 16px color-mix(in srgb, var(--accent) 18%, transparent);
}

.rail-hero-copy {
  text-align: center;
  margin-bottom: 12px;
}

.rail-hero-copy b {
  display: block;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.rail-hero-copy span {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mini-meter {
  margin-top: 9px;
}

.mini-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.rail-foot {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.rail-res {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 2px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.rail-res span {
  font-size: 13px;
  line-height: 1;
}

.rail-res b {
  font-size: 12px;
  font-weight: 600;
}

.rail-res small {
  font-size: 8.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.main {
  min-width: 0;
  padding: 26px 34px 70px;
}

/* ---------- Topbar ---------- */

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 5px;
}

.topbar-title h1 {
  font-size: 30px;
  line-height: 1.1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.res-chip {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 21, 35, 0.65);
  font-size: 12px;
}

.res-chip b {
  font-size: 13px;
  font-weight: 600;
}

.res-ico {
  font-size: 13px;
  transform: translateY(1px);
}

.res-label {
  font-size: 9.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.res-chip.gold b {
  color: var(--gold);
}
.res-chip.gem b {
  color: #9fd0ff;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(15, 21, 35, 0.65);
  color: var(--muted);
  transition: 0.18s ease;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
}

/* ---------- Screens / panels ---------- */

.screen {
  display: none;
}

.screen.is-active {
  display: block;
  animation: fadeUp 0.35s ease both;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(22, 29, 47, 0.76) 0%, rgba(14, 19, 32, 0.82) 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(14px);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-head h3 {
  font-size: 19px;
}

.panel-note {
  font-size: 11.5px;
  color: var(--muted-2);
  margin-top: 5px;
}

.hint {
  font-size: 11.5px;
  color: var(--muted-2);
}

.muted {
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.tag-accent {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 32%, transparent);
  background: var(--accent-soft);
}

.tag-danger {
  color: #ff9aa2;
  border-color: rgba(255, 107, 118, 0.28);
  background: var(--red-dim);
}

/* ---------- Hero banner ---------- */

.hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) 320px;
  align-items: center;
  gap: 20px;
  min-height: 268px;
  padding: 30px 34px;
  overflow: hidden;
  background:
    radial-gradient(520px 280px at 82% 42%, color-mix(in srgb, var(--accent) 13%, transparent) 0%, transparent 66%),
    radial-gradient(400px 260px at 100% 100%, rgba(255, 107, 118, 0.06) 0%, transparent 70%),
    linear-gradient(115deg, rgba(26, 35, 57, 0.9) 0%, rgba(14, 19, 32, 0.92) 100%);
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(115deg, transparent 0 48%, rgba(255, 255, 255, 0.028) 48% 48.4%, transparent 48.4% 100%);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.live-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: breathe 2.4s ease-in-out infinite;
}

.hero-banner-copy h2 {
  margin: 13px 0 8px;
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.08;
}

.hero-banner-copy > p {
  max-width: 540px;
  color: var(--muted);
  font-size: 13px;
}

.banner-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 220px));
  gap: 16px;
  margin-top: 22px;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bar {
  position: relative;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.bar-xp > i {
  background: linear-gradient(90deg, var(--gold-2), #f7d69c);
  box-shadow: 0 0 14px rgba(238, 194, 127, 0.35);
}

.bar-hp > i {
  background: linear-gradient(90deg, #c4475a, #ff8b93);
  box-shadow: 0 0 14px rgba(255, 107, 118, 0.28);
}

.bar-boss {
  height: 9px;
}

.bar-boss > i {
  background: linear-gradient(90deg, #8d2637, #ff5d6c);
  box-shadow: 0 0 18px rgba(255, 93, 108, 0.38);
}

.hero-banner-art {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 250px;
}

.avatar-large {
  width: 210px;
  height: 250px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 24px 30px rgba(0, 0, 0, 0.5));
  animation: floaty 7s ease-in-out infinite;
}

.halo {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent) 0%, transparent 66%);
  filter: blur(8px);
}

.orbit {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  border-radius: 50%;
  transform: rotate(-24deg);
}

.orbit-1 {
  width: 260px;
  height: 150px;
}

.orbit-2 {
  width: 300px;
  height: 200px;
  border-style: dashed;
  opacity: 0.6;
}

.level-chip {
  position: absolute;
  left: 6px;
  top: 44px;
  z-index: 3;
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 10px;
  background: rgba(9, 13, 22, 0.82);
  backdrop-filter: blur(8px);
  font-family: var(--display);
}

.level-chip span {
  font-size: 8px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
}

.level-chip b {
  font-size: 17px;
  color: var(--accent);
}

.class-chip {
  position: absolute;
  right: 8px;
  bottom: 30px;
  z-index: 3;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(9, 13, 22, 0.8);
  border: 1px solid var(--line);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pet-chip {
  position: absolute;
  right: 40px;
  top: 22px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(9, 13, 22, 0.85);
  border: 1px solid rgba(255, 138, 76, 0.3);
  color: #ffb38a;
  font-size: 9px;
  letter-spacing: 0.06em;
}

/* ---------- Today grid ---------- */

.today-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.quests-panel {
  padding: 22px 24px 18px;
}

.quest-progress {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--display);
  font-size: 16px;
  color: var(--muted-2);
}

.quest-progress b {
  font-size: 28px;
  color: var(--accent);
  line-height: 1;
}

.filters {
  display: flex;
  gap: 6px;
  margin: 16px 0 12px;
}

.chip {
  padding: 6px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: 0.16s ease;
}

.chip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.chip.is-active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 22%, transparent);
}

.quest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quest-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 13px;
  padding: 11px 12px 11px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.028), rgba(255, 255, 255, 0.008));
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.quest-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--stat-color) 32%, var(--line));
  background: linear-gradient(110deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012));
}

.quest-card[data-stat="fuerza"] {
  --stat-color: #ff8a7a;
}
.quest-card[data-stat="sabiduria"] {
  --stat-color: #9ca8ff;
}
.quest-card[data-stat="vitalidad"] {
  --stat-color: #7fe0b0;
}
.quest-card[data-stat="disciplina"] {
  --stat-color: #f3c46d;
}
.quest-card[data-stat="carisma"] {
  --stat-color: #ff9fc7;
}

.q-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--stat-color) 12%, #0c111d);
  border: 1px solid color-mix(in srgb, var(--stat-color) 20%, transparent);
  font-size: 19px;
}

.q-main {
  min-width: 0;
}

.q-main h4 {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.q-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 4px;
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}

.q-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.q-meta .q-stat {
  color: var(--stat-color);
  opacity: 0.85;
}

.q-meta .q-streak {
  color: #f0a56a;
}

.q-check {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--stat-color) 34%, var(--line));
  background: transparent;
  color: transparent;
  font-size: 15px;
  font-weight: 700;
  transition: 0.18s ease;
}

.q-check:hover {
  border-color: var(--stat-color);
  color: color-mix(in srgb, var(--stat-color) 70%, white);
  background: color-mix(in srgb, var(--stat-color) 10%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--stat-color) 18%, transparent);
}

.quest-card.is-done {
  opacity: 0.62;
  background: linear-gradient(110deg, rgba(120, 214, 166, 0.07), rgba(255, 255, 255, 0.008));
  border-color: rgba(120, 214, 166, 0.16);
}

.quest-card.is-done .q-main h4 {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

.quest-card.is-done .q-check {
  border-color: var(--green);
  background: var(--green);
  color: #0a1712;
  box-shadow: 0 0 18px rgba(120, 214, 166, 0.3);
}

.quest-card.just-done {
  animation: questPop 0.45s ease;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  transition: 0.18s ease;
}

.ghost-btn:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ghost-btn.small {
  padding: 6px 10px;
  font-size: 10.5px;
}

.ghost-btn .plus {
  font-size: 15px;
  line-height: 1;
  color: var(--accent);
}

.add-quest {
  width: 100%;
  margin-top: 10px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 30px 20px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  font-size: 12px;
  text-align: center;
}

.empty-state p {
  max-width: 30ch;
  line-height: 1.5;
}

.side-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ---------- Boss ---------- */

.boss-panel {
  padding: 22px 22px 20px;
  background:
    radial-gradient(300px 180px at 50% 55%, rgba(255, 70, 90, 0.09) 0%, transparent 70%),
    linear-gradient(180deg, rgba(30, 21, 39, 0.8) 0%, rgba(14, 19, 32, 0.9) 100%);
}

.boss-stage {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.boss-art {
  position: relative;
  height: 170px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.boss-art svg {
  height: 100%;
  width: auto;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.45));
  animation: bossFloat 6s ease-in-out infinite;
}

.boss-glow {
  position: absolute;
  bottom: 0;
  width: 190px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 70, 90, 0.18) 0%, transparent 70%);
  filter: blur(8px);
}

.boss-panel.is-hit .boss-art svg {
  animation: bossHit 0.4s ease;
}

.boss-hp {
  margin-top: 2px;
}

.hp-labels {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 9.5px;
  color: var(--muted-2);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hp-labels b {
  color: #ff9aa2;
  font-size: 11px;
  letter-spacing: 0.02em;
}

.boss-hp .hint {
  margin-top: 8px;
}

.boss-hp .hint b {
  color: #ffb2b8;
}

/* ---------- Streak ---------- */

.streak-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 18px;
}

.streak-flame {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 14px;
  font-size: 24px;
  background: radial-gradient(circle at 50% 60%, rgba(255, 145, 70, 0.22), rgba(255, 145, 70, 0.04));
  border: 1px solid rgba(255, 145, 70, 0.2);
  box-shadow: 0 0 26px rgba(255, 145, 70, 0.1) inset;
}

.streak-copy {
  min-width: 0;
}

.big-number {
  font-family: var(--display);
  font-size: 25px;
  line-height: 1.05;
  color: #ffb27c;
}

.big-number small {
  font-family: var(--body);
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.shield-btn {
  margin-left: auto;
  flex: none;
  font-size: 17px;
}

/* ---------- Hero screen ---------- */

.hero-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 18px;
  align-items: start;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 22px 22px;
  text-align: center;
  background:
    radial-gradient(260px 220px at 50% 18%, var(--accent-soft) 0%, transparent 70%),
    linear-gradient(180deg, rgba(23, 30, 49, 0.8) 0%, rgba(14, 19, 32, 0.9) 100%);
}

.profile-art {
  position: relative;
  width: 170px;
  height: 195px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.profile-art .avatar-large {
  width: 165px;
  height: 195px;
}

.profile-card h2 {
  font-size: 26px;
  margin-top: 8px;
}

.profile-card .muted {
  font-size: 11.5px;
  margin-top: 3px;
}

.profile-level {
  margin-top: 14px;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-level b {
  font-family: var(--display);
  font-size: 18px;
  color: var(--accent);
  margin-left: 4px;
}

.profile-card .meter {
  width: 100%;
  margin-top: 12px;
  text-align: left;
}

.profile-resources {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.profile-resources div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.profile-resources span {
  font-size: 13px;
}

.profile-resources b {
  font-size: 13px;
}

.profile-resources small {
  font-size: 8px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.stack > .panel,
.achievements-panel {
  padding: 20px 22px;
}

.stats-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 18px;
}

.stat-row-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 10px;
}

.stat-row-item .s-ico {
  font-size: 15px;
  text-align: center;
}

.stat-row-item .s-name {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
  margin-bottom: 5px;
}

.stat-row-item .s-name em {
  font-style: normal;
  color: var(--muted-2);
  font-size: 9px;
}

.stat-row-item .s-val {
  font-family: var(--display);
  font-size: 14px;
  color: var(--accent);
  text-align: right;
}

.s-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.s-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, #7a4f24), var(--accent));
  transition: width 0.6s ease;
}

.equip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.equip-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
  min-width: 0;
}

.equip-slot .e-ico {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.04);
  font-size: 15px;
}

.equip-slot b {
  display: block;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.equip-slot small {
  display: block;
  font-size: 9px;
  color: var(--muted-2);
}

.equip-slot.is-empty {
  opacity: 0.55;
  border-style: dashed;
}

.achievements {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.achievement {
  display: flex;
  gap: 10px;
  padding: 11px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.02);
}

.achievement .a-ico {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  font-size: 16px;
  background: var(--accent-soft);
}

.achievement b {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
}

.achievement small {
  display: block;
  font-size: 9px;
  color: var(--muted-2);
  line-height: 1.35;
  margin-top: 2px;
}

.achievement.is-locked {
  opacity: 0.42;
  filter: grayscale(0.85);
}

.achievement.is-locked .a-ico {
  background: rgba(255, 255, 255, 0.04);
}

/* ---------- Shop ---------- */

.shop-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 26px 30px;
  background:
    radial-gradient(420px 200px at 92% 10%, rgba(238, 194, 127, 0.12) 0%, transparent 62%),
    linear-gradient(120deg, rgba(28, 35, 55, 0.85), rgba(14, 19, 32, 0.9));
}

.shop-banner h2 {
  font-size: clamp(24px, 2.5vw, 34px);
  margin-bottom: 8px;
}

.shop-banner p {
  max-width: 620px;
  font-size: 12.5px;
}

.wallet {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 12px 18px;
  border: 1px solid rgba(238, 194, 127, 0.22);
  border-radius: 14px;
  background: var(--gold-dim);
}

.wallet span {
  font-size: 24px;
}

.wallet b {
  display: block;
  font-family: var(--display);
  font-size: 24px;
  color: var(--gold);
  line-height: 1;
}

.wallet small {
  display: block;
  font-size: 8.5px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 3px;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.shop-grid > .panel {
  padding: 22px;
}

.reward-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.reward-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.022);
  transition: 0.18s ease;
}

.reward-card:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.038);
}

.reward-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(238, 194, 127, 0.09);
  border: 1px solid rgba(238, 194, 127, 0.13);
  font-size: 17px;
}

.reward-main h4 {
  font-size: 12px;
  font-weight: 600;
}

.reward-main small {
  display: block;
  font-size: 9px;
  color: var(--muted-2);
  margin-top: 2px;
}

.buy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border: 1px solid rgba(238, 194, 127, 0.24);
  border-radius: 9px;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.16s ease;
}

.buy-btn:hover {
  background: rgba(238, 194, 127, 0.22);
  border-color: var(--gold);
}

.buy-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--line);
  color: var(--muted);
}

.buy-btn.owned {
  color: var(--green);
  border-color: rgba(120, 214, 166, 0.22);
  background: var(--green-dim);
}

/* ---------- Progress ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(22, 29, 47, 0.72), rgba(14, 19, 32, 0.82));
}

.stat-card span {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 6px;
}

.stat-card b {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1;
  color: var(--accent);
}

.stat-card small {
  font-size: 9.5px;
  color: var(--muted-2);
  margin-left: 4px;
}

.progress-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.progress-grid > .panel {
  padding: 22px;
}

.log-panel {
  grid-column: 1 / -1;
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 210px;
  margin-top: 22px;
  padding-top: 10px;
  border-bottom: 1px solid var(--line);
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 7px;
}

.bar-col .bar-num {
  font-size: 9px;
  color: var(--muted-2);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.bar-col:hover .bar-num {
  opacity: 1;
}

.bar-col .bar-shape {
  width: 100%;
  max-width: 46px;
  min-height: 6px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, white), color-mix(in srgb, var(--accent) 26%, #0d1422));
  opacity: 0.72;
  transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}

.bar-col:hover .bar-shape {
  opacity: 1;
}

.bar-col.is-today .bar-shape {
  opacity: 1;
  box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 28%, transparent);
}

.bar-col .bar-day {
  font-size: 9px;
  color: var(--muted-2);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bar-col.is-today .bar-day {
  color: var(--accent);
  font-weight: 600;
}

.heatmap {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 20px;
}

.heat-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.025);
  transition: transform 0.15s ease;
}

.heat-cell:hover {
  transform: scale(1.18);
}

.heat-cell[data-level="1"] {
  background: color-mix(in srgb, var(--accent) 22%, #0e1422);
}
.heat-cell[data-level="2"] {
  background: color-mix(in srgb, var(--accent) 42%, #0e1422);
}
.heat-cell[data-level="3"] {
  background: color-mix(in srgb, var(--accent) 66%, #0e1422);
}
.heat-cell[data-level="4"] {
  background: var(--accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 28%, transparent);
}

.heat-legend {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
  margin-top: 12px;
  font-size: 8.5px;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.heat-legend i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.045);
}

.heat-legend i[data-level="1"] {
  background: color-mix(in srgb, var(--accent) 22%, #0e1422);
}
.heat-legend i[data-level="2"] {
  background: color-mix(in srgb, var(--accent) 42%, #0e1422);
}
.heat-legend i[data-level="3"] {
  background: color-mix(in srgb, var(--accent) 66%, #0e1422);
}
.heat-legend i[data-level="4"] {
  background: var(--accent);
}

.log {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  margin-top: 16px;
}

.log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.log-item .l-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.log-item p {
  font-size: 10.5px;
  color: var(--muted);
  line-height: 1.4;
}

.log-item time {
  display: block;
  font-size: 8.5px;
  color: var(--muted-2);
  margin-top: 2px;
}

/* ---------- Modals ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 11, 0.72);
  backdrop-filter: blur(9px);
  animation: fadeIn 0.2s ease both;
  overflow-y: auto;
}

.overlay[hidden] {
  display: none;
}

.modal {
  position: relative;
  width: min(540px, 100%);
  padding: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background:
    radial-gradient(400px 200px at 50% -10%, var(--accent-soft) 0%, transparent 60%),
    linear-gradient(180deg, #171f33 0%, #0d1320 100%);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.modal h2 {
  font-size: 27px;
  line-height: 1.15;
}

.modal-sub {
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 20px;
  max-width: 44ch;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.class-modal {
  width: min(900px, 100%);
  padding: 38px;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 6px;
}

.class-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 18px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  text-align: left;
  transition: 0.2s ease;
}

.class-card:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-3px);
}

.class-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 5px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 20px;
}

.class-card b {
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.03em;
}

.class-card small {
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted);
  min-height: 29px;
}

.class-card em {
  font-style: normal;
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
}

.fineprint {
  font-size: 9.5px;
  color: var(--muted-2);
  margin-top: 20px;
  text-align: center;
}

.field {
  display: block;
  margin-bottom: 15px;
  border: 0;
  padding: 0;
  min-width: 0;
}

.field > span,
.field > legend {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 7px;
  padding: 0;
}

.field input,
.field select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 10, 18, 0.6);
  color: var(--text);
  font-size: 12.5px;
  transition: border-color 0.16s ease;
}

.field input::placeholder {
  color: #5d687d;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.icon-choice {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  font-size: 15px;
  transition: 0.15s ease;
}

.icon-choice:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.06);
}

.icon-choice.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.icon-picker.compact .icon-choice {
  width: 31px;
  height: 31px;
  font-size: 13px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  background: linear-gradient(180deg, #f4d29a 0%, var(--gold-2) 100%);
  color: #1a1206;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 24px rgba(201, 147, 79, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: 0.18s ease;
}

.primary-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.primary-btn.full {
  width: 100%;
}

.danger-btn {
  height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 107, 118, 0.28);
  border-radius: 10px;
  background: var(--red-dim);
  color: #ff9aa2;
  font-size: 11px;
  font-weight: 600;
  transition: 0.16s ease;
}

.danger-btn:hover {
  background: rgba(255, 107, 118, 0.2);
  border-color: var(--red);
}

.settings-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.settings-actions .ghost-btn,
.settings-actions .danger-btn {
  flex: 1;
}

/* ---------- Level up ---------- */

.level-modal {
  text-align: center;
  width: min(420px, 100%);
  overflow: hidden;
}

.level-rays {
  position: absolute;
  top: -80px;
  left: 50%;
  width: 340px;
  height: 340px;
  transform: translateX(-50%);
  background: conic-gradient(from 0deg, transparent 0 8%, var(--accent-soft) 8% 12%, transparent 12% 22%, var(--accent-soft) 22% 26%, transparent 26% 38%, var(--accent-soft) 38% 42%, transparent 42% 58%, var(--accent-soft) 58% 62%, transparent 62% 78%, var(--accent-soft) 78% 82%, transparent 82% 100%);
  opacity: 0.5;
  animation: spin 22s linear infinite;
  pointer-events: none;
}

.level-big {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  margin: 16px 0 2px;
  font-family: var(--display);
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent-soft);
}

.level-big small {
  font-size: 14px;
  margin-top: 10px;
  color: var(--muted-2);
  letter-spacing: 0.1em;
}

.level-big span {
  font-size: 68px;
  line-height: 1;
}

.level-modal h2 {
  font-size: 25px;
}

.level-modal .primary-btn {
  margin-top: 6px;
}

/* ---------- Toasts / confetti ---------- */

.toasts {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 210px;
  max-width: 330px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-left: 2px solid var(--accent);
  border-radius: 10px;
  background: rgba(13, 19, 32, 0.96);
  box-shadow: var(--shadow);
  font-size: 11.5px;
  animation: toastIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.toast.is-going {
  animation: toastOut 0.25s ease both;
}

.toast .t-ico {
  font-size: 15px;
}

.toast strong {
  font-weight: 600;
}

.toast.success {
  border-left-color: var(--green);
}
.toast.warn {
  border-left-color: var(--red);
}
.toast.loot {
  border-left-color: var(--gold);
}

.confetti {
  position: fixed;
  inset: 0;
  z-index: 150;
  pointer-events: none;
  overflow: hidden;
}

.confetti i {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: var(--w);
  height: var(--h);
  background: var(--c);
  border-radius: 2px;
  opacity: 0.9;
  animation: confettiFall var(--d) ease-in forwards;
  animation-delay: var(--delay);
  transform: rotate(var(--r));
}

/* ---------- Mobile nav ---------- */

.mobile-nav {
  display: none;
}

/* ---------- Animation ---------- */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}

@keyframes bossFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-0.5deg);
  }
  50% {
    transform: translateY(-6px) rotate(0.5deg);
  }
}

@keyframes bossHit {
  0%,
  100% {
    transform: translateX(0);
    filter: drop-shadow(0 20px 20px rgba(0, 0, 0, 0.45));
  }
  25% {
    transform: translateX(-7px) rotate(-2deg);
    filter: drop-shadow(0 0 24px rgba(255, 90, 100, 0.55));
  }
  60% {
    transform: translateX(6px) rotate(2deg);
  }
}

@keyframes questPop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.012);
    box-shadow: 0 0 30px rgba(120, 214, 166, 0.18);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

@keyframes spin {
  to {
    transform: translateX(-50%) rotate(360deg);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(18px);
  }
}

@keyframes confettiFall {
  0% {
    transform: translateY(-10vh) rotate(0deg);
  }
  100% {
    transform: translateY(110vh) rotate(540deg);
    opacity: 0.7;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 1240px) {
  .hero-grid {
    grid-template-columns: 260px minmax(0, 1fr);
  }
  .achievements-panel {
    grid-column: 1 / -1;
  }
  .achievements {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .today-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.85fr);
  }
}

@media (max-width: 1080px) {
  .app {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .main {
    padding: 22px 24px 70px;
  }
  .hero-banner {
    grid-template-columns: minmax(0, 1fr) 260px;
    padding: 26px;
  }
  .avatar-large {
    width: 180px;
    height: 220px;
  }
  .hero-banner-art {
    height: 220px;
  }
  .today-grid {
    grid-template-columns: 1fr;
  }
  .side-stack {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    align-items: stretch;
  }
  .boss-panel {
    min-height: 0;
  }
  .boss-stage {
    flex-direction: row;
    align-items: center;
  }
  .boss-art {
    width: 160px;
    height: 150px;
    flex: none;
  }
  .boss-hp {
    flex: 1;
  }
  .streak-panel {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }
  .streak-panel .shield-btn {
    position: absolute;
    top: 14px;
    right: 14px;
  }
  .progress-grid {
    grid-template-columns: 1fr;
  }
  .log-panel {
    grid-column: auto;
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
  }
  .rail {
    display: none;
  }
  .main {
    padding: 18px 18px 96px;
  }
  .mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: rgba(12, 17, 28, 0.92);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
  .mobile-nav .nav-btn {
    flex-direction: column;
    gap: 2px;
    padding: 7px 4px;
    justify-content: center;
    text-align: center;
    border-radius: 11px;
  }
  .mobile-nav .nav-btn span {
    font-size: 16px;
    line-height: 1;
    filter: grayscale(0.2);
  }
  .mobile-nav .nav-btn small {
    font-size: 9px;
    letter-spacing: 0.04em;
  }
  .mobile-nav .nav-dot {
    display: none;
  }
  .topbar {
    align-items: center;
    margin-bottom: 18px;
  }
  .topbar-title h1 {
    font-size: 24px;
  }
  .hero-banner {
    grid-template-columns: minmax(0, 1fr) 210px;
    padding: 24px;
    min-height: 230px;
  }
  .hero-banner-copy h2 {
    font-size: 29px;
  }
  .banner-bars {
    grid-template-columns: 1fr;
    gap: 10px;
    max-width: 340px;
  }
  .hero-banner-art {
    height: 200px;
  }
  .avatar-large {
    width: 158px;
    height: 195px;
  }
  .halo {
    width: 160px;
    height: 160px;
  }
  .orbit-1 {
    width: 200px;
    height: 120px;
  }
  .orbit-2 {
    width: 230px;
    height: 160px;
  }
  .level-chip {
    left: -6px;
    top: 30px;
  }
  .class-chip {
    right: -8px;
    bottom: 16px;
  }
  .shop-grid {
    grid-template-columns: 1fr;
  }
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .achievements-panel {
    grid-column: auto;
  }
  .achievements {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-art {
    width: 150px;
    height: 170px;
  }
  .profile-art .avatar-large {
    width: 145px;
    height: 170px;
  }
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .log {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 16px 14px 96px;
  }
  .topbar-actions .res-label {
    display: none;
  }
  .res-chip {
    padding: 7px 9px;
    gap: 4px;
  }
  .res-chip b {
    font-size: 11.5px;
  }
  .topbar-actions .icon-btn {
    width: 34px;
    height: 34px;
  }
  .eyebrow {
    font-size: 9px;
  }
  .hero-banner {
    grid-template-columns: 1fr;
    padding: 22px 20px;
    text-align: left;
  }
  .hero-banner-copy > p {
    font-size: 12px;
  }
  .hero-banner-art {
    position: absolute;
    right: -34px;
    bottom: -18px;
    height: 190px;
    width: 190px;
    opacity: 0.38;
    pointer-events: none;
  }
  .hero-banner-copy {
    position: relative;
    z-index: 2;
  }
  .banner-bars {
    max-width: none;
  }
  .level-chip,
  .class-chip,
  .pet-chip {
    display: none;
  }
  .panel {
    border-radius: 16px;
  }
  .quests-panel,
  .boss-panel,
  .shop-grid > .panel,
  .progress-grid > .panel,
  .stack > .panel,
  .achievements-panel {
    padding: 18px 16px;
  }
  .quests-panel {
    padding-bottom: 14px;
  }
  .side-stack {
    grid-template-columns: 1fr;
  }
  .boss-stage {
    flex-direction: column;
    align-items: stretch;
  }
  .boss-art {
    width: auto;
    height: 150px;
  }
  .streak-panel {
    flex-direction: row;
    align-items: center;
  }
  .shop-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    gap: 16px;
  }
  .shop-banner h2 {
    font-size: 25px;
  }
  .wallet {
    width: 100%;
  }
  .class-modal {
    padding: 26px 18px;
  }
  .class-grid {
    grid-template-columns: 1fr 1fr;
  }
  .class-card {
    padding: 14px 12px;
  }
  .class-card small {
    min-height: 0;
  }
  .modal {
    padding: 24px 18px;
  }
  .modal h2 {
    font-size: 23px;
  }
  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .settings-actions {
    flex-direction: column;
  }
  .toasts {
    right: 12px;
    left: 12px;
    bottom: 86px;
    align-items: stretch;
  }
  .toast {
    max-width: none;
  }
  .q-meta {
    gap: 6px;
  }
  .q-meta span:nth-child(3) {
    display: none;
  }
  .bar-chart {
    height: 180px;
  }
  .heatmap {
    gap: 5px;
  }
}

@media (max-width: 400px) {
  .topbar-actions .res-chip.gem {
    display: none;
  }
  .quest-card {
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    gap: 10px;
    padding: 10px;
  }
  .q-icon {
    width: 38px;
    height: 38px;
    font-size: 17px;
  }
  .q-check {
    width: 34px;
    height: 34px;
  }
  .achievements {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
