:root {
  --bg: #e8eee5; --panel: #fbf8e9; --panel-2: #e4e9dc; --ink: #233e40; --muted: #596e66;
  --accent: #287d78; --accent-ink: #fffdf0; --good: #3b8b4e; --bad: #c4423b; --line: #273f40;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16131c; --panel: #221d2b; --panel-2: #2c2537; --ink: #f3ead8; --muted: #a99c8a;
    --accent: #f2a43a; --accent-ink: #1b1406; --good: #62c57c; --bad: #ef7067; --line: #0b090e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16131c; --panel: #221d2b; --panel-2: #2c2537; --ink: #f3ead8; --muted: #a99c8a;
  --accent: #f2a43a; --accent-ink: #1b1406; --good: #62c57c; --bad: #ef7067; --line: #0b090e;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
/* pixel text: DotGothic16 keeps C/O, S/5, H/W distinct; it has one weight, so never fake-bold it */
.px, .prompt, .turn, .label, .btn, .pop, .tag, .card b, .clock, .banner .txt, .vote .q, .winner .who, .hero h1, .tagline { font-family: "DotGothic16", system-ui, sans-serif; font-synthesis: none; }
#app { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }   /* one column that never grows past its container */
button, input { font: inherit; color: inherit; }
.box { background: var(--panel); border: 3px solid var(--line); box-shadow: 4px 4px 0 var(--line); padding: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.btn { border: 3px solid var(--line); background: var(--panel); padding: 8px 14px; font-weight: 700; box-shadow: 3px 3px 0 var(--line); cursor: pointer; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.label { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.prompt { text-align: center; font-size: 28px; font-weight: 700; }
.turn { text-align: center; font-size: 21px; font-weight: 700; }
.turn .who { color: var(--accent); }
.meter { display: flex; align-items: center; gap: 10px; margin-top: -4px; }
.meter .bar { flex: 1; height: 12px; border: 2px solid var(--line); background: var(--panel-2); }
.meter .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s ease-out; }
.meter .to { font-size: 14px; color: var(--muted); min-width: 72px; text-align: right; }
.tray[hidden], .meter[hidden] { display: none; }
.banner {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(86%, 520px);
  background: var(--accent); color: var(--accent-ink); border: 3px solid var(--line); box-shadow: 4px 4px 0 var(--line);
  padding: 12px 16px; text-align: center; line-height: 1.2; z-index: 5;
  animation: banner 2.45s ease-in-out 1 forwards;
}
.banner[hidden] { display: none; }
.banner.high { top: 24%; }
.banner .label { color: inherit; opacity: .8; }
.banner .txt { font-family: "DotGothic16", system-ui, sans-serif; font-weight: 700; font-size: 24px; margin-top: 4px; }
@keyframes banner {
  0% { transform: translate(-160%, -50%); opacity: 1; }
  12.2%, 85.7% { transform: translate(-50%, -50%); opacity: 1; }
  100% { transform: translate(-50%, -50%); opacity: 0; }
}
.prompt.changed { animation: flash 1.6s ease-out 1; }
@keyframes flash { 0%, 40% { color: var(--accent); transform: scale(1.06); } 100% { color: inherit; transform: none; } }
.st.out { opacity: .45; }
.st .gone { font-size: 13px; color: var(--muted); }

.stage { position: relative; border: 3px solid var(--line); box-shadow: 4px 4px 0 var(--line); background: #8fd0ef; line-height: 0; }
canvas { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.tag {
  position: absolute; transform: translate(calc(-100% - 10px), -50%); white-space: nowrap; pointer-events: none;
  background: var(--panel); border: 2px solid var(--line); padding: 1px 6px; font-size: 13px; line-height: 1.3; font-weight: 700;
}
.tag::after { content: ""; position: absolute; right: -12px; top: 50%; margin-top: -6px; border: 6px solid transparent; border-left-color: var(--line); }
.tag.above { transform: translate(-30%, -100%); }
.tag.right { transform: translate(10px, -50%); }
.tag.right::after { right: auto; left: -12px; border-left-color: transparent; border-right-color: var(--line); }
.tag.above::after { right: auto; left: 30%; top: auto; bottom: -12px; margin: 0 0 0 -6px; border-left-color: transparent; border-top-color: var(--line); }
.pop {
  position: absolute; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap; line-height: 1;
  font-weight: 700; font-size: 22px; color: #fff; text-shadow: 2px 0 0 #2b2118, -2px 0 0 #2b2118, 0 2px 0 #2b2118, 0 -2px 0 #2b2118, 2px 2px 0 #2b2118;
  animation: rise 1s ease-out 1 forwards;
}
.pop.whip { color: #ffd34d; font-size: 26px; }
.pop.zebra { color: #fff; font-size: 30px; letter-spacing: .04em; }
.pop.card-pop {
  z-index: 4; padding: 3px 6px; border: 2px solid #c58f73; border-radius: 0;
  background: #392c31; color: #ffe7ce; font: 700 clamp(10px, 1.55vw, 14px)/1.15 system-ui, sans-serif;
  max-width: 41%; white-space: normal; text-align: center; text-shadow: none;
  transform: translateY(-50%); animation: card-mark 2s linear both;
}
.pop.card-pop-left { transform: translate(-100%, -50%); }
.pop.card-blocked { background: #254943; border-color: #91c8b1; color: #e5ffeb; }
.pop.card-used { display: inline-flex; align-items: center; gap: 4px; background: #34474a; border-color: #a8c9bc; color: #edf9e8; }
.card-used img { width: 17px; height: 17px; flex: none; image-rendering: pixelated; }
@keyframes card-mark { 0% { opacity: 1; margin-top: 3px; } 75% { opacity: 1; } 100% { opacity: 0; margin-top: -5px; } }
.card-notices { position: absolute; z-index: 8; inset: auto 8px 9px; display: grid; justify-items: center; gap: 4px; pointer-events: none; }
.card-notice {
  max-width: min(100%, 460px); padding: 4px 8px; border: 2px solid #e0ad82; background: #392c31;
  color: #fff0d8; font: 700 12px/1.3 system-ui, sans-serif; text-align: center;
  box-shadow: 2px 2px #242027; animation: card-notice-fade 5s linear both;
}
.card-notice.block { border-color: #a4ddc3; background: #254943; color: #e5ffeb; }
.card-notice.used { border-color: #aecbbc; background: #34474a; color: #edf9e8; }
@keyframes card-notice-fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .stage:not([data-card-motion]) .pop.card-pop { animation: card-notice-fade 2s linear both; }
  .stage[data-card-motion] .pop.card-pop { animation-duration: 2s; }
}
.pop.bad { color: #ff8a80; }
.pop.first { color: #ffd34d; font-size: 34px; animation-duration: 2.2s; }
@keyframes rise { 0% { opacity: 0; margin-top: 8px; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; margin-top: -26px; } }

.answer { display: flex; gap: 8px; }
.answer input { flex: 1; min-width: 0; border: 3px solid var(--line); background: var(--panel-2); padding: 10px 12px; outline: none; font-size: 18px; }
.answer input:focus { border-color: var(--accent); }

.standings { display: grid; gap: 6px; }
.st { display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px; align-items: center; padding: 4px 6px; border: 2px solid transparent; }
.st.holder { border-color: var(--accent); background: var(--panel-2); }
.st .sw { width: 14px; height: 14px; border: 2px solid var(--line); }
.st .nm { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st .nm .tier { font-weight: 400; color: var(--muted); font-size: 14px; }
.st .shoes { display: flex; gap: 3px; align-items: center; }
.st .shoes .n { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 12px; text-align: right; margin-right: 3px; }
.st.head { padding-top: 0; padding-bottom: 0; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.st.head span:nth-child(3) { text-align: center; }
.st.head span:last-child { text-align: right; }
.st .pts { font-variant-numeric: tabular-nums; min-width: 52px; text-align: right; }
.shoe { width: 20px; height: 20px; image-rendering: pixelated; }
.shoe.lost { opacity: .28; filter: grayscale(1) brightness(.55); }
.tag .tshoes { display: inline-flex; gap: 1px; margin-left: 5px; vertical-align: -3px; }
.tag .shoe { width: 14px; height: 14px; }
.pop.shoe-pop { font-size: 16px; }

.said { display: flex; flex-wrap: wrap; gap: 6px; }
.t-easy { --tier: #9aa3ad; } .t-uncommon { --tier: #3fae5a; } .t-rare { --tier: #3f7fe0; } .t-mythic { --tier: #a259e6; } .t-legendary { --tier: #f2b630; }
.chip[class*="t-"] { border-color: var(--tier); box-shadow: inset 3px 0 0 var(--tier); }
.pop .tier { display: block; font-size: 14px; color: var(--tier); margin-top: 2px; letter-spacing: .06em; text-transform: uppercase; }
.pop.big { font-size: 30px; }
.chip { display: inline-flex; gap: 6px; align-items: center; border: 2px solid var(--line); background: var(--panel-2); padding: 3px 8px; font-size: 15px; }
.chip img { width: 24px; height: 24px; image-rendering: pixelated; margin: -3px 0; }
.key { display: flex; gap: 6px; align-items: center; }
.key img { width: 24px; height: 24px; image-rendering: pixelated; }
.key .arrow { color: var(--muted); font-size: 12px; }
.chip .pts { color: var(--muted); font-size: 13px; }

.pick { max-width: 560px; width: 100%; display: grid; gap: 14px; text-align: center; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card { border: 3px solid var(--line); box-shadow: 3px 3px 0 var(--line); background: var(--panel-2); padding: 12px 8px; display: grid; gap: 6px; justify-items: center; cursor: pointer; }
.card:hover { background: var(--panel); border-color: var(--accent); }
.card img { width: 48px; height: 48px; image-rendering: pixelated; }
.card b { font-size: 17px; }
.card span { font-size: 14px; color: var(--muted); }
.card.rare { border-color: #a259e6; }
.card.legendary { border-color: #f2b630; box-shadow: 3px 3px 0 #8a5a12; }
.card:disabled { opacity: .5; cursor: default; }
.card:disabled:hover { background: var(--panel-2); border-color: var(--line); }
.fxrow { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.fxrow[hidden] { display: none; }
.fx { font-size: 13px; padding: 2px 8px; border: 2px solid var(--line); background: var(--panel-2); display: inline-flex; align-items: center; gap: 4px; }
.fx img { width: 18px; height: 18px; image-rendering: pixelated; }
.fx.good { color: #2f8a3e; }
.fx.bad { color: #c0392b; }
.fx.usecard { cursor: pointer; font: inherit; font-size: 14px; color: var(--ink); border-color: var(--accent); background: var(--panel); box-shadow: 2px 2px 0 var(--line); }
.fx.usecard:hover { background: var(--panel-2); }
.fx.hint b { letter-spacing: 2px; font-family: ui-monospace, Menlo, monospace; }
.fx.hint.clue { max-width: 100%; flex-wrap: wrap; justify-content: center; text-align: center; }
.fx.hint.clue i { font-style: normal; font-weight: 700; }


/* ---- home, lobby, shared bits */
.hero { text-align: center; padding: 18px 0 4px; }
.hero h1 { font-family: "DotGothic16", system-ui, sans-serif; font-size: 46px; margin: 4px 0 0; letter-spacing: .02em; }
.hero p { margin: 6px 0 0; }
.logo { width: 162px; height: auto; image-rendering: pixelated; display: block; margin: 0 auto; }
input.text { width: 100%; border: 3px solid var(--line); background: var(--panel-2); padding: 10px 12px; outline: none; font-size: 17px; }
input.text:focus { border-color: var(--accent); }
input.code { text-transform: uppercase; letter-spacing: .2em; font-weight: 700; width: 9ch; text-align: center; }
.btn.big { padding: 12px 20px; font-size: 18px; }
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; padding-left: 0; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.good { background: var(--good); color: #fff; }
.btn.bad { background: var(--bad); color: #fff; }
.emojis { display: flex; flex-wrap: wrap; gap: 6px; }
.emoji-btn { width: 42px; height: 42px; font-size: 22px; border: 2px solid var(--line); background: var(--panel-2); cursor: pointer; }
.emoji-btn[aria-pressed="true"] { border-color: var(--accent); background: var(--panel); box-shadow: inset 0 0 0 2px var(--accent); }
.roomcode { font-family: "Press Start 2P", system-ui, sans-serif; font-size: 34px; line-height: 1.4; font-weight: 700; letter-spacing: .16em; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.toggle { cursor: pointer; }
.chip.toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--panel); box-shadow: inset 0 0 0 1px var(--accent); }
.chip .x { border: 0; background: none; padding: 0 0 0 4px; color: var(--muted); cursor: pointer; }
.seg { display: inline-flex; border: 3px solid var(--line); }
.seg button { border: 0; background: var(--panel); padding: 6px 11px; min-width: 42px; cursor: pointer; }
.seg button + button { border-left: 2px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.settings .row .label { width: 84px; }
.feedback { min-height: 24px; font-weight: 600; text-align: center; }
.feedback.bad { color: var(--bad); }
.draft { text-align: center; min-height: 22px; color: var(--muted); font-style: italic; margin-top: -8px; }
.checking { display: inline-flex; gap: 8px; align-items: center; }
.dot { width: 8px; height: 8px; background: var(--accent); animation: blink 1s ease-in-out 8 alternate; }
.dot:nth-child(2) { animation-delay: .2s; } .dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { from { opacity: .2; } to { opacity: 1; } }
.vote { text-align: center; display: grid; gap: 10px; }
.vote .q { font-family: "DotGothic16", system-ui, sans-serif; font-size: 22px; font-weight: 700; }
.bar2 { height: 8px; border: 2px solid var(--line); background: var(--panel-2); }
.bar2 > i { display: block; height: 100%; background: var(--accent); width: 100%; }
.missed { display: flex; flex-wrap: wrap; gap: 6px; }
.score { display: grid; grid-template-columns: auto 14px 1fr auto; gap: 8px 12px; align-items: center; }
.score .rank { color: var(--muted); font-variant-numeric: tabular-nums; }
.score .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.winner { text-align: center; }
.winner .who { font-family: "DotGothic16", system-ui, sans-serif; font-size: 30px; font-weight: 700; }
#toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border: 3px solid var(--line);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 30;
}
#toast.on { opacity: 1; transform: translateX(-50%); }
/* your turn: orange edge */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 10;
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 44px color-mix(in srgb, var(--accent) 35%, transparent);
  opacity: 0; transition: opacity .25s;
}
body.myturn::after { opacity: 1; }

@media (max-width: 520px) {
  .roomcode { font-size: 34px; }
  .hero h1 { font-size: 38px; }
  .prompt { font-size: 23px; }
  .cards { grid-template-columns: 1fr; }
  .card { grid-template-columns: 48px 1fr; justify-items: start; text-align: left; }
  .card img { grid-row: span 2; }
}
@media (prefers-reduced-motion: reduce) { .pop { animation-duration: .01s; } }

/* ---- title screen */
.home { max-width: 560px; margin: 0 auto; width: 100%; }
.home-bg { position: fixed; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; z-index: -1; display: block; }
.home { padding-top: 4vh; }
.title-wrap { text-align: center; line-height: 1.2; padding: 8px 0 4px; }
.title {
  font-family: "Press Start 2P", "DotGothic16", system-ui, sans-serif; font-weight: 400;
  font-size: clamp(26px, 7vw, 44px); margin: 0; color: #ffd34d; letter-spacing: .02em; line-height: 1.25;
  text-shadow: 3px 0 0 #22170f, -3px 0 0 #22170f, 0 3px 0 #22170f, 0 -3px 0 #22170f, 3px 3px 0 #22170f, -3px 3px 0 #22170f, 3px -3px 0 #22170f, -3px -3px 0 #22170f, 0 7px 0 #22170f;
}
/* the sign-up card stays light on the daytime track */
.home .box {
  --panel: #fffaf0; --panel-2: #f1e5cc; --ink: #2b2118; --muted: #7d6b57; --line: #2b2118; --accent: #e0861a; --accent-ink: #fff;
  color: var(--ink); background: var(--panel); color-scheme: light;
}
.tagline {
  font-family: "DotGothic16", system-ui, sans-serif; font-weight: 700; margin: 10px 0 0; font-size: 15px; color: #fff; letter-spacing: .06em; text-transform: uppercase;
  text-shadow: 2px 0 0 #22170f, -2px 0 0 #22170f, 0 2px 0 #22170f, 0 -2px 0 #22170f;
}
.picker { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; }
.picker .preview { text-align: center; background: var(--panel-2); border: 3px solid var(--line); padding: 10px 0 6px; }
.picker .preview canvas { width: 162px; height: auto; image-rendering: pixelated; display: block; margin: 0 auto; }
.btn.arrow { font-size: 26px; line-height: 1; padding: 10px 14px; }
.swatches { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; }
.swatch { aspect-ratio: 1; border: 3px solid var(--line); cursor: pointer; padding: 0; min-width: 0; }
.swatch[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.wide { width: 100%; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 2px; background: var(--line); opacity: .5; }
.joinrow { flex-wrap: nowrap; }
.joinrow .code { flex: 1; width: auto; min-width: 0; }
.chip.player img { width: 32px; height: auto; image-rendering: pixelated; margin: -6px 0; }
@media (max-width: 520px) {
  .swatches { gap: 4px; }
  .swatch { border-width: 2px; }
  .picker .preview canvas { width: 130px; }
}
/* footer facts: dark text on a solid card so it reads over the busy track */
.footnote {
  justify-self: center; text-align: center; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 600;
  font-size: 15px; line-height: 1.4; color: #2b2118; background: #fffaf0; border: 3px solid #2b2118; box-shadow: 3px 3px 0 #2b2118;
  padding: 6px 14px; max-width: 100%;
}
/* home and lobby sit outdoors on the track */
body.outdoors { background: #6fc0ea; }
.lobby > .row .btn.ghost, .lobby > .row .small { color: #fff; text-shadow: 2px 0 0 #22170f, -2px 0 0 #22170f, 0 2px 0 #22170f, 0 -2px 0 #22170f; }
.lobby .btn.primary { --line: #2b2118; border-color: #2b2118; box-shadow: 3px 3px 0 #2b2118; }
.home .seg, .home .seg button { --line: #2b2118; }
.chip.toggle .small { color: var(--muted); font-weight: 600; }
/* lobby starting gate */
.gatebox { display: grid; gap: 10px; padding-block: 12px; }
.gatebox h2 { margin: 0; line-height: 1; }
.gateviewport { border: 3px solid var(--line); container-type: inline-size; }
.gatewrap { position: relative; background: #c89a68; }
.gatewrap canvas.gate { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.gate-name {
  position: absolute; left: 31%; transform: translateY(-50%); line-height: 1.35;
  background: var(--panel); border: 2px solid var(--line); padding-right: 6px; font-size: 15px; font-weight: 650;
  display: flex; align-items: center; gap: 5px; max-width: 67%; min-height: 28px;
  box-shadow: 2px 2px #3e574d44;
}
.gate-name b { align-self: stretch; display: grid; place-items: center; background: #356d64; color: #fffdf0; padding: 0 5px; font: 10px/1 "Press Start 2P", system-ui, sans-serif; }
.gate-player { color: var(--ink); min-width: 0; padding-block: 2px; overflow-wrap: anywhere; }
.gate-roles { display: flex; flex: none; gap: 4px; }
.gate-role { color: var(--muted); font-size: 12px; line-height: 1.25; white-space: nowrap; }
.gate-name .x { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; flex: 0 0 24px; min-height: 24px; font-size: 17px; }
.gate-paired .gate-name {
  left: var(--gate-bank); width: 50%; max-width: none; height: var(--gate-lane-height);
  padding: 0; border: 0; background: none; box-shadow: none; pointer-events: none;
}
.gate-paired .gate-name b {
  position: absolute; top: 3px; left: 3px; min-height: 14px; padding: 0 4px; font-size: 8px;
}
.gate-paired .gate-player {
  margin-left: 53%; max-width: 45%; padding: 3px 5px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 1px 1px #3e574d44;
  font-size: 13px; line-height: 1.15;
}
.gate-paired .gate-roles, .gate-paired .gate-name .x {
  position: absolute; bottom: 4px; left: 3px; background: var(--panel);
}
.gate-paired .gate-roles { flex-direction: row; gap: 2px; padding: 1px 2px; border: 1px solid var(--line); }
.gate-paired .gate-role { font-size: 9px; }
.gate-paired .gate-name .x {
  min-width: 24px; border: 1px solid var(--line); line-height: 1; pointer-events: auto;
}
@container (max-width: 380px) {
  .gate-paired .gate-player { padding: 1px 2px; font-size: 10px; line-height: 1; }
  .gate-paired .gate-role { font-size: 8px; }
  .gate-paired .gate-name .x { bottom: 2px; }
}
/* topic buttons: count centred with the name */
.chip.toggle { line-height: 1; align-items: center; padding: 6px 10px; }
.chip.toggle .small { line-height: 1; font-size: 13px; position: relative; top: 0.5px; }
@media (max-width: 520px) {
  .gate-name { font-size: 12px; gap: 4px; }
  .gateviewport:not(.gate-paired) .gate-roles { flex-direction: column; gap: 0; }
  .gateviewport:not(.gate-paired) .gate-role { font-size: 11px; }
}

/* setting descriptions */
.settings .set { display: grid; gap: 2px; }
.settings .hint { margin: 0 0 0 94px; font-size: 13px; line-height: 1.35; color: var(--muted); max-width: 46ch; }
@media (max-width: 520px) { .settings .hint { margin-left: 0; } }

/* how to play: same cream pixel card as the home screen */
.btn.help { background: #fffaf0; color: #2b2118; border-color: #2b2118; box-shadow: 3px 3px 0 #2b2118; padding: 6px 12px; font-size: 14px; }
.btn.help.icon { padding: 4px 10px; min-width: 34px; }
.helprow { display: flex; justify-content: center; }
dialog.guide {
  --ink: #2b2118; --muted: #6f5e4b; --line: #2b2118; --panel: #fffaf0; --panel-2: #f1e5cc; --accent: #e0861a; --accent-ink: #fff;
  color-scheme: light; color: var(--ink); background: var(--panel);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;   /* body text in the clean face, like the rest of the game's prose */
  border: 3px solid var(--line); box-shadow: 6px 6px 0 var(--line); padding: 18px 20px 20px;
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
}
dialog.guide::backdrop { background: rgba(20, 14, 8, .55); }
.guide .ghead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.guide h2, .guide h3 { font-family: "DotGothic16", system-ui, sans-serif; font-synthesis: none; }
.guide h2 { margin: 0; font-size: 22px; line-height: 1.3; font-weight: 400; }
.guide .ghead .btn { padding: 2px 10px; font-size: 18px; line-height: 1.2; box-shadow: 2px 2px 0 var(--line); }
.guide .steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; }
.guide .steps li { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px 0; border-bottom: 2px dashed #d9c9a8; }
.guide .steps li:last-child { border-bottom: 0; }
.guide h3 { margin: 0 0 4px; font-weight: 400; font-size: 18px; color: var(--ink); }
.guide p { margin: 0; font-size: 16px; line-height: 1.5; color: #2b2118; }
.guide .art { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; min-height: 52px; background: #f1e5cc; border: 2px solid var(--line); padding: 6px; }
.guide .art img { image-rendering: pixelated; }
.guide .spr { width: 81px; height: auto; }
.guide .spr.tired { filter: saturate(.8) sepia(.35) hue-rotate(-20deg); width: 64px; }
.guide .mini { width: 36px; height: auto; }
.guide .shoes { display: inline-flex; gap: 2px; align-items: center; }
.guide .shoe { width: 20px; height: 20px; }
.guide .shoe.lost { opacity: .3; filter: grayscale(1); }
.guide .tiers { display: grid; gap: 1px; width: 100%; }
.guide .cardguide { border-top: 2px dashed #d9c9a8; padding: 12px 0 14px; }
.guide .cardguide .small { font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.guide h4 { font-family: "DotGothic16", system-ui, sans-serif; font-weight: 400; font-size: 15px; margin: 10px 0 6px; color: var(--muted); }
.guide .cardlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.guide .cardlist li { display: grid; grid-template-columns: 36px 1fr; gap: 8px; align-items: start; }
.guide .cardlist img { width: 36px; height: 36px; image-rendering: pixelated; background: #f1e5cc; border: 2px solid var(--line); }
.guide .cardlist b { font-family: "DotGothic16", system-ui, sans-serif; font-weight: 400; font-size: 15px; }
.guide .cardlist span { display: block; font-size: 14px; line-height: 1.35; color: #2b2118; }
.guide .cardlist span.ctag { display: inline; font-size: 11px; padding: 0 4px; border: 2px solid; margin-left: 4px; vertical-align: 1px; }
.ctag.rare { border-color: #a259e6; color: #7a3fbf; }
.ctag.legendary { border-color: #f2b630; color: #9a6a10; }
@media (max-width: 520px) { .guide .cardlist { grid-template-columns: 1fr; } }
.traytop { margin-bottom: 8px; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; }
.guide .tierchip { display: grid; grid-template-columns: 16px 1fr auto; gap: 4px; align-items: center; font-size: 13px; line-height: 1.3; }
.guide .tierchip img { width: 16px; height: 16px; }
.guide .tierchip b { font-weight: 600; }
.guide .tierchip i { font-style: normal; font-variant-numeric: tabular-nums; color: var(--muted); }
@media (max-width: 460px) {
  .guide .steps li { grid-template-columns: 1fr; gap: 8px; }
  .guide .art { justify-content: flex-start; }
  .guide .tiers { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}

/* finish placings: ribbon rosettes over each horse */
.place {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 4;
  font-family: "DotGothic16", system-ui, sans-serif; font-synthesis: none; font-size: 13px; line-height: 1;
  color: #2b2118; background: var(--rib, #6fa8e8); border: 2px solid #2b2118; border-radius: 50%;
  width: 34px; height: 34px; display: grid; place-items: center; box-shadow: 0 0 0 3px #fffaf0, 0 0 0 5px #2b2118;
  animation: place-in .45s cubic-bezier(.3, 1.6, .5, 1) both;
}
.place::after {   /* ribbon tails */
  content: ""; position: absolute; left: 50%; top: calc(100% + 3px); transform: translateX(-50%);
  width: 16px; height: 12px; background: linear-gradient(90deg, var(--rib, #6fa8e8) 0 45%, transparent 45% 55%, var(--rib, #6fa8e8) 55%);
}
.place.p1 { --rib: #f2c230; width: 40px; height: 40px; font-size: 15px; }
.place.p2 { --rib: #d3dae2; }
.place.p3 { --rib: #d9925a; }
@keyframes place-in { from { opacity: 0; transform: translate(-50%, -60%) scale(.3); } to { opacity: 1; transform: translate(-50%, -100%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .place { animation-duration: .01s; } }

/* room chat: side panel. Same card, labels and inputs as the rest of the game.
   Docked on the right on wide screens, a sheet on phones. */
.chatside {
  position: fixed; z-index: 20; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); color: var(--ink); border: 3px solid var(--line); box-shadow: 4px 4px 0 var(--line); padding: 14px;
}
body.outdoors .chatside { --panel: #fffaf0; --panel-2: #f1e5cc; --ink: #2b2118; --muted: #7d6b57; --line: #2b2118; --accent: #e0861a; --accent-ink: #fff; color-scheme: light; }
.chathead { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 2px dashed color-mix(in srgb, var(--line) 30%, transparent); }
.chatclose { padding: 0 9px; font-size: 18px; line-height: 1.3; box-shadow: 2px 2px 0 var(--line); }
.chatlog { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.chatempty { margin: 0; font-size: 14px; color: var(--muted); }
.chatline { display: grid; gap: 1px; padding: 4px 8px 5px; border-left: 4px solid var(--c); overflow-wrap: anywhere; }
.chatline.mine { background: var(--panel-2); }
.chatline b { font-family: "DotGothic16", system-ui, sans-serif; font-synthesis: none; font-weight: 400; font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.chatline span { font-size: 15px; line-height: 1.4; }
.chatsys {
  margin: 4px 0; display: flex; align-items: center; gap: 8px; text-align: center;
  font-family: "DotGothic16", system-ui, sans-serif; font-synthesis: none; font-size: 12px; color: var(--muted);
}
.chatsys::before, .chatsys::after { content: ""; flex: 1; border-top: 2px dashed color-mix(in srgb, var(--line) 25%, transparent); }
.chatform { display: flex; gap: 8px; }
.chatform input { flex: 1; min-width: 0; border: 3px solid var(--line); background: var(--panel-2); color: var(--ink); padding: 9px 11px; outline: none; font-size: 16px; }
.chatform input:focus { border-color: var(--accent); }
.chatnote { margin: 0; font-size: 14px; color: var(--bad); }
.chatfab { position: fixed; z-index: 21; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); padding: 8px 14px; }
.chatfab .unread { display: inline-block; min-width: 20px; padding: 0 5px; margin-left: 4px; background: var(--bad); color: #fff; border-radius: 10px; font-size: 13px; text-align: center; }
@media (min-width: 1080px) {
  body.inroom { padding-right: 336px; }
  .chatside { top: calc(16px + env(safe-area-inset-top, 0px)); bottom: 16px; right: max(16px, env(safe-area-inset-right, 0px)); width: 300px; }
  .chatclose, .chatfab { display: none; }
}
@media (max-width: 1079px) {
  .chatside { left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: calc(64px + env(safe-area-inset-bottom, 0px)); height: min(60vh, 440px); }
  body:not(.chatopen) .chatside { display: none; }
}

/* speech bubble over a horse on the track */
.say {
  position: absolute; transform: translate(0, -100%); z-index: 5; pointer-events: none; max-width: 46%;
  background: #fffaf0; color: #2b2118; border: 2px solid #2b2118; padding: 3px 8px; font-size: 13px; line-height: 1.3;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: say 3.8s ease both;
}
.say::after { content: ""; position: absolute; left: 6px; bottom: -8px; border: 5px solid transparent; border-top-color: #2b2118; }
@keyframes say { 0% { opacity: 0; transform: translate(0, -80%); } 8%, 85% { opacity: 1; transform: translate(0, -100%); } 100% { opacity: 0; transform: translate(0, -110%); } }

/* shop: same cream card as the guide */
img.ros { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -3px; margin-right: 3px; }
.btn.help img.ros { margin-right: 4px; }
dialog.shop { width: min(720px, calc(100vw - 32px)); }
.shop .wallet { margin-left: auto; margin-right: 10px; display: inline-flex; align-items: center; gap: 2px; font-size: 15px; }
.shop .wallet b { font-family: "DotGothic16", system-ui, sans-serif; font-synthesis: none; font-weight: 400; font-size: 20px; margin-right: 4px; }
.shop .wallet img.ros { width: 22px; height: 22px; }
.shopnote { margin: 4px 0 12px; font-size: 15px; line-height: 1.45; color: #4a3d30; }
.shop .tabs { display: flex; gap: 0; border: 3px solid var(--line); width: max-content; max-width: 100%; margin-bottom: 14px; flex-wrap: wrap; }
.shop .tabs button { font-family: "DotGothic16", system-ui, sans-serif; font-synthesis: none; font-size: 15px; padding: 6px 14px; border: 0; border-right: 3px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.shop .tabs button:last-child { border-right: 0; }
.shop .tabs button[aria-selected="true"] { background: var(--accent); color: #fff; }
.shop .items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.shop .item { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 10px 8px; border: 3px solid var(--line); background: var(--panel); box-shadow: 3px 3px 0 var(--line); }
.shop .item.on { background: #fff1d6; box-shadow: 3px 3px 0 var(--accent); border-color: var(--accent); }
.shop .item b { font-family: "DotGothic16", system-ui, sans-serif; font-synthesis: none; font-weight: 400; font-size: 15px; }
.shop .item .btn { width: 100%; padding: 5px 8px; font-size: 14px; box-shadow: 2px 2px 0 var(--line); }
.shop .item .btn:disabled { opacity: .55; cursor: default; }
.shop .pic { width: 100%; height: 78px; display: grid; place-items: center; background: #f1e5cc; border: 2px solid var(--line); overflow: hidden; }
.shop .pic img { image-rendering: pixelated; width: 98px; height: auto; }
.shop .pic.theme img { width: 100%; height: 100%; object-fit: cover; object-position: center 70%; }
.earned { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; font-size: 16px; padding: 8px 12px; background: var(--panel); border: 3px solid var(--line); box-shadow: 4px 4px 0 var(--line); }
.earned b { font-family: "DotGothic16", system-ui, sans-serif; font-synthesis: none; font-weight: 400; font-size: 20px; }
.earned img.ros { width: 22px; height: 22px; }

/* Campus Circuit: a small medical badge, warm paper and scrub-green accents. */
.home .box {
  --panel: #fbf8e9; --panel-2: #e6eadd; --ink: #263f40; --muted: #596e66;
  --line: #2c4745; --accent: #287d78; --accent-ink: #fffdf0;
}
.home { max-width: 510px; padding-top: 2vh; }
.home .paddock { padding: 18px 20px; gap: 13px; box-shadow: 5px 5px 0 #2c4745; border-top: 6px solid #397e76; }
.paddock-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.paddock-head .label { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; }
.paddock-head .label::before {
  content: ""; display: inline-block; width: 11px; height: 11px; background: #397e76;
  clip-path: polygon(35% 0,65% 0,65% 35%,100% 35%,100% 65%,65% 65%,65% 100%,35% 100%,35% 65%,0 65%,0 35%,35% 35%);
}
.wardrobe-link { border: 0; padding: 2px 0; color: #286f69; background: transparent; cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.home .picker .preview { position: relative; background: #e0e7d8; border: 2px solid #8ea695; padding: 3px 0 7px; }
.home .picker { grid-template-columns: auto minmax(0, 1fr) auto; }
.home .picker .preview canvas { width: 100%; max-width: 324px; }
.home .picker .preview .small { font-family: "DotGothic16", system-ui, sans-serif; font-size: 13px; }
.home .picker .arrow { background: #e4e9dc; padding: 8px 10px; box-shadow: 2px 2px 0 var(--line); }
.home .title { color: #fff1c4; }
.home .tagline { font-size: 14px; letter-spacing: .04em; }
.edition { display: inline-block; margin: 12px 0 2px; padding: 4px 10px; font-family: "DotGothic16", system-ui, sans-serif; font-size: 10px; letter-spacing: .19em; color: #fff6d9; background: #2b6660; border: 2px solid #244b49; box-shadow: 2px 2px 0 #244b49; }
.outfit-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.outfit-option { cursor: pointer; background: #f6f4e8; border: 2px solid #a4b2a1; color: #486258; padding: 7px 3px; font-family: "DotGothic16", system-ui, sans-serif; font-size: 13px; }
.outfit-option[aria-pressed="true"] { color: #fffdf0; background: #397e76; border-color: #244b49; box-shadow: 2px 2px 0 #244b49; }
.outfit-option:disabled { cursor: wait; opacity: .6; }
.wardrobe-link:focus-visible, .outfit-option:focus-visible, .swatch:focus-visible { outline: 3px solid #d29843; outline-offset: 3px; }
dialog.guide {
  --ink: #263f40; --muted: #596e66; --line: #2c4745; --panel: #fbf8e9;
  --panel-2: #e6eadd; --accent: #287d78; --accent-ink: #fffdf0;
}
.shop .item.on { background: #e5edda; }
.shop .pic, .guide .art { background: #e0e7d8; }
.kit-preview { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px; border: 2px solid #8ea695; background: #e9eddf; margin-bottom: 10px; }
.kit-preview canvas { width: 216px; height: auto; }
.kit-detail { display: grid; gap: 7px; }
.kit-detail h3, .kit-detail p { margin: 0; }
.kit-detail p { font-size: 14px; line-height: 1.45; }
.kit-detail .btn { padding: 5px 8px; font-size: 13px; }
.kit-detail .label { color: #356d65; }
.equipped-gear { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.gear-chip { display: inline-flex; align-items: center; gap: 5px; background: #e0e7d8; border: 1px solid #8ea695; padding: 3px 5px; font-size: 12px; }
.gear-chip button { border: 0; padding: 0 3px; background: transparent; cursor: pointer; font-size: 16px; color: #285f58; }
.kit-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.kit-filters button { border: 2px solid #8ea695; background: #f8f7e9; padding: 4px 8px; cursor: pointer; font-size: 12px; }
.kit-filters button[aria-pressed="true"] { background: #397e76; border-color: #244b49; color: #fffbea; }
.kit-slot { color: #596e66; font-size: 12px; }
.shop .item.trying { outline: 3px solid #d0a353; outline-offset: 1px; }
.shop .item .try-on { background: #e6eadd; }
@media (max-width: 520px) {
  .kit-preview { grid-template-columns: 1fr; gap: 4px; }
  .kit-preview canvas { width: min(216px, 100%); margin: auto; }
  .kit-detail { text-align: center; }
  .kit-detail .row { justify-content: center; }
}
@media (max-width: 520px) {
  .home .paddock { padding: 13px; }
  .home .picker .preview canvas { width: 100%; max-width: 240px; }
  .paddock-head { flex-wrap: wrap; }
}

/* Inspect the same artwork at a useful size before spending ribbons. */
.shop .pic.acc { height: 104px; }
.shop .pic.acc img { width: 128px; height: 100px; }
.kit-views { display: grid; gap: 8px; }
.kit-views figure { margin: 0; text-align: center; }
.kit-views figcaption { font-size: 11px; color: var(--muted); }
.kit-views #kitCloseup { width: 192px; height: 150px; image-rendering: pixelated; }
.kit-views #kitPreview { width: 216px; max-width: 100%; height: auto; image-rendering: pixelated; }

.kit-views.horse-style-views #kitCloseup { width: 216px; height: 176px; }
.shop .pic.acc.horse-style-pic img { width: 128px; height: auto; }
@media (max-width: 520px) { .kit-views.horse-style-views #kitCloseup { max-width: 100%; height: auto; } }

/* Match coat cards to the medical mounts in the shared category. */
.shop .pic.coat { height: 104px; }
.shop .pic.coat img { width: 128px; }

.scenery-preview { border: 2px solid #8ea695; background: #e9eddf; padding: 10px; margin: 12px 0; }
.scenery-preview > img { display:block; width:100%; height:auto; image-rendering:pixelated; border:2px solid var(--line); }
.scene-detail { display:flex; gap:14px; align-items:center; justify-content:space-between; margin-top:10px; }
.scene-detail h3, .scene-detail p { margin:4px 0; }
.scene-detail > .btn { flex-shrink:0; }
@media(max-width:520px) { .scene-detail { align-items:flex-start; flex-direction:column; } }

.mount-group { grid-column: 1 / -1; margin: 18px 0 2px; padding-bottom: 8px; border-bottom: 2px solid #8ea695; color: #2c5956; font-size: 18px; }

.brand-logo { display: block; width: min(100%, 510px); height: auto; margin: 0 auto; image-rendering: pixelated; }
.home .title { line-height: 0; text-shadow: none; }


/* A shared starting scene precedes the first prompt and answer clock. */
.race-starting > :not(.stage):not(.stagewrap):not(.row) { display:none !important; }
.race-starting .stage { margin:24px 0; border-color:#2b5c56; box-shadow:6px 6px 0 #244b49; }
.start-signal { position:absolute; left:0; right:0; top:7%; display:grid; justify-items:center; gap:7px; color:#fff3cc; text-shadow:2px 2px #233c42; text-align:center; pointer-events:none; }
.start-signal[hidden] { display:none; }
.start-signal strong { font-family:"Press Start 2P",monospace; font-size:clamp(24px,5vw,48px); color:#ffe1a0; line-height:1.1; }
.start-signal.released strong { color:#b5edc2; }
::view-transition-old(root),::view-transition-new(root) { animation-duration:.45s; }
@media(prefers-reduced-motion:reduce) { ::view-transition-old(root),::view-transition-new(root) { animation-duration:.01s; } }
/* who is watching mid-race, and who is in the next race */
.watching { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; padding: 6px 6px 2px; border-top: 2px dashed color-mix(in srgb, var(--line) 30%, transparent); }
.watching .label { margin-right: 2px; }
.watcher { display: inline-flex; align-items: center; gap: 6px; }
.watcher .sw { width: 12px; height: 12px; border: 2px solid var(--line); }
.who-next { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
/* lobby on phones: every setting stacks the same way, buttons fill the row */
@media (max-width: 520px) {
  .settings { gap: 12px; }
  .settings .row { display: grid; gap: 5px; }
  .settings .row .label { width: auto; padding-top: 0 !important; }
  .settings .seg { display: flex; width: 100%; }
  .settings .seg button { flex: 1; min-width: 0; padding: 8px 0; }
  .settings .hint { margin-top: 2px; }
  .codebox { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; text-align: left !important; padding: 10px 14px; }
  .codebox .label { grid-column: 1 / -1; }
  .codebox .roomcode { font-size: 26px; line-height: 1.3; }
  body.inroom .lobby { padding-bottom: 60px; }
}
@media (max-width: 520px) {
  .lobby > .row { gap: 6px; flex-wrap: nowrap; }
  .lobby > .row .btn { padding: 6px 9px; font-size: 14px; white-space: nowrap; }
  .codebox .btn { white-space: nowrap; }
}
@media (max-width: 360px) {
  .codebox .roomcode { font-size: 21px; }
  .lobby > .row .btn { padding: 5px 7px; font-size: 13px; }
}
/* phones, while you answer: your lane, the answer box and what's been said, above the keyboard */
.stagewrap { position: relative; }
@media (max-width: 520px) {
  .stagewrap { transition: height .3s ease; }
  .stage { transform-origin: 0 0; transition: transform .3s ease; }
  body.answering #game { gap: 8px; }
  body.answering #game > .row, body.answering #draft, body.answering #meter,
  body.answering #game > .box:not(#saidbox):not(.tray), body.answering .chatfab, body.answering .chatside { display: none !important; }
  body.answering #prompt { order: 1; font-size: 19px; line-height: 1.25; }
  body.answering #turn { order: 2; font-size: 16px; }
  body.answering #fxrow { order: 2; }
  body.answering #votebox { order: 3; }
  body.answering .stagewrap { order: 4; overflow: hidden; border: 3px solid var(--line); box-shadow: 3px 3px 0 var(--line); }
  body.answering .stage { border: 0; box-shadow: none; }
  body.answering #act { order: 5; }
  body.answering #act .feedback { min-height: 0; margin-top: 4px; }
  body.answering #saidbox { order: 6; padding: 8px 10px; box-shadow: 3px 3px 0 var(--line); }
  body.answering #saidbox .key { display: none; }
  /* compact chips, filling whatever room is left above the keyboard (height set in app.js); scroll for older ones */
  body.answering #said { gap: 4px; max-height: 67px; overflow-y: auto; overscroll-behavior: contain; }
  body.answering #said .chip { font-size: 13px; padding: 1px 6px; gap: 4px; }
  body.answering #said .chip img { display: none; }   /* the coloured border already shows the tier */
  body.answering #said .chip .pts { font-size: 11px; }
  body.answering #saidbox .row { margin-bottom: 5px !important; }
  body.answering #tray { order: 7; }
}
/* public races on the home screen */
.publicbox { gap: 10px; }
.publiclist { display: grid; gap: 8px; }
.pubroom { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
  padding: 6px 0 8px; border-bottom: 2px dashed color-mix(in srgb, var(--line) 25%, transparent); }
.pubroom:last-child { border-bottom: 0; padding-bottom: 0; }
.pubroom .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pubroom .btn { grid-row: 1 / span 2; grid-column: 2; padding: 6px 14px; }
/* a correct answer: the card on the track */
.anscard {
  position: absolute; left: 50%; top: 8px; z-index: 6; max-width: 88%; pointer-events: none; text-align: center; line-height: 1.15;
  background: #fffaf0; color: #2b2118; border: 3px solid var(--tier); box-shadow: 3px 3px 0 #2b2118; padding: 6px 14px 7px;
  transform: translateX(-50%); animation: anscard 1.8s ease-out 1 forwards;
}
.anscard .ac-name { font-weight: 800; font-size: 20px; overflow-wrap: anywhere; }
.anscard .ac-meta { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 3px; font-size: 13px; white-space: nowrap; }
.anscard .ac-meta img { width: 18px; height: 18px; image-rendering: pixelated; }
.anscard .ac-meta b { color: var(--tier); text-transform: uppercase; letter-spacing: .06em; }
.anscard.t-legendary .ac-meta b { color: #a87400; }
.anscard.t-easy .ac-meta b { color: #5d636b; }
.anscard .ac-pts { font-weight: 800; font-size: 15px; }
.anscard .ac-who { color: #7d6b57; }
.anscard.big { border-width: 4px; padding: 8px 18px 9px; }
.anscard.big .ac-name { font-size: 24px; }
@keyframes anscard {
  0% { opacity: 0; transform: translate(-50%, -8px) scale(.9); }
  12% { opacity: 1; transform: translate(-50%, 0) scale(1.05); }
  20% { transform: translate(-50%, 0) scale(1); }
  82% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, 0) scale(1); }
}
/* the newest answer in "Said this prompt" flashes once */
.chip.fresh { animation: chipfresh 1.4s ease-out 1; }
@keyframes chipfresh { 0%, 30% { background: color-mix(in srgb, var(--tier) 35%, var(--panel-2)); } 100% { background: var(--panel-2); } }
/* the card over the phone answering strip: one line, a little smaller */
.stagewrap > .anscard { top: 4px; max-width: 94%; padding: 4px 10px 5px; }
.stagewrap > .anscard .ac-name { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stagewrap > .anscard .ac-meta { margin-top: 1px; }
/* "Did you mean" suggestions under the answer box */
.feedback .suggest { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-left: 8px; vertical-align: middle; }
.feedback .suggest .btn { padding: 4px 10px; font-size: 14px; color: var(--ink); }
/* sugar rush armed: shown on your turn line */
.turn .dbl { color: #d9781a; font-weight: 700; }
