/* BOZOKO Together 0.4.1: compact match layout; loaded after existing brand-fit CSS. */

/* v0.4: viewport-sized play surface. Menus remain ordinary scrollable pages.
   Both ends use the larger safe-area inset, so rotation never puts controls
   underneath the opposite end's notch or home indicator. Zoom stays enabled. */
html.match-active,body.match-active{overflow:hidden;height:100%;overscroll-behavior:none}
body.match-active>.topbar,body.match-active>.site-footer{display:none}
#app.in-match{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;min-height:0;max-width:none;margin:0;overflow:hidden;padding:8px;
 padding-top:max(8px,env(safe-area-inset-top,0px),env(safe-area-inset-bottom,0px));
 padding-bottom:max(8px,env(safe-area-inset-top,0px),env(safe-area-inset-bottom,0px));
 padding-left:max(8px,env(safe-area-inset-left,0px),env(safe-area-inset-right,0px));
 padding-right:max(8px,env(safe-area-inset-left,0px),env(safe-area-inset-right,0px))}
.play-frame{height:100%;width:100%;max-width:980px;margin:auto;display:flex;flex-direction:column;gap:8px;transform-origin:50% 50%}
.play-frame.turn-flipped,dialog.turn-flipped{transform:rotate(180deg)}
/* No spin animation: orientation changes once, instantly, on a seat change. */
.match-toolbar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;min-height:46px}
.match-toolbar .button{min-width:44px;min-height:44px;padding:8px 12px;font-size:.86rem;border-radius:12px}
.toolbar-back{background:var(--deep);color:white;flex:none}
.match-title{min-width:0;flex:1;text-align:center}
.match-title h1{font-size:1.4rem;line-height:1.15;letter-spacing:-.03em}
.match-subtitle{font-size:.74rem;line-height:1.4;color:var(--muted);margin-top:3px}
.in-match .scorebar{flex:none;margin:0;gap:6px;width:100%;max-width:none}
.in-match .score-seat{min-width:0;padding:7px;display:flex;flex-direction:row;align-items:center;gap:7px;text-align:left;border-radius:12px}
.in-match .score-seat.active{padding:6px}
.in-match .score-seat .player-mark{width:26px;height:26px;font-size:16px;flex:none}
.in-match .score-seat strong{font-size:.8rem;line-height:1.2}
.in-match .seat-status{font-size:.64rem;line-height:1.3;display:block}
.in-match .score-value{margin-left:auto;font-size:1.2rem;line-height:1.1;text-align:right}
.in-match .score-value span{font-size:.58rem;line-height:1.2}
.in-match .scorebar.seats-1{max-width:none}
.match-scroll{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:4px;scroll-padding:8px}
.in-match .game-stage,.in-match .results{max-width:850px;margin:0 auto;padding:16px;border-radius:18px;box-shadow:none}
.in-match .turn-notice{margin:0 0 12px;gap:8px;font-size:.85rem;justify-content:center;line-height:1.35}
.in-match .turn-notice span:last-child:not(.player-mark){font-size:.8rem;flex-basis:auto}
.in-match .feedback{margin:10px 0;font-size:.87rem;line-height:1.45}
.in-match .game-stage>.small-print{display:none}
.in-match .button{min-height:44px}
.in-match .stage-quiz .turn-notice,.in-match .stage-maths .turn-notice{display:none}
.in-match .quiz-progress{margin:0 auto 10px;gap:5px}
.in-match .quiz-stop{height:26px;width:34px;border-radius:8px;font-size:.9rem}
.in-match .quiz-card{padding:18px;margin:0 0 12px;border-radius:17px}
.in-match .quiz-category{margin:0 0 12px;gap:10px}
.in-match .quiz-symbol{width:36px;height:36px;font-size:1.3rem;border-radius:10px}
.in-match .quiz-tagline{display:none}
.in-match .quiz-prompt{font-size:1.32rem;line-height:1.35;margin:0 0 14px}
.in-match .quiz-answers{gap:8px}
.in-match .quiz-answer{min-height:52px;padding:10px;gap:8px}
.in-match .quiz-answer strong{font-size:1rem;line-height:1.32}
.in-match .quiz-help-row{margin-top:12px;gap:10px;align-items:center}
.in-match .quiz-hint{font-size:.75rem;line-height:1.4}
.in-match .quiz-reveal{margin-top:12px;padding:12px}
.in-match .reveal-fact{font-size:1rem;line-height:1.5}
.quiz-review-answer{display:none}
.in-match .pairs-board{gap:8px;max-width:440px;margin:0 auto}
.in-match .cards-12{grid-template-columns:repeat(4,minmax(0,1fr));max-width:min(440px,calc((100dvh - 270px)*1.33))}
.in-match .cards-16{grid-template-columns:repeat(4,minmax(0,1fr));max-width:min(440px,calc(100dvh - 250px))}
.in-match .cards-24{grid-template-columns:repeat(6,minmax(0,1fr));max-width:min(490px,calc((100dvh - 250px)*1.5))}
.in-match .pair-card{border-radius:10px;min-height:44px;min-width:0}
.in-match .pair-symbol{font-size:1.9rem}.in-match .card-back{font-size:1.8rem}
.in-match .dice-panel{margin:20px 0;gap:24px}
.in-match .die{width:108px;height:108px;font-size:85px}
.in-match .pot>strong{font-size:3.5rem}
.in-match .question-card{padding:18px;margin-bottom:8px;border-radius:16px}
.in-match .equation{margin:18px 0;font-size:2.8rem}
.in-match .answer-grid:not(.quiz-answers){gap:8px}
.in-match .answer:not(.quiz-answer){min-height:58px;padding:10px}
.in-match .dots-board{width:min(100%,440px);margin:0 auto}
.in-match .line-wrap{width:min(100%,470px);margin:0 auto}
.in-match .line-board{gap:5px;padding:8px}
.in-match .column-controls{gap:5px;padding:0 8px;margin-bottom:5px}
.in-match .column-button{min-height:44px}
.in-match .results{padding:20px 16px}
.in-match .result-star{font-size:38px;margin-bottom:8px}
.in-match .result-title{font-size:1.7rem}
.in-match .results>.lead{font-size:.94rem;margin-top:12px}
.in-match .solo-result-score{margin:12px auto 0}
.in-match .solo-result-score strong{font-size:4rem}
.in-match .solo-result-caption{margin:4px 0 10px}
.in-match .result-themes{margin:12px auto;gap:5px}
.in-match .result-themes span{padding:4px 8px;font-size:.7rem}
.in-match .results .actions{margin-top:16px;gap:8px}
.in-match .results .small-print{margin-top:12px}
.in-match .board-cover{min-height:220px;padding:24px}
dialog{max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overflow:auto;overscroll-behavior:contain}
dialog .modal-body{padding:24px}
.setup-rules>summary{min-height:44px;display:list-item;padding:10px 0;font-weight:800;cursor:pointer}
@media(max-width:720px),(max-height:700px){
 .in-match .game-stage{padding:10px;border-radius:14px}
 .in-match .turn-notice{margin-bottom:8px;font-size:.8rem}
 .in-match .turn-notice .player-mark{display:none}
 .in-match .turn-notice span:last-child:not(.player-mark){display:none}
 .in-match .quiz-progress{display:none}
 .in-match .quiz-card{padding:12px;margin-bottom:8px}
 .in-match .quiz-category{margin-bottom:9px}
 .in-match .quiz-symbol{width:27px;height:27px;font-size:1.05rem;border-radius:8px}
 .in-match .quiz-category .eyebrow{font-size:.71rem}
 .in-match .quiz-prompt{font-size:1.13rem;line-height:1.35;margin-bottom:12px}
 .in-match .quiz-answers{grid-template-columns:1fr;gap:6px}
 .in-match .quiz-answer{padding:9px;min-height:44px;gap:8px}
 .in-match .quiz-answer strong{font-size:.96rem}
 .in-match .quiz-answer small{width:23px;height:23px}
 .in-match .quiz-help-row{margin-top:10px}
 .in-match .quiz-help-row .button{font-size:.8rem;padding:8px 10px}
 .in-match .quiz-hint{font-size:.71rem}
 .in-match .phase-review .quiz-answers{display:none}
 .in-match .phase-review .quiz-review-answer{display:block;margin-bottom:10px}
 .in-match .review-answer{font-weight:800;font-size:1rem;line-height:1.4;color:#fff}
 .in-match .review-choice{font-size:.87rem;line-height:1.4;margin-top:5px;color:#d2e3d7}
 .in-match .quiz-reveal{margin-top:8px;padding:12px}
 .in-match .reveal-fact{font-size:.96rem;line-height:1.5}
 .in-match .quiz-card+.feedback{font-size:.79rem;margin:6px 0}
 .in-match .game-stage>[data-next]{width:100%;min-height:46px}
 .in-match .scorebar.seats-3 .player-mark,.in-match .scorebar.seats-4 .player-mark{display:none}
 .in-match .scorebar.seats-3 strong,.in-match .scorebar.seats-4 strong{font-size:.67rem}
 .in-match .scorebar.seats-3 .score-seat,.in-match .scorebar.seats-4 .score-seat{gap:3px}
 .in-match .scorebar.seats-4 .score-value span{display:none}
 .in-match .match-title h1{font-size:1.15rem}
 .in-match .match-subtitle{font-size:.64rem}
 .in-match .toolbar-back,.in-match .toolbar-rules{padding:8px;font-size:.77rem}
 .in-match .solo-results .actions .button{width:auto;flex:1 1 auto}
 #app.in-setup{padding-top:10px}
 .in-setup .setup-layout{gap:12px}
 .in-setup .large-icon,.in-setup .setup-intro>.eyebrow{display:none}
 .in-setup .setup-intro h1{font-size:1.8rem;margin-bottom:8px}
 .in-setup .setup-intro .lead{font-size:.88rem;margin-bottom:2px}
 .in-setup .setup-card{padding:16px;border-radius:18px}
 .in-setup .setup-card>.eyebrow,.in-setup .seat-preview,.in-setup .setup-card>.small-print{display:none}
 .in-setup .setup-card h2{font-size:1.25rem;margin-bottom:14px}
 .in-setup .setting-group{margin-bottom:12px}
 .in-setup .setting-group legend{margin-bottom:7px}
 .in-setup .setting-help{margin:5px 0 12px;font-size:.82rem;line-height:1.4}
 .in-setup .start-button{margin-top:4px}
}
@media(max-width:349px){
 .in-match .cards-24{grid-template-columns:repeat(4,minmax(0,1fr));max-width:100%}
 .in-match .cards-24 .pair-card{aspect-ratio:1.2}
 .in-match .match-title h1{font-size:1rem}
 .in-match .score-seat .player-mark{display:none}
 .in-match .quiz-card{padding:10px}
}
/* Wide, short screens place the quiz choices beside the question, not below it. */
@media(min-width:600px) and (max-height:520px){
 .in-match .quiz-card{display:grid;grid-template-columns:1fr 1fr;column-gap:16px;align-items:start}
 .in-match .quiz-category,.in-match .quiz-prompt,.in-match .quiz-help-row{grid-column:1}
 .in-match .quiz-answers{grid-column:2;grid-row:1 / span 3}
 .in-match .quiz-reveal{grid-column:2;grid-row:1 / span 3;margin-top:0}
 .in-match .quiz-help-row{flex-wrap:wrap}
 .in-match .cards-12,.in-match .cards-16,.in-match .cards-24{max-width:340px}
 .in-match .cards-12{grid-template-columns:repeat(6,minmax(0,1fr))}
 .in-match .cards-16{grid-template-columns:repeat(8,minmax(0,1fr));max-width:480px}
 .in-match .cards-24{grid-template-columns:repeat(8,minmax(0,1fr));max-width:460px}
 .in-match .dice-panel{margin:10px 0;gap:20px}
 .in-match .stage-dice .turn-notice{display:none}
 .in-match .die{width:72px;height:72px;font-size:60px}
 .in-match .pot>strong{font-size:2.7rem}
}
