/* Ouroboros: The Girdle of Jörmungandr — visual system.
   Abyssal teal, one ember-gold accent, rune-etched glass. */
:root {
  --ink: #03090a;
  --ink-2: #061413;
  --ink-3: #0a1f1d;
  --pearl: #f3ecdc;
  --pearl-dim: rgba(243, 236, 220, 0.62);
  --pearl-faint: rgba(243, 236, 220, 0.38);
  --gold: #e8c98a;
  --gold-2: #c69a4e;
  --teal: #7fe3d4;
  --danger: #ff6b5e;
  --line: rgba(232, 201, 138, 0.18);
  --line-soft: rgba(232, 201, 138, 0.09);
  --glass: rgba(6, 17, 16, 0.82);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--pearl);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ------------------------------------------------------------------ stage */
.game {
  position: relative;
  height: 100svh;
  min-height: 500px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 0%, #08201d 0%, #03090a 68%);
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* -------------------------------------------------------------------- hud */
.hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px clamp(12px, 3vw, 28px) 20px;
  background: linear-gradient(to bottom, rgba(2, 7, 7, 0.9), rgba(2, 7, 7, 0.42) 58%, rgba(2, 7, 7, 0));
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.hud.on { opacity: 1; transform: none; }
.hud > * { pointer-events: auto; }
.hud-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hud-kicker {
  font-size: 8.5px;
  letter-spacing: .22em;
  color: var(--gold);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hud-chapter {
  font-family: var(--serif);
  font-size: clamp(12px, 1.45vw, 16px);
  letter-spacing: .01em;
  color: var(--pearl);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34vw;
}
.hud-goal { display: flex; align-items: center; gap: 9px; }
.goal-label {
  font-size: 8px;
  letter-spacing: .2em;
  color: var(--pearl-faint);
}
.goal-num {
  font: 600 12.5px/1 var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--pearl);
  min-width: 46px;
  text-align: right;
}
.goal-bar {
  width: clamp(70px, 16vw, 180px);
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.goal-bar i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #7fe3d4, #e8c98a 70%, #ffb37a);
  box-shadow: 0 0 10px rgba(232, 201, 138, 0.55);
  transition: width .25s var(--ease);
}
.hud-right { display: flex; align-items: center; gap: 10px; }
.hud-stat { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.hud-stat span { font: 600 14px/1 var(--sans); font-variant-numeric: tabular-nums; }
.hud-stat small { font-size: 7.5px; letter-spacing: .16em; color: var(--pearl-faint); }
.hud-stat.chain span { color: var(--gold); }
.icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(4, 13, 12, 0.6);
  color: var(--pearl);
  font-size: 11px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color .2s, background .2s, transform .2s;
  backdrop-filter: blur(6px);
}
.icon-btn:hover { border-color: rgba(232, 201, 138, 0.6); background: rgba(232, 201, 138, 0.12); }
.icon-btn.off { color: rgba(243, 236, 220, 0.32); }
.icon-btn:active { transform: scale(.94); }

/* ------------------------------------------------------------------- dock */
.dock {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 6;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 26px clamp(12px, 3vw, 28px) max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(2, 7, 7, 0.92), rgba(2, 7, 7, 0.35) 60%, rgba(2, 7, 7, 0));
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
}
.dock.on { opacity: 1; transform: none; }
.dock > * { pointer-events: auto; }

.shed {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 14px 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(18, 40, 36, 0.92), rgba(6, 17, 16, 0.92));
  color: var(--pearl);
  font: 500 11.5px/1 var(--sans);
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 10px 26px -16px #000, inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: border-color .2s, transform .12s;
}
.shed:hover { border-color: rgba(232, 201, 138, 0.5); }
.shed:active { transform: scale(.97); }
.shed:disabled { opacity: .38; cursor: default; }
.shed-key {
  font: 600 8.5px/1 var(--sans);
  letter-spacing: .12em;
  color: var(--ink);
  background: var(--gold);
  border-radius: 99px;
  padding: 4px 6px;
}
.shed-pips { display: flex; gap: 3px; margin-left: 2px; }
.shed-pips i {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 6px rgba(127, 227, 212, 0.8);
}
.shed-pips i.spent { background: rgba(255, 255, 255, 0.16); box-shadow: none; }

