@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/assets/fonts/cormorant-garamond-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('/assets/fonts/lora-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('/assets/fonts/lora-latin-italic.woff2') format('woff2');
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
}

:root {
  --color-bg: #f3f2f2;
  --color-surface: #eae9e9;
  --color-text: #201f1d;
  --color-accent: #b68235;
  --color-divider: rgba(32, 31, 29, 0.16);

  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  --color-accent-100: #fff3e4;
  --color-accent-200: #ffe3bf;
  --color-accent-300: #facb8d;
  --color-accent-400: #e1ad66;
  --color-accent-600: #a06f24;
  --color-accent-700: #7d5411;

  --font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body: 'Lora', Georgia, 'Times New Roman', serif;

  --space-1: 4.6px;
  --space-2: 9.2px;
  --space-3: 13.8px;
  --space-4: 18.4px;
  --space-6: 27.6px;
  --space-8: 36.8px;

  --gutter: 20px;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 7px;

  --shadow-sm: 0 1px 2px rgba(45, 43, 43, .14);
  --shadow-md: 0 3px 10px rgba(45, 43, 43, .16);

  --quick: 150ms;
  --settle: 180ms;
  --count: 300ms;
  --ease: cubic-bezier(.2, .7, .3, 1);
}

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

[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img { display: block; max-width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: rgba(182, 130, 53, .3); }

.num { font-variant-numeric: tabular-nums; }

.lbl {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
}

.stage {
  height: 100svh;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--color-bg);
}

.screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-inline: auto;
}
.screen[hidden] { display: none; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 16px 18px 0;
  flex: none;
  width: 100%;
  margin-inline: auto;
}

.stage:has(#onboard:not([hidden])) > .topbar { display: none; }
.wordmark {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: .2em;
  white-space: nowrap;
}
.topmeta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
  min-width: 0;
}
.topmeta .when { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.menu-btn {
  border: 0; background: none; padding: 15px 0 15px 15px; margin: -15px -4px -15px 0;
  cursor: pointer; display: flex; align-items: center; justify-content: flex-end;
  min-width: 44px; min-height: 44px;
}
.menu-btn .glyph {
  width: 22px; height: 14px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.menu-btn .glyph i { display: block; height: 1px; background: var(--color-text); }
.menu-btn:hover .glyph i { background: var(--color-accent-700); }

.daypick { display: flex; gap: 4px; align-items: center; }
.daypick[hidden] { display: none; }
.daypick button {
  font: inherit; font-size: 10px; letter-spacing: .08em;
  padding: 4px 7px; cursor: pointer; min-height: 24px;
  border: 1px dashed var(--color-neutral-400); border-radius: var(--radius-sm);
  background: none; color: var(--color-neutral-600);
}
.daypick span { font-size: 10px; letter-spacing: .08em; color: var(--color-neutral-500); }

.tabs {
  display: flex;
  gap: 24px;
  padding: 8px var(--gutter) 0;
  border-bottom: 1px solid var(--color-divider);
  flex: none;
}
.track {
  display: flex; align-items: center; gap: 8px;
  min-height: 44px;
  padding: 11px 0 10px;
  margin-bottom: -1px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .06em;
  color: var(--color-neutral-600);
  transition: color var(--quick) var(--ease), border-color var(--quick) var(--ease);
}
.track .no {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: .1em;
  color: var(--color-neutral-600);
}

.track .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color-accent);

  box-shadow: 0 0 0 3px rgba(182, 130, 53, .22);
}

.track.on .dot { box-shadow: none; }
.track .tick { color: var(--color-accent-700); font-size: 12px; line-height: 1; }
.track.on { color: var(--color-text); border-bottom-color: var(--color-accent); }
.track:disabled { opacity: .4; cursor: default; }
.track:not(.on):not(:disabled):hover { color: var(--color-text); }

.track[data-track="deepcut"] .no { display: none; }

.readouts {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--color-divider);
  flex: none;
}
.scorebox { display: flex; align-items: baseline; gap: 10px; }
.scorebox .val {
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 38px;
  line-height: .9;
}

.scorebox .cap { line-height: 1.35; }
.guessbox { text-align: right; }
.guessbox .lbl { display: block; margin-bottom: 5px; }
.pips { display: flex; gap: 5px; justify-content: flex-end; margin: 0; padding: 0; list-style: none; }
.pips li {
  width: 9px; height: 9px;
  border: 1px solid var(--color-accent);
  transition: background var(--quick) var(--ease);
}
.pips li.spent { background: var(--color-accent); }

