/* Deeplight.
 *
 * The design rule the whole sheet follows: the page is lit by Wren's lamp.
 *
 *   default      warm light radiates from the reading column outward
 *   .is-dark     she has doused it — everything drops to cold near-black
 *   .is-watched  she is standing under Ardent's own lamps, and the gold comes
 *                from the EDGES instead of the middle, and breathes
 *
 * That inversion is the game's central idea and it is expressed here rather
 * than described in prose, which is why the tokens are grouped by lighting
 * state instead of by component.
 *
 * No web fonts. The display face is whatever good old-style serif the machine
 * already has — Iowan Old Style on a Mac, Palatino on Windows, Georgia
 * everywhere else. All three have the right century in them, none of them costs
 * a request, and none of them is Inter.
 */

/* ─────────────────────────────── tokens ─────────────────────────────── */

:root {
  /* surfaces */
  --ink:        #060a0e;
  --ink-2:      #0b1219;
  --ink-3:      #121c25;

  /* the lamp */
  --lamp:       #f0b45e;
  --lamp-hi:    #ffd9a3;
  --lamp-low:   #b8823c;
  --copper:     #8c6a45;

  /* type */
  --bone:       #e7e0d2;
  --bone-2:     #b9b3a6;
  --bone-3:     #7d8a90;
  --cold:       #8fb0c4;
  --alarm:      #c96a56;

  /* lighting, animated by state classes */
  --glow:       0.42;   /* the lamp's own throw, behind the column   */
  --plate-lum:  0.62;   /* how much of the painted plate is visible  */
  --plate-sat:  0.85;
  --watch:      0;      /* gold pressing in from the edges           */
  --vig:        0.92;   /* vignette strength                         */

  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Hoefler Text',
           'Sitka Text', Georgia, 'Times New Roman', serif;
  --mono:  ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas,
           'Cascadia Mono', 'Roboto Mono', monospace;

  --col:   min(64ch, 100%);
  --pad:   clamp(1.1rem, 4vw, 3.25rem);
  --ease:  cubic-bezier(.22, .61, .36, 1);
}

body.is-dark {
  --glow: 0.06;
  --plate-lum: 0.13;
  --plate-sat: 0.25;
  --vig: 1;
  --bone: #b8c2c7;
  --bone-2: #7e8b91;
  --lamp: #7f93a0;
  --lamp-hi: #a9bcc6;
}

body.is-watched {
  --watch: 1;
  --glow: 0.2;
  --plate-lum: 0.66;
  --vig: 0.7;
}

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

/* ─────────────────────────────── reset ──────────────────────────────── */

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

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  color: var(--bone);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

body {
  overflow: hidden;
  transition: background 900ms var(--ease);
}

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--lamp); outline-offset: 3px; border-radius: 2px; }
::selection { background: rgba(240,180,94,.26); }

/* ─────────────────────────────── world ──────────────────────────────── */

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

.plate {
  position: absolute;
  inset: -3%;                     /* room for the drift */
  background: var(--ink-2) center/cover no-repeat;
  opacity: 0;
  filter: saturate(var(--plate-sat)) brightness(var(--plate-lum)) contrast(1.05);
  transition: opacity 1400ms var(--ease), filter 900ms var(--ease);
  will-change: opacity, transform;
  animation: drift 68s ease-in-out infinite alternate;
}
.plate.is-on { opacity: 1; }

/* The plate is never quite still. 1.5% over a minute — you notice it only
   when you stop reading, which is exactly when it should do the work. */
@keyframes drift {
  from { transform: scale(1.04) translate3d(-0.7%, -0.4%, 0); }
  to   { transform: scale(1.075) translate3d(0.7%, 0.5%, 0); }
}

/* Film grain, so the flat dark areas of a generated plate do not band. */
.grain {
  position: absolute; inset: -50%;
  opacity: .13;
  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='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  animation: grain 900ms steps(3) infinite;
  mix-blend-mode: overlay;
}
@keyframes grain {
  0%   { transform: translate3d(0,0,0); }
  33%  { transform: translate3d(-3%,2%,0); }
  66%  { transform: translate3d(2%,-3%,0); }
  100% { transform: translate3d(0,0,0); }
}

