/* Kwibble — "pub quiz print", night edition.
   A printed quiz sheet on black stock: serif headlines, ruled columns, tick boxes, dotted leaders.
   No rounded cards, no pills, no drop shadows. Colour is ink, one chalk-yellow accent, and marking pens. */

@font-face { font-family: "Old Standard TT"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/fonts/old-standard-tt-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2190-2193, U+2212, U+2215; }
@font-face { font-family: "Old Standard TT"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("/fonts/old-standard-tt-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2C60-2C7F; }
@font-face { font-family: "Old Standard TT"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("/fonts/old-standard-tt-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2190-2193, U+2212, U+2215; }
@font-face { font-family: "Old Standard TT"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("/fonts/old-standard-tt-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2C60-2C7F; }
@font-face { font-family: "Old Standard TT"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/fonts/old-standard-tt-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2190-2193, U+2212, U+2215; }
@font-face { font-family: "Old Standard TT"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("/fonts/old-standard-tt-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2C60-2C7F; }
@font-face { font-family: "Libre Franklin"; font-weight: 400; font-display: swap; src: url("/fonts/libre-franklin-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Franklin"; font-weight: 600; font-display: swap; src: url("/fonts/libre-franklin-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Libre Franklin"; font-weight: 800; font-display: swap; src: url("/fonts/libre-franklin-latin-800-normal.woff2") format("woff2"); }

:root {
  --bg: #121010;          /* black stock */
  --panel: #191614;       /* a sheet laid on it */
  --ink: #ece3d0;         /* cream ink */
  --muted: #9b907d;
  --line: #3a342b;        /* hairline rules */
  --accent: #e3b23c;      /* chalk yellow */
  --accent-ink: #171204;
  --good: #9fcf8e;        /* marking pens */
  --good-bg: rgba(159, 207, 142, .1);
  --warn: #e8a35e;
  --bad: #e36a5b;
  --news: #e36a5b;        /* stop-press red */
  --serif: "Old Standard TT", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Libre Franklin", "Franklin Gothic Medium", "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { height: 100dvh; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
}
::selection { background: var(--accent); color: var(--accent-ink); }
/* paper grain */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .035; /* no blend mode: it forced a full-page recomposite every frame */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
[hidden] { display: none !important; }
h1, h2 { font-family: var(--serif); font-weight: 700; line-height: 1.08; margin: 0; letter-spacing: -.01em; }
a { color: inherit; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.error { color: var(--bad); min-height: 1.4em; margin: 8px 0 0; font-size: .9rem; }

/* small-caps label, used for every piece of "furniture" text */
.field-label, .card label, .daily-main label, .side-head, .chat-head, .rooms-list h2, .foot, .kicker {
  font: 600 .7rem/1.3 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--muted);
}

/* controls */
button, input, select { font: inherit; color: inherit; border-radius: 0; }
button {
  border: 1px solid var(--ink); padding: 11px 18px; cursor: pointer; background: none;
  font: 800 .74rem/1.2 var(--sans); letter-spacing: .11em; text-transform: uppercase;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
button:active { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: not-allowed; }
.primary { background: var(--ink); color: var(--bg); }
.primary:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.secondary { color: var(--ink); }
.secondary:hover:not(:disabled) { background: var(--ink); color: var(--bg); }
.ghost { border-color: var(--line); color: var(--muted); }
.ghost:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.small { padding: 7px 11px; font-size: .66rem; }
.big { padding: 15px 26px; font-size: .82rem; }
/* text fields are lines to write on, like an answer sheet */
input {
  width: 100%; min-width: 0; padding: 8px 2px 7px; background: none; border: 0; border-bottom: 1.5px solid var(--ink);
  font: 400 1.2rem/1.3 var(--serif);
}
input::placeholder { color: var(--muted); font-style: italic; opacity: .8; }
input:focus { outline: none; border-bottom-color: var(--accent); }
select { width: 100%; padding: 9px 10px; background: var(--bg); border: 1px solid var(--line); font-size: .9rem; }
select:focus-visible, button:focus-visible, a:focus-visible, input[type="checkbox"]:focus-visible, input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus-visible { outline: none; } /* a text line shows focus by turning yellow */
input[type="checkbox"], input[type="range"] { width: auto; border: 0; padding: 0; accent-color: var(--accent); }

/* masthead */
.top {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin: 0 clamp(12px, 3vw, 24px) 16px; padding: 14px 0 9px; border-bottom: 3px double var(--ink);
}
.brand { font: 700 2rem/1 var(--serif); letter-spacing: -.02em; color: var(--ink); text-decoration: none; display: flex; align-items: baseline; gap: 14px; }
.brand small { font: 600 .66rem/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 8px; padding-bottom: 2px; }
.conn { width: 8px; height: 8px; background: var(--warn); }
.conn.on { background: var(--good); }
.conn.off { background: var(--bad); }

/* front page */
.home { width: 100%; max-width: 680px; margin: 0 auto; padding: 8px 16px 48px; display: grid; gap: 30px; align-content: start; }
#home { max-width: 1060px; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 34px 56px; }
.hero { padding-top: 10px; }
.hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.3rem); letter-spacing: -.025em; }
.hero em { font-style: italic; font-weight: 400; color: var(--accent); }
.lede { font: 400 1.2rem/1.5 var(--serif); max-width: 44ch; margin: 22px 0 0; }
.lede::first-letter { float: left; font: 700 3.5em/.82 var(--serif); padding: .06em .09em 0 0; color: var(--ink); }
.card { background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--ink); padding: 20px 22px 22px; }
.card label { display: block; margin-bottom: 2px; }
.join-card { align-self: start; margin-top: 14px; }
.join-row { display: flex; align-items: flex-end; gap: 14px; margin-top: 20px; flex-wrap: wrap; }
.join-row .or { font: italic 400 1rem var(--serif); color: var(--muted); padding-bottom: 8px; }
.code-form { display: flex; align-items: flex-end; gap: 10px; flex: 1; min-width: 170px; }
#code { text-transform: uppercase; letter-spacing: .32em; font: 700 1.25rem var(--serif); text-align: center; }
.rooms-list h2 { padding-bottom: 8px; border-bottom: 1px solid var(--ink); margin-bottom: 4px; }
.rooms-list ul { list-style: none; margin: 0; padding: 0; }
.rooms-list li button {
  width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 2px;
  border: 0; border-bottom: 1px dotted var(--line); color: var(--ink); text-align: left;
  font: 400 1.02rem var(--serif); letter-spacing: 0; text-transform: none;
}
.rooms-list li button:hover { color: var(--accent); }
.rooms-list .code { font-weight: 700; letter-spacing: .14em; }
.rooms-list .muted { font: 400 .8rem var(--sans); }
.rooms-list > .muted { font: italic 400 1rem var(--serif); margin: 12px 0 0; }
.foot { grid-column: 1 / -1; padding-top: 12px; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }

/* the table: players | question sheet | chat column */
.room {
  flex: 1; min-height: 0; width: 100%; max-width: 1360px; margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 24px) 16px;
  display: grid; gap: 14px 28px;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, auto) auto minmax(0, 1fr);
  grid-template-areas: "side stage chat" "side say chat" "side . chat";
}
.side { grid-area: side; align-self: start; max-height: 100%; overflow: auto; }
.stage { grid-area: stage; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.say { grid-area: say; }
.chatbox { grid-area: chat; min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); padding-left: 20px; }
.side-head, .chat-head { display: flex; justify-content: space-between; align-items: baseline; padding-bottom: 8px; border-bottom: 1px solid var(--ink); }
.side-head b { font: 700 1.05rem var(--serif); letter-spacing: .16em; color: var(--ink); }
.side-head .muted { letter-spacing: .06em; }

/* scoreboard: name ........ score */
.players { list-style: none; margin: 0; padding: 0; }
.players li { display: flex; align-items: baseline; gap: 8px; padding: 9px 0 8px; border-bottom: 1px solid var(--line); font-weight: 600; }
.players .rank { font: italic 400 .95rem var(--serif); color: var(--muted); width: 20px; flex: none; }
.players .nm { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .sc { flex: 1 0 auto; display: flex; align-items: baseline; justify-content: flex-end; font: 700 1.15rem var(--serif); font-variant-numeric: tabular-nums; }
.players .sc::before { content: ""; flex: 1; min-width: 12px; margin: 0 6px 0 2px; border-bottom: 1px dotted var(--muted); opacity: .6; transform: translateY(-4px); }
.players .gain { font: 600 .72rem var(--sans); color: var(--good); margin-left: 6px; }
.players li.solved .nm { color: var(--good); }
.players li.solved .rank { color: var(--good); font-style: normal; font-size: 0; }
.players li.solved .rank::before { content: "✓"; font-size: .95rem; }
.players li.me .nm::after { content: " (you)"; color: var(--muted); font-weight: 400; font-size: .82em; }
.players li.off { opacity: .4; }
.players .host { font: 600 .6rem var(--sans); color: var(--accent); margin-left: 6px; text-transform: uppercase; letter-spacing: .1em; }

/* the sheet in the middle */
.view {
  background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--ink); padding: clamp(16px, 2.6vw, 30px);
  flex: 0 1 auto; min-height: 150px; overflow-y: auto;
}
/* reserve the sheet's reveal height up front, so the answer line does not move when the answer appears */
@media (min-width: 901px) { #vRound { min-height: clamp(150px, calc(100dvh - 260px), 31rem); } }

/* lobby: a form to fill in */
.lobby-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.lobby-head button { flex: none; }
#vLobby h2 { font-size: 1.9rem; }
#vLobby > .muted { font: italic 400 1.05rem var(--serif); margin: 6px 0 20px; }
/* the title and Start stay in view; only the settings scroll */
#vLobby:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 20px; min-width: 0; }
#settings { flex: 1; min-height: 0; overflow-y: auto; align-content: start; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.field { display: grid; gap: 8px; }
.field > .field-label:not(:first-child) { margin-top: 12px; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
/* categories are tick boxes on a printed list */
.chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)); gap: 0 18px; border-top: 1px solid var(--line); }
.chip {
  display: flex; align-items: center; gap: 10px; padding: 8px 2px; border: 0; border-bottom: 1px dotted var(--line); text-align: left;
  font: 600 .86rem var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink);
}
.chip::before { content: ""; flex: none; width: 14px; height: 14px; border: 1.5px solid var(--muted); font: 800 13px/11px var(--sans); text-align: center; color: var(--accent-ink); }
.chip:hover::before { border-color: var(--ink); }
.chip small { margin-left: auto; font: italic 400 .85rem var(--serif); color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--accent); }
.chip[aria-pressed="true"]::before { content: "✕"; background: var(--accent); border-color: var(--accent); }
.chip.news[aria-pressed="true"] { color: var(--news); }
.chip.news[aria-pressed="true"]::before { background: var(--news); border-color: var(--news); }
/* guests see the host's choices, not controls */
fieldset:disabled .chip { cursor: default; opacity: 1; }
fieldset:disabled .chip::before { display: none; }
fieldset:disabled .chip:not([aria-pressed="true"]) { color: var(--muted); }
.check { display: flex; align-items: center; gap: 9px; font-size: .88rem; }

/* a question */
.round-meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pill { font: 800 .7rem/1.3 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.pill.news { color: var(--news); border: 1px solid var(--news); padding: 2px 6px; }
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dots i { width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--muted); }
.dots i.on { background: var(--muted); }
#qNum { margin-left: auto; font: italic 400 1rem var(--serif); }
.timer { height: 3px; background: var(--line); overflow: hidden; margin: 10px 0 22px; }
.timer > div { height: 100%; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.timer.low > div { background: var(--bad); }
.question { white-space: pre-line; font: 700 clamp(1.55rem, 3.1vw, 2.35rem)/1.2 var(--serif); margin: 0; letter-spacing: -.012em; text-wrap: balance; max-width: 30ch; }
.status { min-height: 2em; margin-top: 16px; font-weight: 600; font-size: .92rem; }
.status.good { color: var(--good); }
.status.warn { color: var(--warn); }
.reveal { margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.reveal strong {
  font: italic 400 clamp(1.8rem, 4.2vw, 2.9rem)/1.15 var(--serif); justify-self: start;
  text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 3px; text-underline-offset: .16em;
}
#answerDetail { font: italic 400 1rem var(--serif); }
.solvers { margin-top: 12px; display: grid; }
.solvers span, .solvers em { padding: 6px 0; border-bottom: 1px dotted var(--line); font-size: .86rem; font-weight: 600; color: var(--good); }
.solvers em { color: var(--muted); font: italic 400 1rem var(--serif); }
.solvers q { font: italic 400 1.02rem var(--serif); color: var(--ink); quotes: "“" "”"; }
.reveal-actions { display: flex; align-items: center; gap: 14px; margin-top: 12px; }
.reveal-actions a { color: var(--news); font: italic 400 1rem var(--serif); }

/* video, picture and song rounds */
.media { position: relative; aspect-ratio: 16 / 9; max-height: 46vh; margin: 0 auto 18px; background: #000; border: 1px solid var(--line); overflow: hidden; }
.media-frame, .media-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.media.blurred .media-frame { will-change: filter; }
.media-mask { position: absolute; left: 0; right: 0; top: 0; height: max(64px, 18%); background: #000; } /* hides the title YouTube draws */
.media-shield { position: absolute; inset: 0; }
/* covers the player until the clip is actually playing, so YouTube's preview image (often the poster or title card) never shows */
.media-cover { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; background: #000; color: var(--muted); font: italic 400 1.1rem var(--serif); }
.media-play { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); white-space: nowrap; }
.media-play:active { transform: translateX(-50%) translateY(1px); }
.media-note { position: absolute; inset: 0; margin: 0; display: grid; place-items: center; padding: 16px; text-align: center; background: #000; font: italic 400 1.15rem var(--serif); }
.pic { display: grid; place-items: center; margin: 0 auto 18px; background: #000; border: 1px solid var(--line); overflow: hidden; }
.pic img { display: block; max-width: 100%; max-height: 44vh; object-fit: contain; }
.song { display: grid; justify-items: center; gap: 12px; padding: 22px 16px; margin-bottom: 18px; border: 1px solid var(--line); text-align: center; }
.song p { margin: 0; font: italic 400 1.05rem var(--serif); color: var(--muted); }
.eq { display: flex; align-items: flex-end; gap: 5px; height: 48px; }
.eq i { width: 3px; background: var(--ink); height: 20%; }
.song.playing .eq i { animation: eq .9s ease-in-out infinite alternate; }
.eq i:nth-child(2) { animation-delay: -.6s !important; } .eq i:nth-child(3) { animation-delay: -.2s !important; }
.eq i:nth-child(4) { animation-delay: -.75s !important; } .eq i:nth-child(5) { animation-delay: -.35s !important; }
.eq i:nth-child(6) { animation-delay: -.5s !important; } .eq i:nth-child(7) { animation-delay: -.1s !important; }
@keyframes eq { from { height: 15%; } to { height: 100%; } }
.vol { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.vol:not([hidden]) + #qNum { margin-left: 10px; }
.vol-btn { border-color: var(--line); padding: 4px 8px; font-size: .62rem; color: var(--muted); }
.vol input { width: 96px; }

/* game over */
#vOver { text-align: center; }
.winner { font-size: clamp(2.1rem, 6vw, 3.4rem); margin: 6px 0 22px; }
.winner span { font-style: italic; font-weight: 400; color: var(--accent); }
.podium { list-style: none; padding: 0; margin: 0 auto 22px; max-width: 380px; text-align: left; border-top: 1px solid var(--ink); }
.podium li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 2px; border-bottom: 1px dotted var(--line); font: 400 1.08rem var(--serif); }
.podium li span:last-child { font-weight: 700; font-variant-numeric: tabular-nums; }
.podium li.me { color: var(--accent); }
.over-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* chat column and the answer line */
.feed { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 2px 4px 0; font-size: .86rem; display: flex; flex-direction: column; gap: 4px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.feed p { margin: 0; overflow-wrap: anywhere; flex: none; }
.feed b { font-weight: 800; font-size: .92em; }
.feed .guess { color: var(--muted); }
.feed .sys { color: var(--muted); font: italic 400 .98rem var(--serif); }
.feed .solve { color: var(--good); font-weight: 600; }
.feed .solve::before { content: "✓ "; }
.say { display: flex; align-items: flex-end; gap: 12px; flex: none; }
.say input { font-size: 1.45rem; padding: 10px 2px 8px; border-bottom-width: 2px; }
.say.answering input { border-bottom-color: var(--accent); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.say.shake input { animation: shake .3s; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10; background: var(--ink); color: var(--bg); padding: 10px 16px; font-weight: 600; max-width: calc(100vw - 32px); }

/* daily five */
.daily-card { grid-column: 1; display: flex; align-items: center; gap: 18px; text-decoration: none; color: var(--ink); align-self: start; }
.daily-card:hover { border-top-color: var(--accent); }
.daily-card b { font: 700 1.25rem var(--serif); }
.daily-card .muted { font-size: .86rem; }
.daily-badge { font: 700 2.6rem/1 var(--serif); padding-right: 18px; border-right: 1px solid var(--line); white-space: nowrap; color: var(--accent); }
.daily-go { margin-left: auto; font: 800 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; white-space: nowrap; }
#home .rooms-list { grid-column: 2; }
.daily-main h2 { font-size: 1.8rem; margin: 18px 0 8px; }
.daily-main > div > .muted { font: 400 1.05rem/1.5 var(--serif); }
.daily-main label { display: block; margin: 18px 0 2px; }
.daily-main #dStart { margin-top: 10px; }
.daily-main .say { margin-top: 18px; }
.d-dots { display: flex; gap: 6px; margin: 14px 0 18px; }
.d-dots span { width: 16px; height: 16px; border: 1.5px solid var(--muted); }
.d-dots .ok { background: var(--good); border-color: var(--good); }
.d-dots .no { background: var(--bad); border-color: var(--bad); }
.d-dots .now { border-color: var(--accent); box-shadow: inset 0 0 0 3px var(--bg), inset 0 0 0 8px var(--accent); }
#dDone { text-align: center; }
.d-share { display: flex; justify-content: center; gap: 8px; margin: 0 0 16px; }
.d-share span { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--muted); }
.d-share .ok { background: var(--good); border-color: var(--good); }
.d-share .no { border-color: var(--bad); }
.d-answers { text-align: left; padding: 0; margin: 22px 0 0; list-style: none; border-top: 1px solid var(--ink); }
.d-answers li { padding: 10px 0; border-bottom: 1px dotted var(--line); font-size: .88rem; color: var(--muted); }
.d-answers b { display: block; font: italic 400 1.15rem var(--serif); color: var(--ink); margin-top: 2px; }
.d-answers li.right b { color: var(--good); }

/* narrow screens: one column — players, sheet, chat, answer line at the bottom */
@media (max-width: 900px) {
  #home { grid-template-columns: minmax(0, 1fr); }
  .daily-card, #home .rooms-list { grid-column: 1; }
  .room {
    grid-template-columns: minmax(0, 1fr); gap: 10px;
    grid-template-rows: auto minmax(0, auto) minmax(90px, 1fr) auto;
    grid-template-areas: "side" "stage" "chat" "say";
  }
  .chatbox { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); }
  .chat-head { display: none; }
  .side { max-height: none; }
  .side-head { padding-bottom: 6px; }
  .players { display: flex; overflow-x: auto; gap: 0; }
  .players li { flex: 0 0 auto; padding: 7px 12px 7px 0; margin-right: 12px; border-bottom: 0; border-right: 1px solid var(--line); font-size: .86rem; }
  .players .rank { display: none; }
  .players li.solved .rank { display: block; width: auto; }
  .players .nm { overflow: visible; }
  .players .sc { font-size: 1rem; }
  .players .sc::before { display: none; }
  .brand { font-size: 1.55rem; }
  .brand small { display: none; }
  .chips { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .daily-badge { font-size: 2rem; }
  .lobby-head { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ballpark */
.bp-card .daily-badge { font-size: 2.2rem; }
.bp { max-width: 1060px; }
.bp-room { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; }
.bp-room .side { grid-area: auto; max-height: none; overflow: visible; } /* the main game's sidebar sizing does not apply here */
.bp-room .view { overflow: visible; }
.bp-side-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.bp-sheet .question { margin-bottom: 18px; }
.bp-guess { max-width: 480px; }
.bp-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; margin-top: 18px; border-top: 1px solid var(--ink); border-left: 1px solid var(--line); }
.bp-slot {
  display: grid; gap: 4px; align-content: start; text-align: left; padding: 12px 12px 14px; min-height: 108px;
  border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font: 400 1rem var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink);
}
.bp-slot:hover:not(:disabled) { background: var(--good-bg); }
.bp-slot:disabled { opacity: 1; cursor: default; }
.bp-odds { font: 800 .7rem/1.3 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--accent); }
.bp-value { font: 700 1.5rem/1.15 var(--serif); font-variant-numeric: tabular-nums; }
.bp-slot:first-child .bp-value { font: italic 400 1.05rem/1.25 var(--serif); color: var(--muted); }
.bp-writers { font-size: .8rem; color: var(--muted); }
.bp-tokens { font: 600 .78rem var(--sans); color: var(--accent); min-height: 1.2em; }
.bp-slot.mine { background: rgba(227, 178, 60, .07); } /* the "Your token" line marks it; no accent bar */
.bp-slot.win { background: var(--good-bg); }
.bp-slot.win .bp-value { color: var(--good); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .15em; }
.bp-mybets { margin-top: 18px; display: grid; gap: 10px; justify-items: start; }
.bp-mybets p { margin: 0; }
.bp-bet { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.bp-bet input { width: 90px; text-align: center; }
#bpReveal .solvers em { color: var(--ink); }
#bpReveal .solvers span.loss, .players .gain.loss { color: var(--bad); }
#bpOver { text-align: center; }
@media (max-width: 900px) {
  .bp-room { grid-template-columns: minmax(0, 1fr); }
  .bp-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* show-off */
.so-rounds { max-width: 260px; margin: 6px 0 16px; }
.so-board { display: grid; gap: 0; margin: 14px 0 18px; border-top: 1px solid var(--ink); }
.so-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 2px; border-bottom: 1px dotted var(--line); }
.so-row .so-cat { font: 700 1.2rem var(--serif); }
.so-values { display: flex; gap: 6px; }
.so-values button { width: 38px; padding: 7px 0; font-size: .85rem; }
.so-values button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.so-boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin: 14px 0 18px; }
.so-player h3 { margin: 0 0 6px; font: 600 .7rem/1.3 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); padding-bottom: 6px; border-bottom: 1px solid var(--ink); }
.so-player.me h3 { color: var(--accent); }
.so-slot { display: flex; align-items: baseline; gap: 10px; width: 100%; padding: 8px 2px; border: 0; border-bottom: 1px dotted var(--line); text-align: left; font: 400 1rem var(--serif); letter-spacing: 0; text-transform: none; color: var(--ink); }
.so-slot b { font: 700 1.1rem var(--serif); color: var(--accent); width: 1.2em; }
.so-slot.played { color: var(--muted); text-decoration: line-through; }
.so-slot.picked { background: rgba(227, 178, 60, .12); }
.so-slot:disabled { opacity: 1; cursor: default; }
.so-swap-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.so-turn-head { margin: 0 0 8px; font: 600 .95rem var(--sans); color: var(--muted); }
.so-turn-head b { color: var(--ink); }
#soShowOff { margin-top: 12px; }
#soResults span.loss { color: var(--bad); }
#soResults span.miss { color: var(--muted); }
.players .so-tokens { font: 400 .62rem var(--sans); letter-spacing: .15em; color: var(--accent); margin-left: 6px; }
#soOver { text-align: center; }
#soQuestion { white-space: pre-line; }

/* first buzz */
.bz-cat { margin-left: auto; }
.bz-settings { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; margin: 6px 0 18px; }
.bz-settings .field { width: 120px; }
.bz-settings .check { display: flex; gap: 8px; align-items: center; font-size: .9rem; padding-bottom: 9px; }
.bz-question { min-height: 3.3em; white-space: pre-line; }
.bz-question .bz-caret { display: inline-block; width: .45em; height: .9em; margin-left: .15em; background: var(--accent); vertical-align: -.05em; animation: bz-blink .9s steps(2) infinite; }
@keyframes bz-blink { 50% { opacity: 0; } }
.bz-buzz { display: block; width: 100%; margin: 14px 0 6px; padding: 22px 0; font: 700 1.5rem var(--serif); letter-spacing: .04em; text-transform: none; background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.bz-buzz:hover:not(:disabled) { filter: brightness(1.08); }
.bz-buzz:disabled { background: transparent; border-color: var(--line); color: var(--muted); opacity: 1; }
.bz-buzz kbd { font: 600 .62rem var(--sans); letter-spacing: .12em; text-transform: uppercase; border: 1px solid currentColor; padding: 2px 6px; margin-left: 10px; vertical-align: middle; opacity: .7; }
.bz-attempts { list-style: none; margin: 10px 0 0; padding: 0; font-size: .92rem; }
.bz-attempts li { padding: 4px 0; border-bottom: 1px dotted var(--line); }
.bz-attempts .no { color: var(--bad); }
.bz-attempts .yes { color: var(--good); }
#bzResults span.loss { color: var(--bad); }
#bzResults span.miss { color: var(--muted); }
#bzDetail { display: block; margin-top: 2px; }
.players .bz-buzzing { font: 600 .62rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-left: 6px; }
.players .bz-rating { font: 400 .66rem var(--sans); color: var(--muted); margin-left: 6px; }
#bzOver { text-align: center; }
#bzLadderBox { margin-top: 26px; }
.bz-ladder { list-style: none; margin: 8px 0 0; padding: 0; border-top: 1px solid var(--ink); }
.bz-ladder li { display: flex; gap: 10px; align-items: baseline; padding: 7px 2px; border-bottom: 1px dotted var(--line); }
.bz-ladder li .r { margin-left: auto; font: 700 1.05rem var(--serif); }
.bz-ladder li .g { font-size: .78rem; color: var(--muted); }
@media (hover: none) { .bz-buzz kbd { display: none; } }

/* show-off countdown */
.so-meta { align-items: center; }
.so-secs { margin-left: auto; font: 700 1.6rem/1 var(--serif); font-variant-numeric: tabular-nums; color: var(--ink); min-width: 2.2ch; text-align: right; }
.so-secs.low { color: var(--bad); }
.so-secs small { font: 600 .62rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-left: 3px; }
.bp-sheet .timer { height: 5px; }
.so-scale { display: flex; justify-content: space-between; width: 170px; margin: 10px 2px -6px auto; font: 600 .66rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.bz-secs { margin-left: 14px; }
.so-subjects { font-size: .85rem; margin: -4px 0 14px; }

/* party modes: Blurt, Rattle Off, Ten Spot */
.party-rules p { margin: 0 0 10px; }
.party-body .say { margin-top: 14px; }
.bl-clues { margin: 6px 0 4px; padding-left: 1.6em; font: 400 1.18rem/1.45 var(--serif); }
.bl-clues li { padding: 5px 0; border-bottom: 1px dotted var(--line); color: var(--muted); }
.bl-clues li.latest { color: var(--ink); font-weight: 700; animation: bl-in .35s ease-out; }
@keyframes bl-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ro-bid { font-weight: 600; margin: 10px 0 0; }
.ro-bidform input { max-width: 140px; }
.ro-named, .ro-all { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 12px 0 0; }
.ro-named li, .ro-all li { border: 1px solid var(--line); padding: 4px 9px; font-size: .9rem; }
.ro-named li { border-color: var(--good); color: var(--good); }
.ro-named li.them { border-color: var(--line); color: var(--muted); }
.ro-all li.named { border-color: var(--good); color: var(--good); }
.ro-wrong { font-size: .85rem; margin-top: 8px; }
.ts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.ts-opt { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 10px 12px; text-align: left; text-transform: none; letter-spacing: 0; font: 400 1rem var(--serif); color: var(--ink); border: 1px solid var(--line); background: transparent; }
.ts-opt:disabled { opacity: 1; cursor: default; }
.ts-opt:not(:disabled):hover { border-color: var(--accent); }
.ts-opt.picked { border-color: var(--accent); background: rgba(227, 178, 60, .12); }
.ts-opt.right { border-color: var(--good); }
.ts-opt.wrong { border-color: var(--bad); }
.ts-opt .ts-val { font: 600 .78rem var(--sans); color: var(--muted); text-align: right; }
.ts-opt.right .ts-val { color: var(--good); }
.ts-opt.wrong .ts-val { color: var(--bad); }
.ts-opt.reveal .ts-val { color: var(--muted); }
.ts-answer { margin: 4px 0 12px; }
.ts-ask { font-weight: 700; margin: 0 0 8px; }
.ts-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-last { margin-top: 10px; }
.party-over { text-align: center; }
@media (max-width: 560px) { .ts-grid { grid-template-columns: minmax(0, 1fr); } }
.party-body .say button { white-space: nowrap; }

/* home: everything on one screen. Hero and join box side by side, the games as a 4 x 2 grid of tiles. */
#home { max-width: 1180px; gap: 22px 48px; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  grid-template-areas: "hero join" "hero rooms" "modes modes" "foot foot"; }
#home .hero { grid-area: hero; align-self: start; }
#home .hero h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.02; margin: 0 0 12px; }
#home .hero .lede { margin: 0; max-width: 44ch; }
#home .join-card { grid-area: join; }
#home .rooms-list { grid-area: rooms; grid-column: auto; }
#home .rooms-list h2 { margin-top: 0; }
#home .rooms-list > .muted { margin-top: 8px; }
#home .foot { grid-area: foot; }
.modes { grid-area: modes; min-width: 0; }
.modes h2 { margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--ink); font: 600 .7rem/1.3 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--muted); }
.mode-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mode-grid .daily-card { grid-column: auto; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 12px; row-gap: 2px; align-items: start; padding: 14px 16px; min-height: 0; }
.mode-grid .daily-badge { grid-row: 1 / span 2; font-size: 1.9rem; padding-right: 12px; min-width: 1.4em; text-align: center; }
.mode-grid .bp-card .daily-badge { font-size: 1.7rem; }
.mode-grid .daily-card > span:nth-child(2) { line-height: 1.25; }
.mode-grid .daily-card b { font-size: 1.08rem; }
.mode-grid .daily-card .muted { font-size: .8rem; line-height: 1.35; display: block; margin-top: 3px; }
.mode-grid .daily-go { display: none; }
.mode-grid .daily-card:hover b { color: var(--accent); }
@media (max-width: 1000px) { .mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  #home { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "join" "modes" "rooms" "foot"; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mode-grid .daily-card { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .mode-grid .daily-badge { grid-row: auto; border-right: 0; padding: 0; text-align: left; font-size: 1.5rem; }
}

#home { gap: 18px 44px; padding-bottom: 20px; }
#home .join-card { padding-top: 16px; padding-bottom: 16px; }
#home .join-card .error { min-height: 0; margin-top: 4px; }
#home .join-card .error:empty { display: none; }
/* short screens (laptops): a smaller headline and intro so the games still fit without scrolling */
@media (max-height: 820px) and (min-width: 761px) {
  #home .hero h1 { font-size: clamp(2.1rem, 3.6vw, 2.9rem); margin-bottom: 8px; }
  #home .hero .lede { font-size: .98rem; line-height: 1.5; }
  #home .hero .lede::first-letter { font-size: 2.6em; }
  .mode-grid .daily-card { padding: 11px 14px; }
}
@media (max-height: 680px) and (min-width: 761px) {
  #home .hero .lede { display: none; }
  #home { padding-top: 0; padding-bottom: 6px; row-gap: 12px; }
  .modes h2 { margin-bottom: 6px; padding-bottom: 5px; }
  .mode-grid { gap: 10px; }
}
@media (max-width: 760px) {
  .mode-grid .daily-card { grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; padding: 10px 12px; }
  .mode-grid .daily-badge { grid-row: 1; font-size: 1.15rem; min-width: 0; }
  .mode-grid .bp-card .daily-badge { font-size: 1.1rem; }
  .mode-grid .daily-card b { font-size: 1rem; }
  .mode-grid .daily-card .muted { grid-column: 1 / -1; font-size: .78rem; }
  #home .hero h1 { font-size: 2.2rem; }
  #home .hero .lede { font-size: .95rem; }
  #home .hero .lede::first-letter { font-size: 1em; float: none; padding: 0; }
}
.mode-grid .daily-card > span:nth-child(2) { display: contents; }
.mode-grid .daily-card > span:nth-child(2) > b { grid-column: 2; align-self: center; }
.mode-grid .daily-card > span:nth-child(2) > br { display: none; }
.mode-grid .daily-card > span:nth-child(2) > .muted { grid-column: 2; }
@media (max-width: 760px) { .mode-grid .daily-card > span:nth-child(2) > .muted { grid-column: 1 / -1; } }
/* every game tile the same size: rows share one height, tiles fill their cell, descriptions stop at two lines */
.mode-grid { grid-auto-rows: 1fr; }
.mode-grid .daily-card { align-self: stretch; height: 100%; box-sizing: border-box; }
.mode-grid .daily-card .muted { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
/* describe it */
.ds-wordcard { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 12px 0; padding: 16px 18px; border: 1px solid var(--accent); background: rgba(227, 178, 60, .08); }
.ds-wordcard .kicker { width: 100%; }
.ds-wordcard strong { font: 700 clamp(1.8rem, 4vw, 2.6rem)/1.1 var(--serif); flex: 1 1 auto; }
.ds-feed { list-style: none; margin: 10px 0 0; padding: 0; max-height: 34vh; overflow-y: auto; font-size: .95rem; }
.ds-feed li { padding: 5px 2px; border-bottom: 1px dotted var(--line); }
.ds-feed .ds-clue { color: var(--ink); }
.ds-feed .ds-guess { color: var(--muted); }
.ds-feed .ds-right { color: var(--good); }
.ds-feed .ds-pass { color: var(--muted); font-style: italic; }