.pips li.over { border-color: var(--color-neutral-400); }

.mast { padding: 22px var(--gutter) 4px; flex: none; }
.mast .cat {
  display: block;
  font-family: var(--font-heading);
  font-weight: 400;
  font-size: 48px;
  line-height: .95;
  letter-spacing: -.01em;
  color: var(--color-accent-700);
  text-wrap: balance;
}
.mast .sub {
  display: block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--color-neutral-600);
}

.slots {
  flex: 1;
  min-height: 0;

  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px var(--gutter) 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;

  gap: 0;
}

.slot { display: flex; gap: 14px; }
.slot .n {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 12px;
  color: var(--color-neutral-500);
  flex: none;
}

.slot--live { padding-bottom: 14px; animation: fade-up var(--settle) var(--ease) both; }
.slot--live:not(:first-child) { border-top: 1px solid var(--color-divider); padding-top: 14px; }
.slot--live .n { color: var(--color-accent-700); padding-top: 7px; }
.slot--live .body { margin: 0; font-size: 18px; line-height: 1.45; text-wrap: pretty; }

.slot--spent { align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--color-divider); }
.slot--spent .n { color: var(--color-accent-700); padding-top: 2px; }
.slot--spent .body { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--color-neutral-700); }

.slot--sealed { align-items: center; padding: 10px 0; border-top: 1px solid var(--color-divider); }
.slot--sealed .body {
  flex: 1; margin: 0;
  font-size: 13px; font-style: italic;
  color: var(--color-neutral-600);
}
.slot--sealed .cost {
  font-size: 11px; letter-spacing: .08em;
  color: var(--color-neutral-500);
}
.slots .slot--sealed:last-child { border-bottom: 1px solid var(--color-divider); }

.slot .hint { margin: 0; }

.slot .tried {
  margin: 6px 0 0;
  font-size: 12px; letter-spacing: .02em;
  color: var(--color-neutral-600);
}
.slot .tried.unknown { font-style: italic; color: var(--color-neutral-500); }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.guessbar {
  flex: none;
  padding: 14px 18px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--color-divider);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--color-neutral-700);
  min-height: 0;
}
.status:empty { display: none; }
.status.miss { color: var(--color-accent-700); }

#guess {
  width: 100%;
  min-height: 48px;
  padding: 14px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.2;
  color: var(--color-text);
  caret-color: var(--color-accent);
  background: var(--color-neutral-100);
  border: 1px solid var(--color-neutral-400);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 2px rgba(32, 31, 29, .07);
  transition: border-color var(--quick) var(--ease), box-shadow var(--quick) var(--ease);
}
#guess::placeholder { color: var(--color-neutral-500); }
#guess:hover { border-color: var(--color-neutral-600); }

#guess:focus-visible {
  border-color: var(--color-accent);
  background: #fffdfa;
  box-shadow: inset 0 1px 2px rgba(32, 31, 29, .05), 0 0 0 3px rgba(182, 130, 53, .16);
  outline: none;
}

.btnrow { display: flex; gap: 10px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  position: relative; overflow: hidden;
  min-height: 48px;
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: .06em;
  color: var(--color-text);
  text-align: center; text-decoration: none;
  background: transparent;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  transition: background var(--quick) var(--ease), border-color var(--quick) var(--ease);
}
.btn--accent { color: var(--color-accent-700); border-color: var(--color-accent); letter-spacing: .1em; }
.btn--accent:hover { background: rgba(182, 130, 53, .12); }
.btn:hover { background: rgba(32, 31, 29, .05); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn { transition: background var(--quick) var(--ease), border-color var(--quick) var(--ease), transform 90ms var(--ease); }
.btn:active:not(:disabled) { transform: scale(.985); }
.btn .ink {
  position: absolute;
  left: var(--x); top: var(--y);
  width: 260px; height: 260px; margin: -130px 0 0 -130px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle,
    rgba(182, 130, 53, .38) 0%, rgba(182, 130, 53, .18) 45%, rgba(182, 130, 53, 0) 70%);
  animation: ink 520ms var(--ease) forwards;
}
@keyframes ink {
  from { transform: scale(0); opacity: .85; }
  to   { transform: scale(1); opacity: 0; }
}
.btn--wide { flex: 1.4; }
.btn--half { flex: 1; }
.btn--block { width: 100%; }