.dock-hint {
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--pearl-faint);
  padding-bottom: 15px;
  text-align: center;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dpad { display: none; grid-template-columns: repeat(3, 42px); grid-template-rows: repeat(2, 42px); gap: 4px; }
.dpad button {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 17, 16, 0.8);
  color: var(--pearl-dim);
  font-size: 13px;
  cursor: pointer;
}
.dpad button:nth-child(1) { grid-column: 2; grid-row: 1; }
.dpad button:nth-child(2) { grid-column: 1; grid-row: 2; }
.dpad button:nth-child(3) { grid-column: 2; grid-row: 2; }
.dpad button:nth-child(4) { grid-column: 3; grid-row: 2; }
.dpad button:active { background: rgba(232, 201, 138, 0.16); }

/* ---------------------------------------------------------------- screens */
.screen {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3vw, 34px);
  background:
    radial-gradient(90% 70% at 50% 28%, rgba(9, 30, 28, 0.5), rgba(1, 5, 5, 0.86) 82%),
    rgba(1, 5, 5, 0.34);
  backdrop-filter: blur(4px) saturate(1.02);
  animation: screenIn .4s var(--ease) both;
  overflow-y: auto;
}
.screen.on { display: flex; }
@keyframes screenIn { from { opacity: 0; } to { opacity: 1; } }

