:root {
  --bg: #17120f;
  --surface: #221a15;
  --surface-2: #2c221b;
  --line: #3a2d24;
  --text: #f3e8d8;
  --muted: #a89684;
  --paper: #f4ead9;
  --ink: #2a1c12;
  --flame: #ff7a1a;
  --ember: #ffb347;
  --ash: #1d1714;
  --ash-ink: #5d5148;
  --bad: #ff8f7a;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --heat: 0; /* 0..1, share of the alphabet burned; set from game.js */
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background:
    radial-gradient(120% 60% at 50% -10%, #3a1f0e 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.45 var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The hearth: a glow at the foot of the page that grows as letters burn. */
body::before {
  content: "";
  position: fixed;
  inset: auto 0 0 0;
  height: 70vh;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(70% 90% at 50% 112%, rgba(255, 150, 40, 0.75), rgba(255, 90, 10, 0.35) 40%, transparent 72%);
  opacity: calc(0.16 + var(--heat) * 0.84);
  transition: opacity 0.6s ease-out;
  animation: hearth 2.8s ease-in-out infinite alternate;
}

@keyframes hearth {
  0%   { transform: scaleY(1); filter: brightness(0.92); }
  35%  { transform: scaleY(1.04); filter: brightness(1.06); }
  70%  { transform: scaleY(0.98); filter: brightness(0.96); }
  100% { transform: scaleY(1.06); filter: brightness(1.1); }
}

.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }

.flash {
  position: fixed; inset: 0; z-index: 6; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(255, 236, 190, 0.95), rgba(255, 140, 40, 0.55) 45%, transparent 80%);
  animation: flash 0.7s ease-out forwards;
}
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

button { font: inherit; color: inherit; cursor: pointer; }