/* The reading scrim.
 *
 * The vignette shapes the whole frame; this darkens the one band the prose
 * actually sits in. Both are needed: a vignette strong enough to make body text
 * comfortable over a lit street would crush the painting everywhere else, and a
 * painting bright enough to be worth looking at will always fight 17px of serif.
 *
 * It is keyed to the same column width as the transcript, so it moves when the
 * layout does and is full-width on a phone, where the text is too.
 */
.readscrim {
  position: absolute; inset: 0;
  background: linear-gradient(
    to right,
    rgba(6,10,14,.90) 0%,
    rgba(6,10,14,.86) calc(max(var(--pad), 0px) + var(--col) * .62),
    rgba(6,10,14,.42) calc(max(var(--pad), 0px) + var(--col) * 1.02),
    transparent calc(max(var(--pad), 0px) + var(--col) * 1.28));
  transition: opacity 900ms var(--ease);
}
@media (max-width: 60rem) {
  .readscrim { background: rgba(6,10,14,.84); }
}
body.is-dark .readscrim { opacity: .55; }

.vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(140% 100% at 34% 52%,
      transparent 0%,
      rgba(6,10,14,calc(.30 * var(--vig))) 42%,
      rgba(6,10,14,calc(.86 * var(--vig))) 78%,
      rgba(6,10,14,calc(.97 * var(--vig))) 100%);
  transition: background 900ms var(--ease);
}

/* The city's own light. It arrives from outside the frame, because the whole
   point is that in Ardent the light is the thing looking at you. */
.watchlight {
  position: absolute; inset: 0;
  opacity: var(--watch);
  transition: opacity 1600ms var(--ease);
  /* Weakest along the bottom edge, where the command line lives. The effect
     has to be felt at the periphery without ever making the prompt hard to
     read — an atmosphere that costs legibility is not atmosphere, it is a bug. */
  background:
    linear-gradient(to right,  rgba(240,180,94,.30), transparent 26%),
    linear-gradient(to left,   rgba(240,180,94,.30), transparent 26%),
    linear-gradient(to bottom, rgba(240,180,94,.16), transparent 20%),
    linear-gradient(to top,    rgba(240,180,94,.09), transparent 14%);
  animation: breathe 7.5s ease-in-out infinite;
  mix-blend-mode: screen;
}
@keyframes breathe {
  0%, 100% { filter: brightness(.82); }
  50%      { filter: brightness(1.18); }
}

/* ─────────────────────────────── screens ────────────────────────────── */

.screen { position: relative; z-index: 1; height: 100%; }
[hidden] { display: none !important; }

/* ──────────────────────────────── title ─────────────────────────────── */

.screen--title {
  display: grid;
  align-content: center;
  padding: var(--pad);
  padding-inline: max(var(--pad), env(safe-area-inset-left));
}

.title-plate { max-width: 40rem; }

.eyebrow {
  margin: 0 0 1.4rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--lamp-low);
}

.wordmark {
  margin: 0;
  font-size: clamp(3.6rem, 15vw, 8.5rem);
  font-weight: 400;
  line-height: .88;
  letter-spacing: -.022em;
  color: var(--bone);
  text-shadow:
    0 0 42px rgba(240,180,94,.30),
    0 0 120px rgba(240,180,94,.16);
  animation: lamp-up 2.6s var(--ease) both;
}
@keyframes lamp-up {
  from { opacity: 0; letter-spacing: .12em; filter: blur(9px); }
  to   { opacity: 1; letter-spacing: -.022em; filter: blur(0); }
}

.tagline {
  max-width: 34rem;
  margin: 1.9rem 0 0;
  font-size: clamp(1.02rem, 2.4vw, 1.2rem);
  line-height: 1.62;
  color: var(--bone-2);
  animation: rise 1s var(--ease) .7s both;
}
.tagline--sub { margin-top: .9rem; color: var(--lamp); animation-delay: 1s; }

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

.title-actions {
  display: flex; flex-wrap: wrap; gap: .7rem;
  margin-top: 2.6rem;
  animation: rise 1s var(--ease) 1.3s both;
}

.btn {
  padding: .82em 1.5em;
  font-family: var(--mono);
  font-size: .8rem;
  letter-spacing: .17em;
  text-transform: uppercase;
  color: var(--bone-2);
  border: 1px solid rgba(140,106,69,.5);
  background: rgba(6,10,14,.5);
  backdrop-filter: blur(7px);
  transition: color 220ms, border-color 220ms, background 220ms, transform 220ms var(--ease);
}
.btn:hover { color: var(--lamp-hi); border-color: var(--lamp); transform: translateY(-1px); }
.btn:active { transform: none; }