.btn.danger { color: var(--color-accent-700); border-color: var(--color-accent); }

.footrow {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3);
  font-size: 11px; line-height: 1.4;
  color: var(--color-neutral-600);
}
.report {
  font: inherit; background: none; border: 0; padding: 4px 0; margin: -4px 0;
  color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
  white-space: nowrap;
}
.report:hover { color: var(--color-accent-700); }

.result { overflow: hidden; }

.plate {
  position: relative;
  height: 300px;
  flex: none;
  border-bottom: 1px solid var(--color-divider);
  width: 100%;
  padding: 0; border-left: 0; border-right: 0; border-top: 0;
  background: var(--color-surface);
  display: block;
  cursor: zoom-in;
}
.plate img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: sepia(.22) saturate(.82) contrast(1.05);
}

.plate .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(32, 31, 29, .92) 0%, rgba(32, 31, 29, .72) 34%,
    rgba(32, 31, 29, .22) 62%, transparent 84%);
}
.plate .over {
  position: absolute; inset: auto 0 0 0;
  padding: var(--gutter);
  text-align: left;
  color: #f3f2f2;
}
.plate .kicker {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--color-accent-300);
}
.plate .answer {
  margin: 6px 0 0;
  font-family: var(--font-heading); font-weight: 400;
  font-size: 34px; line-height: 1.05;
  color: #f8f4f4;
  text-wrap: balance;
}
.plate .when {
  margin-top: 6px;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  opacity: .8;
}

.result--lost .plate { height: 230px; }
.result--lost .plate img { filter: sepia(.3) saturate(.6) contrast(1.02) grayscale(.35); }

.result--lost .plate .scrim {
  background: linear-gradient(to top,
    rgba(32, 31, 29, .94) 0%, rgba(32, 31, 29, .78) 44%,
    rgba(32, 31, 29, .28) 70%, transparent 88%);
}
.result--lost .plate .kicker { color: var(--color-neutral-300); }
.result--lost .plate .answer { font-size: 32px; }

.plate--none,
.result--lost .plate--none { height: auto; background: var(--color-surface); cursor: default; }

.plate--none .scrim { display: none; }

.plate--none .over {
  position: static; display: block; text-align: left;
  padding: var(--space-6) var(--gutter) var(--space-4);
  color: var(--color-text);
}
.plate--none .kicker { color: var(--color-accent-700); }

.result--lost .plate--none .kicker { color: var(--color-neutral-700); }
.plate--none .answer { color: var(--color-text); }

.plate--none .when { opacity: 1; color: var(--color-neutral-700); }

.resbody {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px var(--gutter);

  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scoreline {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  border-bottom: 1px solid var(--color-divider);
  padding-bottom: 14px;
}
.scoreline .val {
  font-family: var(--font-heading); font-weight: 400;
  font-size: 38px; line-height: 1;
  color: var(--color-accent-700);
}
.quip {
  margin: 0;
  text-align: right;
  font-size: 13px; font-style: italic;
  color: var(--color-neutral-700);
  max-width: 170px;
}
.result--lost .quip { text-align: left; max-width: none; font-size: 14px; }

.blurb {
  margin: 0;
  font-size: 14px; line-height: 1.6;
  text-align: justify;
  hyphens: auto;
}
.credit {
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--color-neutral-500);
}

.unopened { border-top: 1px solid var(--color-divider); padding-top: 14px; }
.unopened .lbl { display: block; margin-bottom: 10px; }
.unopened p {
  margin: 0;
  font-size: 15px; line-height: 1.5;
  border-left: 1px solid var(--color-accent);
  padding-left: 14px;
}

.tried-list { border-top: 1px solid var(--color-divider); padding-top: 14px; }
.tried-list .lbl { display: block; margin-bottom: 10px; }
.tried-list ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.tried-list li {
  display: flex; justify-content: space-between; gap: var(--space-3);
  font-size: 13px; color: var(--color-neutral-700);
}
.tried-list .at { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; flex: none; }
.tried-list .unknown { font-style: italic; color: var(--color-neutral-500); }

.sharecard {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.sharecard .head {
  display: flex; justify-content: space-between; gap: var(--space-3);
  font-family: var(--font-heading); font-weight: 600;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-neutral-600);
}