.panel {
  position: relative;
  width: min(580px, 100%);
  padding: clamp(22px, 3.4vw, 38px);
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(90% 60% at 50% 0%, rgba(232, 201, 138, 0.07), transparent 70%),
    linear-gradient(160deg, rgba(11, 28, 26, 0.95), rgba(4, 12, 11, 0.97));
  box-shadow: 0 40px 90px -40px #000, inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: panelIn .5s var(--ease) both;
}
.panel.wide { width: min(780px, 100%); }
.panel.narrow { width: min(400px, 100%); }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(16px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.panel::before, .panel::after {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  pointer-events: none;
  border: 1px solid rgba(232, 201, 138, 0.55);
}
.panel::before { top: 9px; left: 9px; border-right: 0; border-bottom: 0; }
.panel::after { bottom: 9px; right: 9px; border-left: 0; border-top: 0; }

.eyebrow {
  margin: 0 0 10px;
  font-size: 9px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--gold);
}
.panel h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(21px, 2.7vw, 30px);
  letter-spacing: -0.01em;
  margin: 0 0 12px;
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.hint { font-size: 12.5px; line-height: 1.6; color: var(--pearl-dim); margin: 10px 0 16px; }
.stack { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  position: relative;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(232, 201, 138, 0.32);
  background: rgba(232, 201, 138, 0.05);
  color: var(--pearl);
  font: 600 12.5px/1 var(--sans);
  letter-spacing: .06em;
  cursor: pointer;
  transition: transform .16s var(--ease), background .2s, border-color .2s, box-shadow .2s;
}
.btn:hover { border-color: rgba(232, 201, 138, 0.7); background: rgba(232, 201, 138, 0.11); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.btn.primary {
  background: linear-gradient(180deg, #f0d9a8, #d9b56e);
  border-color: rgba(255, 240, 205, 0.7);
  color: #1a1710;
  box-shadow: 0 12px 30px -14px rgba(232, 201, 138, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.btn.primary:hover { background: linear-gradient(180deg, #f7e4ba, #e2c07b); }
.btn:disabled { opacity: .4; cursor: default; box-shadow: none; }
.btn:disabled:hover { background: rgba(232, 201, 138, 0.05); border-color: rgba(232, 201, 138, 0.32); }
.btn.ghost { background: transparent; border-color: rgba(243, 236, 220, 0.16); color: var(--pearl-dim); }
.btn.small { min-height: 38px; padding: 0 16px; font-size: 11px; }
.title-actions .btn, .brief-actions .btn, .result .btn { flex: 1; }

/* ------------------------------------------------------------------ title */
.title-screen { background: radial-gradient(70% 60% at 50% 42%, rgba(8, 30, 27, 0.42), rgba(1, 5, 5, 0.9) 80%); backdrop-filter: blur(2px); }
.title-wrap {
  position: relative;
  width: min(760px, 100%);
  text-align: center;
  padding: 30px 10px 16px;
}
.sigil {
  position: relative;
  width: clamp(120px, 19vw, 168px);
  height: clamp(120px, 19vw, 168px);
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 1px solid rgba(232, 201, 138, 0.25);
  box-shadow: inset 0 0 40px rgba(127, 227, 212, 0.08), 0 0 60px rgba(232, 201, 138, 0.06);
  animation: breathe 7s ease-in-out infinite;
}
.sigil::before {
  content: "";
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  border: 1px solid rgba(232, 201, 138, 0.5);
  border-right-color: transparent;
  border-bottom-color: transparent;
  animation: spin 26s linear infinite;
}
.sigil::after {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  border: 1px dashed rgba(127, 227, 212, 0.22);
  animation: spin 44s linear infinite reverse;
}
.sigil i {
  position: absolute;
  left: 50%; top: 50%;
  width: 5px; height: 5px;
  margin: -2.5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}
.sigil i:nth-child(1) { transform: rotate(0deg) translateY(-46%) scale(1.2); }
.sigil i:nth-child(2) { transform: rotate(120deg) translateY(-46%); opacity: .65; }
.sigil i:nth-child(3) { transform: rotate(240deg) translateY(-46%); opacity: .35; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%,100% { box-shadow: inset 0 0 40px rgba(127,227,212,.06), 0 0 50px rgba(232,201,138,.05); } 50% { box-shadow: inset 0 0 60px rgba(127,227,212,.12), 0 0 80px rgba(232,201,138,.12); } }

.wordmark {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(38px, 8.4vw, 78px);
  line-height: .96;
  letter-spacing: .16em;
  color: var(--pearl);
  text-shadow: 0 2px 40px rgba(127, 227, 212, 0.18);
  animation: rise .8s var(--ease) both;
}
.wordmark em {
  display: block;
  margin-top: 12px;
  font-family: var(--sans);
  font-style: normal;
  font-size: clamp(9px, 1.2vw, 11px);
  letter-spacing: .42em;
  text-transform: uppercase;
  color: var(--gold);
  animation: rise .9s .1s var(--ease) both;
}
.tagline {
  margin: 20px auto 0;
  max-width: 460px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(13px, 1.6vw, 16px);
  line-height: 1.65;
  color: var(--pearl-dim);
  animation: rise 1s .18s var(--ease) both;
}
.title-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin: 27px auto 0;
  max-width: 520px;
  animation: rise 1s .26s var(--ease) both;
}
.title-stats {
  display: flex;
  justify-content: center;
  gap: clamp(20px, 6vw, 54px);
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  animation: rise 1s .34s var(--ease) both;
}
.title-stats div { display: flex; flex-direction: column; gap: 3px; }
.title-stats b { font-family: var(--serif); font-weight: 400; font-size: 19px; color: var(--gold); font-variant-numeric: tabular-nums; }
.title-stats span { font-size: 8.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--pearl-faint); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* --------------------------------------------------------------- chapters */
.chapter-scroll { max-height: min(58svh, 520px); overflow-y: auto; padding-right: 6px; margin-top: 6px; }
.chapter-scroll::-webkit-scrollbar { width: 6px; }
.chapter-scroll::-webkit-scrollbar-thumb { background: rgba(232, 201, 138, 0.22); border-radius: 99px; }
.act-block { margin-bottom: 18px; }
.act-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 10px; }
.act-head h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 16px;
  margin: 0;
  color: var(--pearl);
}
.act-head span { font-size: 8.5px; letter-spacing: .2em; color: var(--gold); text-transform: uppercase; }
.act-head em { margin-left: auto; font-style: normal; font-size: 10px; color: var(--pearl-faint); }
.chapter-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }
.ch {
  position: relative;
  aspect-ratio: 1.16;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
  color: var(--pearl-dim);
  font: 600 13px/1 var(--sans);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  transition: border-color .2s, background .2s, transform .15s;
}
.ch:hover { border-color: rgba(232, 201, 138, 0.5); background: rgba(232, 201, 138, 0.08); transform: translateY(-1px); }
.ch.locked { opacity: .3; cursor: default; }
.ch.locked:hover { transform: none; border-color: var(--line-soft); background: rgba(255,255,255,.02); }
.ch.cleared { border-color: rgba(127, 227, 212, 0.32); color: var(--pearl); }
.ch.current { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(232,201,138,.25), 0 0 22px -8px rgba(232,201,138,.6); }
.ch .st { display: flex; gap: 2px; height: 5px; }
.ch .st i { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.ch .st i.on { background: var(--gold); box-shadow: 0 0 5px rgba(232, 201, 138, 0.8); }
.ch.finale { border-color: rgba(255, 107, 94, 0.28); }
.chapter-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; border-top: 1px solid var(--line-soft); padding-top: 14px; flex-wrap: wrap; }
.chapter-foot .hint { margin: 0; flex: 1; min-width: 200px; }

/* ------------------------------------------------------------------ brief */
.brief-num {
  display: inline-grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-right: 10px;
  border-radius: 50%;
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--gold);
  vertical-align: 3px;
}
.brief-story { margin: 12px 0 0; font-family: var(--serif); font-size: clamp(14px, 1.7vw, 17px); line-height: 1.6; color: var(--pearl); }
.brief-story.dim { color: var(--pearl-dim); margin-top: 6px; }
.brief-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.brief-meta span {
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 10px;
}
.brief-tip { margin: 14px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--pearl-dim); }
.brief-actions { display: flex; gap: 9px; margin-top: 22px; flex-wrap: wrap; }