.btn--primary {
  color: var(--ink);
  background: var(--lamp);
  border-color: var(--lamp);
  box-shadow: 0 0 34px rgba(240,180,94,.28);
}
.btn--primary:hover { background: var(--lamp-hi); border-color: var(--lamp-hi); color: var(--ink); }

.btn--quiet { border-color: rgba(140,106,69,.24); }

/* The title screen's mute. Quiet enough not to compete with the wordmark,
   present enough to be findable without hunting — it says the word "Sound"
   rather than relying on a note glyph alone, because a lone ♪ is as often
   decoration as it is a control. */
.soundtoggle {
  position: absolute;
  top: max(1.4rem, env(safe-area-inset-top));
  right: max(1.4rem, env(safe-area-inset-right));
  display: flex; align-items: center; gap: .55em;
  padding: .5em .85em;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--bone-3);
  border: 1px solid rgba(140,106,69,.24);
  background: rgba(6,10,14,.5);
  backdrop-filter: blur(7px);
  transition: color 220ms, border-color 220ms;
  animation: rise 1s var(--ease) 1.9s both;
}
.soundtoggle:hover { color: var(--lamp-hi); border-color: rgba(240,180,94,.5); }
.soundtoggle__icon { font-size: .9rem; letter-spacing: 0; color: var(--lamp); }
.soundtoggle[data-sound-state="off"] { color: var(--bone-3); opacity: .62; }
.soundtoggle[data-sound-state="off"] .soundtoggle__icon { color: var(--bone-3); }

@media (max-width: 34rem) {
  .soundtoggle__word { display: none; }
  .soundtoggle { padding: .5em .6em; }
}

.title-foot {
  margin-top: 2.4rem;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .13em;
  color: var(--bone-3);
  animation: rise 1s var(--ease) 1.7s both;
}
.sep { opacity: .4; margin: 0 .5em; }

/* ──────────────────────────────── game ─────────────────────────────── */

.screen--game {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  height: 100dvh;
}

/* ── status strip ── */

.strip {
  display: flex;
  align-items: center;
  gap: clamp(.7rem, 2.4vw, 2.1rem);
  padding: .62rem max(var(--pad), env(safe-area-inset-left));
  padding-top: max(.62rem, env(safe-area-inset-top));
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--bone-3);
  background: linear-gradient(rgba(6,10,14,.9), rgba(6,10,14,0));
  border-bottom: 1px solid rgba(140,106,69,.14);
}

.strip__group { display: flex; align-items: center; gap: .5em; min-width: 0; }
.strip__label { color: var(--bone-3); opacity: .75; }
.strip__value { color: var(--bone); font-variant-numeric: tabular-nums; }
.strip__sub   { opacity: .45; }
.strip__title {
  color: var(--lamp-low);
  text-transform: none;
  letter-spacing: .04em;
  font-family: var(--serif);
  font-size: .84rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.strip__menu { display: flex; gap: .35rem; margin-left: auto; flex-shrink: 0; }

/* Twelve marks that go out one at a time. A progress bar would say "resource";
   this says "how she is doing", which is the thing it actually measures. */
.nerve { display: flex; gap: 3px; align-items: center; }
.nerve i {
  display: block; width: 3px; height: 13px;
  background: var(--lamp);
  opacity: .92;
  border-radius: 1px;
  transition: opacity 500ms var(--ease), background 500ms var(--ease), height 300ms var(--ease);
}
.nerve i.out { opacity: .16; background: var(--bone-3); height: 7px; }
.nerve.low i:not(.out) { background: var(--alarm); animation: flicker 2.4s ease-in-out infinite; }
@keyframes flicker { 0%,100% { opacity: .92 } 45% { opacity: .55 } }

.lampdot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--lamp);
  box-shadow: 0 0 12px var(--lamp), 0 0 26px rgba(240,180,94,.5);
  transition: all 600ms var(--ease);
}
.lampdot.out { background: var(--bone-3); box-shadow: none; opacity: .4; }

.chip {
  padding: .34em .7em;
  font-family: var(--mono);
  font-size: .66rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--bone-3);
  border: 1px solid rgba(140,106,69,.22);
  transition: color 200ms, border-color 200ms;
}
.chip:hover { color: var(--lamp); border-color: rgba(240,180,94,.5); }
.chip--icon { font-size: .82rem; letter-spacing: 0; padding: .22em .55em; }
.chip[data-sound-state="off"] { opacity: .4; text-decoration: line-through; }