.sharecard .rows { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.sharecard .rows > li { display: flex; align-items: center; gap: 10px; }
.sharecard .lbl {
  font-family: var(--font-heading); font-size: 14px;
  color: var(--color-neutral-800);
}
.sharecard .pts { margin-left: auto; font-size: 15px; font-weight: 600; }

.sharecard .grid { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; flex: none; }
.sharecard .grid li {
  width: 26px; height: 26px;
  border: 1px solid var(--color-neutral-400);
}

.sharecard .grid li.spent { background: var(--color-neutral-300); }
.sharecard .grid li.solve { border-color: var(--color-accent); background: var(--color-accent-200); }
.sharecard .grid li.bust { border-color: var(--color-accent-600); background: transparent; }
.sharecard .grid li.unreached { border-color: var(--color-divider); background: transparent; }

.sharecard .fire { font-size: 13px; color: var(--color-neutral-700); }

.rate { margin: 0; font-size: 12px; color: var(--color-neutral-700); }
.srcline { margin: -4px 0 0; font-size: 13px; }
.srcline a { color: var(--color-accent-700); text-underline-offset: 3px; }

.resbtns { display: flex; gap: 10px; margin-top: auto; }
.resbtns .btn { flex: 1; }
.nextup { text-align: center; font-size: 12px; color: var(--color-neutral-600); }

.nextup--waiting { color: var(--color-neutral-700); }
.nextup--waiting .dot {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 7px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--color-accent);
}

.btn--waiting::before {
  content: '';
  flex: none;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

@keyframes nudge {
  0%, 100% { border-color: var(--color-divider); background: transparent; }
  40%      { border-color: var(--color-accent); background: rgba(182, 130, 53, .10); }
}
@keyframes nudge-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(182, 130, 53, 0); }
  40%      { box-shadow: 0 0 0 4px rgba(182, 130, 53, .20); }
}
.btn--waiting.is-nudging { animation: nudge 1100ms var(--ease) 2; }
.btn--waiting.is-nudging::before { animation: nudge-dot 1100ms var(--ease) 2; }

@property --trace-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

@supports (mask-composite: exclude) or (-webkit-mask-composite: xor) {
  .btn--waiting.is-tracing::after {
    content: '';
    position: absolute;

    inset: 0;
    border-radius: calc(var(--radius-md) - 1px);
    padding: 1px;
    pointer-events: none;
    background: conic-gradient(from var(--trace-angle),
      rgba(182, 130, 53, 0) 0deg,
      rgba(182, 130, 53, .45) 20deg,
      rgba(182, 130, 53, 0) 52deg,
      rgba(182, 130, 53, 0) 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: trace 5s linear 6;
  }
}
@keyframes trace { to { --trace-angle: 360deg; } }

@media (prefers-reduced-motion: reduce) {
  .btn--waiting.is-nudging { border-color: var(--color-accent); }
  .btn--waiting.is-tracing::after { display: none; }
}

dialog { border: 0; padding: 0; background: none; color: inherit; }
dialog::backdrop { background: rgba(45, 43, 43, .5); }

dialog:not([open]) { display: none; }

.sheet {
  width: min(430px, 100vw);
  max-width: 100vw;
  max-height: 100svh;
  margin: auto;
  background: var(--color-bg);
  color: var(--color-text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  font-family: var(--font-body);
}
.sheet--full {
  width: min(430px, 100vw);
  height: 100svh;
  max-height: 100svh;
  border-radius: 0;
  display: flex; flex-direction: column;
  padding: 22px var(--gutter);
  padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
}
.sheet--ask { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-3); }

.sheet-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-divider);
  flex: none;
}
.sheet-close {
  font: inherit; font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  background: none; border: 0; cursor: pointer;
  color: var(--color-accent-700);
  padding: 12px 0 12px 12px; margin: -12px -2px -12px 0;
  min-height: 44px;
}

.sheet-scroll { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }

.stats { display: flex; gap: 2px; padding: 22px 0; border-bottom: 1px solid var(--color-divider); }
.stats > div { flex: 1; min-width: 0; }
.stats .val {
  font-family: var(--font-heading); font-weight: 400;
  font-size: 46px; line-height: 1;
}
.stats .streak .val { color: var(--color-accent-700); }