/* ----------------------------------------------------------------- result */
.result { text-align: center; }
.rank {
  font-family: var(--serif);
  font-size: 64px;
  line-height: 1;
  color: var(--gold);
  text-shadow: 0 0 40px rgba(232, 201, 138, 0.35);
  margin: 2px 0 6px;
}
.stars { display: flex; justify-content: center; gap: 9px; margin: 2px 0 10px; }
.stars i {
  width: 16px; height: 16px;
  background: rgba(255, 255, 255, 0.13);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.stars i.on { background: var(--gold); filter: drop-shadow(0 0 6px rgba(232, 201, 138, 0.8)); }
.result h2 { margin-bottom: 4px; }
.result-note { font-size: 12.5px; line-height: 1.55; color: var(--pearl-dim); margin: 0 auto 14px; max-width: 380px; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 8px;
  margin: 16px 0 4px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.result-grid div { display: flex; flex-direction: column; gap: 2px; }
.result-grid b { font: 600 15px/1 var(--sans); color: var(--pearl); font-variant-numeric: tabular-nums; }
.result-grid span { font-size: 8px; letter-spacing: .14em; text-transform: uppercase; color: var(--pearl-faint); }

/* ------------------------------------------------------------------ misc */
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--pearl-dim); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.ember { background: var(--gold); box-shadow: 0 0 8px rgba(232, 201, 138, 0.9); }
.dot.rune { background: #b9a4ff; box-shadow: 0 0 8px rgba(185, 164, 255, 0.8); }
.dot.draugr { background: #bfe8d8; box-shadow: 0 0 8px rgba(191, 232, 216, 0.7); }
.dot.fire { background: var(--danger); box-shadow: 0 0 8px rgba(255, 107, 94, 0.8); }
.dot.tide { background: #7fa8e3; box-shadow: 0 0 8px rgba(127, 168, 227, 0.7); }

.how-list { margin: 4px 0 16px; padding-left: 20px; }
.how-list li { font-size: 14px; line-height: 1.65; color: var(--pearl-dim); margin: 7px 0; }
.how-list b { color: var(--pearl); font-weight: 600; }

.toast {
  position: absolute;
  left: 50%;
  top: 68px;
  transform: translate(-50%, -10px);
  z-index: 12;
  max-width: min(400px, calc(100% - 30px));
  padding: 9px 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(4, 14, 13, 0.92);
  color: var(--gold);
  font-size: 11px;
  line-height: 1.45;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  backdrop-filter: blur(8px);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast-sub {
  top: 104px;
  color: var(--pearl-dim);
  letter-spacing: .03em;
  text-transform: none;
  font-size: 11px;
  max-width: min(440px, calc(100% - 40px));
}

/* ---------------------------------------------------------------- article */
.article {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 86px) clamp(18px, 5vw, 32px) 90px;
  border-top: 1px solid var(--line-soft);
  background: radial-gradient(100% 40% at 50% 0%, rgba(9, 28, 26, 0.5), transparent 70%);
}
.crumbs { font-size: 11px; letter-spacing: .04em; color: var(--pearl-faint); margin-bottom: 18px; }
.crumbs a { color: var(--pearl-dim); text-decoration: none; border-bottom: 1px solid rgba(232, 201, 138, 0.25); }
.crumbs a:hover { color: var(--gold); }
.article h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 4.4vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  margin: 0 0 20px;
}
.lede { font-size: 16.5px; line-height: 1.72; color: var(--pearl); }
.article p { font-size: 14.5px; line-height: 1.78; color: var(--pearl-dim); }
.article h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2.8vw, 27px);
  margin: 38px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
}
.article h3 { font-size: 14.5px; font-weight: 600; color: var(--pearl); margin: 20px 0 5px; }
.article ol, .article ul { padding-left: 22px; }
.article li { font-size: 14.5px; line-height: 1.75; color: var(--pearl-dim); margin: 7px 0; }
.article strong { color: var(--pearl); font-weight: 600; }
.article table { width: 100%; border-collapse: collapse; margin: 14px 0 6px; font-size: 13px; }
.article th, .article td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.article th { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.article td { color: var(--pearl-dim); }
.article code { font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: rgba(255, 255, 255, 0.05); padding: 2px 5px; border-radius: 4px; color: var(--gold); }
.article kbd { font: 11px/1 ui-monospace, monospace; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 0; }
.tags span { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--line); border-radius: 99px; padding: 5px 9px; }
.src { font-size: 12px !important; color: var(--pearl-faint) !important; margin-top: 33px; }
.src a { color: var(--gold); text-decoration: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 760px) {
  .chapter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hud-goal .goal-label { display: none; }
  .goal-bar { width: 74px; }
  .dock-hint { display: none; }
}
@media (max-width: 520px) {
  .wordmark { letter-spacing: .1em; }
  .title-stats { gap: 18px; }
  .title-actions .btn { flex: 1 1 42%; }
  .hud-kicker { display: none; }
  .hud-chapter { max-width: 50vw; font-size: 12.5px; }
  .hud-stat.chain { display: none; }
  .hud-goal .goal-bar { display: none; }
  .goal-num { min-width: 38px; font-size: 12px; }
  #btnMute { display: none; }
  .title-wrap { padding-top: 8px; }
  .screen { padding: 10px; }
  .panel { padding: 20px 16px; }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  .result .rank { font-size: 52px; }
  .article { padding-top: 40px; }
  .article table { display: block; overflow-x: auto; white-space: nowrap; }
  .dpad { display: grid; }
  .dock { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .toast { top: 58px; font-size: 9.5px; }
  .toast-sub { top: 92px; font-size: 10px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .game { min-height: 320px; }
  .hud { padding: 4px 12px 8px; }
  .hud-kicker { display: none; }
  .hud-chapter { font-size: 11.5px; max-width: 40vw; }
  .hud-goal .goal-label { display: none; }
  .goal-bar { width: 60px; }
  .dock { padding: 8px 12px 6px; }
  .shed { height: 40px; font-size: 10.5px; }
  .dock-hint { display: none; }
  .toast { top: 44px; font-size: 9.5px; }
  .toast-sub { top: 80px; font-size: 10px; }
  .sigil { display: none; }
  .title-wrap { padding-top: 0; }
  .wordmark { font-size: 34px; }
  .tagline { margin-top: 10px; }
  .title-actions { margin-top: 14px; }
  .title-stats { margin-top: 14px; padding-top: 10px; }
  .screen { align-items: flex-start; padding-top: 46px; }
  .chapter-scroll { max-height: 46svh; }
  .dpad { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}