/* On a phone the strip has to lose things, and the order it loses them in is a
   design decision: the dive TITLE goes before the dive numeral, the score
   denominator goes before the score, and MAP and HINT go before VERBS — both
   are still reachable by typing them and from the menu, and VERBS is the one a
   newcomer needs within reach. What is left is the four things that change
   while you play: where, how she is, whether the lamp is lit, and the score. */
@media (max-width: 48rem) {
  .strip { gap: .85rem; padding-inline: 1rem; }
  .strip__title,
  .strip__sub,
  .strip__group--dive .strip__label,
  .strip__group--nerve .strip__label,
  .strip__group--score .strip__label,
  .strip__group--lamp .strip__label,
  .chip[data-act="map"],
  .chip[data-act="hint"] { display: none; }
  .nerve i { width: 2px; }
}

/* ── the reading column ── */

.reader {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(140,106,69,.35) transparent;
  /* The lamp's throw. Sits behind the text and contracts when she douses. */
  background: radial-gradient(70% 46% at 30% 46%,
    rgba(240,180,94,calc(.09 * var(--glow) / .42)) 0%, transparent 70%);
  transition: background 900ms var(--ease);
}
.reader::-webkit-scrollbar { width: 9px; }
.reader::-webkit-scrollbar-thumb { background: rgba(140,106,69,.34); border-radius: 9px; }
.reader::-webkit-scrollbar-track { background: transparent; }

.reader__fade {
  position: sticky; bottom: 0; left: 0; right: 0;
  height: 3.4rem; margin-top: -3.4rem;
  background: linear-gradient(transparent, var(--ink) 92%);
  pointer-events: none;
}

.transcript {
  width: var(--col);
  margin: 0 auto 0 max(var(--pad), env(safe-area-inset-left));
  padding: 2.2rem 0 1rem;
  font-size: clamp(1.02rem, 1.05rem + .2vw, 1.16rem);
  line-height: 1.72;
}
@media (max-width: 60rem) {
  .transcript { margin-inline: auto; padding-inline: var(--pad); }
}

/* Every line arrives. The stagger is set per-line from JS. */
.line {
  margin: 0 0 1.05em;
  white-space: pre-wrap;
  animation: arrive 620ms var(--ease) both;
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(7px); filter: blur(2px); }
  to   { opacity: 1; transform: none; filter: none; }
}
.transcript.rushed .line { animation-duration: 1ms !important; animation-delay: 0ms !important; }

/* what she says — the only voiced lines, and they look it */
.line--say {
  position: relative;
  margin-left: 1.15em;
  padding-left: 1.15em;
  color: var(--lamp-hi);
  font-style: italic;
}
.line--say::before {
  content: '';
  position: absolute; left: 0; top: .34em; bottom: .34em;
  width: 2px;
  background: linear-gradient(var(--lamp), transparent);
  transform-origin: top;
  animation: draw 700ms var(--ease) both;
}
@keyframes draw { from { transform: scaleY(0); opacity: 0 } to { transform: none; opacity: 1 } }
.line--say.is-speaking::before { box-shadow: 0 0 14px var(--lamp); }

/* room names */
.line--head {
  margin: 1.9em 0 .75em;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--lamp);
}
.line--head::after {
  content: '';
  display: block; margin-top: .8em; height: 1px;
  background: linear-gradient(90deg, rgba(240,180,94,.55), transparent 62%);
}

/* documents, epigraphs, things read aloud off a page */
.line--read {
  margin: 1.4em 0;
  padding: 1.1em 1.3em;
  font-family: var(--mono);
  font-size: .87em;
  line-height: 1.62;
  color: var(--bone-2);
  background: rgba(11,18,25,.62);
  border-left: 1px solid rgba(140,106,69,.42);
  backdrop-filter: blur(3px);
}

/* the chapter card */
.line--flash {
  margin: 2.4em 0 1.8em;
  padding: 1.5em 0;
  font-family: var(--mono);
  font-size: clamp(.86rem, 3.2vw, 1.02rem);
  letter-spacing: .3em;
  text-transform: uppercase;
  text-align: center;
  color: var(--lamp-hi);
  border-top: 1px solid rgba(240,180,94,.28);
  border-bottom: 1px solid rgba(240,180,94,.28);
  text-shadow: 0 0 28px rgba(240,180,94,.5);
  animation: arrive 1100ms var(--ease) both;
}