.chart { padding: 20px 0; border-bottom: 1px solid var(--color-divider); }
.chart .lbl { display: block; margin-bottom: 14px; }
.chart ol {
  display: flex; gap: 5px; align-items: flex-end; height: 86px;
  margin: 0; padding: 0; list-style: none;
}
.chart li {
  flex: 1; min-width: 0;
  border: 1px solid var(--color-neutral-400);
  background: transparent;
}
.chart li.fast { background: var(--color-accent-400); border-color: var(--color-accent-700); }
.chart li.slow { background: var(--color-accent-200); border-color: var(--color-accent-600); }
.chart li.none { border-style: dashed; border-color: var(--color-neutral-300); }
.chart-empty { margin: 0; font-size: 13px; line-height: 1.5; color: var(--color-neutral-600); }
.chart ol[hidden] { display: none; }

.menu-items { display: flex; flex-direction: column; }
.menu-item {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-3);
  padding: 16px 0;
  min-height: 44px;
  border: 0; border-bottom: 1px solid var(--color-divider);
  background: none; cursor: pointer;
  font: inherit; font-size: 15px; text-align: left;
  color: inherit;
}
.menu-item .go { color: var(--color-accent-700); }
.menu-item:hover { color: var(--color-accent-700); }

.whoami {
  display: flex; align-items: center; gap: 14px;
  width: 100%; min-height: 44px;
  padding: 18px 0;
  border: 0; border-bottom: 1px solid var(--color-divider);
  background: none; cursor: pointer;
  font: inherit; text-align: left; color: inherit;
}
.whoami[hidden] { display: none; }
.whoami .mark, .profile-id .mark {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-md);
  font-family: var(--font-heading); font-weight: 600; font-size: 19px;
  color: var(--color-accent-700);
  text-transform: uppercase;
}
.whoami .who { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.whoami .handle, .profile-id .handle {
  display: block;
  font-family: var(--font-heading); font-weight: 600;
  font-size: 17px; letter-spacing: .02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.whoami .sub, .profile-id .since {
  display: block;
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--color-neutral-600);
}
.whoami .go { color: var(--color-accent-700); flex: none; }
.whoami:hover .handle { color: var(--color-accent-700); }

.sheet-back {
  font: inherit; font-family: var(--font-heading); font-weight: 600;
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  background: none; border: 0; cursor: pointer;
  color: var(--color-neutral-600);
  padding: 12px 12px 12px 0; margin: -12px 0 -12px -2px;
  min-height: 44px;
}
.sheet-back:hover { color: var(--color-accent-700); }

.profile-id {
  display: flex; align-items: center; gap: 14px;
  padding: 24px 0;
  border-bottom: 1px solid var(--color-divider);
}
.profile-id .mark { width: 54px; height: 54px; font-size: 24px; }
.profile-id .handle { font-size: 22px; }
.profile-id .since { margin-top: 3px; }

.badges { padding: 20px 0 0; }
.badges .lbl { display: block; margin-bottom: 6px; }
.badges-note { margin: 0 0 14px; font-size: 12px; line-height: 1.5; color: var(--color-neutral-600); }
.badges ol {
  margin: 0; padding: 0; list-style: none;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.badge {
  display: flex; flex-direction: column; gap: 5px;
  padding: 13px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
}
.badge .name {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 14px; letter-spacing: .02em;
  color: var(--color-neutral-600);
}
.badge .hint { font-size: 11.5px; line-height: 1.4; color: var(--color-neutral-600); }
.badge .meter { height: 1px; background: var(--color-neutral-300); margin-top: 3px; }
.badge .meter i { display: block; height: 1px; background: var(--color-accent); }
.badge .tally {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--color-neutral-500);
}
.badge--earned {
  border-color: var(--color-accent);
  background: var(--color-accent-100);
}
.badge--earned .name { color: var(--color-accent-700); }
.badge--earned .hint { color: var(--color-neutral-700); }
.badge--earned .tally { color: var(--color-accent-700); }

.statgroup { padding: 20px 0; border-bottom: 1px solid var(--color-divider); }
.statgroup > .lbl { display: block; margin-bottom: 12px; }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.statgrid div { min-width: 0; }
.statgrid .val {
  font-family: var(--font-heading); font-weight: 400;
  font-size: 30px; line-height: 1;
}
.statgrid .streak .val { color: var(--color-accent-700); }

.menu-panel { font-size: 14px; line-height: 1.6; color: var(--color-neutral-700); padding: 16px 0; }
.menu-panel:empty { display: none; }
.menu-panel p { margin: 0 0 var(--space-2); }
.menu-panel p:last-child { margin-bottom: 0; }

.sheet-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: var(--space-4); flex: none; }
.sheet-note { font-size: 12px; line-height: 1.5; color: var(--color-neutral-600); text-align: center; }

