@font-face{font-family:"Pixelify Sans";src:url(fonts/pixelify-sans-400-2DBhKskTF4jr.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Pixelify Sans";src:url(fonts/pixelify-sans-700-yDbPpcDp1i6p.woff2) format("woff2");font-weight:700;font-style:normal;font-display:swap}
@font-face{font-family:"Jersey 10";src:url(fonts/jersey-10-400-pgbrm0QKvnOG.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Rubik";src:url(fonts/rubik-800-gynXkepbwOxn.woff2) format("woff2");font-weight:800;font-style:normal;font-display:swap}
@font-face{font-family:"Atkinson Hyperlegible";src:url(fonts/atkinson-hyperlegible-400-1kuoOO9Ucrui.woff2) format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Atkinson Hyperlegible";src:url(fonts/atkinson-hyperlegible-700-FA4r0lpzFcig.woff2) format("woff2");font-weight:700;font-style:normal;font-display:swap}
/* HueCards: pixel arcade. One deliberate look (painted swirl, CRT, chunky
   outlined panels), so colours are explicit and the viewer's light/dark
   setting doesn't change the game. */
:root {
  color-scheme: dark;
  --bgc: #140c24;
  --ink: #fffaf0;
  --dim: #c9bde6;
  --faint: #8c7fb0;
  --line: #4a3d6e;
  --edge: #0d0a16;
  --panel: #2a2140;
  --panel-2: #3b2e5a;
  --panel-3: #4a3b70;
  --red: #ff4f6d; --red-d: #a3203f;
  --blue: #2f8cff; --blue-d: #174e99;
  --gold: #ffc23d; --gold-d: #a66f00;
  --green: #3ecf7a; --green-d: #1d7a45;
  --paper: #f5ecd6;
  --paper-ink: #1d1530;
  --t0: #f5ecd6; --t1: #1fbf6b; --t2: #2f8cff; /* Familiar green, Proficient blue */ --t3: #8d5cff; --t4: #ffc23d; --t5: #dfe7f5; --t6: #7fe7ff; --plat: #dfe7f5; --dia: linear-gradient(90deg, #7fe7ff, #e9fdff, #7fe7ff);
  --pix: "Pixelify Sans", "Trebuchet MS", system-ui, sans-serif;
  /* Everything you read to answer or learn uses a clear, highly legible face. */
  --read: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* Chunky and still easy to read: buttons and the word on each card. */
  --disp: "Rubik", "Arial Black", "Segoe UI", system-ui, sans-serif;
  --big: "Jersey 10", "Pixelify Sans", Impact, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: var(--bgc); }
body { margin: 0; color: var(--ink); font: 17px/1.4 var(--read); overflow-x: hidden; font-variant-ligatures: none; }
.btn, .tabs button, .bchip, .seal, .cat, .round, .label, .kicker, .newtag, .feedback .v, .prompt .kind, .drawer header h2, .sect { font-variant-ligatures: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
h1, h2, h3 { margin: 0; line-height: 1; font-weight: 700; }
p { margin: 0; }
.num { font-family: var(--big); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { display: inline-block; vertical-align: middle; image-rendering: pixelated; }

/* --------------------------------------------------------- backdrop */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; image-rendering: pixelated; display: block; }
#bg.nogl { background: radial-gradient(80% 60% at 30% 30%, #2c1450, transparent 70%), radial-gradient(70% 60% at 70% 70%, #12343a, transparent 70%), var(--bgc); }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
.crt { position: fixed; inset: 0; z-index: 45; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.07) 0 1px, transparent 1px 4px),
              radial-gradient(120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.55) 100%); }
.app { position: relative; z-index: 1; min-height: 100%; display: flex; flex-direction: column; padding-inline: 16px; overflow-x: clip; }
.quake { animation: quake .3s steps(6); }
.quake-big { animation: quake 0.55s steps(10); }
@keyframes quake { 20% { transform: translate(-4px, 2px); } 40% { transform: translate(4px, -3px); } 60% { transform: translate(-3px, -2px); } 80% { transform: translate(3px, 3px); } }

/* ------------------------------------------------------- chunky kit */
.panel { background: var(--panel); border: 3px solid var(--edge); border-radius: 12px; box-shadow: 0 6px 0 var(--edge), inset 0 2px 0 rgba(255,255,255,.08); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 10px;
  border: 3px solid var(--edge); background: var(--panel-3); color: var(--ink); font: 800 17px var(--disp); letter-spacing: .02em;
  box-shadow: 0 5px 0 var(--edge), inset 0 -4px 0 rgba(0,0,0,.25), inset 0 2px 0 rgba(255,255,255,.15);
  text-shadow: 0 2px 0 rgba(0,0,0,.35); transition: transform .06s, filter .12s; position: relative; top: 0; }
@media (hover: hover) and (pointer: fine) { .btn:hover:not([disabled]) { filter: brightness(1.12); transform: translateY(-2px) rotate(-.5deg); } }
.btn:active:not([disabled]) { top: 4px; box-shadow: 0 1px 0 var(--edge), inset 0 -2px 0 rgba(0,0,0,.25); transform: none; }
.btn[disabled] { filter: grayscale(.7) brightness(.7); cursor: default; }
.btn.red { background: var(--red); }
.btn.blue { background: var(--blue); }
.btn.gold { background: var(--gold); color: #2b1a00; text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.btn.green { background: var(--green); color: #07260f; text-shadow: none; }
.btn.big { font-size: 22px; padding: 15px 24px; }
.btn.wide { width: 100%; }
.btn.small { font-size: 14px; padding: 7px 12px; box-shadow: 0 3px 0 var(--edge), inset 0 -3px 0 rgba(0,0,0,.25); }
.row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.mini { font-size: 14px; color: var(--dim); }
.label { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }

/* -------------------------------------------------------------- HUD */
/* A solid band: nothing scrolls visibly behind the controls. Its own compositor layer keeps it steady while scrolling on phones. */
.hud { position: sticky; top: 0; z-index: 6; display: grid; grid-template-columns: auto 1fr auto; align-items: center;
  gap: 10px; margin-inline: -16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 8px; background: var(--bgc);
  transform: translateZ(0); will-change: transform; backface-visibility: hidden; }
.hud::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; background: linear-gradient(var(--bgc), transparent); pointer-events: none; }
.cap { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; background: var(--edge);
  border: 3px solid var(--panel-3); box-shadow: 0 4px 0 #000; line-height: 1; }
.cap .round { color: var(--ink); white-space: nowrap; }
.hud .btn { white-space: nowrap; }
@media (max-width: 400px) { .cap { gap: 6px; padding-inline: 10px; } .cap .round { font-size: 19px; } .cap.streak .round { font-size: 17px; } .hud { gap: 8px; } .hud .btn.small { padding-inline: 10px; } }
.cap.streak .round { color: var(--gold); font-size: 20px; }
.sq { width: 46px; height: 46px; padding: 0; border-radius: 10px; }
.hud .mid { display: grid; justify-items: center; gap: 2px; }
.round { font: 400 22px var(--big); letter-spacing: .08em; color: var(--dim); }
.lives { display: flex; gap: 2px; }
.scorebox { padding: 4px 12px; min-width: 96px; text-align: right; font: 400 34px/1 var(--big); color: var(--ink); background: var(--edge);
  border: 3px solid var(--panel-3); border-radius: 10px; box-shadow: 0 4px 0 #000; }
.scorebox.bump { animation: bump .35s steps(4); }
@keyframes bump { 40% { transform: scale(1.15) rotate(-2deg); color: var(--gold); } }
.combo { font: 400 20px var(--big); color: var(--gold); letter-spacing: .06em; text-shadow: 0 2px 0 var(--edge); }
.combo b { font-weight: 400; color: var(--red); }

/* chips x mult, right under the card */
.scorebar { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; font: 400 30px/1 var(--big); }
.scorebar .chips, .scorebar .mult { min-width: 70px; padding: 4px 12px; border-radius: 8px; border: 3px solid var(--edge); text-align: center; box-shadow: 0 4px 0 var(--edge); }
.scorebar .chips { background: var(--blue); }
.scorebar .mult { background: var(--red); }
.scorebar .x { color: var(--red); font-size: 34px; }
.scorebar .eq { color: var(--dim); }
.scorebar .total { color: var(--gold); text-shadow: 0 3px 0 var(--edge); animation: slam .45s cubic-bezier(.2,1.6,.4,1) both; }
.scorebar .chips, .scorebar .mult { animation: pop .3s steps(3) both; }
.scorebar .mult { animation-delay: .12s; }
@keyframes pop { from { transform: scale(.3); } 60% { transform: scale(1.2); } }
@keyframes slam { from { transform: scale(2.2); opacity: 0; } }
.scorebar.none { visibility: hidden; }
.peek-note { font: 400 22px var(--big); color: var(--faint); letter-spacing: .08em; }

/* ------------------------------------------------------------- title */
.title { flex: 1; display: grid; place-items: center; text-align: center; padding-block: 8px 48px; }
.title-inner { display: grid; gap: 18px; justify-items: center; width: 100%; max-width: 480px; }
.wordmark { font: 400 clamp(64px, 20vw, 118px)/.85 var(--big); letter-spacing: .02em; display: flex; justify-content: center;
  filter: drop-shadow(0 6px 0 var(--edge)); }
.wordmark span { display: inline-block; animation: jig 2.4s steps(8) infinite; -webkit-text-stroke: 3px var(--edge); paint-order: stroke fill; }
.wordmark.small { font-size: 40px; }
@keyframes jig { 0%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-5px) rotate(-3deg); } 75% { transform: translateY(3px) rotate(2deg); } }
.tagline { color: var(--dim); font-size: 16px; }
.fan { position: relative; width: 100%; height: 170px; margin-block: 0 4px; pointer-events: none; }
.fan .iwrap.mini { position: absolute; left: 50%; top: 22px; width: min(40vw, 170px); translate: -50% 0; transform-origin: 50% 190%; }
.teaser { width: 100%; text-align: left; padding: 12px 14px; display: grid; gap: 8px; }
.teaser .k { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.teaser b { font-size: 19px; }
.bar { height: 12px; border-radius: 3px; background: var(--edge); overflow: hidden; border: 2px solid var(--edge); }
.bar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--gold) 0 8px, #ffdb7a 8px 10px); transition: width .6s steps(12); }
.boostpick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.bchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 3px solid var(--edge);
  background: var(--panel-2); font-size: 15px; box-shadow: 0 3px 0 var(--edge); }
.bchip[aria-pressed="true"] { background: var(--gold); color: #2b1a00; }
.bchip.static { box-shadow: none; background: transparent; }
.boostbox { display: grid; gap: 8px; justify-items: center; }
.boostbar { width: 100%; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.boostbar .bchip { font-size: 14px; padding: 4px 9px; }
.boostbar .bchip.on { background: var(--gold); color: #2b1a00; opacity: 1; }
.boostbar .hint-line { flex-basis: 100%; }

/* -------------------------------------------------------- index card */
.iwrap { --rx: 0deg; --ry: 0deg; --mx: 50%; position: relative; width: min(100%, 460px); aspect-ratio: 5 / 3; perspective: 1100px;
  animation: sway 5s ease-in-out infinite; }
.iwrap.mini { width: 100%; animation: none; perspective: none; }
@keyframes sway { 50% { transform: translateY(-5px) rotate(.6deg); } }
.icard { position: absolute; inset: 0; display: block; padding: 0; border: 0; background: none; text-align: left; color: var(--paper-ink);
  transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s cubic-bezier(.3,1.4,.5,1);
  container-type: inline-size; }
.icard.flipped { transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + 180deg)); }
button.icard { cursor: pointer; }
.side { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border: 3px solid var(--edge); box-shadow: 0 8px 0 rgba(0,0,0,.5); display: flex; flex-direction: column; padding: 4.5% 5.5% 4%; }
.side.back { transform: rotateY(180deg); }
.paper { position: absolute; inset: 0; z-index: -3; filter: saturate(var(--sat, 1));
  background:
    linear-gradient(to bottom, transparent 23%, rgba(230, 72, 88, .8) 23%, rgba(230, 72, 88, .8) calc(23% + 2px), transparent calc(23% + 2px)) 0 0 / 100% 100% no-repeat,
    linear-gradient(var(--pc, var(--paper)), var(--pc, var(--paper))) 0 0 / 100% 24% no-repeat,
    repeating-linear-gradient(to bottom, transparent 0 calc(12.5% - 1.5px), rgba(60, 120, 200, .25) calc(12.5% - 1.5px) 12.5%) 0 3% / 100% 100%,
    var(--pc, var(--paper)); }
.side::before { content: ""; position: absolute; inset: 0; z-index: -1; box-shadow: inset 0 0 0 var(--fw, 0) var(--tc, transparent), inset 0 0 0 calc(var(--fw, 0) + 2px) rgba(0,0,0,.18); pointer-events: none; border-radius: 9px; }
.icard[data-tier="1"] .side { --pc: #d9f7e5; --tc: var(--t1); --fw: 6px; }
.icard[data-tier="2"] .side { --pc: #dcecff; --tc: var(--t2); --fw: 6px; }
.icard[data-tier="3"] .side { --pc: #ebe0ff; --tc: var(--t3); --fw: 6px; }
.icard[data-tier="4"] .side { --pc: #ffe9a8; --tc: #e0a100; --fw: 6px; }
.icard[data-tier="5"] .side { --pc: #eef2fa; --tc: #9fb0cc; --fw: 6px; }
.icard[data-tier="6"] .side { --pc: #e6fbff; --tc: #36c6e6; --fw: 6px; }
.icard[data-tier="0"][data-played="0"] .paper { filter: grayscale(.4) brightness(.92); }
.foil { position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: 0; mix-blend-mode: multiply; }
.icard[data-tier="4"] .foil { opacity: .85; background: linear-gradient(115deg, #fff3b8 0%, #ffc23d 30%, #e59a00 50%, #ffd76a 70%, #fff3b8 100%); background-size: 220% 100%;
  background-position: var(--mx) 0; animation: foilmove 4s ease-in-out infinite; }
.icard[data-tier="5"] .foil { opacity: .7; mix-blend-mode: multiply; background: linear-gradient(115deg, #ffffff 0%, #c9d4e6 35%, #f6f9ff 50%, #a9b8d0 70%, #ffffff 100%); background-size: 220% 100%; animation: foilmove 4s ease-in-out infinite; }
.icard[data-tier="6"] .foil { opacity: .8; mix-blend-mode: multiply; background: linear-gradient(115deg, #ffffff 0%, #a8efff 22%, #ffffff 38%, #c9fff0 52%, #ffffff 64%, #8fe6ff 80%, #ffffff 100%); background-size: 300% 100%; animation: foilmove 3s linear infinite; }
@keyframes foilmove { 50% { background-position: 100% 0; } }
.dust { position: absolute; inset: 0; z-index: -1; opacity: var(--dust, 0); mix-blend-mode: multiply; pointer-events: none;
  background-image: url("noise.svg"), linear-gradient(rgba(140,120,100,.45), rgba(110,95,80,.35)); }
.c-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; min-height: 14%; }
.cat { font: 700 clamp(9px, 2.8cqw, 13px) var(--read); letter-spacing: .06em; text-transform: uppercase; opacity: .65; }
.seal { font: 800 clamp(9px, 2.8cqw, 13px) var(--disp); letter-spacing: .06em; text-transform: uppercase; padding: 1px 7px 2px; border: 2px solid var(--edge);
  border-radius: 5px; background: var(--tc, #d8cfb8); color: var(--edge); white-space: nowrap; box-shadow: 0 2px 0 var(--edge); }
.icard[data-tier="1"] .seal, .icard[data-tier="2"] .seal, .icard[data-tier="3"] .seal { color: #fff; text-shadow: 0 1px 0 var(--edge); }
.word { flex: 1; display: grid; place-items: center; text-align: center; font: 800 clamp(26px, 12.5cqw, 72px)/1.02 var(--disp); letter-spacing: -.01em;
  overflow-wrap: anywhere; padding-top: 2%; }
.word.sealed { color: #8f86a6; }
/* Pixelated blocks in place of a word that would give the answer away. The word itself isn't in the page. */
.mosaic { display: flex; gap: 0; filter: blur(1.5px); }
.mosaic i { --m: 0; width: clamp(12px, 6cqw, 30px); height: clamp(26px, 12cqw, 60px); display: grid;
  background: linear-gradient(calc(var(--m) * 90deg), rgba(60,40,90,.55) 0 50%, rgba(60,40,90,.3) 50%),
              linear-gradient(rgba(60,40,90,calc(.15 + var(--m) * .08)) 0 50%, rgba(60,40,90,calc(.45 - var(--m) * .06)) 50%); }
.c-foot { display: flex; align-items: center; gap: 8px; min-height: 12%; }
.pips { display: flex; gap: 3px; }
.pips i { width: clamp(8px, 3cqw, 13px); height: clamp(8px, 3cqw, 13px); border: 2px solid var(--edge); background: rgba(255,255,255,.55); }
.pips i.on { background: var(--tc, #e64858); }
.icard[data-tier="0"] .pips i.on { background: #e64858; }
.pips i.pop { animation: pip .45s steps(3); }
@keyframes pip { 50% { transform: scale(1.7); } }
.plabel { font-size: clamp(10px, 3.1cqw, 14px); opacity: .8; margin-left: auto; text-align: right; }
.plabel b { font-weight: 700; }
.fliphint { position: absolute; right: 4%; top: 17%; font-size: 12px; opacity: .6; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.b-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; font-size: clamp(12px, 4cqw, 19px); min-height: 18%; }
.b-head b { line-height: 1.12; }
.b-head.long { font-size: clamp(10.5px, 3.4cqw, 16px); }
.b-head.xlong { font-size: clamp(9.5px, 2.95cqw, 14px); }
.rar { font-size: clamp(9px, 2.6cqw, 12px); letter-spacing: .1em; text-transform: uppercase; opacity: .6; }
.b-sum { font-size: clamp(11px, 3.35cqw, 15.5px); line-height: 1.32; padding-top: 3%; }
.b-facts { margin: auto 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: clamp(10px, 2.9cqw, 14px); }
.b-facts div { padding: 3px 6px; border: 2px solid rgba(13,10,22,.3); border-radius: 6px; background: rgba(255,255,255,.45); }
.b-facts div.hl { background: #fff3a0; border-color: var(--edge); }
.b-facts dt { opacity: .6; font-size: .85em; }
.b-facts dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.lk { opacity: .45; font-weight: 400; }
.newtag { position: absolute; z-index: 3; top: -14px; left: 50%; translate: -50% 0; background: var(--gold); color: #2b1a00; border: 3px solid var(--edge);
  font: 400 20px/1 var(--big); letter-spacing: .1em; padding: 3px 12px 4px; border-radius: 8px; box-shadow: 0 3px 0 var(--edge); animation: jig 1.6s steps(6) infinite; }
.iwrap.mini .side { padding: 6% 7%; border-width: 2px; box-shadow: 0 4px 0 rgba(0,0,0,.5); }
.iwrap.mini .word { font-size: clamp(13px, 15cqw, 28px); }
.iwrap.mini .c-top { min-height: 0; }
.iwrap.mini .cat { display: none; }
.iwrap.mini .seal { font-size: 9px; padding: 0 4px; }

.enter { animation: deal .45s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes deal { from { transform: translate(60vw, -30px) rotate(25deg) scale(.7); opacity: 0; } }
.exit { animation: toss .45s cubic-bezier(.6,0,.8,.4) both; }
@keyframes toss { to { transform: translate(-70vw, -40px) rotate(-30deg) scale(.7); opacity: 0; } }
.good .side { box-shadow: 0 8px 0 rgba(0,0,0,.5), 0 0 0 4px var(--green), 0 0 40px rgba(62,207,122,.6); }
.bad { animation: shake .4s steps(6); }
.bad .side { box-shadow: 0 8px 0 rgba(0,0,0,.5), 0 0 0 4px var(--red), 0 0 40px rgba(255,79,109,.55); }
@keyframes shake { 20%, 60% { transform: translateX(-9px) rotate(-1.5deg); } 40%, 80% { transform: translateX(9px) rotate(1.5deg); } }
.evolve .icard { animation: evolve 1.1s cubic-bezier(.3,1.2,.4,1) backwards; } /* not "both": afterwards the card can be flipped */
@keyframes evolve { 0% { transform: rotateY(0) scale(.9); filter: brightness(2.5); } 50% { transform: rotateY(360deg) scale(1.12); } 100% { transform: rotateY(720deg) scale(1); filter: none; } }

/* ------------------------------------------------------------ stage */
.stage { flex: 1; display: grid; justify-items: center; align-content: start; gap: 14px; padding-block: 4px 40px; width: 100%; max-width: 520px; margin: 0 auto; }
.progress { width: 100%; display: flex; gap: 3px; }
.progress i { flex: 1; height: 8px; background: rgba(0,0,0,.45); border: 2px solid var(--edge); }
.progress i.ok { background: var(--green); } .progress i.no { background: var(--red); } .progress i.now { background: var(--dim); }
.prompt { width: 100%; padding: 12px 16px; font-size: 20px; line-height: 1.25; text-align: center; }
.prompt .kind { display: block; font: 400 17px var(--big); letter-spacing: .14em; color: var(--gold); text-transform: uppercase; margin-bottom: 4px; }

.chips { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chip { min-height: 62px; padding: 10px; border-radius: 10px; border: 3px solid var(--edge); background: var(--panel-2); color: var(--ink);
  font: 700 18px var(--read); box-shadow: 0 5px 0 var(--edge), inset 0 2px 0 rgba(255,255,255,.12); line-height: 1.2;
  /* backwards, not both: once dealt in, a button shows its own style. Safari could otherwise keep the last,
     slightly low and see-through step of the deal-in on the last button to arrive (the bottom-right one). */
  animation: chipIn .3s steps(4) backwards; transition: transform .06s; position: relative; top: 0; }
.chip:nth-child(2) { animation-delay: .05s; } .chip:nth-child(3) { animation-delay: .1s; } .chip:nth-child(4) { animation-delay: .15s; }
@keyframes chipIn { from { transform: translateY(24px); opacity: 0; } }
/* Hover lift only with a real mouse: phones keep "hover" on whatever sits under the last tap, which left
   one freshly dealt answer (usually the bottom-right one) darker, tilted and skipping its deal-in. */
@media (hover: hover) and (pointer: fine) { .chip:hover:not([disabled]) { background: var(--panel-3); transform: translateY(-3px) rotate(-1deg); } }
.chip { touch-action: manipulation; }
@media (hover: hover) and (pointer: fine) { .chip:active:not([disabled]) { top: 4px; box-shadow: 0 1px 0 var(--edge); } }
.chip .k { position: absolute; left: 7px; top: 4px; font: 400 16px var(--big); color: var(--faint); }
.chip.long { font-size: 15.5px; }
.chip.right { background: var(--green); color: #07260f; }
.chip.wrong { background: var(--red); }
.chip.gone { opacity: .25; }
.chip[disabled] { cursor: default; }
.num-ans { font-family: var(--disp); font-size: 22px; font-weight: 800; letter-spacing: .01em; }

.swipebar { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint-line { font-size: 14px; color: var(--dim); text-align: center; }
.stamp { position: absolute; top: 30%; z-index: 5; font: 400 38px/1 var(--big); letter-spacing: .1em; padding: 4px 14px; border: 4px solid; border-radius: 8px; background: rgba(255,255,255,.7); }
.stamp.t { right: 8%; color: var(--green-d); rotate: 10deg; animation: stampIn .28s cubic-bezier(.2,1.6,.4,1) both; }
.stamp.f { left: 8%; color: var(--red-d); rotate: -10deg; animation: stampIn .28s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes stampIn { from { scale: 2.2; opacity: 0; } }
.swipebar .btn[disabled] { filter: none; opacity: 1; }
.swipebar .btn[disabled]:not(.green):not(.red) { opacity: .45; }
.stamp.peek { right: 6%; top: 8%; font-size: 22px; color: #6b5a8c; rotate: 8deg; border-width: 3px; }

.typein { width: 100%; display: flex; gap: 10px; }
.typein input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 10px; border: 3px solid var(--edge); background: var(--paper); color: var(--paper-ink);
  font: 800 22px var(--disp); letter-spacing: .02em; box-shadow: inset 0 3px 0 rgba(0,0,0,.15), 0 4px 0 var(--edge); }
.typein input:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.typein input.right { background: #c9f5d9; } .typein input.wrong { background: #ffd3da; }

.pairboard { width: 100%; display: grid; gap: 12px; }
.timer { height: 14px; border: 3px solid var(--edge); border-radius: 4px; background: rgba(0,0,0,.4); overflow: hidden; }
.timer i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--green) 0 10px, #7ff0ae 10px 12px); transform-origin: left; }
.timer.low i { background: repeating-linear-gradient(90deg, var(--red) 0 10px, #ff9aaa 10px 12px); }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pairs .col { display: grid; gap: 10px; align-content: start; }
.ptile { min-height: 58px; padding: 8px 10px; border-radius: 10px; border: 3px solid var(--edge); background: var(--panel-2); text-align: left;
  display: flex; align-items: center; gap: 8px; box-shadow: 0 4px 0 var(--edge); font-size: 16px; line-height: 1.15; animation: chipIn .3s steps(4) backwards; }
.ptile.left { background: var(--paper); color: var(--paper-ink); font: 800 18px/1.1 var(--disp); }
.ptile.sel { outline: 3px solid var(--gold); outline-offset: 2px; transform: translateY(-3px); }
.ptile.done { opacity: .5; }
.ptile.right { background: var(--green); color: #07260f; } .ptile.wrong { background: var(--red); color: #fff; }
.ptile .n { min-width: 24px; height: 24px; display: grid; place-items: center; font: 400 18px var(--big); background: var(--edge); color: var(--gold); border-radius: 4px; }
.ptile .fix { margin-left: auto; font: 800 15px var(--disp); }

.feedback { width: 100%; padding: 14px 16px; display: grid; gap: 10px; animation: chipIn .25s steps(3) backwards; }
.feedback .v { font: 400 34px/1 var(--big); letter-spacing: .06em; }
.feedback .v.no { color: var(--red); } .feedback .v.ok { color: var(--green); } .feedback .v.new { color: var(--gold); }
.feedback .ans { font-size: 18px; }
.feedback .learn { font-size: 17px; line-height: 1.45; }
.assist { display: grid; justify-items: center; gap: 6px; }
.btn.hint-empty { opacity: .6; }

/* ---------------------------------------------------------- overlays */
.overlay { position: fixed; inset: 0; z-index: 30; display: grid; justify-items: center; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
  background: rgba(8,5,16,.9); animation: fadeIn .2s both; overflow-y: auto; overscroll-behavior: contain; }
/* Centred when it fits; when it's taller than the screen it starts at the top and scrolls, nothing cut off. */
.overlay > * { margin-block: auto; }
@keyframes fadeIn { from { opacity: 0; } }
.celebrate { display: grid; gap: 14px; justify-items: center; text-align: center; width: min(480px, 100%); }
.celebrate .kicker { font: 400 26px var(--big); letter-spacing: .3em; color: var(--gold); animation: jig 1.2s steps(6) infinite; }
.celebrate h2 { font: 400 clamp(64px, 19vw, 110px)/.9 var(--big); letter-spacing: .03em; -webkit-text-stroke: 4px var(--edge); paint-order: stroke fill;
  filter: drop-shadow(0 6px 0 var(--edge)); animation: slam .5s cubic-bezier(.2,1.6,.4,1) both, jig 2s steps(8) .5s infinite; }
.celebrate h2.t1 { color: var(--t1); } .celebrate h2.t2 { color: var(--t2); } .celebrate h2.t3 { color: #a987ff; }
.celebrate h2.t4 { color: var(--gold); } .celebrate h2.t5 { color: var(--t5); } .celebrate h2.t6 { color: #9ff3ff; text-shadow: 0 0 18px rgba(127,231,255,.7), 0 4px 0 var(--edge); }
.celebrate h2.unl { color: var(--ink); font-size: clamp(44px, 13vw, 76px); }
.celebrate p { color: var(--dim); max-width: 40ch; }
.celebrate .icard p { color: inherit; max-width: none; } /* text printed on a card keeps the card's ink */
.celebrate .iwrap { width: min(100%, 380px); margin-bottom: 12px; }
.unlockart { animation: bounceIn .7s cubic-bezier(.2,1.6,.4,1) both; filter: drop-shadow(0 6px 0 var(--edge)); }
@keyframes bounceIn { from { transform: scale(0) rotate(-40deg); } }

.runend { width: min(460px, 100%); display: grid; gap: 14px; padding: 20px; text-align: center; }
.runend .score-big { font: 400 88px/.9 var(--big); color: var(--gold); -webkit-text-stroke: 3px var(--edge); paint-order: stroke fill; filter: drop-shadow(0 5px 0 var(--edge)); }
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.statgrid div { padding: 8px 6px; border-radius: 8px; background: var(--edge); }
.statgrid b { display: block; font: 400 32px/1 var(--big); }
.statgrid span { font-size: 12px; color: var(--dim); }
.newbest { font: 400 26px var(--big); letter-spacing: .2em; color: var(--green); animation: jig 1s steps(6) infinite; display: inline-block; }

/* -------------------------------------------------------------- slot */
.slot { width: min(430px, 100%); padding: 18px 16px 20px; border-radius: 18px; display: grid; gap: 14px; text-align: center;
  background: var(--red); border: 4px solid var(--edge); box-shadow: 0 8px 0 var(--edge), inset 0 4px 0 rgba(255,255,255,.25), inset 0 -8px 0 rgba(0,0,0,.25); }
.slot h2 { font: 400 48px/1 var(--big); letter-spacing: .06em; color: var(--gold); -webkit-text-stroke: 3px var(--edge); paint-order: stroke fill; filter: drop-shadow(0 4px 0 var(--edge)); }
.lights { display: flex; justify-content: space-between; padding-inline: 4px; }
.lights i { width: 10px; height: 10px; background: #ffe9a8; border: 2px solid var(--edge); opacity: .45; }
.slot.spinning .lights i { animation: blink .3s steps(2) infinite; }
.lights i:nth-child(odd) { animation-delay: .15s !important; }
@keyframes blink { 50% { opacity: 1; background: #fff; } }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px; border-radius: 12px; background: var(--edge); }
.reel { height: 100px; overflow: hidden; border-radius: 8px; background: var(--paper); position: relative; border: 3px solid #000; }
.reel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45), transparent 28%, transparent 72%, rgba(0,0,0,.45)); pointer-events: none; }
.strip { display: grid; }
.strip .sym { height: 94px; display: grid; place-items: center; }
.reel.win { background: #fff3a0; box-shadow: 0 0 0 3px var(--gold); }
.payout { min-height: 32px; font: 400 30px/1 var(--big); letter-spacing: .04em; color: #fff; text-shadow: 0 3px 0 var(--edge); }
.payout.win { color: var(--gold); animation: slam .45s both; }
.inv { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.paytable { font-size: 13px; color: #ffe0e6; }

/* -------------------------------------------------------------- menu */
.drawer-bg { position: fixed; inset: 0; z-index: 32; background: rgba(8,5,16,.7); animation: fadeIn .15s both; }
.drawer { position: fixed; z-index: 33; top: 0; bottom: 0; left: 0; width: min(460px, 100%); background: var(--panel); border-right: 4px solid var(--edge);
  display: flex; flex-direction: column; animation: slideIn .22s steps(6) both; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
@keyframes slideIn { from { transform: translateX(-100%); } }
.drawer header { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.drawer header h2 { flex: 1; font: 400 40px var(--big); letter-spacing: .06em; color: var(--gold); }
.tabs { display: flex; gap: 6px; padding: 0 12px 10px; overflow-x: auto; }
.tabs button { padding: 6px 10px; border-radius: 8px; border: 3px solid var(--edge); background: var(--panel-2); color: var(--dim); font: 800 14px var(--disp); white-space: nowrap; box-shadow: 0 3px 0 var(--edge); }
.tabs button[aria-selected="true"] { background: var(--blue); color: #fff; }
.tabbody { flex: 1; overflow-y: auto; padding: 8px 16px 20px; display: grid; gap: 14px; align-content: start; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sgrid div { padding: 10px 12px; border-radius: 8px; background: var(--edge); }
.sgrid b { display: block; font: 400 34px/1 var(--big); }
.sgrid span { font-size: 13px; color: var(--dim); }
.hbar { display: grid; grid-template-columns: 90px 1fr 44px; gap: 10px; align-items: center; font-size: 15px; }
.hbar .r { text-align: right; font: 400 20px var(--big); color: var(--dim); }
.sect { font: 400 22px var(--big); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.minigrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.locked { padding: 12px; border-radius: 10px; border: 3px dashed var(--panel-3); color: var(--dim); display: flex; gap: 12px; align-items: center; font-size: 15px; }
.ach { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--edge); }
.ach .badge { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-2); border: 3px solid #000; }
.ach.done .badge { background: var(--gold); }
.ach b { font-size: 17px; }
.ach p { font-size: 14px; color: var(--dim); }
.ach .bar { margin-top: 6px; height: 10px; }
.ach:not(.done) { opacity: .8; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 2px dashed var(--panel-3); }
.setting p { font-size: 14px; color: var(--dim); }
.toggle { width: 60px; height: 32px; border-radius: 6px; border: 3px solid var(--edge); background: var(--panel-3); position: relative; flex: none; box-shadow: 0 3px 0 var(--edge); }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: var(--ink); border: 2px solid var(--edge); transition: left .1s steps(3); }
.toggle[aria-checked="true"] { background: var(--green); }
.toggle[aria-checked="true"]::after { left: 31px; }
.detail { display: grid; gap: 10px; }
.facts { display: grid; gap: 4px; font-size: 15px; }
.facts div { display: flex; justify-content: space-between; gap: 10px; padding: 4px 8px; border-radius: 6px; background: var(--edge); }
.facts .lk { color: var(--faint); opacity: 1; }
.banner { position: fixed; left: 50%; translate: -50% 0; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 20; padding: 8px 12px; border-radius: 10px;
  background: var(--gold); color: #2b1a00; border: 3px solid var(--edge); box-shadow: 0 4px 0 var(--edge); font-size: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 24px); }
.banner .bchip { background: #fff3c2; color: #2b1a00; padding: 3px 8px; font-size: 13px; }

/* Retro pixel text: opt-in from Settings. */
[data-pixel="1"] .btn, [data-pixel="1"] .tabs button { font-family: var(--pix); font-weight: 700; }
[data-pixel="1"] .word { font: 400 clamp(34px, 19cqw, 108px)/.9 var(--big); letter-spacing: .02em; }
[data-pixel="1"] .iwrap.mini .word { font-size: clamp(16px, 22cqw, 40px); }
[data-pixel="1"] .num-ans, [data-pixel="1"] .ptile.left, [data-pixel="1"] .typein input { font-family: var(--big); font-weight: 400; font-size: 28px; }

.toasts { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; translate: -50% 0; z-index: 50; display: grid; gap: 8px;
  width: min(360px, calc(100% - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: var(--gold); color: #2b1a00;
  border: 3px solid var(--edge); box-shadow: 0 5px 0 var(--edge); font: 800 17px var(--disp); animation: toastIn .45s cubic-bezier(.2,1.6,.4,1) both, toastOut .4s ease-in 3.1s both; }
.toast small { display: block; font: 400 15px var(--big); letter-spacing: .16em; opacity: .75; }
@keyframes toastIn { from { transform: translateY(-60px) scale(.8); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-40px); opacity: 0; } }
.kept { display: grid; gap: 8px; text-align: left; }
.kept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.kept-grid .c-foot { min-height: 0; }
.kept-grid .plabel { display: none; }
.kept-grid .pips i { width: 8px; height: 8px; border-width: 1.5px; }

[data-calm="1"] *, [data-calm="1"] *::before, [data-calm="1"] *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---- pockets: umbrella cards, socketed chips, locked pockets */
.side.back { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.b-facts { grid-template-columns: repeat(auto-fill, minmax(min(100%, 118px), 1fr)); margin-top: 8px; }
.b-facts .lockd { border-style: dashed; background: rgba(255,255,255,.2); }
.b-head .hl, .b-sum.hl { background: #fff3a0; box-shadow: 0 0 0 3px #fff3a0; border-radius: 3px; }
.pk { display: grid; grid-template-columns: auto 1fr; gap: 6px; align-items: start; margin-top: 7px; font-size: clamp(10px, 2.8cqw, 13px); }
.pk-l { font-weight: 700; opacity: .7; padding-top: 2px; white-space: nowrap; }
.pk.shut .pk-l::after { content: " · locked"; font-weight: 400; opacity: .8; }
.pchips { display: flex; flex-wrap: wrap; gap: 4px; }
.pchip { font-style: normal; font-weight: 700; padding: 1px 6px; border-radius: 5px; border: 2px solid rgba(13,10,22,.35); background: #efe9df; color: #3a3350; line-height: 1.35; }
.pchip[data-known="0"] { opacity: .45; border-style: dashed; background: transparent; }
.pchip[data-tier="1"] { background: var(--t1); color: #fff; border-color: rgba(0,0,0,.3); }
.pchip[data-tier="2"] { background: var(--t2); color: #fff; border-color: rgba(0,0,0,.3); }
.pchip[data-tier="3"] { background: var(--t3); color: #fff; border-color: rgba(0,0,0,.3); }
.pchip[data-tier="4"] { background: #ffc23d; color: #3b2600; }
.pchip[data-tier="5"] { background: #dfe6f3; color: #26324a; }
.pchip[data-tier="6"] { background: linear-gradient(115deg, #b6f3ff, #ffffff, #b6f3ff); color: #0d3a48; }
.holds { justify-self: center; align-self: center; font: 700 clamp(10px, 2.9cqw, 13px)/1 var(--read); letter-spacing: .08em; padding: 3px 8px;
  border-radius: 999px; background: rgba(13,10,22,.78); color: #fff; margin-bottom: 4px; }
.icard.umb .side { outline: 3px double rgba(13,10,22,.45); outline-offset: -9px; }
.detail .pk { font-size: 13px; }
.detail .pchip { color: #3a3350; }
.socket { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 2px 0; font-size: 15px; }
.newfan { position: relative; width: min(100%, 380px); height: 150px; margin-bottom: 14px; }
.newfan .iwrap.mini { position: absolute; left: 50%; top: 10px; width: min(44vw, 170px); translate: -50% 0; transform-origin: 50% 180%; }
.pockets-list { display: grid; gap: 6px; }
.pockets-list .b-facts { grid-template-columns: 1fr; margin: 0; font-size: 14px; }
.pockets-list .b-facts div { background: rgba(255,255,255,.06); border-color: var(--line); color: var(--ink); }
.pockets-list .b-facts dt { color: var(--faint); opacity: 1; }
.pockets-list .pk-l { color: var(--faint); opacity: 1; }
.pockets-list .pchip { font-size: 12px; }
.pockets-list .pchip[data-known="0"] { color: var(--faint); border-color: var(--line); opacity: 1; }
.reveal { animation: rise .5s cubic-bezier(.3,1.2,.4,1) backwards; }
.newfan .iwrap.mini .icard { cursor: pointer; }
/* ---- CLOCK IN: the first tap, which browsers require before any sound */
.clockin { position: fixed; inset: 0; z-index: 60; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 24px;
  text-align: center; background: radial-gradient(90% 70% at 50% 40%, #241640, var(--bgc) 70%); cursor: pointer; animation: fadeIn .4s both; }
.ci-top { font: 400 18px var(--big); letter-spacing: .3em; color: var(--faint); }
.clockin .btn { min-width: 220px; animation: ciPulse 2.4s ease-in-out infinite; }
@keyframes ciPulse { 50% { transform: scale(1.04); filter: brightness(1.12); } }
[data-calm="1"] .clockin .btn { animation: none; }

/* ---- 2-Bit G4N */
.g4n-ask { display: inline-flex; align-items: center; gap: 8px; justify-self: center; padding: 6px 12px 6px 8px; border-radius: 999px;
  border: 2px solid #6a3fd0; background: rgba(106,63,208,.18); color: var(--ink); font: 600 15px var(--read); cursor: pointer; }
.g4n-ask:hover { background: rgba(106,63,208,.32); }
.g4n-ask b { color: #c9b3ff; }
.g4n-overlay { z-index: 38; }
.panel.g4n { width: min(100%, 480px); padding: 18px; display: grid; gap: 12px; text-align: left; border-color: #6a3fd0;
  box-shadow: 0 6px 0 var(--edge), 0 0 0 2px rgba(127,231,255,.15), 0 0 40px rgba(106,63,208,.35); }
.g4n-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.g4n-head h2 { font: 800 22px/1.15 var(--disp); }
.g4n-name { font: 400 16px var(--big); letter-spacing: .14em; color: var(--t6); }
.g4n-face { display: inline-grid; animation: g4nGlitch 5.2s steps(1) infinite; }
@keyframes g4nGlitch { 0%, 91%, 100% { transform: none; filter: none; } 92% { transform: translateX(2px); filter: hue-rotate(40deg); } 94% { transform: translateX(-1px); } 96% { filter: brightness(1.6); } }
[data-calm="1"] .g4n-face { animation: none; }
.g4n-talk { font-size: 17px; line-height: 1.55; }
.g4n-link { display: inline; padding: 0; border: 0; background: none; color: var(--t6); font: inherit; text-decoration: underline;
  text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.g4n-link:hover { color: #c9fbff; }
.binary { display: grid; gap: 10px; padding: 12px; border-radius: 10px; background: var(--edge); }
.bits { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.bit { display: grid; justify-items: center; gap: 2px; padding: 6px 0; border-radius: 8px; border: 2px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; }
.bit b { font: 400 26px/1 var(--big); }
.bit small { font-size: 11px; color: var(--faint); }
.bit.on { background: var(--t6); color: #0d3a48; border-color: #36c6e6; }
.bit.on small { color: #0d3a48; }
.bin-sum { font: 400 20px var(--big); letter-spacing: .04em; text-align: center; }
.bin-sum b { font-size: 30px; color: var(--gold); }
.bin-steps { display: grid; gap: 6px; }
.bin-steps ol { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; font-size: 13.5px; }
.bin-steps li { color: var(--faint); }
.bin-steps li b { display: inline-block; min-width: 30px; font: 400 17px var(--big); color: var(--dim); }
.bin-steps li.on { color: var(--ink); }
.bin-steps li.on b { color: var(--t6); }
.bin-result { font: 400 20px var(--big); text-align: center; letter-spacing: .06em; }
.bin-result b { color: var(--gold); letter-spacing: .12em; }
.bin-in input { width: 80px; margin-left: 6px; padding: 4px 6px; border-radius: 6px; border: 2px solid var(--line); background: #fffaf0; color: #140c24; font: 16px var(--read); }
.g4n-trivia { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px;
  background: rgba(106,63,208,.16); border: 2px dashed rgba(106,63,208,.6); text-align: left; }
.g4n-trivia small { display: block; font: 400 14px var(--big); letter-spacing: .14em; color: var(--t6); }

/* ---- the Overclerk: one memo line under the plain one */
.memo { font: 500 12.5px/1.4 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: .02em; color: var(--faint); max-width: 44ch; margin-inline: auto; }
.defeat .memo { color: #ff9aa9; animation: fadeIn .8s 2s both; }
.celebrate p.memo { color: var(--faint); }

/* ---- card record (binder) */
.record { grid-column: 1 / -1; display: grid; gap: 8px; padding: 12px; border-radius: 10px; background: var(--edge); border: 2px dashed var(--line); }
.rec-head { font: 400 18px var(--big); letter-spacing: .12em; color: var(--faint); }
.rec-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.rec-stats b { display: block; font: 400 24px/1 var(--big); color: var(--ink); }
.rec-stats span { font-size: 12px; color: var(--dim); }
.rec-moments { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.rec-moments li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.rec-moments time { color: var(--faint); white-space: nowrap; }
.rec-moments .k-recovered span { color: var(--green); font-weight: 700; }
.rec-moments .k-level span { color: var(--gold); }
.rec-moments .k-lost span, .rec-moments .k-miss span { color: var(--dim); }
.rec-note { font: italic 13px var(--read); color: var(--faint); }

/* ---- defeat: the screen drains to red */
.defeat { position: fixed; inset: 0; z-index: 36; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 24px; text-align: center;
  background: radial-gradient(120% 90% at 50% 45%, #7a0014 0%, #3a0009 55%, #140004 100%); animation: bleed 1.8s ease-in both; cursor: pointer; }
.defeat.leaving { animation: bleedOut .45s ease-out both; }
@keyframes bleed { 0% { opacity: 0; filter: saturate(0) brightness(.4); } 35% { opacity: .85; } 100% { opacity: 1; filter: none; } }
@keyframes bleedOut { to { opacity: 0; } }
.defeat h2 { display: grid; gap: 4px; margin: 0; font: 400 clamp(46px, 14vw, 96px)/.9 var(--big); letter-spacing: .06em; color: #ff2d4a;
  -webkit-text-stroke: 3px #1a0006; paint-order: stroke fill; text-shadow: 0 0 28px rgba(255,30,60,.75), 0 6px 0 #1a0006; }
.defeat h2 span { animation: doom .7s cubic-bezier(.2,1.5,.4,1) both; }
.defeat h2 span:nth-child(1) { animation-delay: .55s; } .defeat h2 span:nth-child(2) { animation-delay: .8s; }
.defeat h2 span:nth-child(3) { animation-delay: 1.05s; font-size: 1.25em; }
@keyframes doom { from { opacity: 0; transform: scale(2.6); filter: blur(6px); } 60% { opacity: 1; filter: none; } }
.defeat p { color: #ffc2cb; font-size: 17px; max-width: 32ch; animation: fadeIn .8s 1.6s both; }
.defeat .btn { background: #2a0008; border-color: #ff2d4a; color: #ffd9de; animation: fadeIn .5s both; }
.runend.lost { box-shadow: 0 6px 0 var(--edge), 0 0 0 3px #7a0014, 0 0 40px rgba(255,30,60,.35); }
.runend.lost .label { color: #ff4f6d; }
.linkish { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline; font: inherit; cursor: pointer; }
.celebrate .flipnote { font-size: 14px; color: var(--faint); margin-top: -6px; }
@keyframes rise { from { opacity: 0; translate: 0 24px; scale: .94; } }
[data-calm="1"] .reveal { animation: none; }

/* ---- account */
.panel.auth { width: min(100%, 440px); padding: 22px; display: grid; gap: 12px; text-align: left; }
.panel.auth h2 { margin: 0; font: 400 34px/1 var(--big); color: var(--gold); }
.authform { display: grid; gap: 8px; }
.authform label, label.mini { font-weight: 700; }
.authform input, input.typed { font: 18px var(--read); padding: 12px 14px; border-radius: 10px; border: 3px solid var(--edge); background: #fffaf0; color: #140c24; width: 100%; box-sizing: border-box; }
.authform input:focus-visible, input.typed:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--line); }
.autherr { color: #ffb3c0; font-weight: 700; margin: 0; }
.teaser.guest { display: grid; gap: 6px; justify-items: start; }
