@import url('./playful-fonts.css');
@font-face{font-family:Classroom;src:url('../fonts/NotoSans-Regular.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:Classroom;src:url('../fonts/NotoSans-Bold.ttf') format('truetype');font-weight:700;font-display:swap}

:root{
  --bar-min-height:58px;
  --page-font-scale:1;--question-font-scale:1;--answer-font-scale:1;
  font-size:calc(16px * var(--page-font-scale));
  --ink:#304567;--muted:#596b86;--bg:#e8f8fa;--surface:#fffdf7;
  --line:#cbdce8;--gold:#ffce59;--purple:#7960c7;--good:#176d48;--bad:#b83b51;
  --radius:24px;color-scheme:light;font-family:Quicksand,Classroom,system-ui,sans-serif;
}
*{box-sizing:border-box}
html{scrollbar-gutter:stable}
body{margin:0;min-height:100vh;color:var(--ink);background:var(--bg) url('../images/art/stage-background.webp') center center/cover fixed no-repeat;font-size:1rem;font-weight:600}
button,input,select{font:inherit}
button,summary,select{cursor:pointer}
button{border:2px solid transparent;border-radius:16px;padding:11px 20px;min-height:46px;font-weight:700;transition:transform .16s,box-shadow .16s,background .16s}
button:disabled{opacity:.5;cursor:not-allowed}
button:not(:disabled):hover{transform:translateY(-2px)}
button:active:not(:disabled){transform:translateY(2px);box-shadow:none}
button:focus-visible,a:focus-visible,summary:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #6345bd;outline-offset:4px}
.primary{background:var(--gold);color:#563714;border-color:#dc9d32;box-shadow:0 5px 0 #d99c32;border-radius:18px;font-size:1.1rem;padding:12px 28px}
.primary:not(:disabled):hover{background:#ffd973;box-shadow:0 7px 0 #d99c32}
.secondary{background:#e5f6ff;color:#235a81;border-color:#9dcee7;box-shadow:0 3px 0 #9dcee7}
.quiet{background:rgba(255,255,255,0.9);color:#586783;font-weight:700;border-color:transparent;font-size:.87rem}
.quiet:hover{background:#eef3ff;border-color:#d7def3}
[hidden]{display:none!important}
a{color:inherit}
.muted,small{color:var(--muted)}
small{font-size:.8rem;line-height:1.6}
h1,h2,.welcome-tagline{font-family:'Baloo 2',Quicksand,Classroom,sans-serif;font-weight:800}
h1,h2,p{margin-top:0}
h1{font-size:clamp(2rem,calc(3.1vw * var(--page-font-scale)),3.3rem);line-height:1.2;letter-spacing:-.025em}
h2{font-size:1.65rem;line-height:1.25}
p{line-height:1.65}
.error{color:var(--bad);font-size:.88rem;min-height:1.3em}
.topbar{min-height:70px;display:flex;align-items:center;gap:22px;padding:9px 3vw;background:rgba(255,255,255,0.9);border-bottom:3px solid #d6eef1}
.wordmark{display:flex;align-items:center;gap:8px;text-decoration:none;font-family:'Baloo 2',Quicksand,sans-serif;font-size:1.1rem;line-height:1.1;white-space:nowrap}
.wordmark img{width:42px;height:42px;object-fit:contain}
.wordmark strong{color:#7252c4;display:block;font-size:1.25em}
.topbar nav{margin-left:auto;display:flex;gap:4px;flex-wrap:wrap}
.topbar button{font-size:.78rem;min-height:39px;padding:8px 12px;border-radius:30px}
#sessionMeta{font-size:.75rem;max-width:220px}
.screen{max-width:1430px;margin:auto;padding:28px 4vw}
.eyebrow{font-size:.76rem;letter-spacing:.08em;color:#526d8c;font-weight:700;margin:0 0 12px}

/* Stage art supplies the clouds, arch, foliage and wall props. */
#dataInfo{font-size:.74rem;max-width:500px;margin:0 auto;padding:0 15px;line-height:1.55}
.setup{background:rgba(255,253,248,0.9);padding:25px 28px 22px;border:3px solid #fff;border-radius:28px;box-shadow:0 8px 0 #b5d9e4,0 18px 35px #477a8b12;width:100%;max-width:460px;justify-self:center}
.setup-kicker{font-size:.67rem;color:#7b6c93;letter-spacing:.08em;margin-bottom:8px;font-weight:700}
.setup h2{color:#6851a6;margin-bottom:20px}
.setup>label{display:block;font-size:.9rem;margin-bottom:7px}
fieldset{border:0;margin:0;padding:0}
legend{font-size:.75rem;color:var(--muted);margin-bottom:3px}
.screen-switches{margin-bottom:20px}
.switch-row{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:11px 0;border-bottom:1px solid #e7e8f1}
.switch-row strong{font-size:.92rem}.switch-row small{display:block;font-size:.73rem}
.switch-row input{width:24px;height:24px;accent-color:#6b50b4;cursor:pointer}
select,input[type=text],input[type=number]{background:#f6f9ff;border:2px solid #d4dfef;border-radius:12px;padding:10px 12px;color:#3f5273;width:100%;min-height:44px;font-size:.88rem}
select{max-width:100%}
.advanced{margin:13px 0;font-size:.83rem}
.advanced summary{color:#64587f;padding:7px 0}
.advanced label{display:block;margin-top:10px}
.advanced .auto-next-option{display:flex;align-items:center;gap:8px}
.auto-next-option input{width:18px;height:18px;flex-shrink:0;accent-color:var(--purple,#8662b0)}
.two-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.two-fields input,.two-fields select{margin-top:7px}
#startButton{width:100%;font-family:'Baloo 2',Quicksand,sans-serif;font-size:1.5rem;line-height:1.1;padding:14px}
.play-rules{margin-top:10px}
.advanced .play-rules .switch-row{display:flex;margin:0;min-height:48px;font-size:.82rem}
.play-rules .switch-row small{margin-top:4px;color:var(--muted)}
.play-rules input[role=switch]{appearance:none;position:relative;flex:0 0 44px;width:44px;height:26px;border:2px solid #b7bfd0;border-radius:20px;background:#dbe0eb;transition:background .15s,border-color .15s}
.play-rules input[role=switch]::after{content:"";position:absolute;left:2px;top:2px;width:18px;height:18px;background:white;border-radius:50%;box-shadow:0 1px 3px #24304b33;transition:transform .15s}
.play-rules input[role=switch]:checked{background:#7554af;border-color:#7554af}
.play-rules input[role=switch]:checked::after{transform:translateX(18px)}
@media(prefers-reduced-motion:reduce){.play-rules input[role=switch],.play-rules input[role=switch]::after{transition:none}}

.selection{text-align:center;max-width:1050px;padding-top:22px;padding-bottom:60px;position:relative}
.selection-mascot{width:115px;height:115px;object-fit:contain;display:block;margin:0 auto 0}
.selection h1{font-size:clamp(2rem,calc(3.8vw * var(--page-font-scale)),3.2rem);color:#7654b6;margin-bottom:10px;text-shadow:0 2px #fff}
.selected-player{min-height:215px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:15px;margin:12px auto 14px}
.selected-player h2{font-size:clamp(2.4rem,calc(5vw * var(--page-font-scale)),4.7rem);line-height:1.1;margin:0;overflow-wrap:anywhere;color:#3b7fa6;text-shadow:0 3px #fff}
.initial{width:105px;height:105px;display:grid;place-items:center;background:#ffedb7;color:#8564bf;font-size:3rem;font-family:'Baloo 2',sans-serif;border-radius:35px;border:5px solid white;box-shadow:0 5px 0 #d7cbef}
#playerAvatar{width:112px;height:112px;object-fit:cover;border-radius:35px;border:5px solid white;box-shadow:0 5px 0 #c5dae9}
.secondary-row{display:flex;gap:7px;justify-content:center;flex-wrap:wrap;margin:9px 0}
.selection details{max-width:440px;margin:18px auto;color:var(--muted);font-size:.88rem}
.selection details select{margin-top:14px}
#remainingStudents{font-size:.87rem}

/* One central camera is flanked by two illustrated answers on each side. */
.quiz{width:100%;max-width:1320px;padding:14px 28px 24px}
.quiz-meta{display:flex;align-items:center;flex-wrap:wrap;gap:16px;font-size:.83rem;color:#526783;margin:0 0 10px}
#quizPlayer{color:#6e4aa9;font-weight:700}
#score{margin-left:auto;color:#37654e;font-weight:700}
#timer{font-variant-numeric:tabular-nums;min-width:87px;color:#6d568d}
.quiz-phase{font-size:.72rem;color:#77578f}
.quiz-question{margin-bottom:16px;min-width:0;padding:16px 24px;background:none;border:0;border-radius:0;box-shadow:none;align-items:center}
.quiz-question h1{font-size:clamp(1.45rem,calc(2vw * var(--page-font-scale)),2rem);line-height:1.35;overflow-wrap:anywhere;margin:0;padding:0;color:#394c73;background:none;border:0;box-shadow:none}
.question-image{display:block;max-width:100%;max-height:120px;object-fit:contain;margin:10px auto 0;border-radius:12px}
.quiz-layout,.question-area{width:100%;min-width:0}
.camera-source{position:fixed;left:-10px;top:0;width:1px;height:1px;opacity:0;pointer-events:none}
/* A/B occupy the left column, C/D the right; the camera spans both rows. */
.quiz-stage{display:grid;grid-template-columns:minmax(0,1fr) min(25.6%,41.6dvh) minmax(0,1fr);grid-template-rows:repeat(2,minmax(min-content,1fr));gap:var(--quiz-stage-gap,12px);align-items:stretch}
.answers{display:contents}
.quiz-stage [data-answer="0"]{grid-column:1;grid-row:1}
.quiz-stage [data-answer="1"]{grid-column:1;grid-row:2}
.quiz-stage [data-answer="2"]{grid-column:3;grid-row:1}
.quiz-stage [data-answer="3"]{grid-column:3;grid-row:2}
.camera-preview-frame{grid-column:2;grid-row:1 / span 2;position:relative;align-self:center;justify-self:center;width:100%;aspect-ratio:1 / 1;overflow:hidden;border:0;border-radius:20px;background:rgba(243,248,250,0.9);isolation:isolate}
.camera-preview{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;transform:scale(calc(-1 * var(--camera-preview-zoom,1)),var(--camera-preview-zoom,1));opacity:0}
.camera-preview-frame.is-live{background:#142639}
.camera-preview-frame.is-live .camera-preview{opacity:1}
.question-illustration{display:block;min-width:0;min-height:0;background:rgba(255,255,255,0.9);border:0;border-radius:12px;overflow:hidden}
.question-illustration .question-image{display:block;width:100%;height:clamp(180px,30dvh,320px);max-width:100%;max-height:none;margin:0;padding:6px;object-fit:contain;object-position:center}
.answer{
  --answer-fill:rgba(225,243,255,0.9);--answer-border:#91c5e7;--answer-ink:#245779;
  position:relative;display:flex;flex-direction:row;align-items:center;gap:0;padding:0;min-width:0;min-height:0;
  border:0;border-radius:20px;overflow:visible;
  background:var(--answer-fill);color:var(--answer-ink);box-shadow:none;
  text-align:center;opacity:1!important;
}
.answer:nth-child(2){--answer-fill:rgba(255,234,237,0.9);--answer-border:#e8a2b1;--answer-ink:#8a3d55}
.answer:nth-child(3){--answer-fill:rgba(224,245,229,0.9);--answer-border:#92cba4;--answer-ink:#2c6546}
.answer:nth-child(4){--answer-fill:rgba(238,229,255,0.9);--answer-border:#bda5e4;--answer-ink:#63458d}
.answer:disabled{cursor:default}
.answer-pose{display:flex;flex:0 0 150px;align-items:center;justify-content:flex-start;width:150px;height:150px;margin:8px 0;pointer-events:none}
.answer-pose img{display:block;width:150px;height:150px;object-fit:contain;object-position:left center;opacity:1}
.answer-letter{position:absolute;left:11px;top:10px;z-index:2;display:grid;place-items:center;
  width:32px;height:32px;font-size:1.08rem;border-radius:10px;color:#fff;background:var(--answer-ink);border:2px solid #fff;
}
.answer-content{display:flex;text-align:left;flex-direction:column;justify-content:center;min-height:50px;padding:10px 15px;overflow-wrap:anywhere;font-weight:700;font-size:clamp(.95rem,calc(1.35vw * var(--page-font-scale)),1.3rem);line-height:1.4}
.answer.candidate{outline:3px solid #7f58cb;outline-offset:2px}
.answer.chosen{outline:3px solid #a66f13;outline-offset:2px}
.answer.correct{--result-glow:22,163,74;border-color:#16a34a}
.answer.wrong{--result-glow:220,38,38;border-color:#dc2626}
.answer.correct,.answer.wrong{
  outline:none;
  box-shadow:0 0 0 2px rgba(var(--result-glow),.35),0 0 14px rgba(var(--result-glow),.36),inset 0 0 8px rgba(var(--result-glow),.1);
  animation:answerResultGlow 1.7s ease-in-out infinite;
}
@keyframes answerResultGlow{
  0%,100%{box-shadow:0 0 0 2px rgba(var(--result-glow),.25),0 0 8px rgba(var(--result-glow),.24),inset 0 0 5px rgba(var(--result-glow),.06)}
  50%{box-shadow:0 0 0 3px rgba(var(--result-glow),.6),0 0 22px rgba(var(--result-glow),.58),inset 0 0 13px rgba(var(--result-glow),.15)}
}
#holdProgress{display:block;width:100%;max-width:1020px;height:7px;appearance:none;border:0;background:#dce8f3;border-radius:10px;overflow:hidden;margin:12px auto 0}
#holdProgress::-webkit-progress-bar{background:#dce8f3}
#holdProgress::-webkit-progress-value{background:#b17ddd;transition:width .08s linear}
#holdProgress::-moz-progress-bar{background:#b17ddd}
.quiz-status{display:flex;flex-direction:column;gap:3px;align-items:center;max-width:1020px;margin:0 auto;text-align:center}
.feedback{margin:0;min-height:0;font-size:.88rem;font-weight:700;color:#4d607e}
.feedback:empty{display:none}
.feedback.good{color:var(--good)}.feedback.bad{color:var(--bad)}
.question-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.question-actions .primary{font-size:1rem;padding:10px 24px}

/* Dialogs use the same friendly reading surfaces, not another page layout. */
dialog{color:var(--ink);background:#fffdf7;border:4px solid #d9c7f0;border-radius:28px;padding:28px;max-width:720px;width:calc(100% - 32px);max-height:90vh;box-shadow:0 12px 45px #294b6630}
dialog::backdrop{background:#3b557d99;backdrop-filter:blur(3px)}
dialog h2{color:#7552ab}
dialog p,dialog li{color:#52617d;font-size:.95rem;line-height:1.7}
dialog ol{padding-left:22px}
.pose-gallery{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:20px 0}
.pose-gallery figure{margin:0;text-align:center}
.pose-gallery img{width:100%;height:95px;object-fit:contain;background:#f0e7ff;border:2px solid #e4d9f5;border-radius:15px}
.pose-gallery figcaption{font-size:.7rem;margin-top:4px;color:var(--muted)}
#summaryDialog{text-align:center}
.summary-mascot{width:150px;height:150px;object-fit:contain;margin:-10px auto 0;display:block}
#summaryText{font-size:1.1rem;font-weight:700;color:#40795c}
#summaryList{max-height:34vh;overflow:auto;margin-bottom:24px;text-align:left}
#summaryList p{display:flex;justify-content:space-between;gap:15px;border-bottom:1px solid #dfdde8;padding:9px 0;margin:0;font-size:.88rem}
.global-status{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);max-width:90vw;background:#fffdf7;color:#3f5375;border-radius:14px;z-index:20;box-shadow:0 4px 20px #314b7730;font-size:.9rem}
.global-status:not(:empty){padding:12px 20px;border:2px solid #d4c9ef}
.pulse{animation:namePulse .45s ease-out}
@keyframes namePulse{from{transform:scale(.94);opacity:.5}to{transform:scale(1);opacity:1}}

body:has(#quizScreen:not([hidden])) .topbar{min-height:var(--bar-min-height);padding-top:5px;padding-bottom:5px}
body:has(#quizScreen:not([hidden])) .wordmark img{width:34px;height:34px}
body:has(#quizScreen:not([hidden])) .wordmark{font-size:.88rem}

/* Shared controls keep fluid sizing around the answer row. */

.topbar{min-height:var(--bar-min-height);padding:6px 20px;gap:16px;flex-wrap:wrap}
.topbar nav{gap:2px}
.topbar button{min-height:36px;padding:7px 10px}
.topbar .theme-select{flex:0 0 auto;width:154px;min-height:36px;padding:6px 8px;border:1px solid #d4dfef;border-radius:18px;background:rgba(255,255,255,.9);color:#425777;font-size:.75rem;font-weight:700}
.wordmark img{width:36px;height:36px}
.wordmark{font-size:.95rem}
#sessionMeta{max-width:190px;font-size:.7rem}
#dataInfo{font-size:.7rem}
.setup{max-width:420px;padding:19px 24px}
.setup h2{font-size:1.5rem;margin-bottom:12px}
.screen-switches{margin-bottom:12px}
.switch-row{padding:9px 0}
.advanced{margin:10px 0}
#startButton{font-size:1.35rem;padding:12px}
.privacy{margin-top:13px}
.selection{padding-top:10px;padding-bottom:18px}
.selection-mascot{width:80px;height:80px}
.selection h1{font-size:2.2rem;margin-bottom:6px}
.selected-player{min-height:170px;gap:10px;margin:8px auto 10px}
.selected-player h2{font-size:3.1rem}
.initial,#playerAvatar{width:90px;height:90px;border-radius:29px}
.selection details{margin:12px auto}
.quiz{max-width:none;padding:10px clamp(8px,1.4642vw,20px) 18px}
.quiz-meta{font-size:.78rem;gap:14px;margin-bottom:9px}
.quiz-question{margin-bottom:14px}
.quiz-question h1{font-size:1.5rem;padding:0;line-height:1.35}
.question-image{max-height:96px}
.answer{border:0;border-radius:17px}
.answer-letter{left:9px;top:8px;width:29px;height:29px;font-size:1rem}
.answer-content{flex:1;min-height:60px;font-size:1.12rem;line-height:1.35;padding:10px 11px}
#holdProgress{max-width:none;margin-top:11px}
.quiz-status{max-width:none;gap:4px;margin:0 auto}
.feedback{font-size:.86rem}
.question-actions .primary{font-size:1rem;padding:9px 23px}

/* Player context and the current action share a quiet footer. */
.quiz-meta{
  display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto auto;
  align-items:center;gap:18px;padding:10px 16px;margin-bottom:14px;
  background:#fffefbf5;border:1px solid #dce6ee;border-radius:17px;
}
.player-identity{min-width:0}
.meta-label{display:block;color:#637088;font-size:.6rem;line-height:1.2;letter-spacing:.08em;font-weight:700;margin-bottom:2px}
.player-identity #quizPlayer{display:block;font-family:'Baloo 2',Quicksand,sans-serif;font-size:clamp(1.4rem,calc(2vw * var(--page-font-scale)),1.85rem);line-height:1.15;color:#51377f;overflow-wrap:anywhere}
.round-context{display:flex;flex-direction:column;gap:5px;min-width:0;color:#50617c;font-size:.86rem}
.round-context .quiz-phase{font-size:.7rem;color:#64738b;line-height:1.4}
.quiz-meta #score{margin:0;font-size:.89rem;color:#38664e;overflow-wrap:anywhere}
.camera-zoom{width:300px;max-width:100%;color:var(--ink)}
.camera-zoom label{display:flex;align-items:baseline;justify-content:space-between;gap:12px;font-size:.81rem}
.camera-zoom output{font-variant-numeric:tabular-nums;font-weight:700}
.camera-zoom-range{display:flex;align-items:center;gap:8px;font-size:.7rem}
.camera-zoom input{flex:1;min-width:0;width:100%;min-height:32px;margin:0;accent-color:var(--purple);cursor:pointer}

.quiz-meta{gap:clamp(6px,1.1713vw,16px);padding:9px 14px;margin-bottom:12px}
.player-identity #quizPlayer{font-size:clamp(.9rem,calc(1.6vw * var(--page-font-scale)),1.35rem)}

/* Font controls stay in a single header dropdown and apply without rebuilding the game. */
.topbar{position:sticky;top:0;z-index:40}
.font-panel{position:absolute;right:12px;top:calc(100% + 8px);z-index:30;width:300px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 90px);overflow:auto;padding:16px;background:#fffdf7;border:2px solid #d9c7f0;border-radius:16px;box-shadow:0 8px 28px #30456730;text-align:left}
.font-panel label{display:flex;justify-content:space-between;align-items:baseline;gap:12px;font-size:.85rem;color:#3f5273}
.font-panel output{font-variant-numeric:tabular-nums;color:#7152a6;font-weight:700}
.font-panel input[type=range]{display:block;width:100%;min-height:32px;margin:4px 0 14px;accent-color:var(--purple);cursor:pointer}
.font-panel #resetFonts{width:100%;font-size:.8rem;background:#f1ebfa;color:#654493}
#fontButton[aria-expanded=true]{background:#f1ebfa;color:#654493}
#questionText{font-size:calc(2rem * var(--question-font-scale));font-weight:800;line-height:1.4;color:#243d64;width:100%;max-width:78%;margin:0 auto;text-wrap:balance;text-shadow:-1px -1px 0 #fff,1px -1px 0 #fff,-1px 1px 0 #fff,1px 1px 0 #fff,0 1px 3px rgba(255,255,255,0.9)}
.answer-content{font-size:calc(1.12rem * var(--answer-font-scale))}

/* The question floats over the stage; long questions and answers grow naturally. */
.quiz-question{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto;min-height:calc(4.05rem * var(--question-font-scale) + 26px)}
#questionText{min-width:0;min-height:0;height:auto;overflow:visible}
.quiz-question .question-image{margin:0;object-fit:contain}
.answer-content{flex:1 0 0;min-width:0;justify-content:center;height:auto;min-height:calc(2.7em + 20px);overflow:visible}
.answer-content>span{display:block;flex-shrink:0;width:100%;margin:0}

/* Dock the answer row and footer together so their heights never overlap. */
body:has(#quizScreen:not([hidden])){display:flex;flex-direction:column;min-height:100dvh}
body:has(#quizScreen:not([hidden])) main{display:flex;flex:1;flex-direction:column}
.quiz{--quiz-gutter:clamp(8px,1.4642vw,20px);display:flex;flex:1;flex-direction:column;margin:0;min-height:0;padding-inline:var(--quiz-gutter);padding-bottom:0}
.quiz>.quiz-question{flex-shrink:0;width:100%;margin:auto 0}
.quiz-question.has-illustration{grid-template-columns:minmax(0,1fr) minmax(180px,32%);gap:16px}
.quiz-question.has-illustration #questionText{max-width:100%;margin:0;text-align:left;text-wrap:wrap}
.quiz-bottom{position:sticky;bottom:0;z-index:10;flex-shrink:0;min-width:0;width:100%;margin-top:0}
.quiz-layout{margin-bottom:0}
.quiz-meta{position:relative;flex-shrink:0;width:calc(100% + var(--quiz-gutter) + var(--quiz-gutter));margin:0 calc(0px - var(--quiz-gutter)) 0;padding-inline:20px;border-radius:0;border:0;border-top:3px solid #d6eef1;background:rgba(255,254,251,0.9);box-shadow:0 -3px 18px #30456712}
#questionText{text-align:center;align-content:start;align-content:safe center}

/* The optional clock shares the footer, while camera zoom stays in the header. */
.quiz-meta{min-height:var(--bar-min-height);padding-block:6px}
.quiz-meta .question-actions button{min-height:36px;padding:7px 12px;font-size:.8rem;line-height:1.2}
.quiz-meta .player-identity{grid-column:1}
.quiz-meta .round-context{grid-column:2}
.quiz-meta .countdown{grid-column:3}
.quiz-meta #score{grid-column:4}
.quiz-meta .question-actions{grid-column:5;justify-self:end;justify-content:flex-end;min-inline-size:12rem}
.quiz-meta:has(#timerPanel[hidden]){grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto auto}
.quiz-meta:has(#timerPanel[hidden]) #score{grid-column:3}
.quiz-meta:has(#timerPanel[hidden]) .question-actions{grid-column:4}
.countdown{--clock-accent:#7e78b4;display:flex;align-items:center;justify-content:center;gap:8px;min-height:38px;padding:4px 10px;text-align:center;border:2px solid var(--clock-accent);border-radius:999px;background:#f8f6ff;color:#574b89}
.countdown #timerLabel{max-width:7em;font-size:.65rem;font-weight:700;line-height:1.3;text-align:left}
.countdown #timer{display:block;min-width:4.6ch;color:inherit;font-size:1.35rem;font-weight:700;line-height:1;letter-spacing:.02em;font-variant-numeric:tabular-nums}
.countdown[data-state="running"]{--clock-accent:#66add5;background:#f0fbff;color:#255e82}
.countdown[data-state="warning"],.countdown[data-state="expired"]{--clock-accent:#dc665e;background:#fff0ed;color:#a52e2b}
.countdown[data-state="paused"],.countdown[data-state="complete"],.countdown[data-state="idle"]{--clock-accent:#b2b8d0;background:#f5f5fa;color:#626a83}

.feedback-effect{position:fixed;left:50%;top:50%;width:clamp(160px,26vw,300px);aspect-ratio:1;transform:translate(-50%,-50%);z-index:60;pointer-events:none}
.feedback-effect--success{width:clamp(260px,46vw,650px)}
.feedback-effect svg{display:block;width:100%;height:100%}
.feedback-effect--celebration{inset:0;width:100%;height:100%;aspect-ratio:auto;transform:none}

@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.feedback-effect{display:none!important}}

@media(max-width:760px){
  .quiz-meta{display:flex;flex-wrap:wrap;gap:8px 16px}
  .quiz-meta .player-identity,.quiz-meta .round-context{flex:1 1 36%}
  .quiz-meta .question-actions{min-inline-size:0;margin-left:auto}
  .quiz-meta #score{margin-left:auto}
  .camera-zoom{width:300px}
}

/* The ready pose lives inside the existing help text, beside the four answer pictograms. */
.ready-guide{display:flex;align-items:center;gap:16px}
.ready-guide img{width:76px;height:86px;object-fit:contain;flex-shrink:0}
.ready-guide span{min-width:0}


/* Restore the original inline options and welcome artwork; camera still starts automatically. */
.welcome{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(360px,.85fr);gap:5vw;align-items:center;min-height:calc(100vh - 72px);padding-left:10vw;padding-right:10vw;padding-bottom:50px}
.welcome-copy{text-align:center;min-width:0}
.welcome-copy h1{font-size:clamp(3.3rem,calc(4.8vw * var(--page-font-scale)),5.2rem);line-height:.96;margin:0 0 13px;color:#3c91cb;text-shadow:0 3px 0 #ffffff;letter-spacing:-.025em}
.welcome-copy h1 em{font-style:normal;color:#8560ca}
.welcome-tagline{font-size:clamp(1.1rem,calc(1.6vw * var(--page-font-scale)),1.45rem);color:#4d6d7d;margin-bottom:0}
.welcome-friends{display:block;width:100%;height:clamp(145px,23vh,240px);object-fit:contain;margin:7px auto 5px;filter:drop-shadow(0 9px 9px #618c8522)}
.intro{max-width:550px;margin:0 auto 13px;font-size:.94rem;color:#46617a;line-height:1.6}
.pose-strip{display:flex;justify-content:center;gap:10px;margin:16px 0 12px}
.pose-tile{flex:1;max-width:112px;text-align:center;color:#33436b;border-radius:17px;padding:7px;background:#ffffffdf;border:2px solid #fff;box-shadow:0 3px 0 #bbd8e7}
.pose-tile:nth-child(2){background:#fff1d0}.pose-tile:nth-child(3){background:#e0f4e7}.pose-tile:nth-child(4){background:#f0e6ff}
.pose-tile img{display:block;width:100%;height:77px;object-fit:contain}
.pose-tile b{font-size:.68rem;line-height:1.3;display:block;min-height:25px}
.welcome{min-height:calc(100dvh - 58px);padding:16px clamp(12px,4.6852vw,64px) 22px;gap:clamp(12px,3.0747vw,42px);grid-template-columns:minmax(0,1.1fr) minmax(0,.9fr)}
.welcome-copy h1{font-size:3.7rem}
.welcome-copy .eyebrow{font-size:.7rem;margin-bottom:10px}
.welcome-tagline{font-size:1.15rem}
.welcome-friends{height:136px;margin:5px auto}
.intro{font-size:.86rem;line-height:1.5;margin-bottom:9px}
.pose-strip{gap:9px;margin:10px 0}
.pose-tile{max-width:103px;padding:6px}
.pose-tile img{height:58px}
.pose-tile b{font-size:.65rem;min-height:22px}

/* Per-turn results stay focused; history is an on-demand side drawer. */
.turn-result{text-align:center;max-width:460px}
.turn-player{font-size:1.35rem;font-weight:700;margin-bottom:8px;overflow-wrap:anywhere}
.turn-points{display:block;font-family:'Baloo 2',Quicksand,sans-serif;font-size:2.7rem;color:var(--good);line-height:1.2;margin:12px 0}
#turnStats{margin-bottom:22px}
.history-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(420px,100%);max-width:100%;height:100dvh;max-height:100dvh;border:0;border-left:2px solid var(--line);border-radius:20px 0 0 20px;padding:22px;box-shadow:-8px 0 32px #30456726}
.history-drawer[open]{display:flex;flex-direction:column}
.history-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.history-heading h2{font-size:1.3rem;margin:0}
.history-list{flex:1;min-height:0;overflow:auto;padding-top:8px}
.history-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:15px 0;border-bottom:1px solid var(--line)}
.history-row>div{min-width:0}
.history-row strong{display:block;overflow-wrap:anywhere}
.history-row small{display:block;margin-top:4px;font-size:.75rem}
.history-row>b{white-space:nowrap;font-size:.9rem;color:var(--good)}

.turn-actions{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap}

.turn-result>.feedback-effect{position:relative;left:auto;top:auto;width:80px;height:80px;aspect-ratio:1;transform:none;margin:0 auto 8px}

.two-fields:has(#questionsPerTurnField[hidden]){grid-template-columns:minmax(0,1fr)}

/* Pose selection shares the welcome examples and only opens on request. */
#choosePosesButton{font-size:.82rem;margin-bottom:5px}
.pose-picker[open]{display:flex;flex-direction:column;max-width:820px;max-height:88dvh;overflow:hidden;padding:22px}
.pose-picker-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.pose-picker-heading h2{margin:0}
.pose-picker #posePickerCount{margin:8px 0 16px;font-size:.85rem}
.pose-picker-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;overflow:auto;min-height:0;padding:5px;overscroll-behavior:contain}
.pose-picker-grid label{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:6px;min-width:0;padding:12px 8px 10px;border:2px solid #d8dfeb;border-radius:14px;background:#f5f8fc;cursor:pointer;color:var(--ink)}
.pose-picker-grid label:has(input:checked){border-color:#8662b0;background:#f1e9fb}
.pose-picker-grid label:focus-within{outline:3px solid #6345bd;outline-offset:1px}
.pose-picker-grid input{position:absolute;top:9px;right:9px;width:20px;height:20px;accent-color:#7554af;cursor:pointer}
.pose-picker-grid img{display:block;width:100%;height:105px;object-fit:contain;pointer-events:none}
.pose-picker-grid span{text-align:center;font-size:.75rem;line-height:1.4;overflow-wrap:anywhere}
.pose-picker-actions{display:flex;justify-content:flex-end;gap:10px;padding-top:16px}
@media(max-width:540px){.pose-picker[open]{padding:16px}.pose-picker-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pose-picker-heading h2{font-size:1.3rem}}

/* Reserve a line while the selected name is revealed character by character. */
#playerName{min-height:1.1em}

/* Compact camera zoom stays with the header controls. */
.topbar .camera-zoom{flex:0 1 180px;width:180px;min-width:140px;max-width:100%}
.topbar .camera-zoom label{font-size:.72rem;line-height:1.2}
.topbar .camera-zoom input{min-height:28px}
.quiz-status>p:not(:empty){margin:6px 0}


/* Quiz-only mode removes the player slot and gives its space to question progress. */
.quiz-meta.without-player{display:flex;flex-wrap:wrap;align-items:center}
.quiz-meta.without-player .round-context{flex:1 1 auto}
.quiz-meta.without-player .question-actions{min-inline-size:0}

.question-actions #cameraButton{min-height:36px;padding:7px 12px;font-size:.76rem;white-space:nowrap}

@media (max-width:640px){
  .quiz-stage{grid-template-columns:minmax(0,1fr);grid-template-rows:auto}
  .camera-preview-frame{grid-column:1;grid-row:1;width:min(51.2%,30.4dvh)}
  .quiz-stage [data-answer="0"]{grid-column:1;grid-row:2}
  .quiz-stage [data-answer="1"]{grid-column:1;grid-row:3}
  .quiz-stage [data-answer="2"]{grid-column:1;grid-row:4}
  .quiz-stage [data-answer="3"]{grid-column:1;grid-row:5}
  .answer-content{padding:8px;font-size:calc(1rem * var(--answer-font-scale))}
  .quiz-question.has-illustration{grid-template-columns:minmax(0,1fr);gap:8px}
  .question-illustration{width:min(100%,360px);justify-self:center}
  .question-illustration .question-image{height:220px}
}
