/* =========================================================
   SPIREBOUND — dark grimoire / burnt gold on obsidian
   Mobile-first. All motion runs through the four tokens.
   ========================================================= */

/* --- self-hosted variable fonts (woff2 only) --------------
   Boska    → display / headers  (old-style serif, weird details)
   Switzer  → body / flavor text (modern grotesk)
   League Mono → numbers & UI mono (tabular figures)
   --------------------------------------------------------- */
@font-face {
  font-family: 'Boska';
  src: url('../fonts/Boska-Variable.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Switzer';
  src: url('../fonts/Switzer-Variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Switzer';
  src: url('../fonts/Switzer-VariableItalic.woff2') format('woff2');
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'League Mono';
  src: url('../fonts/LeagueMono-VF.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* motion tokens — the only easings allowed on this project */
  --ease-signature: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth:    cubic-bezier(0.4, 0.0, 0.2, 1);
  --ease-none:      none;
  --ease-loop:      linear;

  /* palette */
  --ink:        #0b0a0d;
  --ink-2:      #131118;
  --ink-3:      #1c1824;
  --parch:      #e8dcc3;
  --parch-dim:  #a3977e;
  --gold:       #d4a24e;
  --gold-hot:   #f2c268;
  --blood:      #c03a3a;
  --venom:      #7bb661;
  --frost:      #6fa8c9;
  --hex:        #a778d4;

  --r-common: #9a917c;
  --r-rare:   #6fa8c9;
  --r-epic:   #a778d4;
  --r-unique: #d4a24e;

  --font-display: 'Boska', Georgia, serif;
  --font-body: 'Switzer', system-ui, sans-serif;
  --font-mono: 'League Mono', ui-monospace, monospace;

  --fs-hero: clamp(2.6rem, 11vw, 5.5rem);
  --fs-h2: clamp(1.3rem, 4.5vw, 2rem);
  --fs-body: clamp(1rem, 2.6vw, 1.1rem);
  --fs-small: clamp(.78rem, 2.2vw, .88rem);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--ink);
  color: var(--parch);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  overflow: hidden;
  overscroll-behavior: none;
}

/* candlelit atmosphere: radial glow + grain */
.atmo { position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(212,162,78,.09), transparent 60%),
    radial-gradient(90% 70% at 50% 115%, rgba(192,58,58,.07), transparent 60%);
}
.atmo::after { content:''; position:absolute; inset:0; opacity:.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =============== SCREENS =============== */
.screen { position: fixed; inset: 0; z-index: 1; display: none; flex-direction: column;
  opacity: 0; transform: translateY(10px); }
.screen.active { display: flex;
  animation: screen-in .55s var(--ease-signature) forwards; }
@keyframes screen-in { to { opacity: 1; transform: none; } }

/* =============== BUTTONS =============== */
.btn { font-family: var(--font-display); font-weight: 700; letter-spacing: .06em;
  color: var(--parch); background: var(--ink-3); border: 1px solid #3a3346;
  padding: .8rem 1.4rem; min-height: 44px; border-radius: 4px; cursor: pointer;
  font-size: .9rem; text-transform: uppercase;
  transition: transform .25s var(--ease-smooth), background .25s var(--ease-smooth), border-color .25s var(--ease-smooth); }
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(160deg, #7a5a24, #4c3814); border-color: var(--gold);
  color: var(--gold-hot); box-shadow: 0 0 24px rgba(212,162,78,.15); }
.btn-primary:active { background: #5e4519; }
.btn-ghost { background: transparent; border-color: #2c2735; color: var(--parch-dim); }
.btn-big { font-size: 1.05rem; padding: 1rem 2.2rem; }
.btn[disabled] { opacity: .35; pointer-events: none; }

/* =============== TITLE =============== */
#screen-title { align-items: center; justify-content: center; text-align: center; }
.title-wrap { padding: 1.5rem; max-width: 640px; }
.title-eyebrow { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .35em;
  text-transform: uppercase; color: var(--parch-dim); margin-bottom: 1rem;
  opacity: 0; animation: rise .7s var(--ease-signature) .1s forwards; }
.title-logo { font-family: var(--font-display); font-weight: 900; font-size: var(--fs-hero);
  line-height: .95; color: var(--parch); text-shadow: 0 0 60px rgba(212,162,78,.25);
  opacity: 0; animation: rise .7s var(--ease-signature) .22s forwards; }
.title-logo span { color: var(--gold); display: block; }
.title-sub { color: var(--parch-dim); margin: 1.2rem auto 2rem; max-width: 40ch;
  opacity: 0; animation: rise .7s var(--ease-signature) .34s forwards; }
.title-actions { display: flex; flex-direction: column; gap: .8rem; align-items: center;
  opacity: 0; animation: rise .7s var(--ease-signature) .46s forwards; }
.title-foot { margin-top: 2rem; font-family: var(--font-mono); font-size: .7rem;
  color: #5c5468; letter-spacing: .1em;
  opacity: 0; animation: rise .7s var(--ease-signature) .58s forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* =============== HUB =============== */
#screen-hub { z-index: 2; }
.hub-head { display: flex; justify-content: space-between; align-items: baseline;
  padding: max(env(safe-area-inset-top), .9rem) 1rem .4rem; }
.hub-title { font-family: var(--font-display); font-size: var(--fs-h2); color: var(--gold); }
.relic-purse { font-family: var(--font-mono); font-weight: 600; color: var(--gold-hot);
  background: rgba(212,162,78,.08); border: 1px solid rgba(212,162,78,.3);
  padding: .3rem .7rem; border-radius: 3px; }
.hub-tabs { display: flex; gap: .3rem; padding: .4rem .8rem; border-bottom: 1px solid #241f2e; }
.tab { flex: 1; min-height: 44px; background: none; border: none; color: var(--parch-dim);
  font-family: var(--font-display); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: color .25s var(--ease-smooth), border-color .25s var(--ease-smooth); }
.tab.active { color: var(--gold-hot); border-bottom-color: var(--gold); }
.hub-body { flex: 1; overflow-y: auto; padding: 1rem .9rem 7.5rem; -webkit-overflow-scrolling: touch; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: pane-in .4s var(--ease-signature); }
@keyframes pane-in { from { opacity: 0; transform: translateY(8px); } }

.hub-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--ink) 30%);
  display: flex; gap: .8rem; align-items: center; }
.hub-selected { flex: 1; font-size: var(--fs-small); color: var(--parch-dim); line-height: 1.3; }
.hub-selected b { color: var(--gold-hot); font-family: var(--font-display); }

/* class + trait cards */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.pick-card { position: relative; background: var(--ink-2); border: 1px solid #2c2735;
  border-radius: 6px; padding: .85rem .8rem; cursor: pointer; text-align: left;
  color: var(--parch); font-family: var(--font-body); min-height: 44px;
  transition: border-color .25s var(--ease-smooth), transform .25s var(--ease-smooth), box-shadow .25s var(--ease-smooth); }
.pick-card:active { transform: scale(.98); }
.pick-card.selected { border-color: var(--gold); box-shadow: 0 0 18px rgba(212,162,78,.18); }
.pick-card.locked { opacity: .55; }
.pick-card .pc-icon { font-size: 1.7rem; display: block; margin-bottom: .3rem; }
.pick-card .pc-name { font-family: var(--font-display); font-weight: 700; font-size: .92rem; color: var(--parch); }
.pick-card .pc-tag { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold); display: block; margin: .15rem 0 .35rem; }
.pick-card .pc-desc { font-size: .8rem; color: var(--parch-dim); line-height: 1.35; }
.pick-card .pc-cost { position: absolute; top: .5rem; right: .5rem; font-family: var(--font-mono);
  font-size: .7rem; color: var(--gold-hot); background: rgba(0,0,0,.4); padding: .15rem .4rem; border-radius: 3px; }
.pick-card .pc-check { position: absolute; top: .45rem; right: .45rem; color: var(--gold);
  font-size: 1rem; opacity: 0; transition: opacity .2s var(--ease-smooth); }
.pick-card.selected .pc-check { opacity: 1; }
.section-note { font-size: var(--fs-small); color: var(--parch-dim); margin: 0 0 .8rem; line-height: 1.4; }
.section-note b { color: var(--gold-hot); }

/* relic forge rows */
.forge-row { display: flex; align-items: center; gap: .8rem; background: var(--ink-2);
  border: 1px solid #2c2735; border-radius: 6px; padding: .8rem; margin-bottom: .6rem; }
.forge-row .fr-icon { font-size: 1.5rem; }
.forge-row .fr-info { flex: 1; }
.forge-row .fr-name { font-family: var(--font-display); font-size: .88rem; color: var(--parch); }
.forge-row .fr-desc { font-size: .78rem; color: var(--parch-dim); line-height: 1.3; }
.forge-row .btn { padding: .5rem .8rem; font-size: .75rem; white-space: nowrap; }
.forge-row.owned { border-color: rgba(212,162,78,.4); }

/* =============== RUN SCREEN =============== */
#screen-run { background: radial-gradient(140% 100% at 50% 0%, #16121d, var(--ink) 70%); }
.run-head { display: flex; justify-content: space-between; align-items: center;
  padding: max(env(safe-area-inset-top), .7rem) .9rem .5rem; }
.run-floor { display: flex; flex-direction: column; }
.floor-num { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--gold-hot); }
.floor-biome { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .2em;
  text-transform: uppercase; color: var(--parch-dim); }
.run-meta { display: flex; gap: .4rem; align-items: center; }
.chip { font-family: var(--font-mono); font-size: .78rem; color: var(--parch);
  background: rgba(255,255,255,.05); border: 1px solid #2c2735; border-radius: 4px;
  padding: .35rem .55rem; min-height: 34px; display: inline-flex; align-items: center; }
.chip-btn { cursor: pointer; min-width: 44px; min-height: 44px; justify-content: center;
  transition: background .2s var(--ease-smooth); }
.chip-btn:active { background: rgba(255,255,255,.12); }

/* arena */
.arena { flex: 1; display: flex; flex-direction: column; padding: .4rem .9rem; min-height: 0; }
.enemy-row { display: flex; gap: .6rem; justify-content: center; align-items: stretch; flex-wrap: wrap;
  padding: .6rem 0 .8rem; transition: opacity .5s var(--ease-smooth); }
.enemy-row.clearing { opacity: 0; } /* the beat between a win and the floor menu */
.enemy-card { position: relative; width: min(30%, 130px); min-width: 96px;
  background: var(--ink-2); border: 1px solid #332c40; border-radius: 8px;
  padding: .6rem .5rem .5rem; text-align: center;
  animation: enemy-in .5s var(--ease-signature) backwards; }
.enemy-card:nth-child(2) { animation-delay: .08s; }
.enemy-card:nth-child(3) { animation-delay: .16s; }
@keyframes enemy-in { from { opacity: 0; transform: translateY(-14px) scale(.92); } }
.enemy-card.elite { border-color: var(--hex); box-shadow: 0 0 16px rgba(167,120,212,.18); }
.enemy-card.boss { width: min(62%, 230px); border-color: var(--blood);
  box-shadow: 0 0 26px rgba(192,58,58,.22); }
.enemy-card.dying { animation: enemy-die .45s var(--ease-signature) forwards; }
@keyframes enemy-die { to { opacity: 0; transform: scale(.7) rotate(6deg); filter: grayscale(1); } }
.enemy-face { font-size: 2rem; line-height: 1.1; display: block;
  transition: transform .15s var(--ease-smooth); }
.enemy-card.boss .enemy-face { font-size: 3rem; }
.enemy-card.hit .enemy-face { animation: recoil .28s var(--ease-signature); }
@keyframes recoil { 30% { transform: translateX(5px) scale(.93); } }
.enemy-name { font-family: var(--font-display); font-size: .68rem; letter-spacing: .04em;
  color: var(--parch-dim); display: block; margin: .25rem 0 .35rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.enemy-hp { height: 7px; background: #241f2e; border-radius: 4px; overflow: hidden; }
.enemy-hp .fill { height: 100%; background: linear-gradient(90deg, #8e2f2f, var(--blood));
  transition: width .3s var(--ease-smooth); }
.enemy-debuffs { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center;
  min-height: 16px; margin-top: .35rem; }
.dbf { font-size: .58rem; font-family: var(--font-mono); background: rgba(0,0,0,.5);
  border-radius: 3px; padding: 0 3px; line-height: 1.5; }

/* minions — the player's summoned allies, guarding the summoner */
.minion-row { display: flex; gap: .4rem; justify-content: center; align-items: flex-end;
  flex-wrap: wrap; min-height: 0; padding: 0; transition: min-height .3s var(--ease-smooth); }
.minion-row.has-minions { min-height: 46px; padding: .3rem 0 .1rem; }
.minion-card { position: relative; width: 46px; padding: .25rem .2rem .3rem;
  background: var(--ink-2); border: 1px solid #2c3a34; border-radius: 7px; text-align: center;
  animation: enemy-in .35s var(--ease-signature) backwards; }
.minion-card.linked { border-color: #6f5ea8; box-shadow: 0 0 10px rgba(140,110,210,.28); }
.minion-card.hit .minion-face { animation: recoil .28s var(--ease-signature); }
.minion-card.dying { animation: enemy-die .4s var(--ease-signature) forwards; }
.minion-face { font-size: 1.35rem; line-height: 1; display: block; }
.minion-hp { height: 5px; margin-top: .2rem; background: #241f2e; border-radius: 3px; overflow: hidden; }
.minion-hp .fill { height: 100%; background: linear-gradient(90deg, #2f8e5a, var(--venom));
  transition: width .3s var(--ease-smooth); }

/* floating damage numbers */
.dmg-float { position: absolute; left: 50%; top: 18%; transform: translateX(-50%);
  font-family: var(--font-mono); font-weight: 600; font-size: .9rem; color: var(--parch);
  pointer-events: none; text-shadow: 0 2px 6px #000;
  animation: floaty .8s var(--ease-signature) forwards; }
.dmg-float.crit { color: var(--gold-hot); font-size: 1.15rem; }
.dmg-float.dot { font-size: .72rem; opacity: .85; }
.dmg-float.heal { color: var(--venom); }
.dmg-float.hurt { color: var(--blood); }
@keyframes floaty { to { transform: translateX(-50%) translateY(-34px); opacity: 0; } }

/* battle log */
.battle-log { flex: 1; min-height: 0; overflow-y: auto; font-family: var(--font-mono);
  font-size: .68rem; line-height: 1.55; color: #7d7389; padding: .4rem .2rem;
  mask-image: linear-gradient(transparent, #000 18%);
  -webkit-mask-image: linear-gradient(transparent, #000 18%); }
.battle-log .l-gold { color: var(--gold); }
.battle-log .l-red { color: var(--blood); }
.battle-log .l-green { color: var(--venom); }
.battle-log .l-hex { color: var(--hex); }

/* player panel */
.player-panel { background: linear-gradient(transparent, rgba(11,10,13,.94) 22%);
  padding: .4rem .9rem calc(.7rem + env(safe-area-inset-bottom)); }
.hero-line { display: flex; align-items: center; gap: .6rem; }
.hero-face { font-size: 1.9rem; }
.hero-face.hurt { animation: recoil .3s var(--ease-signature); }
.hero-bars { flex: 1; display: flex; flex-direction: column; gap: .3rem; }
.bar { position: relative; height: 16px; background: #241f2e; border-radius: 4px; overflow: hidden; }
.bar-xp { height: 8px; }
.bar-fill { height: 100%; border-radius: 4px; transition: width .35s var(--ease-smooth); }
.bar-hp .bar-fill { background: linear-gradient(90deg, #4c7a3a, var(--venom)); }
.bar-xp .bar-fill { background: linear-gradient(90deg, #6b5a9e, var(--hex)); }
.bar-shield { position: absolute; inset: 0 auto 0 0; background: rgba(111,168,201,.55);
  border-radius: 4px; transition: width .35s var(--ease-smooth); mix-blend-mode: screen; }
.bar-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: .62rem; color: #fff; text-shadow: 0 1px 3px #000; }
.hero-stats-btn { min-width: 52px; min-height: 44px; background: var(--ink-3); color: var(--parch);
  border: 1px solid #3a3346; border-radius: 6px; font-family: var(--font-mono); font-size: .72rem;
  cursor: pointer; transition: background .2s var(--ease-smooth); }
.hero-stats-btn b { color: var(--gold-hot); font-size: .95rem; }
.hero-debuffs { display: flex; gap: 3px; min-height: 14px; padding: .2rem 0 .1rem 2.6rem; flex-wrap: wrap; }

/* skill bar */
.skill-bar { display: flex; gap: .45rem; justify-content: center; padding-top: .35rem; }
.skill-slot { position: relative; width: 58px; height: 58px; min-width: 44px;
  background: var(--ink-2); border: 1px solid #3a3346; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 1.45rem;
  cursor: pointer; overflow: hidden; user-select: none; -webkit-user-select: none; }
.skill-slot.empty { opacity: .3; border-style: dashed; font-size: .9rem; color: var(--parch-dim); }
.skill-slot .cd-veil { position: absolute; inset: 0; background: rgba(0,0,0,.72);
  transform-origin: bottom; transition: transform .1s var(--ease-none); }
.skill-slot.ready { border-color: var(--gold); }
.skill-slot.ready::after { content:''; position: absolute; inset: -1px; border-radius: 8px;
  box-shadow: inset 0 0 12px rgba(212,162,78,.35); pointer-events: none; }
.skill-slot.fired { animation: pulse .35s var(--ease-signature); }
@keyframes pulse { 40% { transform: scale(1.14); } }
.skill-slot.passive { border-color: #4b4358; }
.skill-slot .auto-dot { position: absolute; top: 3px; right: 4px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--venom); transition: background .2s var(--ease-smooth); }
.skill-slot.no-auto .auto-dot { background: #4b4358; }
.skill-slot .p-badge { position: absolute; bottom: 2px; right: 4px; font-family: var(--font-mono);
  font-size: .5rem; color: var(--parch-dim); }

/* =============== MODAL =============== */
.modal-root { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.modal-root[hidden] { display: none; } /* class display beats UA [hidden] — restore it explicitly */
@media (min-width: 640px) { .modal-root { align-items: center; } }
.modal-scrim { position: absolute; inset: 0; background: rgba(5,4,8,.78);
  backdrop-filter: blur(3px); animation: fade .3s var(--ease-smooth); }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; width: min(100%, 560px); max-height: 88dvh; overflow-y: auto;
  background: var(--ink-2); border: 1px solid #3a3346; border-bottom: none;
  border-radius: 14px 14px 0 0; padding: 1.2rem 1.1rem calc(1.4rem + env(safe-area-inset-bottom));
  animation: sheet-up .45s var(--ease-signature); -webkit-overflow-scrolling: touch; }
@media (min-width: 640px) { .modal-card { border-radius: 14px; border-bottom: 1px solid #3a3346; } }
@keyframes sheet-up { from { transform: translateY(60px); opacity: 0; } }
.modal-eyebrow { font-family: var(--font-mono); font-size: .62rem; letter-spacing: .3em;
  text-transform: uppercase; color: var(--gold); margin-bottom: .3rem; }
.modal-title { font-family: var(--font-display); font-size: 1.35rem; color: var(--parch); margin-bottom: .3rem; }
.modal-sub { font-size: .88rem; color: var(--parch-dim); line-height: 1.45; margin-bottom: 1rem; }

/* choice cards inside modals (level-ups, doors, treasures) */
.choice-list { display: flex; flex-direction: column; gap: .6rem; }
.choice-card { display: flex; gap: .8rem; align-items: flex-start; text-align: left; width: 100%;
  background: var(--ink-3); border: 1px solid #3a3346; border-radius: 8px; padding: .85rem .8rem;
  color: var(--parch); font-family: var(--font-body); cursor: pointer; min-height: 44px;
  animation: choice-in .5s var(--ease-signature) backwards;
  transition: border-color .2s var(--ease-smooth), transform .2s var(--ease-smooth); }
.choice-card:nth-child(1) { animation-delay: .05s; }
.choice-card:nth-child(2) { animation-delay: .13s; }
.choice-card:nth-child(3) { animation-delay: .21s; }
.choice-card:nth-child(4) { animation-delay: .29s; }
@keyframes choice-in { from { opacity: 0; transform: translateY(14px); } }
.choice-card:active { transform: scale(.985); }
.choice-card .cc-icon { font-size: 1.6rem; line-height: 1; }
.choice-card .cc-name { font-family: var(--font-display); font-weight: 700; font-size: .92rem; }
.choice-card .cc-desc { font-size: .8rem; color: var(--parch-dim); line-height: 1.35; margin-top: .15rem; }
.choice-card .cc-meta { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .1em;
  text-transform: uppercase; margin-top: .3rem; }
.choice-card.q-common { border-left: 3px solid var(--r-common); }
.choice-card.q-rare { border-left: 3px solid var(--r-rare); }
.choice-card.q-epic { border-left: 3px solid var(--r-epic); }
.choice-card.q-unique { border-left: 3px solid var(--r-unique);
  box-shadow: 0 0 16px rgba(212,162,78,.12); }
.choice-card[disabled] { opacity: .45; pointer-events: none; }
.q-common .cc-meta { color: var(--r-common); } .q-rare .cc-meta { color: var(--r-rare); }
.q-epic .cc-meta { color: var(--r-epic); } .q-unique .cc-meta { color: var(--r-unique); }

/* doors get their own drama */
.door-card { flex-direction: column; align-items: center; text-align: center; padding: 1.1rem .6rem; }
.door-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: .6rem; }
.door-card .cc-icon { font-size: 2rem; }

.modal-actions { display: flex; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.modal-actions .btn { flex: 1; }

/* stat sheet */
.sheet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .9rem;
  font-family: var(--font-mono); font-size: .74rem; }
.sheet-grid .k { color: var(--parch-dim); }
.sheet-grid .v { color: var(--gold-hot); text-align: right; }
.sheet-list { font-size: .8rem; color: var(--parch-dim); line-height: 1.6; margin-top: .4rem; }
.sheet-list b { color: var(--parch); }
hr.sep { border: none; border-top: 1px solid #2c2735; margin: .9rem 0; }

/* toasts */
.toast-root { position: fixed; top: max(env(safe-area-inset-top), .8rem); left: 0; right: 0;
  z-index: 60; display: flex; flex-direction: column; align-items: center; gap: .4rem; pointer-events: none; }
.toast { background: var(--ink-3); border: 1px solid var(--gold); color: var(--gold-hot);
  font-family: var(--font-display); font-size: .8rem; padding: .55rem 1rem; border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  animation: toast-in .45s var(--ease-signature), toast-out .4s var(--ease-smooth) 2.4s forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

/* boss intro banner */
.boss-banner { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center;
  justify-content: center; flex-direction: column; background: rgba(5,4,8,.82); pointer-events: none;
  animation: fade .3s var(--ease-smooth), toast-out .5s var(--ease-smooth) 1.7s forwards; }
.boss-banner .bb-face { font-size: 4rem; animation: rise .6s var(--ease-signature); }
.boss-banner .bb-name { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem;
  color: var(--blood); letter-spacing: .08em; text-transform: uppercase;
  animation: rise .6s var(--ease-signature) .12s backwards; }
.boss-banner .bb-sub { font-family: var(--font-mono); font-size: .65rem; letter-spacing: .3em;
  color: var(--parch-dim); text-transform: uppercase; margin-top: .3rem;
  animation: rise .6s var(--ease-signature) .24s backwards; }

/* level-up flash on hero */
.hero-face.levelup { animation: pulse .5s var(--ease-signature); }

/* scrollbars */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: #3a3346; border-radius: 2px; }

/* reduced motion — kill the theatrics, keep the game */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; }
}
