/* Good Question's table: the seats over the cabinet, the stage over the
   cabinet for a clue and each big moment, the dock under it; on the room's
   structure (games/room/room.css), from the tokens in good-question.css.
   On a phone the cabinet turns on its side (a row a category), and with
   the keyboard up (typing an answer) the board steps aside, so the clue,
   what you're typing and the clock all stay in view. */

/* ── the frame ───────────────────────────────────────────────────────── */
.felt.gq { position: relative; height: calc(100dvh - 2 * var(--frame)); min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.felt.gq.docked { grid-template-columns: minmax(0, 1fr) 300px; }
.gq .logdock { min-height: 0; display: flex; flex-direction: column; }
.gq .logdock:empty { display: none; }
.gq .logdock .gamelog { flex: 1; }
.gq .tablemain { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.gq .gamelog.drawer { position: absolute; z-index: 30; right: 14px; top: 64px; bottom: 24px; width: min(360px, calc(100% - 28px)); box-shadow: -10px 10px 30px rgba(0, 0, 0, .45); }
.gq .logbtn.on { background: var(--pick-tint); box-shadow: var(--pick-ring); }
.gq .bar .more svg { display: block; }
.gq .bar .title { font: var(--display-weight) var(--t-bar, 18px)/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gqwhere { font: 500 var(--t-bar, 17px)/1.2 var(--ui-font); color: var(--soft); }

/* ── the seats: library card pockets, each with its card standing up out
   of it, the player's name typed on the card, mark and score on the pocket ── */
.gqseats { display: flex; gap: 12px; flex-wrap: wrap; padding-top: 14px; }
.gqseat { position: relative; display: flex; align-items: center; gap: 8px; min-width: 150px; padding: 18px 12px 7px 10px; border-radius: 4px 4px 8px 8px;
  background: linear-gradient(180deg, #dcc596, #b99d66); color: var(--type); box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .6); }
.gqseat .seatmark { flex: none; }
.gqnm { position: absolute; left: 8px; right: 8px; top: -9px; height: 22px; padding: 5px 6px 0; border-radius: 3px 3px 0 0; background: var(--card); border-top: 3px solid var(--card-red);
  font: 700 12px/1.1 var(--typed); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
.gqnm small { font: 500 11px var(--ui-font); text-transform: none; letter-spacing: 0; color: var(--type-soft); }
.gqtag { position: absolute; right: 4px; bottom: calc(100% + 12px); font: 700 11px/1 var(--ui-font); background: var(--ink); color: var(--green-lo); padding: 3px 6px; border-radius: 3px; white-space: nowrap; }
.gqsc { font: 800 21px/1.1 var(--ui-font); font-variant-numeric: tabular-nums; }
.gqsc.neg { color: var(--bad-on-card); }
.gqseat .gqsc.neg { color: #7a1a12; } /* (a deeper red: the pockets' tan is darker than a card, 4.7:1) */
.gqstandings .gqsc.neg { color: var(--bad); } /* (on the green, the light red) */
.gqseat.turn { box-shadow: inset 0 0 0 3px var(--turn), 0 6px 12px -6px rgba(0, 0, 0, .6); } /* (rings inside the seat's edge, as every highlight is: ADR 0105) */
.gqseat.turn .gqtag { background: var(--turn); color: var(--turn-ink); }
.gqseat.out { opacity: .78; box-shadow: 0 0 0 2px var(--soft); outline: 2px dashed var(--green-lo); outline-offset: -5px; }
/* the buzz: the answerer's pocket rings in their color on every screen */
.gqseat.lit { box-shadow: inset 0 0 0 3px var(--c), inset 0 0 0 7px color-mix(in srgb, var(--c) 30%, transparent), 0 6px 12px -6px rgba(0, 0, 0, .6); }

/* ── the board ───────────────────────────────────────────────────────── */
.gqmain { position: relative; flex: 1; min-height: 0; display: flex; }
.gqboardwrap { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.gqcabinet { flex: 1; min-height: 0; display: flex; flex-direction: column; border-radius: 8px; background: linear-gradient(180deg, var(--oak-lo), var(--oak-deep)); box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .12); }
.gqgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: 62px repeat(5, minmax(0, 1fr)); gap: 8px; padding: 10px; }
/* on a phone, on its side: a category a row, its title at the left */
.gqcabinet.side .gqgrid { padding: 6px; }
.gqcabinet.side .gqcrown { height: 22px; }
.gqcabinet.side .gqnameplate { padding: 3px 10px 6px; } /* (Courier's capitals sit low: more below than above centers their ink) */
.gqcabinet.side .gqnameplate { font-size: 10px; }
.gqcabinet.side .gqplinth { height: 8px; }
.gqgrid.wave { grid-template-rows: repeat(5, minmax(0, 1fr)); }
.gqcabinet.side .gqgrid.wave { grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); }
.gqcabinet.side .gqgrid { grid-template-columns: 96px repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 5px; }
.gqcabinet.side .gqcat { font-size: 11px; padding: 3px 5px; border-top: 0; border-left: 3px solid var(--card-red); }
.gqcabinet.side .gqdrawer { --plate: 13px; --knob: 5px; gap: 4px; }
/* (at a phone's size the figures sit high in a line of 1: the padding leans down) */
.gqcabinet.side .gqplate { min-width: 0; width: 90%; padding: 2px; }
.gqcabinet.side .gqplate b { padding: calc(2px + .08em) 0 calc(2px - .08em); line-height: 1; }
/* (the narrowest phones: four figures still fit a plate) */
@media (max-width: 360px) { .gqcabinet.side .gqdrawer { --plate: 11px; } .gqcabinet.side .gqplate { width: 96%; padding: 1px; } }
.gqfinal { flex: 1; }
.gqline { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--t-note); color: var(--soft); gap: 12px; }
.gqline b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* (Under the stage's cover the line would only ghost through at the cabinet's foot.) */
.gqmain:has(> .gqstage:not([hidden])) .gqline { visibility: hidden; }
/* (nor the crown's nameplate, behind the stage's heading: a round's introduction has no cover, so it stays) */
.gqmain:has(> .gqstage:not([hidden]):not(.intro)) .gqcrown .gqnameplate { visibility: hidden; }

/* ── the stage: a card over the board ────────────────────────────────── */
.gqstage { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 14px; overflow: auto; background: rgba(6, 20, 16, .82); border-radius: 10px; }
.gqstage[hidden] { display: none; }
.gqcol { width: 100%; max-width: 640px; display: grid; gap: 12px; justify-items: center; }
.gqcol.wide { max-width: 820px; }
.gqstagehead { font: 400 34px/1.1 var(--display); text-align: center; margin: 0; color: var(--ink); }
.gqstagehead small { display: block; font: 600 14px/1.3 var(--ui-font); letter-spacing: .14em; text-transform: uppercase; color: var(--brass); margin-bottom: 6px; }
/* the Last Question: the lights down to one lamp over the card */
.gqstage.dim { background: radial-gradient(ellipse 45% 55% at 50% 38%, rgba(255, 214, 120, .18), transparent 70%), rgba(2, 8, 6, .93); }
/* a round's introduction: each category big on the stage, with its line */
.gqbigcat { width: min(560px, 92%); box-sizing: border-box; background: var(--card); color: var(--type); border-radius: 6px; border-top: 6px solid var(--card-red); padding: 20px 26px 24px; text-align: center; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8); }
.gqbigcat small { display: block; font: 600 14px/1 var(--ui-font); letter-spacing: .14em; text-transform: uppercase; color: var(--type-soft); margin-bottom: 12px; }
.gqbigcat b { display: block; font: 700 40px/1.15 var(--typed); text-transform: uppercase; letter-spacing: .02em; text-wrap: balance; overflow-wrap: break-word; }
.gqbigcat p { margin: 14px 0 0; font: 500 19px/1.35 var(--ui-font); color: var(--type-soft); }
/* (the round's name and who picks first: the same card, in the heading face) */
.gqbigcat.say b { font: 400 40px/1.15 var(--display); text-transform: none; letter-spacing: 0; }
/* (the introduction keeps the board in sight, its drawers dimmed, so you see
   each category land on its guide card) */
.gqstage.intro { background: none; overflow: visible; }
.gqcabinet.introing .gqdrawer { opacity: .4; }
/* (flying home: it shrinks onto its guide card, its title still on it, the rest fading) */
.gqbigcat.fly { transition: transform var(--fly, 600ms) cubic-bezier(.5, 0, .3, 1), box-shadow var(--fly, 600ms); box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.gqbigcat.fly > :not(b) { opacity: 0; transition: opacity calc(var(--fly, 600ms) / 2); }
@media (prefers-reduced-motion: no-preference) {
  .gqbigcat { animation: gqbigin 420ms cubic-bezier(.2, 1.2, .4, 1) both; }
  @keyframes gqbigin { from { opacity: 0; transform: translateY(24px) scale(.94); } to { opacity: 1; transform: none; } }
}
/* "Mom buzzed in": a held beat, in the buzzer's color, over the card */
.gqrung { display: flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px; border-radius: 999px; background: var(--green-lo); border: 3px solid var(--c); box-shadow: 0 0 0 8px color-mix(in srgb, var(--c) 25%, transparent); font: 400 26px/1.1 var(--display); }
.gqrung small { display: block; font: 600 15px var(--ui-font); color: var(--soft); }
.gqsline { text-align: center; font-size: 17px; margin: 0; max-width: 42ch; padding: 6px 12px; border-radius: 10px; background: var(--green-lo); }
.gqread { height: 10px; border-radius: 6px; background: rgba(35, 33, 28, .14); overflow: hidden; margin-top: 10px; }
.gqread i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(180deg, var(--brass-hi), var(--brass) 50%, var(--brass-lo)); }
.gqread.full i { background: var(--good-on-card); }
/* opening a square: the drawer lifts and grows into the clue's card */
@media (prefers-reduced-motion: no-preference) {
  .gqcard.lift { animation: gqlift 1000ms cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes gqlift { 0% { transform: scale(.18) translateY(30%); opacity: 0; } 25% { opacity: 1; } 100% { transform: none; } }
}

/* the bet */
.gqwager { display: grid; gap: 12px; background: var(--panel); border: var(--panel-edge); border-radius: 14px; padding: 16px; width: 100%; max-width: 420px; box-sizing: border-box; }
.gqnote { margin: 0; font-size: var(--t-note); color: var(--soft); }
.gqstepper { display: grid; grid-template-columns: 52px 1fr 52px; gap: 8px; align-items: center; }
.gqstepper .btn { padding: 0; height: 52px; font-size: 24px; }
.gqnum { box-sizing: border-box; width: 100%; height: 52px; border-radius: 10px; background: #fffdf7; color: var(--type); text-align: center; font: 700 26px/1 var(--ui-font); font-variant-numeric: tabular-nums; border: 2px solid var(--soft); }
.gqnum:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.gqchoices { display: flex; gap: 6px; padding: 4px; border-radius: 12px; border: var(--panel-edge); }
.gqchoices button { all: unset; box-sizing: border-box; flex: 1; text-align: center; min-height: 44px; display: grid; place-items: center; border-radius: 8px; font: 600 15px/1 var(--ui-font); cursor: pointer; }
.gqchoices button.on { background: var(--pick-tint); box-shadow: var(--pick-ring); font-weight: var(--pick-weight); }
.gqchoices button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* "Close enough?" */
.gqvote { width: 100%; max-width: 440px; box-sizing: border-box; background: #fbf7ec; color: var(--type); border-radius: 16px; padding: 18px; display: grid; gap: 12px; box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .75); }
.gqvote h2 { margin: 0; font: 400 26px/1.1 var(--display); }
.gqvote p { margin: 0; color: #3f3c34; }
.gqvote .gqnote { color: var(--type-soft); }
.gqsaid { font: 700 17px/1.4 var(--typed); background: #f1ead8; border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; overflow-wrap: anywhere; }
.gqsaid span { font: 600 13px/1 var(--ui-font); color: var(--type-soft); text-transform: uppercase; letter-spacing: .08em; }
.gqvote .btns { display: flex; gap: 8px; }
.gqvote .btn { flex: 1; color: var(--type); border: 2px solid var(--type); background: transparent; }
.gqraise { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gqraise .btn { white-space: normal; text-align: left; height: auto; min-height: 44px; }

/* the scoreboard, the reveal */
.gqstandings { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 440px; display: grid; gap: 6px; }
.gqstandings li { display: grid; grid-template-columns: 30px 30px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--panel); border: var(--panel-edge); }
.gqstandings li.you { border-color: var(--ink); }
.gqpl { font: 700 14px/1 var(--ui-font); color: var(--soft); text-align: center; font-variant-numeric: tabular-nums; }
.gqstandings .gqnm { font-weight: 600; text-align: left; min-width: 0; overflow-wrap: anywhere; }
.gqstandings .gqnm small { display: block; font-weight: 400; color: var(--soft); font-size: 13px; }
.gqstandings .gqsc { font-size: 22px; text-align: right; white-space: nowrap; }
.gqstandings .gqsc small { display: block; font: 500 12px/1.2 var(--ui-font); color: var(--bad); }
.gqmoments { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; max-width: 440px; }
.gqmoments li { display: flex; gap: 8px; align-items: baseline; font-size: 15px; }
.gqmoments li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--brass); transform: translateY(-1px) rotate(45deg); }
.gqqueue { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.gqqueue span { display: flex; align-items: center; gap: 6px; font-size: 14px; padding: 5px 10px 5px 5px; border-radius: 999px; border: var(--panel-edge); background: var(--panel); }
.gqqueue span.now { border-color: var(--turn); color: var(--turn); }
.gqqueue span.done { color: var(--soft); }
.gqreveal { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; align-items: center; }
.gqdelta { display: grid; gap: 8px; }
.gqdl { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; padding: 10px 14px; border-radius: 10px; background: var(--panel); border: var(--panel-edge); }
.gqdl b { font-variant-numeric: tabular-nums; }
.gqbig { font: 700 34px/1 var(--ui-font); font-variant-numeric: tabular-nums; text-align: center; padding: 8px 0; }
.gqbig.up { color: var(--good); }
.gqbig.down { color: var(--bad); }
.gqlead { font: 400 26px/1.15 var(--display); color: var(--turn); text-align: center; margin: 0; }
.gqresult p { margin: 0 0 10px; }

/* ── the dock ────────────────────────────────────────────────────────── */
.gqdock { flex: none; display: flex; align-items: center; gap: 16px; min-height: 74px; padding: 12px 16px; border-radius: var(--panel-radius); background: var(--panel); border: var(--panel-edge); box-sizing: border-box; flex-wrap: wrap; }
.gqdock.live { border: 2px solid var(--turn); }
.gqstatus { flex: 1 1 260px; min-width: 0; font-size: 16px; line-height: 1.35; }
.gqgo { color: var(--turn); }
.gqbuzz { height: 56px; min-width: 240px; font-size: 20px; letter-spacing: .02em; border-radius: 14px; }
.gqbuzz.off { border-style: dashed; color: var(--soft); border-color: var(--soft); background: transparent; }
.gqbuzz.primary { box-shadow: 0 0 0 5px rgba(255, 216, 77, .22); }
/* the brass desk bell on Buzz: it rocks when you ring it */
.gqbuzz svg { flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .gqbuzz.rang svg { animation: gqring 600ms ease-in-out 2; transform-origin: 50% 85%; }
  @keyframes gqring { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
}
/* rung: the button presses down and rings in your seat's color */
.gqbuzz.rang { background: var(--c); border-color: var(--c); color: var(--seat-ink); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 35%, transparent), 0 0 0 12px color-mix(in srgb, var(--c) 14%, transparent); transform: translateY(2px); }
.gqanswer { flex: 1 1 340px; display: grid; gap: 8px; min-width: 0; }
.gqfield { display: flex; align-items: center; height: 52px; border-radius: 10px; background: #fffdf7; color: var(--type); border: 2px solid var(--turn); padding: 0 12px; font: 700 18px/1 var(--typed); box-sizing: border-box; min-width: 0; }
.gqfield:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.gqpre { color: #6b665a; white-space: nowrap; margin-right: 8px; }
.gqpost { color: #6b665a; margin-left: 2px; }
.gqtype { all: unset; flex: 1; min-width: 0; font: inherit; color: var(--type); height: 100%; }
/* (the field shows focus round the whole box, ask and all) */
.gqfield .gqtype:focus, .gqfield .gqtype:focus-visible { outline: none; box-shadow: none; }
.gqrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.gqclock { display: flex; align-items: center; gap: 8px; font: 700 16px/1 var(--ui-font); font-variant-numeric: tabular-nums; }

/* ── a phone ─────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #app { padding: 0; }
  .felt.gq { height: 100dvh; gap: 0; }
  .gq .tablemain { gap: 6px; }
  .felt.gq .bar .tools { display: none; }
  .felt.gq .bar .more { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .gqwhere { display: none; }
  .gqline { padding: 0 2px; }
  .gqseats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 8px; padding-top: 12px; }
  .gqseat { min-width: 0; padding: 17px 8px 5px; gap: 7px; }
  .gqsc { font-size: 18px; }
  .gqbigcat b { font-size: 26px; }
  .gqbigcat p { font-size: 16px; }
  .gqbigcat.say b { font-size: 30px; }
  .gqrung { font-size: 21px; }
  .gqstage { padding: 8px; }
  .gqstagehead { font-size: 28px; }
  .gqcard { padding: 14px 16px 36px; }
  .gqcard .gqhead { font-size: 12px; padding-bottom: 9px; }
  .gqcard .gqclue { font-size: 21px; margin: 12px 0 6px; }
  .gqcard .gqans { font-size: 15px; }
  .gqcard.stamped { padding-bottom: 66px; }
  .gqstamp { font-size: 20px; right: 12px; bottom: 11px; gap: 7px; padding: 5px 10px 5px 6px; }
  .gqstamp small { font-size: 11px; letter-spacing: .04em; }
  .gqreveal { grid-template-columns: 1fr; }
  .gqdock { flex-direction: column; align-items: stretch; gap: 10px; padding: 10px 12px; }
  .gqstatus { flex: none; }
  .gqbuzz { width: 100%; min-width: 0; height: 64px; }
  .gqanswer { flex: none; }

  /* typing, with the keyboard up: the board steps aside, the seats fold to
     one strip of marks and scores, and the card sits above the answer */
  .gq.typing .gqseats { display: flex; gap: 6px; padding-top: 0; }
  .gq.typing .gqseat { flex: 1 1 0; min-width: 0; padding: 3px 6px 3px 4px; gap: 5px; border-radius: 8px; }
  .gq.typing .gqnm, .gq.typing .gqtag { display: none; }
  .gq.typing .gqsc { font-size: 15px; }
  .gq.typing .gqboardwrap { display: none; }
  .gq.typing .gqstage { position: static; background: none; padding: 0; place-items: start center; flex: 1; }
  .gq.typing .gqstagehead { display: none; }
  .gq.typing .gqcard { padding: 10px 14px 28px; }
  .gq.typing .gqcard .gqclue { font-size: 18px; margin: 8px 0 4px; }
  .gq.typing .gqcard::after { width: 12px; height: 12px; margin-left: -6px; bottom: 9px; }
  .gq.typing .gqdock { padding: 8px 12px; gap: 8px; }
}

/* phones on their side: the bar folds, the seats keep to one line */
@media (max-height: 520px) and (min-width: 560px) {
  #app { padding: 0; }
  .felt.gq { height: 100dvh; border: 0; border-radius: 0; gap: 0; }
  .gq .tablemain { gap: 6px; }
  .felt.gq .bar .tools { display: none; }
  .felt.gq .bar .more { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 32px; }
  /* (the name's card stands 9px over its pocket, 22px tall: the pocket keeps
     room under it for the mark and score, which it covered; the details check, 2026-11-21) */
  .gqseats { flex-wrap: nowrap; overflow: hidden; padding-top: 10px; }
  .gqseat { padding: 16px 8px 3px 5px; }
  .gqgrid { grid-template-rows: 36px repeat(5, minmax(0, 1fr)); gap: 4px; }
  .gqcabinet { padding: 5px; }
  .gqdrawer { --plate: 14px; --knob: 6px; gap: 2px; }
  .gqcat { font-size: 11px; padding: 2px 4px; }
  .gqdock { min-height: 0; padding: 6px 10px; }
  .gqbuzz { height: 44px; }
}

@media (pointer: coarse) {
  .felt.gq .bar .btn { min-height: 44px; }
}