.sheet h2 {
  margin: 0;
  font-family: var(--font-heading); font-weight: 600;
  font-size: 20px; line-height: 1.2;
}
.sheet-sub { margin: 0; font-size: 14px; line-height: 1.55; color: var(--color-neutral-700); }
.sheet-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: var(--space-2); }
.sheet-field { display: block; font-size: 14px; }
.sheet-field span { display: block; margin-bottom: 5px; color: var(--color-neutral-700); }
.sheet-field textarea {
  width: 100%; min-height: 90px; padding: 10px; resize: vertical;
  font-family: var(--font-body); font-size: 16px; color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.sheet fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sheet fieldset label { display: flex; gap: 8px; align-items: baseline; font-size: 14px; }

.photo {
  width: 100vw; height: 100svh; max-width: 100vw; max-height: 100svh;
  display: grid; place-items: center;
  background: rgba(24, 23, 22, .96);
}
.photo img { max-width: 96vw; max-height: 80svh; width: auto; height: auto; }
.photo-credit {
  margin: var(--space-3) auto 0; max-width: 60ch; padding: 0 var(--gutter);
  text-align: center; font-size: 11px; letter-spacing: .06em;
  color: var(--color-neutral-400);
}
.photo-close {
  position: absolute; top: 12px; right: 12px;
  min-height: 44px; padding: 10px 16px;
  font-family: var(--font-heading); font-weight: 600;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  background: none; border: 1px solid rgba(248, 244, 244, .4); border-radius: var(--radius-md);
  color: #f8f4f4; cursor: pointer;
}

.onboard { padding: 0; }
.onboard .brand { padding: 64px 24px 0; text-align: center; flex: none; }
.onboard .brand .name {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 15px; letter-spacing: .24em;
}
.onboard .brand .tag {
  margin-top: 10px;
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--color-accent-700);
}
.onboard .body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 52px 24px;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 22px;
}
.onboard h2 {
  margin: 0;
  font-family: var(--font-heading); font-weight: 400;
  font-size: 46px; line-height: 1.02;
  text-wrap: pretty;
}
.rules { display: flex; flex-direction: column; }
.rules li {
  display: flex; gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--color-divider);
}
.rules { margin: 0; padding: 0; list-style: none; }
.rules li:last-child { border-bottom: 1px solid var(--color-divider); }
.rules .n {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 13px; color: var(--color-accent-700); flex: none;
}
.rules p { margin: 0; font-size: 14px; line-height: 1.55; }

.screen--play[data-revealed="3"] .mast { padding-top: 14px; }
.screen--play[data-revealed="3"] .mast .cat { font-size: 36px; }
.screen--play[data-revealed="3"] .readouts { padding-block: 10px; }
.screen--play[data-revealed="3"] .scorebox .val { font-size: 30px; }

.screen--play[data-revealed="4"] .mast,
.screen--play[data-revealed="5"] .mast { padding-top: 10px; padding-bottom: 0; }
.screen--play[data-revealed="4"] .mast .cat,
.screen--play[data-revealed="5"] .mast .cat { font-size: 27px; letter-spacing: 0; }
.screen--play[data-revealed="4"] .mast .sub,
.screen--play[data-revealed="5"] .mast .sub { margin-top: 4px; font-size: 10px; }
.screen--play[data-revealed="4"] .readouts,
.screen--play[data-revealed="5"] .readouts { padding-block: 8px; }
.screen--play[data-revealed="4"] .scorebox .val,
.screen--play[data-revealed="5"] .scorebox .val { font-size: 26px; }
.screen--play[data-revealed="4"] .slots,
.screen--play[data-revealed="5"] .slots { padding-top: 10px; gap: 11px; }

.mast .cat, .mast .sub, .scorebox .val { transition: font-size var(--settle) var(--ease); }

@media (max-width: 359px) {
  :root { --gutter: 16px; }
  .topmeta .when .date { display: none; }
  .mast .cat { font-size: 40px; }
  .tabs { gap: 18px; }
}

