/* Speaks: a pixel debate tournament. The canvas behind everything is the
   school; the panels on top are chunky, square-cornered UI in the same
   pixel language. */
:root {
  /* Three base colors: indigo for structure, brass for action, mint for progress. */
  --indigo: #1C1F3F;
  --tangerine: #E3B75A;
  --mint: #3ED1B6;
  /* derived from those three */
  --night: #14172E;
  --panel: #1C1F3F;
  --edge: #0B0D20;
  --hi: #30356A;
  --text: #F3F1FA;
  --dim: #A9AED0;
  --gold: var(--tangerine);
  --gold-dark: #B48A33;
  --red: #FF6B5E;
  --teal: var(--mint);
  --t0: #6E7399; --t1: #9DA2C6; --t2: #3ED1B6; --t3: #8EF0DC; --t4: #EED394; --t5: #E3B75A; --tx: #3A3F6E;
  --font: "Jersey 15", "Atkinson Hyperlegible Next", ui-sans-serif, system-ui, sans-serif;
  --step: steps(4, end);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
/* a phone never slides sideways: nothing pans, nothing rubber-bands, no double-tap zoom */
html { overflow: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--night); color: var(--text); font-synthesis: none; font: 400 23px/1.3 var(--font); letter-spacing: .01em; font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0; overflow: hidden; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, a, input, textarea, select, label, summary { touch-action: manipulation; }
button, input, textarea { font: inherit; color: inherit; font-variant-ligatures: none; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
b { font-variant-numeric: tabular-nums; }

#scene { position: fixed; left: 0; bottom: 0; image-rendering: pixelated; image-rendering: crisp-edges; }

/* chunky pixel panel: square corners with a notched outline */
.panel {
  background: var(--panel); color: var(--text);
  border: 3px solid var(--edge);
  box-shadow: inset 0 3px 0 var(--hi), 0 6px 0 rgba(0, 0, 0, .35);
  clip-path: polygon(0 6px, 6px 6px, 6px 0, calc(100% - 6px) 0, calc(100% - 6px) 6px, 100% 6px, 100% calc(100% - 6px), calc(100% - 6px) calc(100% - 6px), calc(100% - 6px) 100%, 6px 100%, 6px calc(100% - 6px), 0 calc(100% - 6px));
}
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 25px; background: var(--gold); color: var(--indigo);
  font: 700 25px/1 var(--font); letter-spacing: .02em;
  box-shadow: inset 0 -5px 0 var(--gold-dark), inset 0 3px 0 color-mix(in srgb, var(--tangerine) 60%, white), 0 0 0 3px var(--edge);
  transition: transform .06s var(--step);
}
.btn:active { transform: translateY(3px); box-shadow: inset 0 -2px 0 var(--gold-dark), 0 0 0 3px var(--edge); }
.btn:disabled { filter: grayscale(.8) brightness(.8); cursor: default; }
.btn.dark { background: var(--hi); color: var(--text); box-shadow: inset 0 -5px 0 var(--edge), inset 0 3px 0 color-mix(in srgb, var(--hi) 70%, white), 0 0 0 3px var(--edge); }
.btn.wide { width: 100%; }
.kbd { font: 600 16px/1 var(--font); padding: 4px 6px; background: rgba(0, 0, 0, .25); }

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 20; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; pointer-events: none; }
.hud-box { pointer-events: auto; background: var(--panel); border: 3px solid var(--edge); box-shadow: inset 0 3px 0 var(--hi); padding: 6px 12px 7px; min-width: 104px; }
.hud-box.right { text-align: right; }
.hud-box span { display: block; font: 600 15px/1 var(--font); color: var(--dim); letter-spacing: .06em; }
.hud-box b { display: block; font: 700 32px/1.05 var(--font); margin-top: 3px; }
.hud-box b.bump { animation: bump .45s var(--step); }
@keyframes bump { 50% { transform: scale(1.2); color: var(--gold); } }
.hud-mid span.flash { animation: flash 1.6s steps(8) both; }
@keyframes flash { 0%, 60% { background: var(--gold); color: var(--indigo); text-shadow: none; } 100% { background: transparent; } }
.hud-mid span { padding: 3px 6px; }
.hud-mid { text-align: center; font: 600 17px/1 var(--font); color: var(--text); text-shadow: 0 2px 0 var(--edge); }
.pips { display: flex; justify-content: center; gap: 5px; margin: 6px 0 7px; }
.pips i { width: 18px; height: 18px; background: rgba(14, 11, 26, .6); border: 2px solid var(--edge); }
.pips i.now { background: var(--text); animation: blinkPip 1s var(--step) infinite; }
@keyframes blinkPip { 50% { background: var(--gold); } }

/* ---------- stage: where panels sit ---------- */
.stage { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; padding: calc(96px + env(safe-area-inset-top)) 14px calc(14px + env(safe-area-inset-bottom)); pointer-events: none; }
.stage > * { pointer-events: auto; }
.col { width: min(720px, 100%); }
.enter { animation: panelIn .35s var(--step) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(-12px); } }

/* home */
.home { margin-top: 2vh; text-align: center; padding: 26px 22px 28px; }
.logo { margin: 0; font: 400 clamp(72px, 15vw, 132px)/.85 var(--font); color: var(--gold); letter-spacing: .01em; text-shadow: 4px 4px 0 var(--mint), 8px 8px 0 var(--edge); }
.tagline { margin: 18px auto 0; max-width: 30ch; font: 500 23px/1.4 var(--font); color: var(--text); }
.home-actions { display: grid; gap: 14px; margin-top: 25px; }
.home-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
#t-sound { padding: 8px; }
.tile { padding: 10px 8px; background: rgba(255, 255, 255, .06); border: 2px solid var(--edge); text-align: center; font: 600 18px/1.2 var(--font); color: var(--text); }
.tile:hover { background: rgba(255, 255, 255, .12); }
.tile small { display: block; color: var(--dim); font-size: 16px; margin-top: 3px; }
.meta-line { margin-top: 14px; font: 500 18px/1.4 var(--font); color: var(--dim); }
.sound-btn { position: fixed; z-index: 21; top: calc(12px + env(safe-area-inset-top)); right: 14px; }
.sound-btn .btn { min-height: 44px; padding: 0 16px; font-size: 18px; }

/* the motion */
.motion-card { margin-top: 3vh; padding: 26px 24px 28px; text-align: center; }
.eyebrow { font: 600 18px/1 var(--font); color: var(--gold); }
.motion { margin: 12px 0 0; font: 400 clamp(38px, 6.4vw, 62px)/1.05 var(--font); letter-spacing: .005em; text-wrap: balance; }
.motion-help { margin: 16px auto 0; max-width: 40ch; font: 500 21px/1.4 var(--font); color: var(--dim); }
.motion-card .btn { margin-top: 25px; min-width: 240px; }

/* an argument */
.arg-card { padding: 18px 20px 23px; }
.arg-top { display: flex; flex-direction: column; gap: 4px; font: 600 17px/1.3 var(--font); color: var(--dim); }
.arg-top em { font-style: normal; color: var(--gold); font-size: 18px; }
.claim { margin: 8px 0 0; font: 400 clamp(34px, 5vw, 52px)/1.08 var(--font); letter-spacing: .005em; text-wrap: balance; }
.count { margin-top: 14px; font: 600 21px/1 var(--font); color: var(--dim); }
.count b { color: var(--gold); font-size: 28px; }