/* Title */
.title {
  margin: 0;
  font: 700 34px/1 var(--serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: linear-gradient(180deg, #fff1cf 0%, #ffe2a8 18%, var(--ember) 42%, var(--flame) 66%, #c2410c 86%, #7a2408 100%);
  background-size: 100% 190%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleFlame 2.4s ease-in-out infinite alternate;
}

@keyframes titleFlame {
  0%   { background-position: 0 0;   filter: drop-shadow(0 0 8px rgba(255, 122, 26, 0.25)); }
  30%  { background-position: 0 38%; filter: drop-shadow(0 0 16px rgba(255, 140, 40, 0.5)); }
  55%  { background-position: 0 18%; filter: drop-shadow(0 0 10px rgba(255, 122, 26, 0.3)); }
  100% { background-position: 0 55%; filter: drop-shadow(0 0 22px rgba(255, 150, 50, 0.6)); }
}

/* Start screen */
.intro {
  position: fixed; inset: 0; z-index: 4;
  display: grid; place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(90% 70% at 50% 115%, rgba(255, 110, 20, 0.3), transparent 70%),
    radial-gradient(120% 60% at 50% -10%, #3a1f0e 0%, transparent 60%),
    var(--bg);
  text-align: center;
}
.intro.leaving { animation: introOut 0.7s ease-in forwards; pointer-events: none; }
@keyframes introOut { to { opacity: 0; transform: scale(1.06); filter: brightness(1.8); } }

.intro-inner { width: 100%; max-width: 560px; animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.1) backwards; }
/* Left padding balances the trailing letter-spacing so the word sits centred. */
.intro .title { font-size: clamp(44px, 13vw, 80px); white-space: nowrap; padding-left: 0.14em; }
.intro-tag { margin: 18px 0 26px; font: 500 19px/1.4 var(--serif); color: var(--text); }
.intro-meta { margin: 18px 0 0; color: var(--muted); font-size: 14px; }

.link { border: 0; background: none; padding: 0; color: var(--ember); text-decoration: underline; }

.match {
  position: relative;
  width: 7px; height: 92px;
  margin: 0 auto 26px;
  border-radius: 2px;
  background: linear-gradient(90deg, #c9a875, #e8cfa0 50%, #b08f5e);
  transform: rotate(14deg);
  transform-origin: 50% 100%;
}
.match-head {
  position: absolute; left: 50%; top: -9px;
  width: 13px; height: 18px; margin-left: -6.5px;
  border-radius: 50% 50% 45% 45%;
  background: radial-gradient(circle at 40% 30%, #c23a2a, #6d1710);
}
.match.struck { animation: strike 0.5s cubic-bezier(0.3, 0, 0.2, 1); }
.match.struck .match-head { background: radial-gradient(circle at 40% 30%, #fff3c4, #ff9a2e 55%, #c2410c); box-shadow: 0 0 22px 8px rgba(255, 150, 40, 0.8); }
@keyframes strike {
  0%   { transform: rotate(14deg) translateX(0); }
  40%  { transform: rotate(-22deg) translateX(-26px); }
  100% { transform: rotate(14deg) translateX(0); }
}

/* Header */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 6px;
}
.top-left { justify-self: start; }
.top-right { justify-self: end; display: flex; gap: 8px; }

.brand { text-align: center; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 13px; letter-spacing: 0.04em; }

.icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
}
.icon:hover { color: var(--ember); border-color: var(--flame); transform: translateY(-1px); }
.icon:active { transform: scale(0.94); }
#soundBtn .slash { display: none; }
#soundBtn.off .waves { display: none; }
#soundBtn.off .slash { display: inline; }

main { max-width: 560px; margin: 0 auto; padding: 10px 16px 40px; }

.shaking { animation: quake 0.32s linear; }
@keyframes quake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(calc(var(--amp) * -1), calc(var(--amp) * 0.5)); }
  40% { transform: translate(var(--amp), calc(var(--amp) * -0.6)); }
  60% { transform: translate(calc(var(--amp) * -0.6), calc(var(--amp) * -0.3)); }
  80% { transform: translate(calc(var(--amp) * 0.4), calc(var(--amp) * 0.4)); }
}

/* Alphabet */
.alphabet {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.tile {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1.15;
  display: grid; place-items: center;
  border-radius: 5px;
  background: linear-gradient(180deg, #fbf3e4, var(--paper) 60%, #e6d8c0);
  color: var(--ink);
  font: 700 clamp(13px, 3.6vw, 20px)/1 var(--serif);
  text-transform: uppercase;
  user-select: none;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1.5), background 0.14s;
}

.alphabet.dealing .tile { animation: deal 0.5s calc(var(--i) * 18ms) backwards cubic-bezier(0.2, 0.9, 0.3, 1.35); }
@keyframes deal {
  from { opacity: 0; transform: translateY(-18px) scale(0.7) rotate(-8deg); }
}

/* A letter in the current guess: about to burn. */
.tile.lit {
  background: linear-gradient(180deg, #fff3cf, #ffd78f);
  transform: translateY(-4px) scale(1.05);
  animation: litFlicker 0.5s ease-in-out infinite alternate;
}
@keyframes litFlicker {
  0%   { box-shadow: 0 0 0 2px var(--flame), 0 0 10px rgba(255, 122, 26, 0.5), 0 -5px 14px rgba(255, 190, 70, 0.4); }
  100% { box-shadow: 0 0 0 2px var(--ember), 0 0 20px rgba(255, 122, 26, 0.75), 0 -9px 24px rgba(255, 170, 50, 0.55); }
}

.tile.burned {
  background: radial-gradient(120% 120% at 30% 20%, #33291f, var(--ash) 70%);
  color: var(--ash-ink);
  text-decoration: line-through;
  box-shadow: inset 0 0 0 1px #3a302a;
  transform: rotate(var(--tilt)) translateY(1px) scale(0.95);
}

/* The moment of burning: flare, char, then a smoulder that fades. */
.tile.just { animation: burn 2.6s ease-out; }
.tile.just::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--ash) 0%, var(--ash) 38%, #ff5a0a 46%, #ffb030 52%, #fff0b8 56%, transparent 62%);
  background-size: 100% 300%;
  animation: wipe 0.6s ease-in forwards, fadeOut 0.7s 0.75s forwards;
}
@keyframes wipe { from { background-position: 0 0; } to { background-position: 0 100%; } }
@keyframes fadeOut { to { opacity: 0; } }

@keyframes burn {
  0%   { background: #fff3cf; color: var(--ink); transform: translateY(-7px) scale(1.22); box-shadow: 0 0 26px 6px rgba(255, 170, 50, 0.9); }
  10%  { background: #ffd166; color: var(--ink); transform: translateY(-4px) scale(1.14) rotate(calc(var(--tilt) * -1)); box-shadow: 0 0 30px 8px rgba(255, 130, 20, 0.9); }
  24%  { background: #e8590c; color: #ffe8c9; transform: translateY(-1px) scale(1.05); box-shadow: 0 0 22px 4px rgba(220, 70, 0, 0.8); }
  40%  { background: var(--ash); color: #ff9a4a; transform: rotate(var(--tilt)) translateY(1px) scale(0.95); box-shadow: inset 0 0 14px #ff6a00, 0 0 14px rgba(255, 90, 0, 0.55); }
  70%  { background: var(--ash); color: #b0602e; transform: rotate(var(--tilt)) translateY(1px) scale(0.95); box-shadow: inset 0 0 8px rgba(255, 106, 0, 0.5), 0 0 6px rgba(255, 90, 0, 0.2); }
  100% { background: var(--ash); color: var(--ash-ink); transform: rotate(var(--tilt)) translateY(1px) scale(0.95); box-shadow: inset 0 0 0 1px #3a302a; }
}

.tile.denied { animation: denied 0.35s; }
@keyframes denied {
  0%, 100% { translate: 0 0; }
  30% { translate: -3px 0; box-shadow: 0 0 0 2px var(--bad); }
  60% { translate: 3px 0; box-shadow: 0 0 0 2px var(--bad); }
}

/* Fuse: burns left to right as the alphabet goes. */
.fuse {
  position: relative;
  height: 6px;
  margin: 14px 2px 0;
  border-radius: 3px;
  background: repeating-linear-gradient(115deg, #8a6a45 0 4px, #6f5435 4px 8px);
}
.fuse-burnt {
  position: absolute; inset: 0 auto 0 0;
  width: calc(var(--heat) * 100%);
  border-radius: 3px;
  background: var(--ash);
  box-shadow: inset 0 0 0 1px #3a302a;
  transition: width 0.4s ease-out;
}
.fuse-spark {
  position: absolute; top: 50%; left: calc(var(--heat) * 100%);
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: radial-gradient(#fff, #ffd166 40%, #ff7a1a 70%, transparent 72%);
  box-shadow: 0 0 12px 4px rgba(255, 140, 40, 0.7);
  transition: left 0.4s ease-out;
  animation: sparkle 0.22s infinite alternate;
}
@keyframes sparkle { from { transform: scale(0.8); opacity: 0.8; } to { transform: scale(1.25); opacity: 1; } }

/* Meter */
.meter {
  display: flex; justify-content: space-between;
  margin: 10px 2px 14px;
  color: var(--muted); font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.meter b { display: inline-block; color: var(--ember); font-size: 18px; font-family: var(--serif); }
.bump { animation: bump 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.6); }
@keyframes bump { 40% { transform: scale(1.45); color: #fff1cf; text-shadow: 0 0 14px var(--flame); } }

.float {
  position: fixed; z-index: 6; pointer-events: none;
  font: 800 24px var(--serif); color: #ffe2a8;
  text-shadow: 0 0 12px var(--flame), 0 0 2px #7a2408;
  animation: floatUp 1.1s ease-out forwards;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, -20%) scale(0.5); }
  18%  { opacity: 1; transform: translate(-50%, -70%) scale(1.25); }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); }
}

/* Prompt list */
.prompts { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.prompts li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  min-width: 0;
  transition: opacity 0.3s, border-color 0.3s;
}

.prompts .n {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  background: var(--surface-2); color: var(--muted);
}

.prompts .body { min-width: 0; }
.prompts .cat { font-size: 12px; color: var(--muted); letter-spacing: 0.05em; text-transform: uppercase; }
.prompts .ans { font: 600 18px/1.2 var(--serif); overflow-wrap: anywhere; }
.prompts .pts { font: 700 16px var(--serif); color: var(--ember); font-variant-numeric: tabular-nums; }

.prompts li.current { border-color: var(--flame); animation: currentGlow 1.3s ease-in-out infinite alternate; }
@keyframes currentGlow {
  from { box-shadow: 0 0 0 1px var(--flame), 0 6px 22px -14px var(--flame); }
  to   { box-shadow: 0 0 0 1px var(--ember), 0 8px 30px -8px var(--flame); }
}
.prompts li.current .n { background: var(--flame); color: #1c0f05; }
.prompts li.pending { opacity: 0.55; }
.prompts li.skipped .ans { color: var(--ash-ink); font-style: italic; font-weight: 400; }
.prompts li.skipped .pts { color: var(--ash-ink); }
.prompts li.bonus { border-style: dashed; border-color: var(--flame); background: rgba(255, 122, 26, 0.08); }
.prompts li.bonus .ans { font-size: 15px; }

.prompts li.pop { animation: cardPop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
@keyframes cardPop {
  0%   { transform: scale(0.96); border-color: var(--ember); box-shadow: 0 0 0 2px var(--ember), 0 0 34px -4px var(--flame); background: #3a2414; }
  45%  { transform: scale(1.025); }
  100% { transform: none; }
}
.prompts li.fizzle { animation: fizzle 0.5s ease-out; }
@keyframes fizzle { 0% { opacity: 0.2; filter: blur(3px); transform: translateX(8px); } 100% { opacity: 1; filter: none; transform: none; } }

/* Each letter of a fresh answer sears in. */
.prompts .ans .ch {
  display: inline-block; white-space: pre;
  animation: sear 0.5s calc(var(--c) * 45ms) backwards;
}
@keyframes sear {
  from { opacity: 0; transform: translateY(8px) scale(1.6); color: #ffe2a8; text-shadow: 0 0 14px var(--flame); }
  60%  { color: #ffb347; text-shadow: 0 0 8px var(--flame); }
}

/* Play form */
.play { margin-top: 16px; }
.play label { display: block; font: 600 19px/1.25 var(--serif); margin-bottom: 8px; }
.play label.swap { animation: rise 0.35s ease-out; }

.row { display: flex; gap: 8px; }

#answer {
  flex: 1; min-width: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #120d0a;
  color: var(--text);
  font: 600 18px var(--serif);
  letter-spacing: 0.02em;
  transition: border-color 0.15s, box-shadow 0.15s;
}
#answer:focus { outline: none; border-color: var(--flame); box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.25), 0 0 26px -6px var(--flame); }
#answer:disabled { opacity: 0.5; }
#answer.shake { animation: shake 0.3s; border-color: var(--bad); }

@keyframes shake {
  0%, 100% { transform: none; }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.burn {
  position: relative; overflow: hidden;
  padding: 12px 20px;
  border: 0; border-radius: 10px;
  background: linear-gradient(180deg, #ffc56b, var(--flame) 70%, #e35d0a);
  color: #1c0f05; font-weight: 800; letter-spacing: 0.03em;
  box-shadow: 0 4px 18px -6px var(--flame), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}
.burn::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.5) 50%, transparent 65%);
  transform: translateX(-120%);
  animation: sheen 3.2s ease-in-out infinite;
}
@keyframes sheen { 0%, 60% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }
.burn:hover { transform: translateY(-1px); box-shadow: 0 8px 26px -6px var(--flame), inset 0 1px 0 rgba(255, 255, 255, 0.45); filter: brightness(1.06); }
.burn:active { transform: translateY(1px) scale(0.97); }
.burn:disabled { filter: grayscale(1); opacity: 0.5; cursor: default; transform: none; }
.burn:disabled::after { display: none; }
.burn.big { padding: 16px 30px; font-size: 19px; border-radius: 14px; animation: beckon 1.8s ease-in-out infinite alternate; }
@keyframes beckon { from { box-shadow: 0 4px 18px -6px var(--flame), inset 0 1px 0 rgba(255,255,255,.45); } to { box-shadow: 0 6px 44px -2px var(--flame), inset 0 1px 0 rgba(255,255,255,.45); } }

.ghost {
  display: inline-block;
  padding: 11px 18px;
  border: 1px solid var(--line); border-radius: 10px;
  background: transparent; color: var(--text);
  text-decoration: none; font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}
.ghost:hover { border-color: var(--flame); color: var(--ember); }

.sub {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  margin-top: 8px; min-height: 24px;
}
#msg { color: var(--muted); font-size: 14px; }
#msg.warn { color: var(--bad); }

.skip {
  border: 0; background: none; padding: 2px 4px;
  color: var(--muted); font-size: 14px; text-decoration: underline; white-space: nowrap;
}
.skip:hover { color: var(--text); }
.sub-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.skip.confirm { color: var(--bad); font-weight: 700; }
.skip.urgent {
  padding: 6px 14px; border-radius: 8px;
  background: var(--flame); color: #1c0f05;
  font-weight: 800; text-decoration: none;
}

/* Result */
.result {
  margin-top: 18px; padding: 20px 16px;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, #2a1a10, var(--surface));
  text-align: center;
}
.result.reveal { animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.15); }
.result.reveal > * { animation: rise 0.5s ease-out backwards; }
.result.reveal > :nth-child(2) { animation-delay: 0.1s; }
.result.reveal > :nth-child(3) { animation-delay: 0.9s; }
.result.reveal > :nth-child(4) { animation-delay: 1.05s; }
.result.reveal > :nth-child(5) { animation-delay: 1.2s; }
.result.reveal > :nth-child(n + 6) { animation-delay: 1.35s; }
.result.blaze { border-color: var(--flame); animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.15), currentGlow 1.3s 0.7s ease-in-out infinite alternate; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.result-kicker { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.result-score { margin: 4px 0 0; }
.result-score b {
  display: inline-block;
  font: 700 64px/1 var(--serif); color: var(--ember); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 26px rgba(255, 122, 26, 0.55);
}
.result-score span { color: var(--muted); }
.result-best { margin: 6px 0 14px; color: var(--muted); font-size: 14px; }

.share-preview {
  display: inline-block; text-align: left;
  margin: 0 0 14px; padding: 10px 14px;
  border-radius: 10px; background: #120d0a; border: 1px solid var(--line);
  font: 14px/1.5 var(--sans);
  max-width: 100%; overflow-x: auto; white-space: pre;
}

.result-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.result-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.result-links .ghost { padding: 8px 14px; font-size: 14px; }

.result details { margin-top: 14px; text-align: left; font-size: 14px; color: var(--muted); }
.result summary { cursor: pointer; text-align: center; }
.result details ol { margin: 8px auto 0; padding-left: 22px; max-width: 320px; color: var(--text); }
.result details ol li.plain { list-style: none; color: var(--ember); }
.result details[open] > summary { color: var(--ember); }
.ways-note { margin: 8px 0 0; text-align: center; font-size: 13px; }
.ways { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; color: var(--text); }
.ways li {
  display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: baseline;
  padding: 7px 10px; border-radius: 8px; background: #120d0a; border: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.ways b { font: 700 16px var(--serif); color: var(--ember); font-variant-numeric: tabular-nums; text-align: right; }
.next { margin: 14px 0 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }

/* Ad slots: ads.js fills them, shows a dashed placeholder on a local server, or hides them. */
.ad-slot { margin-top: 22px; min-height: 90px; }
.ad-slot.placeholder {
  display: grid; place-items: center;
  border: 1px dashed var(--line); border-radius: 10px;
  color: var(--ash-ink); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
}

/* Side ads: tall units either side of the game, on wide desktop screens only.
   They sit above the particle canvas so nothing is drawn over an ad, and a clear gap
   separates them from the game so they are not clicked by accident. */
.ad-rail { display: none; }
@media (min-width: 1024px) and (min-height: 680px) {
  .ad-rail {
    display: block;
    position: fixed; top: 50%; z-index: 7;
    width: 160px; height: 600px;
    transform: translateY(-50%);
  }
  .ad-rail.left { right: calc(50% + 280px + 32px); }
  .ad-rail.right { left: calc(50% + 280px + 32px); }
  .ad-rail .ad-slot { margin: 0; width: 100%; height: 100%; min-height: 0; }
  /* Hidden while the start screen is up, so ads only appear beside the game itself. */
  .intro:not([hidden]) ~ .ad-rail { visibility: hidden; }
}
@media (min-width: 1340px) and (min-height: 680px) {
  .ad-rail { width: 300px; }
  .ad-rail.left { right: calc(50% + 280px + 40px); }
  .ad-rail.right { left: calc(50% + 280px + 40px); }
}

/* Footer links */
.foot { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px; margin-top: 26px; font-size: 14px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover, .foot a[aria-current] { color: var(--ember); }

/* Archive and text pages */
.page-title { margin: 14px 0 4px; font: 700 26px var(--serif); color: var(--ember); }
.page-lede { margin: 0 0 16px; color: var(--muted); }
.days { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.day {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.day:hover { border-color: var(--flame); transform: translateY(-1px); box-shadow: 0 8px 26px -14px var(--flame); }
.day-name { font: 700 18px var(--serif); }
.day-name small { margin-left: 8px; font: 400 13px var(--sans); color: var(--muted); }
.day-cats { grid-column: 1 / -1; color: var(--muted); font-size: 13px; }
.day-status { font-size: 14px; color: var(--muted); text-align: right; white-space: nowrap; }
.day-status b { font: 700 18px var(--serif); color: var(--ember); }
.day.today { border-color: var(--flame); }
.day.done .day-name { color: var(--ember); }
.prose { color: var(--text); line-height: 1.6; }
.prose h2 { margin: 22px 0 6px; font: 700 19px var(--serif); color: var(--ember); }
.prose p, .prose ul { margin: 0 0 10px; }
.prose a { color: var(--ember); }

/* Dialogs */
dialog {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); color: var(--text);
  padding: 22px;
  box-shadow: 0 30px 80px -20px #000, 0 0 60px -20px var(--flame);
}
dialog[open] { animation: dialogIn 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2); }
@keyframes dialogIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
dialog::backdrop { background: rgba(8, 5, 3, 0.75); }
dialog h2 { margin: 0 0 10px; font: 700 24px var(--serif); color: var(--ember); }
dialog ul { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; }
dialog form { text-align: right; }

.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0 18px; text-align: center; }
.stat-grid b { display: block; font: 700 26px var(--serif); color: var(--ember); font-variant-numeric: tabular-nums; }
.stat-grid span { font-size: 11px; color: var(--muted); }

@media (max-width: 420px) {
  .alphabet { gap: 3px; }
  .brand .title { font-size: 28px; }
  .burn { padding: 12px 14px; }
  .burn.big { padding: 16px 26px; }
}

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