@media (max-height: 720px) {
  .mast { padding-top: 16px; }
  .mast .cat { font-size: 40px; }
  .slots { gap: 11px; padding-top: 12px; }
}
@media (max-height: 620px) {
  .mast { padding-top: 12px; padding-bottom: 0; }
  .mast .cat { font-size: 32px; }
  .mast .sub { margin-top: 6px; }
  .slot--live { padding-bottom: 10px; }
  .slot--live:not(:first-child) { padding-top: 10px; }
  .slots { padding-top: 10px; }
  .slot--live .body { font-size: 16px; }
  .readouts { padding-block: 10px; }
  .scorebox .val { font-size: 30px; }
}

@media (max-height: 560px) {
  .footrow { display: none; }
}

.kb-open .slot--spent,
.kb-open .footrow { display: none; }
.kb-open .mast { padding-top: 10px; padding-bottom: 0; }
.kb-open .mast .cat { font-size: 30px; }
.kb-open .slots { gap: 8px; }
.stage { padding-bottom: var(--kb, 0px); }

@media (min-width: 900px) {
  .stage { padding: 0; }
  .screen--play {
    display: grid;
    grid-template-columns: 240px minmax(0, 480px);
    column-gap: var(--space-8);
    align-content: start;
    justify-content: center;
    width: 100%;
    padding: 0 var(--space-6) var(--space-6);
    overflow: hidden;
  }

  .stage > .topbar {
    max-width: calc(240px + var(--space-8) + 480px + var(--space-6) * 2);
    padding: var(--space-6) var(--space-6) 0;
  }

  .stage:has(#result:not([hidden])) > .topbar {
    max-width: calc(480px + var(--space-6) * 2);
  }
  .screen--play .tabs { grid-column: 1 / -1; grid-row: 1; padding-inline: 0; }

  .screen--play .readouts {
    grid-column: 1; grid-row: 2 / 5;
    flex-direction: column; align-items: flex-start; gap: var(--space-4);
    padding: var(--space-6) 0 0;
    border-bottom: 0;
    align-self: start;
  }
  .screen--play .guessbox { text-align: left; }
  .screen--play .pips { justify-content: flex-start; }

  .screen--play .mast { grid-column: 2; grid-row: 2; padding: var(--space-6) 0 4px; }
  .screen--play .slots { grid-column: 2; grid-row: 3; padding: 16px 0 0; }

  .screen--play .guessbar { grid-column: 2; grid-row: 4; padding: 14px 0 44px; }

  .screen--play { grid-template-rows: auto auto minmax(0, 1fr) auto; }

  .screen--result { max-width: 480px; }

  .sheet--full { border-radius: var(--radius-lg); height: min(820px, 92svh); margin: auto; }
}

@media (min-width: 900px) and (max-height: 780px) {
  .screen--play .mast { padding-top: var(--space-4); }
  .screen--play .readouts { padding-top: var(--space-4); }
}

@media (min-width: 481px) and (max-width: 899px) {
  .screen, .stage > .topbar { max-width: 480px; }
}

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

.doc {
  max-width: 34rem;
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) var(--space-8);
  color: var(--color-neutral-800);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
}

.doc-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
  margin-bottom: var(--space-6);
}
.doc-head .wordmark { font-size: 20px; }
.doc-back { font-family: var(--font-body); font-size: 14px; color: var(--color-neutral-600); }

.doc h1 {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 34px; line-height: 1.1;
  margin: 0 0 var(--space-4);
  color: var(--color-text);
}
.doc h2 {
  font-family: var(--font-heading); font-weight: 600;
  font-size: 23px; line-height: 1.2;
  margin: var(--space-8) 0 var(--space-2);
  color: var(--color-text);
}
.doc p { margin: 0 0 var(--space-4); }
.doc ul { margin: 0 0 var(--space-4); padding-left: 1.2em; }
.doc li { margin-bottom: var(--space-2); }
.doc a { color: var(--color-accent-700); }

.doc-lede {
  font-size: 18px; line-height: 1.55;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.doc-foot {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
  font-size: 13px; color: var(--color-neutral-600);
}
.doc-foot a { color: var(--color-neutral-700); }

.doc-links {
  text-align: center;
  font-size: 12px;
  color: var(--color-neutral-500);
}
.doc-links a { color: var(--color-neutral-600); text-decoration: none; }
.doc-links a:hover, .doc-links a:focus-visible { text-decoration: underline; }
