/* Quiz Race in play: the top bar, the track, the question and the teaching cards, and the other sheets. */
.bar{display:flex; align-items:center; gap:6px; min-height:44px}
/* the family HUD: pills (Word Cube's) */
.pill{flex:none; display:inline-flex; align-items:center; justify-content:center; min-height:36px; padding:0 12px; border:0; border-radius:999px; background:var(--panel); box-shadow:inset 0 0 0 1px var(--panel-line);
  font:600 16px/1 var(--font-display); font-variant-numeric:tabular-nums; color:var(--ink); white-space:nowrap}
.pill.pbtn{width:44px; min-height:44px; padding:0; font-size:22px; touch-action:manipulation}
.pill.pbtn:focus-visible{outline:3px solid var(--you); outline-offset:2px}
.who-now{flex:1 1 auto; min-width:0; text-align:center; font:700 15px/1.2 var(--font-body); color:var(--muted); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.who-now .cface{width:22px; height:22px; margin-right:4px}
.world{position:relative; flex:none; height:clamp(96px, 22vh, 190px); border-radius:18px; background:var(--panel); box-shadow:inset 0 0 0 1px var(--panel-line); overflow:hidden}
.world #track{position:absolute; inset:0; width:100%; height:100%; display:block}
.track-line{position:absolute; right:10px; top:6px; margin:0; font:800 12px/1 var(--font-body); color:var(--muted)}
.stage{flex:1 1 auto; min-height:0; overflow:auto; overscroll-behavior:contain; display:flex; flex-direction:column; align-items:center; padding-bottom:4px}
.world{height:clamp(84px, 13vh, 120px)}
body.reading .world{height:72px}

/* A question */
.qcard{flex:1 0 auto; width:100%; max-width:560px; box-sizing:border-box; padding:16px; border-radius:22px; background:var(--tile); box-shadow:var(--lift); display:flex; flex-direction:column; gap:12px; animation:qIn .34s cubic-bezier(.2,.75,.25,1)}
@keyframes qIn{from{opacity:0; transform:translateY(14px)}}
.qcard.is-leaving{animation:qOut .2s ease-in forwards}
@keyframes qOut{to{opacity:0; transform:translateY(-10px)}}
.q-tag{align-self:center; padding:4px 12px; border-radius:999px; background:var(--gold-soft); font:700 13px/1.2 var(--font-body); color:var(--ink)}
.q-who{display:flex; align-items:center; justify-content:center; gap:6px; font:700 15px/1 var(--font-display); color:var(--muted)}
.q-who .cface{width:26px; height:26px}
.q-host,.q{flex:1 0 auto; display:flex; flex-direction:column; gap:14px}
/* the answers: a 2x2 grid anchored to the bottom, in the thumb zone (design §3) */
.q-options{margin-top:auto}
.q-prompt{position:relative; display:flex; flex-direction:column; gap:10px; padding-right:46px}
.q-text{margin:0; font:600 clamp(22px, 5.4vw, 30px)/1.2 var(--font-display); text-wrap:balance}
.q-text.is-quiet{position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0)}
.q-passage{padding:12px 14px; border-radius:14px; background:var(--soft); font:500 18px/1.5 var(--font-body)}
.q-passage p{margin:0}
.q-book{font:800 12px/1 var(--font-body); letter-spacing:.06em; text-transform:uppercase; color:var(--muted)}
.q-say{position:absolute; right:0; top:0; width:44px; height:44px; border:0; border-radius:50%; background:var(--given); display:grid; place-items:center; color:var(--you)}
.q-options{display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:10px}
.q-options-tap-image{grid-template-columns:repeat(auto-fit, minmax(110px, 1fr))}
.q-opt{position:relative; min-height:72px; padding:10px 14px; border:0; border-radius:16px; background:var(--given); color:var(--ink); font:600 22px/1.2 var(--font-display); display:flex; align-items:center; justify-content:center; gap:10px; box-shadow:0 3px 0 var(--tile-edge); touch-action:manipulation; text-align:center; overflow-wrap:anywhere}
.q-opt{transition:scale .12s cubic-bezier(.3,1.35,.5,1)}
.q-opt:active{scale:.96; transition-duration:0s}
html.calm .q-opt{transition:none}
.q-opt:disabled{cursor:default}
.q-opt.is-chosen{box-shadow:0 0 0 3px var(--you)}
.q-opt.is-right{background:var(--good); color:var(--on-good); box-shadow:0 3px 0 color-mix(in srgb, var(--good) 70%, #000)}
/* (the one picked that was not it: quiet, never shouted; the right one is shown beside it) */
.q-opt.is-wrong{background:var(--soft); color:var(--muted); box-shadow:inset 0 0 0 2px var(--slot-line)}
.q-art{display:inline-block}
.q-art svg{width:100%; height:100%; display:block}
.q-options-tap-image .q-opt{min-height:88px; padding:8px}
.q-figure{display:flex; justify-content:center}
.q-slots{display:flex; justify-content:center; flex-wrap:wrap; gap:8px; min-height:56px}
.q-slot{min-width:44px; height:52px; padding:0 8px; box-sizing:border-box; border-radius:12px; border:2px dashed var(--slot-line); background:var(--slot); display:grid; place-items:center; font:600 26px/1 var(--font-display)}
.q-slot.is-filled{border-style:solid; border-color:var(--you); background:var(--you-soft); cursor:pointer}
.q-slots.is-right .q-slot{border-color:var(--good); background:var(--good-soft)}
.q-slots.is-wrong .q-slot{border-color:var(--slot-line); background:var(--soft)}
.q-tray{display:flex; justify-content:center; flex-wrap:wrap; gap:8px}
.q-tile{min-width:52px; height:52px; padding:0 12px; border:0; border-radius:12px; background:var(--tile); box-shadow:0 3px 0 var(--tile-edge), inset 0 0 0 2px var(--tile-edge); font:600 26px/1 var(--font-display); touch-action:manipulation}
.is-words .q-slot,.is-words .q-tile{font-size:20px}
.q-answer{text-align:center; font:600 22px/1.2 var(--font-display); color:var(--good)}
.q-undo{align-self:center; min-height:40px; font-size:15px; padding:6px 18px}
.q-count-field{display:flex; flex-wrap:wrap; justify-content:center; gap:10px}
.q-countable{width:72px; height:72px; border:0; border-radius:16px; background:var(--given); padding:6px; touch-action:manipulation}
.q-countable svg{width:100%; height:100%}
.q-countable.is-counted{background:var(--you-soft); box-shadow:inset 0 0 0 3px var(--you)}
.q-count-readout{text-align:center; font:700 34px/1 var(--font-display); color:var(--you)}
.q-count-readout.is-right{color:var(--good)}
/* "Trace the 3": the shared tracer (src/trace/) fills a square as big as this box's smaller side */
.q-trace-stage{display:grid; width:100%; height:min(58vh, 92vw, 420px); margin:0 auto}
.q-trace-stage canvas{background:var(--slot); box-shadow:inset 0 0 0 2px var(--panel-line)}
.q-trace-stage.is-shown{pointer-events:none; opacity:.75}
@media (min-aspect-ratio: 5/4) and (max-height: 560px){ .q-trace-stage{height:calc(100dvh - 150px)} }

/* The one-card fix: one line under the question, a build row, or the answer to tap (never red) */
.fix{display:flex; flex-direction:column; gap:10px; padding-top:4px}
.fix-why{margin:0; padding:10px 14px; border-radius:14px; background:var(--you-soft); font:600 18px/1.35 var(--font-display); text-align:center}
.fix-build .q-slots{min-height:52px}
.fix-tap{background:var(--good); box-shadow:0 4px 0 color-mix(in srgb, var(--good) 70%, #000)}
/* Teaching a mistake: gentle, never shouted */
.teach{align-items:stretch; text-align:center}
.teach .t-kind{font:800 13px/1 var(--font-body); letter-spacing:.06em; text-transform:uppercase; color:var(--muted)}
.teach h3{margin:0; font:600 24px/1.2 var(--font-display)}
.teach .t-msg{margin:0; font:500 19px/1.45 var(--font-body)}
.teach .t-emoji{font-size:52px; line-height:1}
.teach .t-ans{display:inline-block; margin:0 auto; padding:10px 18px; border-radius:14px; background:var(--good-soft); font:600 26px/1.2 var(--font-display)}

/* The praise float (short: "Turned around!") */
.praise{position:fixed; left:50%; top:var(--y, 40%); transform:translate(-50%,-50%); z-index:30; pointer-events:none; font:700 clamp(30px,9vw,48px)/1 var(--font-display); color:var(--c, var(--you)); white-space:nowrap; text-shadow:0 4px 0 var(--paper),0 0 14px var(--paper); animation:praise 1.1s cubic-bezier(.3,1.5,.5,1) forwards}
@keyframes praise{0%{opacity:0; transform:translate(-50%,-50%) scale(.4)}25%{opacity:1; transform:translate(-50%,-50%) scale(1.06)}70%{opacity:1; transform:translate(-50%,-60%) scale(1)}100%{opacity:0; transform:translate(-50%,-90%)}}

/* 3, 2, 1 */
.count-ov{z-index:60; grid-template-rows:auto auto; align-content:center; gap:8px}
.countnum{font:700 120px/1 var(--font-display); color:var(--you); text-align:center}
.counttext{margin:0; font:700 18px/1.3 var(--font-body); color:var(--muted); text-align:center}

/* Rooms, taking turns, passing the device */
.joincode{display:flex; gap:8px}
.joincode input{flex:1 1 auto; min-width:0; min-height:48px; padding:0 14px; border:0; border-radius:14px; background:var(--given); color:var(--ink); font:700 22px/1 var(--font-display); letter-spacing:.2em; text-transform:uppercase}
.joincode input:focus{outline:2px solid var(--you)}
.joincode .btn{flex:none}
.list{display:flex; flex-direction:column; gap:6px}
.prow{display:flex; align-items:center; gap:8px; width:100%; min-height:48px; padding:6px 10px; border:0; border-radius:14px; background:var(--given); color:var(--ink); font:800 15px/1.2 var(--font-body); text-align:left}
.prow .cface{width:32px; height:32px}
.prow .pn{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.prow .pn small{display:block; font-weight:700; color:var(--muted); font-size:12px}
.prow .go{flex:none; min-height:44px; min-width:44px; padding:8px 14px; border-radius:999px; background:var(--you); color:var(--on-you); font-size:14px}
.prow .go.quiet{background:var(--tile); color:var(--muted)}
.codebox{display:flex; flex-direction:column; align-items:center; gap:8px}
.code{font:700 48px/1 var(--font-display); letter-spacing:.18em}
.room-people{display:flex; flex-wrap:wrap; justify-content:center; gap:10px}
.rp{display:flex; flex-direction:column; align-items:center; gap:4px; width:72px; border:0; background:none; padding:0; font:700 13px/1.2 var(--font-body); color:var(--ink)}
.rp .cface{width:56px; height:56px}
.rp.off{opacity:.45}
.rp .nm{max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.ways{display:flex; gap:8px; justify-content:center; flex-wrap:wrap}
.ways .chip{font-size:15px; padding:10px 16px; min-height:44px}
.wayhint{flex-basis:100%; margin:0; text-align:center; font-size:13px; font-weight:700; color:var(--muted)}
.turns-grid{display:flex; flex-wrap:wrap; justify-content:center; gap:12px}
.tp{display:flex; flex-direction:column; align-items:center; gap:6px; width:84px; padding:6px 2px; border:0; border-radius:16px; background:none; font:700 14px/1.2 var(--font-display); color:var(--ink)}
.tp .cface{width:60px; height:60px; box-shadow:0 0 0 3px transparent}
.tp[aria-checked="true"] .cface{box-shadow:0 0 0 4px var(--you)}
.tp .nm{max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.tp.add .plus{width:60px; height:60px; border-radius:50%; border:3px dashed var(--panel-line); display:grid; place-items:center; font-size:30px; color:var(--muted); box-sizing:border-box}
.card.hand{align-items:center; text-align:center}
.hand-face .cface{width:110px; height:110px}
.claps{display:flex; gap:8px; justify-content:center}
.claps button{min-width:48px; min-height:44px; border:0; border-radius:999px; background:var(--given); font-size:22px}
.claps button.sent{background:var(--you-soft)}
.react{position:fixed; z-index:70; pointer-events:none; font-size:34px; animation:reactUp 1.4s ease-out forwards}
@keyframes reactUp{0%{opacity:0; transform:translateY(10px) scale(.6)}20%{opacity:1; transform:translateY(0) scale(1.1)}100%{opacity:0; transform:translateY(-70px)}}
.reactbar{display:flex; gap:6px; justify-content:center}
.reactbar button{min-width:44px; min-height:44px; border:0; border-radius:999px; background:var(--given); font-size:20px}

/* A phone on its side: the track beside the question */
@media (min-aspect-ratio: 5/4) and (max-height: 560px){
  #app{max-width:none; display:grid; grid-template-columns:minmax(220px, 36%) minmax(0, 1fr); grid-template-rows:auto minmax(0,1fr); column-gap:12px}
  .bar{grid-column:1; grid-row:1}
  .world{grid-column:1; grid-row:2; height:auto}
  .pill{min-height:32px; padding:0 9px; font-size:14px} .pill.pbtn{width:44px; min-height:44px}
  .stage{grid-column:2; grid-row:1 / span 2; justify-content:flex-start}
  .qcard{padding:12px; gap:10px}
  .q-opt{min-height:52px; font-size:19px}
  .q-text{font-size:22px}
  body.reading .world{height:auto}
  .card{padding:16px 18px 14px; gap:12px}
}
@media (prefers-reduced-motion: reduce){ .qcard,.praise,.react{animation:none!important} }
html.calm :is(.qcard,.praise,.react){animation:none!important}
.q-text{white-space:pre-line}
/* a room's round: who has answered (a tick by each face, never whether right) */
.ticks{position:absolute; left:50%; top:4px; transform:translateX(-50%); display:flex; gap:4px}
.tick{position:relative; opacity:.45}
.tick .cface{width:22px; height:22px}
.tick.on{opacity:1}
.tick.on::after{content:'✓'; position:absolute; right:-4px; bottom:-4px; width:13px; height:13px; border-radius:50%; background:var(--you); color:#fff; font:800 9px/13px var(--font-body); text-align:center}

/* ---------- Contests, 13 and up (src/trivia/; EdGames docs/family/QUIZRACE-TRIVIA.md §5) ---------- */
.c-card{gap:10px}
/* the escalation: four dots, the current one ringed, the round's points in plain words */
.c-dots{display:flex; align-items:center; gap:10px; font:700 14px/1.2 var(--font-body); color:var(--muted)}
.c-dotrow{display:inline-flex; gap:6px}
.c-dotrow i{width:12px; height:12px; border-radius:50%; background:var(--given); box-shadow:inset 0 0 0 2px var(--slot-line)}
.c-dotrow i.done{background:var(--you); box-shadow:none}
.c-dotrow i.now{background:var(--you); box-shadow:0 0 0 3px var(--you-soft), 0 0 0 5px var(--you)}
.c-cat{font:800 12px/1 var(--font-body); letter-spacing:.06em; text-transform:uppercase; color:var(--muted)}
/* the calm 20 s: a thin line that shortens slowly (no colour change, no sound); calm motion: a still "20 s" */
.c-limit{height:4px; border-radius:2px; background:var(--soft); overflow:hidden; position:relative}
.c-limit i{position:absolute; inset:0; background:var(--muted); opacity:.45; transform-origin:left; transform:scaleX(1); transition-property:transform; transition-timing-function:linear}
.c-limit i.go{transform:scaleX(0)}
.c-limit.stop i{transition:none; opacity:.2}
.c-limit:has(.c-limit-t){height:auto; background:none; text-align:right}
.c-limit-t{font:700 12px/1 var(--font-body); color:var(--muted)}
.c-why{text-align:left}
.c-next{align-self:stretch}
.c-round{justify-content:center; align-items:center; text-align:center; cursor:pointer}
.c-round-n{font:700 40px/1.1 var(--font-display)}
.c-round-p{font:600 20px/1.2 var(--font-display); color:var(--muted)}
.c-wait{font:600 20px/1.3 var(--font-display); color:var(--muted)}
/* who is here in the live final: a tick as each answers, never right or wrong */
.c-faces{display:flex; flex-wrap:wrap; gap:6px; align-items:center; min-height:26px}
.c-faces .tick{opacity:.55} .c-faces .tick.on{opacity:1}
.c-faces .c-more{font:700 13px/1 var(--font-body); color:var(--muted)}
/* leaders: one row of tabs */
.tabs{display:flex; gap:6px; justify-content:center}
.tabs[hidden]{display:none}
.tabs .chip{min-height:36px}
.btnrow{display:flex; gap:8px}
.btnrow .btn{flex:1 1 0; min-width:0}
.btnrow:not(:has(.btn:not([hidden]))){display:none}
/* the question of the day and yesterday's answers */
.qotd .q-text{font-size:clamp(20px, 5vw, 26px)}
.qotd-knew{margin:0; text-align:center; font:700 16px/1.2 var(--font-body); color:var(--muted)}
.answers{max-height:calc(100dvh - 32px); overflow:auto}
.ans-list{margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:10px}
.ans{padding:10px 12px; border-radius:14px; background:var(--given)}
.ans-h{display:flex; justify-content:space-between; gap:8px; font:800 12px/1.2 var(--font-body); color:var(--muted); text-transform:uppercase; letter-spacing:.04em}
.ans-me.on{color:var(--good)}
.ans-q{margin:6px 0 4px; font:600 17px/1.3 var(--font-display)}
.ans-a{margin:0; font:700 17px/1.3 var(--font-display); color:var(--good)}
.ans-why{margin:4px 0 0; font:500 14px/1.35 var(--font-body); color:var(--ink)}
.layer-ways{justify-content:center}
.endcard{position:relative}
.endmore{position:absolute; top:10px; right:10px}
#reportList .prow{box-sizing:border-box}
#reportList .prow .pn{font-weight:600; white-space:normal}
#reportList .prow .go{background:var(--tile); color:var(--ink); box-shadow:inset 0 0 0 2px var(--panel-line)}
#reportList .prow .go:disabled{color:var(--muted)}
/* the stages: cold (the question alone), four choices, two (the other two step aside, still, never red) */
.q-options.is-cold{visibility:hidden}
.c-cold{margin:0; text-align:center; font:600 15px/1.3 var(--font-body); color:var(--muted)}
.q-opt.is-gone{opacity:.25}
.credit{margin:0; font:500 12px/1.35 var(--font-body); color:var(--muted)}
.rules li.credit{list-style:none}
#reportList .rp-link{display:block; margin-top:2px; font:700 13px/1.2 var(--font-body); color:var(--you)}

/* A big screen in the room (src/screen.js; EdGames docs/family/SCREEN-PRINT-NOTE.md §1): "Show on a big screen", the
   host's "Questions for", the tiles' marks and the tiles alone on a phone (the TV shows the question) */
.bigscreen{margin:0; font-size:13px; line-height:1.35; text-align:center; color:var(--muted); overflow-wrap:anywhere}
.bigscreen b{color:var(--ink)}
.bigscreen:empty{display:none}
.qfor{display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; font:700 15px/1.2 var(--font-body); color:var(--muted); width:100%}
.qfor b{color:var(--ink)}
.qfor-s{min-height:44px; padding:6px 12px; border:0; border-radius:12px; background:var(--given); color:var(--ink); font:700 16px/1.2 var(--font-body); max-width:100%}
.q-mark{flex:none; font:700 22px/1 system-ui, sans-serif; color:var(--ink); opacity:.85}
.q-opt.is-right .q-mark{color:inherit}
.qcard.tiles-only .q-prompt, .qcard.tiles-only .c-cat, .qcard.tiles-only > .q-text{display:none}
.qcard.tiles-only .q-options{margin-top:0; flex:1 1 auto; grid-auto-rows:minmax(96px, 1fr)}
.qcard.tiles-only .q-opt{font-size:24px}
.q-showq{align-self:center; min-height:40px}