.line--note {
  font-family: var(--mono);
  font-size: .78em;
  line-height: 1.6;
  letter-spacing: .02em;
  color: var(--bone-3);
}
.line--item { margin-left: 1.3em; text-indent: -1.3em; color: var(--bone-2); }
.line--item::before { content: '·  '; color: var(--lamp-low); }

/* what the player typed */
.line--echo {
  margin-top: 1.7em;
  font-family: var(--mono);
  font-size: .82em;
  letter-spacing: .04em;
  color: var(--bone-3);
}
.line--echo::before { content: '▸ '; color: var(--lamp); }

/* the last thing you say to her */
.line--said {
  margin: 2em 0;
  font-size: 1.24em;
  line-height: 1.6;
  text-align: center;
  color: var(--lamp-hi);
  text-shadow: 0 0 30px rgba(240,180,94,.4);
}

.line--score { font-family: var(--mono); font-size: .74em; letter-spacing: .1em; color: var(--lamp-low); }
.line--score::before { content: '+'; }
.line--beat { height: .5em; margin: 0; }

/* Interactive nouns. A faint underline, not a hyperlink — this is prose. */
.n {
  color: inherit;
  cursor: pointer;
  border-bottom: 1px solid rgba(240,180,94,.34);
  transition: color 180ms, border-color 180ms, background 180ms;
}
.n:hover { color: var(--lamp-hi); border-bottom-color: var(--lamp); background: rgba(240,180,94,.09); }

/* ── the console ── */

.console {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  width: var(--col);
  margin: 0 auto 0 max(var(--pad), env(safe-area-inset-left));
  padding: .9rem 0 max(1.1rem, env(safe-area-inset-bottom));
}

/* The prompt sits on its own ground, so no lighting state can wash it out.
   Fixed to the viewport rather than sized off the console: an earlier version
   used `right: -100vw` to reach the edge and added 640px of horizontal scroll
   on a phone, because the element still counts toward scrollWidth. */
.screen--game > .console::after {
  content: '';
  position: fixed; z-index: -1;
  left: 0; right: 0; bottom: 0;
  height: 7rem;
  background: linear-gradient(transparent, rgba(6,10,14,.88) 34%, var(--ink) 72%);
  pointer-events: none;
}
@media (max-width: 60rem) {
  .console { margin-inline: auto; padding-inline: var(--pad); width: 100%; }
}

.console::before {
  content: '';
  position: absolute; left: 0; right: 0;
  margin-top: -.9rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140,106,69,.34) 12%, rgba(140,106,69,.34) 60%, transparent);
}

.console__prompt {
  color: var(--lamp);
  font-family: var(--mono);
  font-size: 1rem;
  text-shadow: 0 0 12px rgba(240,180,94,.6);
  animation: pulse 3.4s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .45 } }

.console__input {
  flex: 1; min-width: 0;
  padding: .35rem 0;
  font-family: var(--mono);
  font-size: clamp(.92rem, .9rem + .2vw, 1rem);
  letter-spacing: .02em;
  color: var(--bone);
  background: none;
  border: 0;
  caret-color: var(--lamp);
}
.console__input:focus { outline: none; }
.console__input::placeholder { color: var(--bone-3); opacity: .5; }

.console__send {
  font-family: var(--mono);
  font-size: 1.05rem;
  color: var(--bone-3);
  padding: .2em .5em;
  transition: color 200ms;
}
.console__send:hover { color: var(--lamp); }
@media (hover: hover) and (pointer: fine) { .console__send { display: none; } }