.dock { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); width: min(720px, calc(100% - 24px)); padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.dock textarea {
  grid-column: 1 / -1; width: 100%; min-height: 64px; max-height: 30vh; resize: none; padding: 12px 16px;
  background: var(--edge); color: var(--text); border: 3px solid var(--hi); outline: none;
  font: 500 22px/1.35 var(--font);
}
.dock textarea:focus { border-color: var(--gold); }
.dock textarea::placeholder { color: #7D7596; }
.dock textarea.shake { animation: shake .3s steps(6); border-color: var(--red); }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 75% { transform: translateX(-3px); } }
.clock { display: flex; align-items: center; gap: 10px; }
.clock-blocks { display: flex; gap: 2px; flex: 1; padding: 2px; background: var(--edge); }
.clock-blocks i { flex: 1; height: 18px; background: var(--teal); }
.clock-blocks i.off { background: #262A55; }
.clock.low .clock-blocks i:not(.off) { background: var(--red); }
.clock-n { font: 700 28px/1 var(--font); min-width: 2.2ch; text-align: right; white-space: nowrap; }
.clock.low .clock-n { color: #FF8C7F; }
.dock-row { display: flex; gap: 10px; align-items: center; grid-column: 1 / -1; }
.dock-row .clock { flex: 1; }
.hint { font: 500 17px/1.3 var(--font); color: var(--dim); }
.mic.on { background: var(--mint); color: var(--indigo); box-shadow: inset 0 -5px 0 #2BA790, 0 0 0 3px var(--edge); }
.msg { grid-column: 1 / -1; min-height: 23px; font: 600 18px/1.3 var(--font); color: #FFB3A8; }
.msg.wait { color: var(--dim); }

/* the verdict */
.verdict { margin-top: 14px; }
.your { font: 500 20px/1.4 var(--font); color: var(--dim); border-left: 3px solid var(--hi); padding-left: 10px; max-height: 5.6em; overflow: hidden; }
.points { display: grid; gap: 6px; margin-top: 14px; }
.pt { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; padding: 9px 11px; background: rgba(255, 255, 255, .05); border: 2px solid var(--edge); animation: panelIn .3s var(--step) both; }
.pt.off { opacity: .55; }
.pt-label { font: 600 21px/1.3 var(--font); }
.pt-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.pt-pts { font: 700 25px/1 var(--font); color: var(--gold); text-align: right; }
.pt-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font: 500 17px/1 var(--font); color: var(--dim); }
.tierchip { padding: 3px 7px; color: #120E1E; font: 700 16px/1 var(--font); }
/* rarity, in the colours games use for loot: grey, green, blue, purple, gold */
.tierchip.r0, .tierchip.r1 { background: #C9C9C9; }
.tierchip.r2 { background: #4CAF6A; color: #fff; }
.tierchip.r3 { background: #3B7DDD; color: #fff; }
.tierchip.r4 { background: #8A4FD8; color: #fff; }
.tierchip.r5 { background: #FFCC00; box-shadow: 0 0 0 2px #120E1E inset; }
.newchip { padding: 3px 7px; background: var(--text); color: #120E1E; font: 700 16px/1 var(--font); }
.impact { display: inline-flex; align-items: center; gap: 2px; }
.impact i { width: 9px; height: 9px; background: var(--hi); }
.impact i.on { background: var(--red); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 14px; font: 700 23px/1 var(--font); }
.total b { font-size: 34px; color: var(--gold); }
.note { margin-top: 8px; font: 500 18px/1.4 var(--font); color: var(--dim); }
.bubbles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.bubble { padding: 5px 9px; background: rgba(255, 255, 255, .07); border: 2px solid var(--edge); font: 500 17px/1.2 var(--font); }
.bubble.mine { background: var(--mint); color: var(--indigo); }
.bubble b { margin-left: 6px; opacity: .75; }
.room-h { margin-top: 16px; font: 600 17px/1 var(--font); color: var(--gold); }
.next-row { margin-top: 16px; display: flex; justify-content: flex-end; }

/* ballot */
.ballot { padding: 20px 20px 21px; }
.ballot .eyebrow { color: var(--dim); }
.place { margin: 6px 0 0; font: 400 clamp(46px, 9vw, 76px)/1 var(--font); letter-spacing: .01em; color: var(--gold); text-shadow: 3px 3px 0 var(--edge); }
.ballot-line { margin-top: 10px; font: 500 22px/1.4 var(--font); }
.ballot-line b { color: var(--gold); }
.squares { display: flex; gap: 6px; margin-top: 16px; }
.squares i { width: 34px; height: 34px; border: 3px solid var(--edge); }
.ballot-actions { display: grid; gap: 10px; margin-top: 18px; }
.rows { margin-top: 18px; display: grid; gap: 6px; }
.row { display: grid; gap: 4px; text-align: left; padding: 10px 14px; background: rgba(255, 255, 255, .05); border: 2px solid var(--edge); }
.row:hover { background: rgba(255, 255, 255, .1); }
.row-claim { font: 600 20px/1.3 var(--font); }
.row-meta { display: flex; justify-content: space-between; gap: 10px; font: 500 17px/1.3 var(--font); color: var(--dim); }
.scroll { max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px); overflow-y: auto; scrollbar-width: thin; }
.arg-card.scroll { max-height: 64vh; max-height: 64dvh; }
@media (max-width: 600px) { .arg-card.scroll { max-height: 56vh; max-height: 56dvh; } }
details summary { cursor: pointer; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+ "; }
details[open] summary::before { content: "- "; }

.t0 { background: var(--t0); } .t1 { background: var(--t1); } .t2 { background: var(--t2); } .t3 { background: var(--t3); } .t4 { background: var(--t4); } .t5 { background: var(--t5); } .tx { background: var(--tx); }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; }
.overlay-scrim { position: absolute; inset: 0; background: rgba(14, 11, 26, .7); }
.overlay-panel { position: relative; width: min(560px, 100%); max-height: 88vh; overflow-y: auto; padding: 22px 20px 23px; animation: panelIn .3s var(--step) both; }
.close { position: absolute; top: 8px; right: 10px; width: 44px; height: 44px; font: 700 34px/1 var(--font); color: var(--dim); }
.ov-title { margin: 0 44px 12px 0; font: 700 37px/1.05 var(--font); color: var(--gold); }
.ov-text { margin: 0 0 14px; font: 500 21px/1.45 var(--font); }
.ov-list { margin: 0; padding-left: 25px; display: grid; gap: 8px; font: 500 21px/1.4 var(--font); }
.ladder { display: grid; gap: 4px; margin-top: 16px; }
.ladder div { display: flex; justify-content: space-between; padding: 7px 10px; color: #120E1E; font: 700 18px/1 var(--font); }
.archive { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.arch { display: grid; gap: 4px; padding: 10px; background: rgba(255, 255, 255, .06); border: 2px solid var(--edge); text-align: left; }
.arch b { font: 700 22px/1 var(--font); }
.arch span { font: 500 17px/1.2 var(--font); color: var(--dim); }
.arch em { font: 700 18px/1 var(--font); font-style: normal; color: var(--gold); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stats div { padding: 10px; background: rgba(255, 255, 255, .05); border: 2px solid var(--edge); }
.stats b { display: block; font: 700 34px/1 var(--font); color: var(--gold); }
.stats span { font: 500 17px/1.2 var(--font); color: var(--dim); }

.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 0); padding: 12px 21px; background: var(--gold); color: var(--indigo); border: 3px solid var(--edge); font: 700 23px/1.2 var(--font); text-align: center; opacity: 0; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { animation: toast 2.6s var(--step) both; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

@media (min-width: 1000px) {
  .col { width: 760px; }
  .tile { font-size: 21px; } .tile small { font-size: 17px; }
  .arg-top { font-size: 20px; } .pt-label { font-size: 23px; } .pt-meta, .note, .hint, .meta-line { font-size: 20px; }
  .hud-box span { font-size: 17px; } .hud-box b { font-size: 37px; } .hud-mid { font-size: 20px; }
}
@media (max-width: 600px) {
  body { font-size: 20px; }
  .hud-box { min-width: 86px; padding: 5px 9px 6px; }
  .hud-box b { font-size: 28px; }
  .pips i { width: 14px; height: 14px; }
  .stage { padding-top: calc(88px + env(safe-area-inset-top)); }
  .home-row { grid-template-columns: 1fr 1fr 1fr; }
  .dock { padding: 10px; }
  .btn { min-height: 52px; font-size: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

.next-dock { grid-template-columns: 1fr; }
.arg-card.scroll { max-height: calc(100dvh - 210px); }

/* ---------- simple home ---------- */
.sound { position: fixed; z-index: 25; top: calc(12px + env(safe-area-inset-top)); right: 12px; width: 40px; height: 40px; display: grid; place-items: center; background: var(--panel); border: 3px solid var(--edge); box-shadow: inset 0 3px 0 var(--hi); color: var(--text); }
.sound svg { width: 22px; height: 22px; fill: currentColor; }
.sound .cross { display: none; }
.sound.off .wave { display: none; }
.sound.off .cross { display: block; }
.sound.off { color: var(--dim); }
.hud { grid-template-columns: auto 1fr 52px; }
.hud-spacer { width: 52px; }
.home { text-align: left; }
.home .logo { text-align: center; }
.how { margin: 20px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; counter-reset: how; }
.how li { position: relative; padding-left: 36px; font-size: 21px; line-height: 1.3; color: var(--dim); counter-increment: how; }
.how li::before { content: counter(how); position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: grid; place-items: center; background: var(--mint); color: var(--indigo); font-size: 19px; }
.how b { color: var(--text); font-weight: inherit; }
.pick-h { margin: 22px 0 10px; font: 400 26px/1 var(--font); color: var(--tangerine); }
.levels { display: grid; gap: 8px; }
.level { display: grid; gap: 2px; text-align: left; padding: 12px 14px; background: var(--hi); border: 3px solid var(--edge); box-shadow: inset 0 -4px 0 #22265A; transition: transform .06s var(--step); }
.level:hover { background: var(--tx); }
.level:active { transform: translateY(2px); }
.level-name { font-size: 28px; line-height: 1; color: var(--text); }
.level-about { font-size: 19px; color: var(--dim); }
.level.done { background: #233B4A; }
.level.done .level-about { color: var(--mint); }
.account { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 19px; color: var(--dim); }
.account .note { margin: 0; flex-basis: 100%; }
.link { min-height: 40px; padding: 0 12px; border: 2px solid var(--hi); color: var(--text); font-size: 19px; }
.link:hover { background: var(--hi); }
.note { margin: 0; color: var(--dim); font-size: 19px; }
.stat-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 20px; }
.stat-table th { text-align: left; color: var(--dim); font-weight: 400; padding: 6px 4px; border-bottom: 2px solid var(--hi); }
.stat-table td { padding: 8px 4px; border-bottom: 1px solid var(--hi); font-variant-numeric: tabular-nums; }
.dim { color: var(--dim); }

/* ---------- result ---------- */
.result { padding: 20px; }
.score { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.score b { font: 400 clamp(72px, 14vw, 112px)/.9 var(--font); color: var(--tangerine); text-shadow: 4px 4px 0 var(--edge); }
.score span { font-size: 26px; color: var(--dim); }
.curve { margin-top: 14px; }
.curve-h { margin: 0 0 8px; font-size: 21px; color: var(--dim); }
.curve-h b { color: var(--mint); font-weight: inherit; }
.curve svg { display: block; width: 100%; height: auto; }
.c-area { fill: rgba(62, 209, 182, .18); }
.c-line { fill: none; stroke: var(--mint); stroke-width: 3; }
.c-axis { stroke: var(--hi); stroke-width: 2; }
.c-avg { stroke: var(--dim); stroke-width: 2; stroke-dasharray: 4 4; }
.c-you { stroke: var(--tangerine); stroke-width: 4; }
.c-you-tag { fill: var(--tangerine); }
.c-you-lab { fill: var(--indigo); font: 400 24px var(--font); }
.c-lab { fill: var(--dim); font: 400 24px var(--font); }
.result-actions { display: grid; gap: 10px; margin-top: 16px; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 1000px) {
  .how li { font-size: 24px; }
  .level-name { font-size: 32px; } .level-about { font-size: 22px; }
  .account, .note, .link { font-size: 21px; }
  .arg-top em { font-size: 21px; }
  .row-claim { font-size: 22px; } .row-meta { font-size: 19px; }
  .eyebrow { font-size: 21px; }
  .curve-h { font-size: 23px; }
}

/* short or narrow windows: panels shrink to fit and scroll inside */
.col { max-height: calc(100dvh - 110px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; scrollbar-width: thin; }
.arg-card, .arg-card.scroll { max-height: calc(100dvh - 300px); min-height: 0; }
.home { margin-top: 0; }
.how-link { margin-top: 14px; }
.overlay .how { margin-top: 4px; }
@media (max-height: 760px) {
  .stage { padding-top: calc(70px + env(safe-area-inset-top)); }
  .logo { font-size: clamp(56px, 10vw, 84px); }
  .home, .motion-card, .result { padding: 16px 18px; }
  .pick-h { margin: 14px 0 8px; }
  .level { padding: 8px 12px; }
  .level-name { font-size: 24px; } .level-about { font-size: 18px; }
  .claim { font-size: clamp(28px, 4vw, 40px); }
  .motion { font-size: clamp(30px, 5vw, 46px); }
  .dock textarea { min-height: 52px; }
  .btn { min-height: 48px; }
  .col { max-height: calc(100dvh - 84px); }
  .arg-card, .arg-card.scroll { max-height: calc(100dvh - 260px); }
}

.gbtn { gap: 12px; font-size: 21px; }
.gbtn .g { width: 30px; height: 30px; display: grid; place-items: center; background: var(--text); color: var(--indigo); font-size: 24px; line-height: 1; }

.home .tagline { margin: 14px auto 18px; text-align: center; max-width: 34ch; color: var(--dim); }
.start { min-height: 64px; font-size: 26px; }

.strchip { padding: 3px 8px; font-size: 16px; color: var(--indigo); background: var(--t1); }
.kindchip { padding: 3px 7px; background: #C9CDE6; color: #120E1E; font: 700 16px/1 var(--font); }
.strchip.s1 { background: #FF6B5E; color: #fff; } .strchip.s2 { background: #6E7399; color: var(--text); }
.strchip.s3 { background: #C9CDE6; } .strchip.s4 { background: var(--mint); } .strchip.s5 { background: var(--tangerine); }
.strchip.turn { background: var(--tangerine); color: #120E1E; font-weight: 700; box-shadow: 0 0 0 2px #120E1E inset; }
.pt.neg .pt-pts, .total b.neg { color: #FF6B5E; }

/* ---------- the room ---------- */
.fade { position: fixed; inset: 0; z-index: 35; background: #0B0D20; opacity: 0; pointer-events: none; transition: opacity .3s steps(5); }
.fade.on { opacity: 1; }
#scene { transform-origin: 50% 50%; will-change: transform; }
.board { position: fixed; z-index: 8; display: flex; flex-direction: column; justify-content: center; padding: 4px 12px; text-align: center; color: var(--indigo); line-height: 1.1; text-wrap: balance; overflow: hidden; pointer-events: none; }
.board span { font-size: .6em; color: var(--tangerine); }
.say { position: fixed; z-index: 18; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .3)); animation: sayIn .25s steps(3) both; display: flex; flex-direction: column; }
@keyframes sayIn { from { opacity: 0; transform: translateY(8px); } }
.say-inner { background: var(--text); color: var(--indigo); border: 3px solid var(--edge); padding: 12px 16px 14px; overflow: hidden; min-height: 0; }
.say::after { content: ""; position: absolute; left: var(--tail); bottom: -12px; width: 18px; height: 15px; background: var(--text); clip-path: polygon(0 0, 100% 0, 30% 100%); }
.say-name { margin: 0 0 4px; font-size: 17px; color: var(--bubble-dim, #5A5F8A); }
.say p { margin: 0; }
.say-claim { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.1; }
.say-claim.long { font-size: clamp(21px, 2.2vw, 26px); line-height: 1.3; }
.say-inner { scrollbar-width: thin; scrollbar-color: var(--edge) transparent; overscroll-behavior: contain; }
.duel-args { margin: 12px 0 4px; padding: 0 0 0 1.4em; display: grid; gap: 8px; color: var(--indigo); font-size: clamp(19px, 2vw, 24px); line-height: 1.25; }
.duel-args li { padding-left: 4px; }
.duel-args li::marker { color: var(--accent-ink, #7E5F17); font-weight: bold; }
.say .duel-reveal { margin-top: 12px; display: inline-block; color: var(--accent-ink, #7E5F17); }
.dock-links { display: flex; gap: 10px 16px; flex-wrap: wrap; justify-content: space-between; align-items: center; }
/* every link under the answer box sits on one line at one height, reread included */
.dock-links .link { margin: 0; min-height: 44px; display: inline-flex; align-items: center; }
#duel-pause { position: fixed; z-index: 60; color: var(--text); }
#duel-pause .duel-pause-inner { background: var(--panel); border: 3px solid var(--edge); padding: 16px 20px; box-shadow: 0 8px 0 rgba(0,0,0,.35); }
#duel-pause .duel-pause-h { margin: 0 0 8px; font-size: 30px; color: var(--tangerine); }
#duel-pause p { margin: 0 0 12px; font-size: 19px; }
#duel-pause .duel-pause-row { display: flex; gap: 10px; flex-wrap: wrap; }
#duel-pause.duel-pause-banner { left: 50%; top: 14px; transform: translateX(-50%); width: min(460px, calc(100vw - 24px)); }
#duel-pause.duel-pause-ov { inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.72); padding: 16px; }
#duel-pause.duel-pause-ov .duel-pause-inner { width: min(460px, calc(100vw - 32px)); text-align: center; }
#duel-pause.duel-pause-ov .duel-pause-row { justify-content: center; }
#duel-pause .duel-pause-end { margin: 14px 0 0; }
.say-text { font-size: 19px; color: var(--bubble-ink, #3A3F6E); }
.say-note { margin-top: 6px !important; font-size: 19px; color: #C2412A; }
.say b { color: var(--tangerine); font-weight: inherit; }
.say.mine .say-inner { background: var(--bubble-mine, #E9FBF7); }
.say.mine::after { background: var(--bubble-mine, #E9FBF7); }
.say .pt { background: rgba(28, 31, 63, .06); border-color: rgba(28, 31, 63, .15); }
.say .pt-label { color: var(--indigo); }
.say .pt-pts, .say .total b { color: var(--accent-ink, #7E5F17); }
.say .total { color: var(--indigo); }
.say .room-h { color: var(--accent-ink, #7E5F17); }
.say .bubble { background: rgba(28, 31, 63, .08); border-color: rgba(28, 31, 63, .15); color: var(--indigo); }
.say .bubble.mine { background: var(--mint); }
.hud-mid span { background: var(--panel); border: 2px solid var(--edge); padding: 3px 8px; text-shadow: none; }
@media (max-width: 600px) {
  .dock-row { flex-wrap: wrap; }
  .dock-row .clock { flex: 1 1 100%; }
  .dock-row .btn { flex: 1; }
}

.pt.ignored .pt-label { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .7; }

.result { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 28px 24px; width: min(640px, 100%); margin-top: auto; margin-bottom: auto; }
.result .score { justify-content: center; margin: 0; }
.result .score b { font-size: clamp(96px, 18vw, 160px); }
.result .curve { width: 100%; margin: 0; }
.result .curve-h { text-align: center; font-size: 24px; }
.result .btn.wide { max-width: 420px; }
.stage:has(.result) { justify-content: center; overflow-y: auto; pointer-events: auto; }

.link-row.center { justify-content: center; margin-top: 14px; }
a.link { display: inline-flex; align-items: center; text-decoration: none; }
.link.parli { border-color: var(--mint); color: var(--mint); }

/* the board steps aside when a bubble covers it; the motion shows in the top bar instead */
.board { transition: opacity .2s; }
.board.covered { opacity: 0; }
.hud-motion { margin: 6px auto 0; max-width: min(560px, 62vw); padding: 4px 9px; background: var(--panel); border: 2px solid var(--edge); color: var(--text); font: 400 16px/1.15 var(--font); text-shadow: none; text-wrap: balance; }
/* the How it works card keeps its button in view */
.overlay-panel { max-height: calc(100dvh - 36px); }
.overlay-panel > .btn[data-close], #overlay-body > .btn.wide { position: sticky; bottom: -23px; }
/* short windows: the score screen fits without scrolling off its buttons */
@media (max-height: 640px) {
  .result { gap: 8px; padding: 14px 18px; }
  .result .score b { font-size: clamp(64px, 14vh, 110px); }
  .result .curve svg { max-height: 26vh; }
  .result .curve-h { font-size: 20px; margin-bottom: 4px; }
}
.say.lifted::after, .say.lifted::before { display: none; }

/* the research card before a round */
.research { width: min(640px, 100%); margin: auto 0; padding: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.research-h { margin: 0; color: var(--tangerine); font-size: 20px; }
.research-m { margin: 0; font: 400 clamp(28px, 4.4vw, 40px)/1.1 var(--font); text-wrap: balance; }
.research-c { margin: 0; max-width: 54ch; color: var(--dim); font-size: 20px; line-height: 1.3; text-wrap: pretty; }
.research .note { margin: 0; font-size: 18px; }
.research-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; margin-top: 4px; }
.research-actions .btn { flex: 1 1 180px; max-width: 260px; }
.stage:has(.research) { justify-content: center; overflow-y: auto; pointer-events: auto; }
.research-actions a.btn { text-decoration: none; }
.flag-notes { margin-top: 8px; display: grid; gap: 4px; }
.flag-notes p { margin: 0; font-size: .74em; line-height: 1.25; color: var(--bubble-ink, #3A3F6E); }
.flag-notes b { color: var(--indigo); font-weight: inherit; }
.dock .reread { display: block; margin: 6px auto 0; font-size: 18px; color: var(--mint); text-decoration: underline; text-underline-offset: 3px; }
.dock .dock-links .reread { margin: 0; } /* in a links row it lines up with its neighbours instead of floating lower */
.reread-m { margin: 6px 0 10px; font: 400 26px/1.15 var(--font); color: var(--text); text-wrap: balance; }
.overlay .research-actions { margin-top: 14px; position: sticky; bottom: -23px; padding: 10px 0 4px; background: var(--panel); }

/* ── the home card: one centred column, the hallway visible around it ── */
.home { width: min(560px, 100%); margin: auto 0; padding: 30px 28px 24px; text-align: center; display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.home .logo { text-align: center; }
.home .tagline { margin: 16px auto 0; max-width: 32ch; font: 400 21px/1.3 var(--font); color: var(--dim); text-align: center; }
.today { margin: 22px 0 16px; padding: 14px 16px 16px; background: var(--edge); border: 2px solid var(--hi); }
.today .note { margin: 0; }
.today-h { margin: 0 0 6px; font-size: 17px; color: var(--mint); }
.today-m { margin: 0; font-size: 25px; line-height: 1.2; color: var(--text); text-wrap: balance; }
.home .levels { display: grid; gap: 0; }
.start-note { margin: 10px 0 0; font-size: 17px; color: var(--dim); text-wrap: balance; }
.home-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.home-links .link { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 8px; font-size: 18px; text-align: center; border: 2px solid var(--hi); color: var(--text); }
.home-links .link.parli { border-color: var(--hi); color: var(--mint); }
.home .account { margin-top: 18px; justify-content: center; gap: 8px 12px; font-size: 17px; }
.home .account .note { flex-basis: auto; font-size: 16px; }
.home .gbtn { min-height: 44px; font-size: 18px; padding: 0 14px; }
.home .gbtn .g { width: 24px; height: 24px; font-size: 19px; }
.textlink { color: var(--dim); text-decoration: underline; text-underline-offset: 3px; font-size: 17px; min-height: 44px; }
.textlink:hover { color: var(--text); }
.stage:has(.home) { justify-content: center; }
@media (max-width: 520px) {
  .home { padding: 22px 16px 18px; }
  .home-links { grid-template-columns: 1fr 1fr; }
  .home-links .parli { grid-column: 1 / -1; }
  .today-m { font-size: 22px; }
}
@media (max-height: 700px) {
  .home { padding: 18px 22px 16px; }
  .home .logo { font-size: clamp(52px, 11vh, 84px); }
  .home .tagline { display: none; }
  .today { margin: 14px 0 12px; padding: 10px 14px 12px; }
  .home-links { margin-top: 14px; }
  .home .account { margin-top: 10px; }
}
.stage:has(.home) { overflow-y: auto; pointer-events: auto; }

/* ── trying palettes: a row of swatches in the top right ── */
.palettes { position: fixed; z-index: 45; top: calc(10px + env(safe-area-inset-top)); right: 62px; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--panel); border: 2px solid var(--edge); box-shadow: 0 0 0 2px var(--hi); }
.palettes .pl-name { font-size: 16px; color: var(--dim); margin-right: 4px; white-space: nowrap; }
.palettes .sw { width: 26px; height: 26px; padding: 0; display: grid; grid-template-rows: 1fr 1fr; grid-template-columns: 1fr 1fr; border: 2px solid var(--edge); cursor: pointer; }
.palettes .sw i { display: block; }
.palettes .sw i:first-child { grid-row: 1 / -1; }
.palettes .sw.on { outline: 3px solid var(--text); outline-offset: 1px; }
.palettes .pl-toggle { display: none; min-height: 36px; padding: 0 10px; font-size: 17px; color: var(--text); border: 2px solid var(--hi); }
@media (max-width: 760px) {
  .palettes { right: 58px; flex-wrap: wrap; justify-content: flex-end; max-width: calc(100vw - 120px); }
  .palettes .pl-toggle { display: inline-flex; align-items: center; }
  .palettes:not(.open) .sw, .palettes:not(.open) .pl-name { display: none; }
  .palettes.open .pl-name { flex-basis: 100%; text-align: right; }
}

/* a smaller home card */
.home { width: min(480px, 100%); padding: 22px 22px 18px; }
.home .logo { font-size: clamp(64px, 11vw, 96px); }
.today { margin: 18px 0 14px; padding: 12px 14px 14px; }
.today-m { font-size: 23px; }
.home-links { margin-top: 16px; }
.home-links .link { font-size: 17px; min-height: 42px; }
.home .account { margin-top: 12px; font-size: 16px; }

/* the title is plain text: no stacked shadow */
.logo, .home .logo { text-shadow: none; color: var(--text); }

/* black and white with yellow accents, the chosen palette (palettes.js "ink"), here too so the first paint is already right */
:root {--indigo: #161616; --panel: #161616; --night: #0F0F0F; --edge: #0A0A0A; --hi: #323232; --text: #F2F2F2; --dim: #A9A9A9; --tangerine: #FFCC00; --gold-dark: #B89300; --mint: #BDBDBD; --t0: #686868; --t1: #969696; --t2: #BDBDBD; --t3: #D7D7D7; --t4: #FFDE59; --t5: #FFCC00; --tx: #393939; --bubble-mine: #F7F7F7; --accent-ink: #735C00; --bubble-ink: #393939; --bubble-dim: #686868; }

/* the home card sits in the middle of the screen: the stage's top room is for the in-game bar, not needed here */
.stage:has(.home) { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.home { margin: auto 0; }

/* every card that isn't the game itself (home, research, score) sits in the middle of the screen */
.stage:has(.home), .stage:has(.research), .stage:has(.result) { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); justify-content: center; }
.research, .result { margin: auto 0; }
/* emphasis on the white speech bubbles and the whiteboard: a yellow highlight, never the accent colour (white in this palette) */
:root { --mark: #FFCC00; }
.say b { color: var(--bubble-ink, #161616); background: var(--mark); padding: 0 .15em; }
.board span { color: var(--bubble-dim, #6B6B6B); }

/* ── the score chart ── */
.c-mine { fill: var(--tangerine); }
.c-thin { fill: none; stroke: var(--text); stroke-width: 2; } .c-shade { fill: var(--tangerine); opacity: .22; } .c-mark-thin { stroke: var(--tangerine); stroke-width: 2; }
.c-you-lab { fill: var(--tangerine); font: 400 22px var(--font); }
.curve-note { margin: -4px 0 6px; font-size: 17px; color: var(--dim); text-align: center; }

/* ── your stats: the big card ── */
#practice-slot { width: 100%; display: flex; flex-direction: column; align-items: center; }
#practice-slot .btn.wide { width: 100%; max-width: 420px; }
.statscard { width: min(820px, 100%); margin: auto; padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; pointer-events: auto; }
.stage:has(.statscard) { justify-content: center; overflow-y: auto; pointer-events: auto; }
.st-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.st-top .link { justify-self: start; white-space: nowrap; }
.st-title { margin: 0; font: 400 34px/1 var(--font); color: var(--text); }
.st-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.st-nums div { padding: 12px 10px; text-align: center; border: 2px solid var(--hi); }
.st-nums b { display: block; font: 400 40px/1 var(--font); color: var(--tangerine); }
.st-nums span { font-size: 16px; color: var(--dim); }
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.st-box { padding: 14px 16px; border: 2px solid var(--hi); min-width: 0; }
.st-box h3 { margin: 0 0 12px; font: 400 19px/1.2 var(--font); color: var(--dim); }
.st-bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 18px; }
.st-bar { position: relative; flex: 1; max-width: 34px; background: #4A4A4A; }
.st-bar.now { background: var(--tangerine); }
.st-bar span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--dim); white-space: nowrap; }
.st-meter { height: 18px; border: 2px solid var(--hi); }
.st-fill { height: 100%; background: var(--tangerine); }
.st-big { margin: 8px 0 0; font: 400 40px/1 var(--font); color: var(--text); }
.st-big small { font-size: 18px; color: var(--dim); }
.st-small { margin: 8px 0 0; font-size: 16px; color: var(--dim); }
.st-small.center { text-align: center; }
.st-stack { display: flex; height: 22px; border: 2px solid var(--hi); }
.st-stack i { display: block; min-width: 4px; }
.st-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 16px; color: var(--text); }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 12px; height: 12px; display: inline-block; }
.st-kind { display: grid; grid-template-columns: minmax(0, 190px) 1fr 28px; align-items: center; gap: 8px; margin: 6px 0; font-size: 16px; }
.st-kind div { height: 12px; background: var(--night); }
.st-kind i { display: block; height: 100%; background: var(--text); }
.st-kind b { font-weight: 400; color: var(--dim); text-align: right; }
@media (max-width: 640px) {
  .statscard { padding: 16px; }
  .st-nums { grid-template-columns: repeat(2, 1fr); }
  .st-grid { grid-template-columns: 1fr; }
}
.st-grid { margin-top: 12px; }
.stage:has(.statscard) { padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
.statscard { max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }

/* ── settings ── */
.settings { gap: 12px; }
.faces { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.face { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; background: var(--night); border: 2px solid var(--hi); color: var(--text); font: 400 16px/1 var(--font); cursor: pointer; }
.face canvas { width: 100%; max-width: 88px; height: auto; image-rendering: pixelated; }
.face.on { border-color: var(--tangerine); box-shadow: 0 0 0 2px var(--tangerine); }
.face:focus-visible { outline: 3px solid var(--text); outline-offset: 2px; }
.name-row { display: flex; gap: 8px; }
.name-row input { flex: 1; min-width: 0; padding: 10px 12px; font: 400 18px var(--font); color: var(--text); background: var(--night); border: 2px solid var(--hi); }
.name-row input:focus { outline: none; border-color: var(--tangerine); }
@media (max-width: 640px) { .faces { grid-template-columns: repeat(3, 1fr); } }
.home-links { grid-template-columns: 1fr 1fr; }
.home-links .parli { grid-column: auto; }
#home-practice { margin-top: 10px; }
.home-modes #home-practice { margin-top: 0; } /* the grid's own gap spaces it; the margin skewed it 10px below its neighbours */

/* other ways to answer an argument */
.answers { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.answers li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; background: rgba(0, 0, 0, .05); font-size: 17px; line-height: 1.25; color: var(--bubble-ink); }
.answers li.best { background: color-mix(in srgb, var(--tangerine) 30%, transparent); }
.answers li em { font-style: normal; font-size: 14px; padding: 1px 5px; background: var(--bubble-ink); color: #fff; }
.answers .tierchip { flex: none; font-size: 14px; }
.overlay .answers li { color: var(--text); background: rgba(255, 255, 255, .06); }

/* caught using AI: a red stamp slams onto the screen */
.aicaught { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; text-align: center;
  background: rgba(10, 10, 10, .88); animation: ai-dim .25s ease-out both, ai-shake .45s .55s steps(6) both; }
.ai-stamp { margin: 0 0 30px; font: 400 clamp(56px, 13vw, 150px)/1 var(--font); color: #FF3B3B; letter-spacing: .04em; padding: 10px 26px 16px; border: 10px solid #FF3B3B; transform: rotate(-8deg);
  text-shadow: 6px 6px 0 #5A0E0E; box-shadow: 6px 6px 0 #5A0E0E, inset 0 0 0 4px rgba(255, 59, 59, .25); animation: ai-stamp .5s .2s cubic-bezier(.2, 1.6, .4, 1) both; }
.ai-line { margin: 0; max-width: 520px; font-size: 24px; color: var(--text); animation: ai-up .3s 1.1s both; }
.ai-leave { max-width: 360px; animation: ai-up .3s 1.4s both; }
.link.ai-leave { margin-top: -8px; }
@keyframes ai-dim { from { background: rgba(10, 10, 10, 0); } }
@keyframes ai-stamp { from { transform: rotate(-8deg) scale(3.2); opacity: 0; } 60% { opacity: 1; } to { transform: rotate(-8deg) scale(1); } }
@keyframes ai-shake { 0%, 100% { transform: translate(0, 0); } 20% { transform: translate(-8px, 4px); } 40% { transform: translate(7px, -5px); } 60% { transform: translate(-5px, -3px); } 80% { transform: translate(4px, 3px); } }
@keyframes ai-up { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { .aicaught, .ai-stamp, .ai-line, .ai-leave { animation: none; } }

/* asking a guest for a name after their first game */
.name-ask { width: 100%; max-width: 420px; display: grid; gap: 8px; text-align: left; }
.name-ask label { font-size: 18px; color: var(--text); }

/* the score card fits the screen: it never scrolls, it shrinks */
.result { max-height: none; overflow: visible; gap: clamp(6px, 1.6vh, 16px); padding: clamp(14px, 2.6vh, 28px) 24px; }
.result .score b { font-size: clamp(52px, 13vh, 150px); }
.result .curve svg { max-height: 24vh; }
.result .curve-h { margin: 0; font-size: clamp(17px, 2.6vh, 24px); }
.result .btn.wide { min-height: clamp(42px, 6.4vh, 56px); }
.result .link-row .link { min-height: clamp(32px, 4.6vh, 40px); }
/* finished for the day: score and curve on the home card */
.home-done { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.home-score { justify-content: center; margin: 0; }
.home-score b { font-size: clamp(48px, 9vh, 84px); }
.home-score span { font-size: 20px; }
.home-curve { width: 100%; margin: 0; }
.home-curve .curve-h { margin: 0 0 4px; text-align: center; font-size: 18px; }
.home-curve svg { max-height: 17vh; }
.home { max-height: none; overflow: visible; }

/* the finished-day home card grows with the score and curve, so everything on it scales with the screen's height */
.home.done { padding-top: clamp(10px, 2vh, 26px); padding-bottom: clamp(10px, 2vh, 28px); }
.home.done .logo { margin: 0; font-size: clamp(36px, 7vh, 80px); line-height: 1; }
.home.done .today { margin-top: clamp(6px, 1.4vh, 16px); padding: clamp(6px, 1.2vh, 14px) 12px; }
.home.done .today-m { font-size: clamp(15px, 2.3vh, 20px); }
.home.done .levels { margin-top: clamp(6px, 1.2vh, 14px); }
.home.done .home-done { gap: clamp(4px, 1vh, 10px); }
.home.done .home-score b { font-size: clamp(36px, 7vh, 72px); }
.home.done .home-curve .curve-h { font-size: clamp(14px, 2vh, 18px); }
.home.done .home-curve svg { max-height: 15vh; }
.home.done #home-practice { min-height: clamp(40px, 6vh, 56px); margin-top: 4px; }
.home.done .home-modes #home-practice { margin-top: 0; } /* in the modes row it must line up with its neighbours */
.home.done .home-links { margin-top: clamp(8px, 1.4vh, 22px); gap: 6px; }
.home.done .home-links .link { min-height: clamp(32px, 4.8vh, 44px); }
.home.done .account { margin-top: clamp(6px, 1.2vh, 16px); }
@media (max-height: 700px) { .home.done .account .note { display: none; } }
/* the motion reads big on the home card; the four small links sit on one line */
.home .home-links, .home.done .home-links { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.home .home-links .link { padding: 0 4px; font-size: clamp(14px, 1.9vh, 17px); line-height: 1.1; }
.home .home-links .parli { grid-column: auto; }
.home .home-links .link { font-size: clamp(15px, 2.1vh, 19px); }

/* finished-day home: a wider card and a bigger curve */
.home.done { width: min(600px, 100%); }
.home.done .home-curve svg { max-height: 27vh; }
.home.done .home-curve .curve-h { font-size: clamp(16px, 2.4vh, 21px); }
.home.done .account .note { display: none; }
/* the motion reads big on the home card; the four small links sit on one line */
.home .today-m { font-size: clamp(26px, 4.6vh, 40px); }
.home.done .today-m { font-size: clamp(22px, 3.6vh, 32px); }
.home .today-h { font-size: clamp(22px, 3.8vh, 34px); line-height: 1.1; margin: 0 0 4px; color: var(--tangerine); }
.home.done .today-h { font-size: clamp(18px, 3vh, 28px); }

/* the name asked for before the first score */
.name-gate .name-row { width: 100%; max-width: 460px; }
.name-gate .research-m { margin: 0; }

/* Practice opens into Case and Theory side by side */
.practice-pick { width: 100%; max-width: 420px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.home-done .practice-pick { max-width: none; }
.home.done .practice-pick .btn { min-height: clamp(40px, 6vh, 56px); }

/* the countdown to the next motion */
.next-drop { margin: 0; font-size: clamp(15px, 2.2vh, 19px); color: var(--dim); text-align: center; }
.next-drop b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: inherit; }
@media (max-height: 700px) {
  .home.done .home-curve svg { max-height: 19vh; }
  .home.done .today-m { font-size: clamp(17px, 2.8vh, 24px); }
  .home.done .today-h { font-size: clamp(15px, 2.4vh, 22px); }
  .home.done .logo { font-size: clamp(30px, 6vh, 60px); }
}

.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 18px; }
.acct-row b { color: var(--tangerine); font-weight: inherit; }
.settings .gbtn { margin-top: 10px; }

/* colour choice in settings */
.swatches { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 2px; background: var(--night); border: 2px solid var(--hi); color: var(--text); font: 400 14px/1 var(--font); cursor: pointer; }
.swatch i { width: 28px; height: 28px; background: var(--c); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .25); }
.swatch.on { border-color: var(--c); box-shadow: 0 0 0 2px var(--c); }
@media (max-width: 640px) { .swatches { grid-template-columns: repeat(4, 1fr); } }

/* Deep Dive button: the mode's name, and what it is in small type */
.deep-btn { margin-top: 10px; flex-wrap: wrap; gap: 4px 10px; }
.deep-sub { font-size: 0.62em; color: var(--dim); }
.home.done .deep-btn { margin-top: 6px; min-height: clamp(40px, 6vh, 56px); }

/* building choice in settings */
.bpick { display: flex; flex-wrap: wrap; gap: 8px; }
.bpick .bp.on, .bpick .tp.on { background: var(--tangerine); color: var(--indigo); border-color: var(--tangerine); }
/* a small label over a picker row (the duel format card) */
.pick-h { margin: 14px 0 8px; font-size: 16px; color: var(--dim); }
.st-box h3 + .pick-h { margin-top: 0; }
#duel-est { margin: 12px 0; }
.duel-fmt { margin-top: 10px; }
/* format pickers: equal-width cells in clean rows, instead of ragged content-sized buttons */
#duel-secs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
#duel-rounds { display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
#duel-secs .link, #duel-rounds .link { padding: 0 4px; display: inline-flex; align-items: center; justify-content: center; text-align: center; }
@media (max-width: 540px) {
  #duel-secs { grid-template-columns: repeat(3, 1fr); }
  #duel-rounds { grid-template-columns: repeat(4, 1fr); }
}

/* the topic card's way back home */
.research-back { align-self: flex-start; margin: -6px 0 -4px -4px; }

/* one-time notice: centred, dims everything, closes only with its button */
.notice { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(14, 11, 26, .82); }
.notice-panel { width: min(460px, 100%); padding: 26px 24px 24px; text-align: center; display: flex; flex-direction: column; gap: 12px; border: 3px solid var(--gold); animation: panelIn .3s var(--step) both; }
.notice-new { margin: 0 auto; padding: 2px 10px; background: var(--gold); color: #000; font: 700 18px/1.3 var(--font); }
.notice-h { margin: 0; font: 700 34px/1.05 var(--font); color: var(--gold); text-wrap: balance; }
.notice-p { margin: 0; font: 500 21px/1.35 var(--font); text-wrap: pretty; }
.notice .btn { margin-top: 6px; }

/* sign in / sign up */
.signin .st-box { display: flex; flex-direction: column; gap: 12px; }
.si-or { margin: 2px 0 0; text-align: center; color: var(--dim); font-size: 17px; }
.si-form { display: flex; flex-direction: column; gap: 12px; }
.si-form label { display: flex; flex-direction: column; gap: 6px; font-size: 18px; color: var(--dim); }
.si-form input { padding: 11px 12px; font: 400 20px var(--font); color: var(--text); background: var(--night); border: 2px solid var(--hi); }
.si-form input:focus { outline: none; border-color: var(--tangerine); }
.si-code { font-size: 32px !important; letter-spacing: .3em; text-align: center; }
.si-msg { min-height: 1.3em; margin: 0; }
.si-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.si-lead { margin: 0; font-size: 19px; }
.si-lead b { color: var(--tangerine); font-weight: inherit; }

/* the offer to switch to Novice, above the next button */
.dock-note { grid-column: 1 / -1; margin: 0; font-size: 19px; line-height: 1.3; color: var(--text); text-align: center; }
.dock-row .btn.wide { flex: 1; }

/* sent early on the daily argument: a reminder that there's time for more */
.early { position: fixed; z-index: 30; left: 50%; bottom: calc(190px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(480px, calc(100% - 32px)); padding: 18px 20px; text-align: center; display: flex; flex-direction: column; gap: 8px; border: 3px solid var(--gold); animation: panelIn .2s var(--step) both; }
.early-h { margin: 0; font-size: 24px; }
.early-h b { color: var(--gold); font-weight: inherit; }
.early-p { margin: 0; font-size: 19px; line-height: 1.3; color: var(--dim); }
.early-row { display: flex; gap: 10px; justify-content: center; margin-top: 4px; }
.early-row .btn { flex: 1; }

/* Speed Parli: live duels */
.duel-card { text-align: center; align-items: center; }
.duel-card .st-top { width: 100%; gap: 12px; }
.duel-menu { width: min(520px, 100%); }
.duel-menu .st-title { font-size: 27px; }
.duel-card .research-m, .duel-card .research-c { margin-left: auto; margin-right: auto; }
.duel-card .st-box { width: 100%; }
.duel-card .start-note { max-width: 52ch; }
.duel-sides { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; align-items: baseline; font: 600 21px/1.3 var(--font); }
.duel-sides b { color: var(--gold); font-weight: inherit; }
.duel-vs { color: var(--dim); font-size: 18px; }
.duel-code { font: 700 clamp(44px, 9vw, 72px)/1 var(--font); letter-spacing: .16em; color: var(--gold); text-shadow: 4px 4px 0 var(--edge); padding-left: .16em; }
#duel-code-in { text-transform: uppercase; letter-spacing: .14em; }
.duel-win { font: 400 clamp(42px, 8vw, 68px)/1 var(--font); color: var(--gold); text-shadow: 4px 4px 0 var(--edge); }
.duel-score-line { margin: 0; font: 600 24px/1.2 var(--font); }
.duel-score-line b { color: var(--gold); }
.duel-flow { display: grid; gap: 10px; width: 100%; text-align: left; overflow-y: auto; min-height: 0; }
.duel-round { border: 2px solid var(--hi); background: rgba(255, 255, 255, .04); padding: 10px 12px; }
.duel-ph { display: flex; justify-content: space-between; font: 600 17px/1 var(--font); color: var(--dim); }
.duel-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.duel-ans { font: 500 18px/1.3 var(--font); color: var(--text); max-height: 7.8em; overflow-y: auto; min-width: 0; }
.duel-ans b { display: block; color: var(--gold); margin-bottom: 2px; }
@media (max-width: 560px) { .duel-two { grid-template-columns: 1fr; } }
.home-duo { display: flex; gap: 10px; margin-top: 10px; align-items: stretch; width: 100%; }
.home-duo #home-practice, .home.done .home-duo #home-practice { margin-top: 0; min-height: 0; }
.home-duo > * { flex: 1; min-width: 0; }
.home-duo .practice-pick { display: flex; gap: 10px; }
.home-duo .practice-pick > * { flex: 1; min-width: 0; }
@media (max-width: 540px) { .home-duo { flex-direction: column; } }
.home-duo .btn { min-height: 48px; font-size: 19px; padding: 4px 12px; line-height: 1.1; }
.home-duo .deep-sub { display: none; }
/* The three secondary modes under the daily: The Block, Multiplayer, Regular practice. */
/* A grid of three equal cells that all stretch to the same height; each cell's button fills it. */
.home-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; align-items: stretch; width: 100%; }
.home-modes > * { min-width: 0; }
.home-modes .practice-pick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; max-width: none; }
/* All three secondary modes are the same button: equal width, equal height, one line each. */
.home-modes .btn { min-height: 56px; height: auto; width: 100%; font-size: clamp(16px, 2.1vw, 19px); padding: 4px 10px; line-height: 1.1; white-space: nowrap; }
/* the Practice button sits inside its picker div: stretch both so all three buttons match */
.home-modes .practice-pick { height: 100%; }
.home-modes .practice-pick .btn { height: 100%; }
.home-modes .deep-sub { display: none; }
.home.done .home-modes .btn { min-height: clamp(44px, 6vh, 56px); }
/* The Block's score (once played) in the accent colour; the button itself matches the others exactly. */
.home-modes .btn b { color: var(--tangerine); font-weight: inherit; }
/* Practice opened: its three choices and Back fill the row in place of the other two modes. */
.home-modes.picking > :not(#home-practice) { display: none; }
.home-modes.picking #home-practice { grid-column: 1 / -1; grid-auto-flow: unset; grid-template-columns: repeat(3, 1fr) auto; }
.practice-pick { grid-template-columns: repeat(3, 1fr) auto; grid-auto-flow: unset; }
.practice-pick:has(> :only-child) { grid-template-columns: 1fr; }
.practice-pick .pick-back { width: auto; padding-inline: 14px; }
/* phones: The Block and Multiplayer side by side, Practice full width under them */
@media (max-width: 540px) {
  .home-modes { grid-template-columns: 1fr 1fr; }
  .home-modes #home-practice { grid-column: 1 / -1; }
  .home-modes .btn { min-height: 52px; font-size: 18px; }
}
/* hovering the dark home buttons lights them in the accent colour */
@media (hover: hover) {
  .home-duo .btn.dark:hover, .home-modes .btn.dark:hover { background: var(--gold); color: var(--indigo); box-shadow: inset 0 -5px 0 var(--gold-dark), inset 0 3px 0 color-mix(in srgb, var(--gold) 60%, white), 0 0 0 3px var(--edge); }
}

/* The shared 3-2-1 before a duel round: both screens open the round at the same instant. */
.duel-count-card { align-items: center; text-align: center; }
.duel-count { font: 700 84px/1 var(--font); color: var(--gold); margin: 20px 0 10px; min-height: 84px; }

/* The lobby before the opponent joins: the motion stays hidden so the host can't prep early. */
.duel-hidden { color: var(--dim); }

/* "Sending to the judge… Wait, take it back": the undo sits right in the dock message line. */
.undo-send { margin-left: 10px; min-height: 44px; display: inline-flex; align-items: center; }

/* Your own last arguments above the opponent's, so a turn is read next to the point it turned. */
.duel-yours { margin: 8px 0 0; font: 500 18px/1.4 var(--font); color: var(--dim); }
.duel-yours b { color: var(--text); }

/* The end screen: each answer as its scored arguments (the voters), exact words behind one tap. */
.duel-voters { margin: 4px 0 0; padding: 0; list-style: none; }
.duel-voters li { margin: 4px 0; font: 500 18px/1.3 var(--font); }
.duel-voters i { font-style: normal; color: var(--gold); margin-right: 8px; }
.duel-ans-note { margin: 4px 0 0; font: 500 18px/1.3 var(--font); color: var(--dim); }
.duel-exact { margin: 8px 0 0; min-height: 44px; display: inline-flex; align-items: center; }
.duel-exact-text { margin: 8px 0 0; font: 500 17px/1.4 var(--font); color: var(--dim); }
.duel-exact-text p { margin: 6px 0; }
.duel-exact-text b { color: var(--text); }

/* Speed Parli cards appear without the fade: iPhone Safari could leave them stuck on the fade's last step, a
   quarter see-through over the room. And on a phone the lobby fits on one screen, Ready button included. */
.duel-card.enter { animation: none; }
@media (max-width: 640px), (max-height: 760px) {
  .duel-card { gap: 10px; }
  .duel-card .st-title { font-size: 26px; }
  .duel-card .research-h { margin: 0; }
  .duel-card .research-m { font-size: 24px; line-height: 1.15; }
  .duel-card .research-c { font-size: 16px; line-height: 1.3; }
  .duel-card { padding-top: 12px; padding-bottom: 14px; }
  .duel-card .duel-sides { font-size: 16px; gap: 4px 8px; }
  .duel-card .duel-vs { font-size: 14px; }
  .duel-card .research-m { font-size: 22px; }
  .duel-card .duel-ready-hint { display: none; }
  .duel-card .st-small { margin: 0; font-size: 15px; }
  .duel-card .btn { min-height: 50px; font-size: 22px; }
  .duel-card .link-row { margin: 0; }
  .duel-card .link-row .link { padding: 6px 12px; font-size: 16px; }
}

/* ---------- 1v1: Play queue, per-turn payoff, one-line answers ---------- */
.duel-friend-row { margin: 8px 0 0; text-align: center; }
.duel-friend-row .link { font-size: 15px; }
.q-count { animation: bump 1s steps(2, end) infinite; }
.duel-count-m { margin: 8px 0 2px; }
.duel-count-side { color: var(--dim); margin: 0 0 4px; font-size: 17px; }
.duel-count-side b { color: var(--text); }
.payoff { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin: 6px 0 4px; }
.po-side { background: var(--hi); border: 2px solid var(--edge); padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.payoff.won .po-side:first-child, .payoff.lost .po-side:last-child { border-color: var(--gold); }
.po-who { color: var(--dim); font-size: 15px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.po-n { font: 700 44px/1 var(--font); color: var(--gold); }
.po-n.bump { animation: bump 0.35s var(--step); }
.po-why { font-size: 14px; color: var(--text); line-height: 1.25; }
.po-total { color: var(--dim); margin: 2px 0 0; font-size: 15px; }
.score-pop { position: fixed; z-index: 60; transform: translate(-50%, 0); pointer-events: none; display: flex; flex-direction: column; align-items: center;
  animation: scorePop 2.6s steps(26, end) forwards; text-align: center; }
.score-pop b { font: 700 54px/1 var(--font); color: var(--gold); text-shadow: 3px 3px 0 var(--edge); }
.score-pop.meh b { color: var(--text); }
.score-pop span { margin-top: 4px; background: var(--edge); color: var(--text); padding: 3px 8px; font-size: 16px; white-space: nowrap; }
@keyframes scorePop { 0% { opacity: 0; transform: translate(-50%, 16px) scale(0.6); } 10% { opacity: 1; transform: translate(-50%, 0) scale(1.15); } 18% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; transform: translate(-50%, -26px); } 100% { opacity: 0; transform: translate(-50%, -40px); } }
.word-count { margin: 2px 0 0; text-align: right; font-size: 14px; color: var(--dim); }
.word-count.full { color: var(--gold); }
#hud-where.bump { animation: bump 0.5s var(--step); display: inline-block; }
@media (prefers-reduced-motion: reduce) { .score-pop, .q-count, .po-n.bump, #hud-where.bump { animation: none; } }

/* ---------- Home as a scrolling feed of small cards (Nov 9) ---------- */
.stage:has(.home-feed) { justify-content: flex-start; overflow-y: auto; pointer-events: auto; padding-top: calc(14px + env(safe-area-inset-top)); }
.home-feed { width: min(560px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; }
.feed-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; }
.feed-top .logo, .home-feed .logo { font-size: 40px; line-height: 1; margin: 0; text-align: left; }
.feed-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.feed-links .link { font-size: 15px; padding: 5px 9px; min-height: 0; border: 2px solid var(--hi); color: var(--text); text-decoration: none; }
.home-feed .hcard { width: 100%; margin: 0; padding: 12px 14px; text-align: left; display: block; }
.hcard-h { margin: 0; font-size: 18px; line-height: 1.1; color: var(--gold); }
.hcard-d { margin: 3px 0 0; font-size: 15px; line-height: 1.25; color: var(--dim); }
.hcard-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hcard-t { min-width: 0; }
.hcard-b { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.home-feed .hcard-b .btn { width: auto; min-height: 40px; padding: 0 16px; font-size: 17px; }
.home-feed .hcard-b .link { font-size: 14px; }
.home-feed .practice-pick { width: auto; max-width: none; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.home-feed .home.hcard .today { margin: 6px 0 10px; padding: 8px 12px 10px; }
.home-feed .home.hcard .today-h { display: none; }
.home-feed .home.hcard .today-m { font-size: 21px; }
.home-feed .home.hcard .start { min-height: 44px; font-size: 18px; }
.home-feed .feed-account { margin: 0; padding: 8px 14px; justify-content: center; font-size: 14px; gap: 6px 10px; }
.home-feed .feed-account .note { flex-basis: auto; font-size: 13px; }
.home-feed .feed-account .btn { min-height: 34px; font-size: 15px; padding: 0 12px; }
@media (max-width: 480px) {
  .feed-top .logo, .home-feed .logo { font-size: 32px; }
  .feed-links .link { font-size: 13px; padding: 4px 7px; }
  .home-feed .home.hcard .today-m { font-size: 19px; }
}
.hcard-row:has(.pick-back) { flex-wrap: wrap; }
.hcard-row:has(.pick-back) .hcard-b { width: 100%; }
.hcard-row:has(.pick-back) .hcard-b .btn { flex: 1; padding: 0 8px; }
@media (max-width: 600px) { .home-feed .feed-top { margin-right: 50px; } }
@media (max-width: 480px) {
  .feed-links { flex-wrap: nowrap; gap: 4px; }
  .feed-links .link { font-size: 13px; padding: 4px 7px; white-space: nowrap; }
  .feed-top .logo, .home-feed .logo { font-size: 28px; }
  .feed-top { padding: 8px 10px; }
}
.live-n { margin-left: 8px; font-size: 13px; color: var(--mint); vertical-align: middle; }

/* ---------- Home: pixel icons and chunkier pixel cards (Nov 9) ---------- */
.picon { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.ibox { flex: 0 0 auto; width: 44px; height: 44px; padding: 5px; display: inline-block; background: var(--edge); border: 2px solid var(--hi);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,0.08), inset -2px -2px 0 rgba(0,0,0,0.35); }
.home-feed .hcard-row { justify-content: flex-start; }
.home-feed .hcard-row .hcard-t { flex: 1; }
.home-feed .home.hcard .hcard-h { display: flex; align-items: center; gap: 10px; }
.home-feed .home.hcard .ibox { width: 34px; height: 34px; padding: 4px; }
.home-feed .hcard { position: relative; }
.home-feed .hcard:nth-of-type(1) .ibox { border-color: var(--gold); }
.home-feed .hcard:nth-of-type(2) .ibox { border-color: var(--mint); }
.home-feed .hcard:nth-of-type(3) .ibox { border-color: var(--gold-dark); }
.home-feed .hcard:nth-of-type(4) .ibox { border-color: #E5484D; }
.home-feed .hcard-h { font-size: 20px; text-shadow: 2px 2px 0 var(--edge); }
.feed-top .logo { display: flex; align-items: center; gap: 10px; color: var(--gold); text-shadow: 3px 3px 0 var(--edge), 6px 6px 0 rgba(0,0,0,.25); letter-spacing: .04em; }
.logo-icon { width: 40px; height: 30px; filter: drop-shadow(2px 2px 0 var(--edge)); }
.home-feed .feed-top { background-image: repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,0.025) 22px 24px); }
@media (max-width: 480px) {
  .ibox { width: 38px; height: 38px; padding: 4px; }
  .logo-icon { width: 26px; height: 20px; }
}
.home-feed .hcard-row { flex-wrap: wrap; }
.home-feed .hcard-row .hcard-t { min-width: 170px; }
@media (max-width: 480px) { .home-feed .hcard-row:has(#duel-go) .hcard-b { width: 100%; } .home-feed .hcard-row:has(#duel-go) .hcard-b .btn { flex: 1; } }
.home-feed .hcard-row .hcard-b { margin-left: auto; }
.confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; display: block; box-shadow: 2px 2px 0 rgba(0,0,0,.35); animation-name: confettiFall; animation-timing-function: steps(18, end); animation-fill-mode: forwards; }
@keyframes confettiFall { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(var(--drift), 110vh) rotate(360deg); } }
.streak { margin-left: auto; font-size: 14px; color: var(--gold); text-shadow: none; background: var(--edge); border: 2px solid var(--gold-dark); padding: 2px 8px; }

/* ---------- Pixel-art detail for the whole interface (Nov 9, user: "the rest of the game, the other UI") ----------
   Every panel gets a bevel (lit top-left, shaded bottom-right), a fine 2px dither and corner rivets; buttons get a
   pixel glint and lift on hover; bubbles, the HUD, the clock, score rows, toasts and the overlay scrim match. */
:root { --rivet: color-mix(in srgb, var(--hi) 70%, white 10%); }
.panel {
  background-color: var(--panel);
  background-image:
    linear-gradient(var(--rivet), var(--rivet)), linear-gradient(var(--rivet), var(--rivet)),
    linear-gradient(var(--rivet), var(--rivet)), linear-gradient(var(--rivet), var(--rivet)),
    repeating-conic-gradient(rgba(255,255,255,.028) 0 25%, transparent 0 50%);
  background-size: 4px 4px, 4px 4px, 4px 4px, 4px 4px, 4px 4px;
  background-position: 9px 9px, calc(100% - 9px) 9px, 9px calc(100% - 9px), calc(100% - 9px) calc(100% - 9px), 0 0;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 rgba(0,0,0,.38), 0 6px 0 rgba(0,0,0,.35);
}
/* buttons: a two-pixel glint in the top-left, a lift on hover, a press on click */
.btn { background-image: linear-gradient(rgba(255,255,255,.6), rgba(255,255,255,.6)), linear-gradient(rgba(255,255,255,.6), rgba(255,255,255,.6));
  background-size: 8px 3px, 3px 8px; background-position: 6px 6px, 6px 6px; background-repeat: no-repeat; }
.btn.dark { background-image: linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,.22)), linear-gradient(rgba(255,255,255,.22), rgba(255,255,255,.22)); background-size: 8px 3px, 3px 8px; background-position: 6px 6px, 6px 6px; background-repeat: no-repeat; }
@media (hover: hover) { .btn:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.06); } }
.btn:not(:disabled):active { transform: translateY(3px); filter: none; }
/* speech bubbles: stepped corners, an inner rule and a stepped tail */
.say-inner { clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px));
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.06), inset 0 -4px 0 rgba(0,0,0,.08);
  background-image: repeating-conic-gradient(rgba(0,0,0,.022) 0 25%, transparent 0 50%); background-size: 4px 4px; }
.say::after { clip-path: polygon(0 0, 100% 0, 100% 25%, 78% 25%, 78% 50%, 56% 50%, 56% 75%, 34% 75%, 34% 100%, 18% 100%, 18% 0); }
/* HUD boxes match the panels */
.hud-box { box-shadow: inset 3px 3px 0 var(--hi), inset -3px -3px 0 rgba(0,0,0,.38), 0 4px 0 rgba(0,0,0,.3);
  background-image: repeating-conic-gradient(rgba(255,255,255,.028) 0 25%, transparent 0 50%); background-size: 4px 4px; }
/* the clock: each block is a lit pixel tile */
.clock-blocks { box-shadow: inset 0 2px 0 rgba(0,0,0,.4); }
.clock-blocks i { box-shadow: inset 0 3px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(0,0,0,.25), inset 3px 0 0 rgba(255,255,255,.12); }
/* scored rows: bevelled tiles with a gold notch */
.pt { box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -2px -2px 0 rgba(0,0,0,.25); position: relative; }
.pt:not(.off)::before { content: ""; position: absolute; left: -2px; top: 8px; width: 4px; height: 12px; background: var(--gold); }
.toast { box-shadow: inset 3px 3px 0 rgba(255,255,255,.35), inset -3px -3px 0 rgba(0,0,0,.2), 0 5px 0 rgba(0,0,0,.35); }
/* the dimmed backdrop behind popups is a pixel dither, not a flat tint */
.overlay-scrim { background: repeating-conic-gradient(rgba(14,11,26,.82) 0 25%, rgba(14,11,26,.62) 0 50%) 0 0 / 4px 4px; }
/* headings get a hard pixel drop shadow */
.ov-title, .st-title, .research-m, .duel-win { text-shadow: 3px 3px 0 var(--edge); }
.research-h, .hcard-h { letter-spacing: .03em; }
/* text boxes: inset bevel */
.dock textarea, .name-row input { box-shadow: inset 3px 3px 0 rgba(0,0,0,.35), inset -2px -2px 0 rgba(255,255,255,.05); }
.duel-rec { display: block; margin-top: 3px; color: var(--text); } .duel-rec b { color: var(--gold); }
.dock-meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; grid-column: 1 / -1; margin-top: 2px; }
.dock-meta .word-count { margin: 0; }
.opp-status { font-size: 14px; color: var(--dim); }
.opp-status i { font-style: normal; animation: dots 1.2s steps(1, end) infinite; }
.opp-status i:nth-child(2) { animation-delay: .2s; } .opp-status i:nth-child(3) { animation-delay: .4s; }
.opp-status.done { color: var(--mint); }
@keyframes dots { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .opp-status i { animation: none; } }
.how-ctas { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; } @media (max-width: 420px) { .how-ctas { grid-template-columns: 1fr; } }
.duel-squares { margin: 4px 0 10px; text-align: center; font-size: 26px; letter-spacing: 4px; }
.duel-squares span { display: inline-block; animation: sqIn .4s steps(4, end) both; }
@keyframes sqIn { from { transform: scale(0); } 70% { transform: scale(1.25); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .duel-squares span { animation: none; } }
.top5 { margin: 10px 0 4px; background: var(--edge); border: 2px solid var(--hi); padding: 8px 12px; }
.top5-h { margin: 0 0 4px; font-size: 15px; color: var(--gold); }
.top5 ol { margin: 0; padding-left: 22px; font-size: 16px; }
.top5 li { padding: 1px 0; }
.top5 li > * { vertical-align: middle; }
.top5 li { display: list-item; }
.top5 li span { display: inline-block; min-width: 70%; }
.top5 li b { float: right; color: var(--gold); }
.top5 li.you span { color: var(--gold); }
.top5 { width: 100%; box-sizing: border-box; align-self: stretch; text-align: left; } .top5 li b { margin-left: 10px; }
.gs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.gs-tile { background: var(--edge); border: 2px solid var(--hi); padding: 10px; text-align: center; box-shadow: inset 2px 2px 0 rgba(255,255,255,.05), inset -2px -2px 0 rgba(0,0,0,.3); }
.gs-tile b { display: block; font: 700 40px/1 var(--font); color: var(--gold); text-shadow: 2px 2px 0 var(--edge); }
.gs-tile span { font-size: 15px; color: var(--dim); }
.streak.risk { color: #FF8C7F; border-color: #E5484D; animation: bump 1.4s steps(2, end) 2; }
.q-tip { margin: 6px 0 10px; font-size: 15px; color: var(--text); background: var(--edge); border: 2px solid var(--hi); padding: 6px 10px; } .q-tip b { color: var(--gold); }
/* Play a friend: time and rounds pickers each fit on one row of even pixel chips */
.duel-menu .bpick { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.duel-menu .bpick .tp { min-width: 0; padding: 8px 0; text-align: center; font-size: 17px; box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -2px -2px 0 rgba(0,0,0,.3); }
.duel-menu .bpick .tp.on { box-shadow: inset 0 -3px 0 var(--gold-dark); }
@media (max-width: 420px) { .duel-menu .bpick .tp { font-size: 15px; padding: 7px 0; } }
/* Before a round: which side you're on, and the background as a readable box instead of a centred wall */
.research-side { margin: 6px auto 10px; display: inline-block; padding: 4px 12px; background: var(--edge); border: 2px solid var(--gold-dark); font-size: 17px; color: var(--dim); }
.research-side b { color: var(--gold); letter-spacing: .04em; }
.research-bg { text-align: left; background: var(--edge); border: 2px solid var(--hi); padding: 8px 12px 10px; margin: 4px 0 12px; box-shadow: inset 2px 2px 0 rgba(0,0,0,.3); }
.research-bg > span { display: block; font-size: 14px; color: var(--gold); margin-bottom: 2px; }
.research-bg .research-c { text-align: left; margin: 0; max-width: none; font-size: 16px; line-height: 1.45; }
/* Phones: the links under the answer box sit on one compact row instead of wrapping to two */
@media (max-width: 480px) {
  .dock .dock-links { flex-wrap: nowrap; gap: 6px; }
  .dock .dock-links .link { font-size: 14px; min-height: 36px; padding: 0 8px; white-space: nowrap; }
}
/* The game code as big letter tiles (Kahoot-style PIN): easy to read out across a room */
.duel-code { display: flex; justify-content: center; gap: 8px; letter-spacing: 0; }
.duel-code span { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 62px; background: var(--edge); border: 3px solid var(--gold); color: var(--gold);
  font: 700 44px/1 var(--font); box-shadow: inset 0 -5px 0 rgba(0,0,0,.4), 0 4px 0 rgba(0,0,0,.35); animation: sqIn .4s steps(4, end) both; }
@media (max-width: 420px) { .duel-code span { width: 46px; height: 56px; font-size: 38px; } }
@media (prefers-reduced-motion: reduce) { .duel-code span { animation: none; } }
/* Settings: level and building choices as an even grid of bevelled chips instead of a ragged wrap */
.st-box .bpick:has(.bp), .st-box .bpick:has([data-tier]) { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.st-box .bpick .bp, .st-box .bpick [data-tier] { margin: 0; justify-content: center; text-align: center; box-shadow: inset 2px 2px 0 rgba(255,255,255,.06), inset -2px -2px 0 rgba(0,0,0,.3); }
.st-box .bpick .bp.on, .st-box .bpick [data-tier].on { box-shadow: inset 0 -3px 0 var(--gold-dark); }
/* Phones: panels start below the sound button instead of sliding under it (it covered the Settings corner) */
@media (max-width: 480px) {
  .stage:has(.statscard):not(:has(.home-feed)) { padding-top: calc(62px + env(safe-area-inset-top)); }
}
.hud-star { width: 12px; height: 12px; margin-right: 5px; vertical-align: -1px; image-rendering: pixelated; }
/* Play queue: the 1v1 speech-bubble icon hops while you wait */
.q-icon { display: block; width: 56px; height: 56px; margin: 4px auto 0; animation: qHop 1s steps(4, end) infinite; filter: drop-shadow(3px 3px 0 var(--edge)); }
@keyframes qHop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .q-icon { animation: none; } }
/* Before round 1: a fighting-game style "You VS them" banner, names sliding in from each side */
.vs-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; width: 100%; margin: 4px 0 6px; }
.vs-name { font: 700 24px/1.1 var(--font); color: var(--text); background: var(--edge); border: 2px solid var(--hi); padding: 6px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: vsInR .45s steps(5, end) both; }
.vs-name.you { color: var(--gold); border-color: var(--gold-dark); text-align: right; animation-name: vsInL; }
.vs-mark { font: 700 40px/1 var(--font); color: #E5484D; text-shadow: 3px 3px 0 var(--edge); animation: bump .6s steps(3, end) .45s both; }
@keyframes vsInL { from { transform: translateX(-60px); opacity: 0; } }
@keyframes vsInR { from { transform: translateX(60px); opacity: 0; } }
@media (max-width: 420px) { .vs-name { font-size: 18px; padding: 5px 7px; } .vs-mark { font-size: 30px; } }
@media (prefers-reduced-motion: reduce) { .vs-name, .vs-mark { animation: none; } }
/* A win: a pixel trophy drops in above "You win" */
.win-cup { display: block; width: 64px; height: 70px; margin: 0 auto -4px; filter: drop-shadow(3px 3px 0 var(--edge)); animation: cupIn .6s steps(6, end) both; }
@keyframes cupIn { from { transform: translateY(-40px) scale(.6); opacity: 0; } 70% { transform: translateY(4px) scale(1.08); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .win-cup { animation: none; } }

/* 1v1 finish: totals count up, then a small pop when they land */
.duel-score-line .tick-up { display: inline-block; min-width: 1.2ch; font-variant-numeric: tabular-nums; }
.duel-score-line .tick-done { animation: tickPop 0.28s steps(4) both; }
@keyframes tickPop { 0% { transform: scale(1); } 50% { transform: scale(1.35); } 100% { transform: scale(1); } }

/* Practice picker: a one-line plain hint under Case / Theory / Kritik */
.practice-pick .pick-sub { display: block; margin-top: 2px; font-size: 10px; line-height: 1.1; font-weight: 500; opacity: 0.7; letter-spacing: 0.02em; text-transform: none; white-space: nowrap; }
.practice-pick [data-mode] { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.practice-pick .pick-sub { font-size: 11px; margin-top: 3px; }
.practice-pick [data-mode] { gap: 3px; padding-top: 7px; padding-bottom: 7px; }
.practice-pick [data-mode] .pick-sub { margin-top: 0; line-height: 1; }

/* last five seconds: the clock number thumps once per tick */
.clock-n { display: inline-block; transform-origin: right center; }
.clock-n.beat { animation: clockBeat 0.32s steps(4) both; }
@keyframes clockBeat { 0% { transform: scale(1); } 30% { transform: scale(1.45); color: #FFFFFF; text-shadow: 0 0 0 transparent, 3px 3px 0 rgba(255,59,48,.55); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .clock-n.beat { animation: none; } }