/* ─────────────────────────────── overlay ────────────────────────────── */

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--pad); }
.overlay__scrim {
  position: absolute; inset: 0;
  background: rgba(3,6,9,.84);
  backdrop-filter: blur(9px);
  animation: fade 300ms var(--ease) both;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

.sheet {
  position: relative;
  width: min(56rem, 100%);
  max-height: min(84vh, 46rem);
  display: flex; flex-direction: column;
  background: linear-gradient(rgba(18,28,37,.97), rgba(11,18,25,.99));
  border: 1px solid rgba(140,106,69,.34);
  box-shadow: 0 40px 120px rgba(0,0,0,.7), 0 0 90px rgba(240,180,94,.06);
  animation: sheet-in 420ms var(--ease) both;
}
@keyframes sheet-in {
  from { opacity: 0; transform: translateY(20px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.sheet__head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.1rem 1.6rem;
  border-bottom: 1px solid rgba(140,106,69,.2);
}
.sheet__title {
  margin: 0;
  font-family: var(--mono);
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--lamp);
}
.sheet__close { color: var(--bone-3); font-size: .95rem; padding: .3em .5em; transition: color 200ms; }
.sheet__close:hover { color: var(--lamp); }

.sheet__body { padding: 1.6rem; overflow-y: auto; line-height: 1.68; color: var(--bone-2); }
.sheet__body p { margin: 0 0 1em; max-width: 46em; }
.sheet__body strong { color: var(--bone); font-weight: 400; }
.sheet__body h3 {
  margin: 1.9em 0 .7em;
  font-family: var(--mono);
  font-size: .7rem; font-weight: 400;
  letter-spacing: .26em; text-transform: uppercase;
  color: var(--lamp-low);
}
.sheet__body h3:first-child { margin-top: 0; }
.sheet__body code, .sheet__body kbd {
  font-family: var(--mono);
  font-size: .84em;
  letter-spacing: .04em;
  color: var(--lamp-hi);
  text-transform: uppercase;
}
.sheet__body ul { margin: 0 0 1em; padding: 0; list-style: none; }
.sheet__body li { margin: 0 0 .42em; padding-left: 1.1em; text-indent: -1.1em; }
.sheet__body li::before { content: '·  '; color: var(--copper); }
.sheet__body em { color: var(--bone-3); font-style: italic; }

/* leaderboard */
.board { width: 100%; border-collapse: collapse; font-size: .92rem; }
.board th {
  padding: .5rem .7rem;
  font-family: var(--mono);
  font-size: .64rem; font-weight: 400;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--bone-3);
  text-align: left;
  border-bottom: 1px solid rgba(140,106,69,.24);
}
.board td { padding: .62rem .7rem; border-bottom: 1px solid rgba(140,106,69,.09); }
.board tr:hover td { background: rgba(240,180,94,.04); }
.board .rank { font-family: var(--mono); color: var(--bone-3); width: 2.4rem; }
.board .who  { font-family: var(--mono); letter-spacing: .18em; color: var(--lamp-hi); }
.board .pts  { font-variant-numeric: tabular-nums; color: var(--bone); text-align: right; }
.board .is-you td { background: rgba(240,180,94,.1); }
.board__tabs { display: flex; gap: .4rem; margin-bottom: 1.2rem; }
.board__empty { color: var(--bone-3); font-style: italic; }

/* the ending card */
.ending { text-align: center; padding: 1rem 0 2rem; }
.ending__title {
  margin: 0 0 .3em;
  font-size: clamp(2.2rem, 8vw, 3.4rem);
  font-weight: 400;
  color: var(--bone);
  text-shadow: 0 0 44px rgba(240,180,94,.34);
}
.ending__rank {
  font-family: var(--mono);
  font-size: .76rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--lamp);
}
.ending__score {
  margin: 1.4rem 0 .3rem;
  font-size: clamp(3rem, 12vw, 4.6rem);
  line-height: 1;
  color: var(--lamp-hi);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 50px rgba(240,180,94,.4);
}
.ending__of { font-family: var(--mono); font-size: .72rem; letter-spacing: .26em; color: var(--bone-3); }
.ending__stats {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.6rem;
  margin: 2rem 0;
  font-family: var(--mono); font-size: .7rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--bone-3);
}
.ending__stats b { display: block; font-weight: 400; font-size: 1.5rem; letter-spacing: 0; color: var(--bone); }
.ending__form { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; align-items: center; margin-top: 1rem; }
.ending__initials {
  width: 6.2rem; padding: .7rem;
  font-family: var(--mono); font-size: 1.3rem;
  letter-spacing: .4em; text-align: center; text-transform: uppercase;
  color: var(--lamp-hi); background: rgba(6,10,14,.7);
  border: 1px solid rgba(140,106,69,.5);
}
.ending__initials:focus { outline: none; border-color: var(--lamp); }

/* boot */
body.booting .screen { opacity: 0; }
body:not(.booting) .screen { animation: fade 700ms var(--ease) both; }
