/* V3.19: the viewport owns the board height; content cannot push the logo offscreen. */
body[data-screen=board] .score-panel{display:flex;flex-direction:column;min-height:0;min-width:0;box-sizing:border-box}
body[data-screen=board] .score-panel>*{flex-shrink:0}
body[data-screen=board] .score-panel .score-scroll{flex:1 1 0;min-height:0;grid-template-rows:repeat(var(--score-rows),minmax(0,1fr));gap:8px;padding:5px;overflow:visible}
body[data-screen=board] .score-panel .team-score{box-sizing:border-box;min-height:0;padding:6px 5px;margin:0;justify-content:center;gap:3px;overflow:visible}
body[data-screen=board] .score-panel .team-score h3{flex:0 0 auto;font-size:clamp(11px,1.05vw,18px);line-height:1.1;min-height:1.1em;max-width:100%;margin:0;white-space:normal;overflow-wrap:anywhere;text-overflow:clip;text-align:center}
body[data-screen=board] .score-panel .score-num{gap:5px;align-items:center;justify-content:center;flex:0 0 auto}
body[data-screen=board] .score-panel .score-num strong{font-size:clamp(22px,2.1vw,36px);width:4ch;max-width:100%;flex:0 1 auto;padding:1px 3px}
body[data-screen=board] .score-panel .score-num button{width:25px;height:25px;min-height:25px;font-size:21px;flex:0 0 auto}
body[data-screen=board] .score-panel .all-game-total{flex-direction:row;justify-content:center;flex-wrap:wrap;gap:4px;margin:0;line-height:1.1}
body[data-screen=board] .score-panel .all-game-total span{font-size:10px;letter-spacing:0}
body[data-screen=board] .score-panel .all-game-total span:after{content:none}
body[data-screen=board] .score-panel .all-game-total strong{font-size:14px}
body[data-screen=board] .score-panel .side-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0}
body[data-screen=board] .score-panel .side-actions button{font-size:clamp(10px,.8vw,14px);padding:6px 4px;min-height:32px;line-height:1.15;border-radius:9px}
body[data-screen=board] .score-panel .side-notice{grid-column:1/-1;margin:0;font-size:11px;line-height:1.2}
body[data-screen=board] .score-panel .side-icons{padding:0;gap:24px;margin:0}
body[data-screen=board] .score-panel .side-icons button{width:38px;height:34px;min-height:34px}
body[data-screen=board] .score-panel>.return-home{margin:0;min-height:29px;padding:4px;font-size:11px;line-height:1.2;flex:0 0 auto}
body[data-screen=board] .score-panel>h2{line-height:1.1;font-size:clamp(16px,1.45vw,25px);margin:0;flex:0 0 auto}
body[data-screen=board] .score-panel .mini-join{display:flex;flex-direction:row;align-items:center;gap:10px;padding:4px;margin:0}
body[data-screen=board] .mini-join canvas[data-qr]{width:76px!important;height:76px!important;margin:3px;flex:none}
body[data-screen=board] .mini-join small{font-size:9px}
body[data-screen=board] .mini-join strong{font-size:15px}
body[data-screen=board] .mini-join button{min-height:25px;padding:3px 5px;font-size:10px;margin:3px 0}
body[data-screen=board] .score-panel[data-teams='5'] .score-scroll,body[data-screen=board] .score-panel[data-teams='6'] .score-scroll,body[data-screen=board] .score-panel[data-teams='7'] .score-scroll,body[data-screen=board] .score-panel[data-teams='8'] .score-scroll{grid-template-columns:repeat(2,minmax(0,1fr))}
body[data-screen=board] .score-panel:is([data-teams='5'],[data-teams='6'],[data-teams='7'],[data-teams='8']) .team-score h3{font-size:clamp(10px,.85vw,14px)}
body[data-screen=board] .score-panel:is([data-teams='5'],[data-teams='6'],[data-teams='7'],[data-teams='8']) .score-num{gap:3px}
body[data-screen=board] .score-panel:is([data-teams='5'],[data-teams='6'],[data-teams='7'],[data-teams='8']) .score-num strong{font-size:clamp(19px,1.55vw,27px);width:3.5ch}
body[data-screen=board] .score-panel:is([data-teams='5'],[data-teams='6'],[data-teams='7'],[data-teams='8']) .score-num button{width:20px;height:23px;min-height:23px;font-size:18px}
body[data-screen=board] .score-panel:is([data-teams='5'],[data-teams='6'],[data-teams='7'],[data-teams='8']) .all-game-total span{font-size:0}
body[data-screen=board] .score-panel:is([data-teams='5'],[data-teams='6'],[data-teams='7'],[data-teams='8']) .all-game-total span:after{content:'ALL GAMES';font-size:9px}
body[data-screen=board] .score-panel:is([data-teams='5'],[data-teams='6'],[data-teams='7'],[data-teams='8']) .all-game-total strong{font-size:12px}
@media(min-width:900px){
 body[data-screen=board]{display:block;height:100svh;overflow:hidden}
 body[data-screen=board] #stage{display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:100svh;min-height:0;aspect-ratio:auto;padding:10px 2vw 14px;margin:0}
 body[data-screen=board] .masthead{flex:0 0 clamp(105px,17svh,190px);height:auto;min-height:0;max-height:none;padding:0 22vw 0 0;overflow:visible}
 body[data-screen=board] .brand{height:100%;width:min(36vw,560px);max-height:100%;padding:0;display:flex;align-items:center}
 body[data-screen=board] .brand img{width:100%;height:100%;max-height:100%;object-fit:contain;transform:none}
 body[data-screen=board] #app{flex:1 1 0;min-height:0;width:100%;max-width:none;margin:0}
 body[data-screen=board] .play-layout{height:100%;min-height:0;margin:0;grid-template-columns:minmax(0,1fr) clamp(285px,23vw,425px);gap:22px;align-items:stretch}
 body[data-screen=board] .board-wrap{display:flex;flex-direction:column;min-height:0}
 body[data-screen=board] .board{flex:1 1 0;min-height:0;height:100%;box-sizing:border-box}
 body[data-screen=board] .score-panel{height:100%;gap:7px;padding:8px 5px;border-width:17px;border-image-width:17px;border-image-outset:4px}
 body[data-screen=board] .board-wrap>.game-caption{bottom:calc(100% + 10px);width:clamp(190px,20vw,310px);padding:7px 10px}
 body[data-screen=board] .game-number{font-size:clamp(18px,1.5vw,26px)}
 body[data-screen=board] .game-name{font-size:clamp(12px,1vw,17px)}
}
@media(min-width:900px) and (max-height:720px){
 body[data-screen=board] #stage{padding-top:5px;padding-bottom:9px}
 body[data-screen=board] .masthead{flex-basis:95px}
 body[data-screen=board] .score-panel{gap:5px;border-width:13px;border-image-width:13px;padding:5px}
 body[data-screen=board] .score-panel .score-scroll{gap:5px;padding:3px}
 body[data-screen=board] .score-panel .team-score{padding:4px;gap:2px}
 body[data-screen=board] .score-panel .team-score h3{font-size:12px}
 body[data-screen=board] .score-panel .score-num strong{font-size:25px}
 body[data-screen=board] .score-panel .side-actions button{min-height:28px;font-size:10px;padding:4px}
 body[data-screen=board] .score-panel .side-icons button{height:29px;min-height:29px;width:33px}
 body[data-screen=board] .mini-join canvas[data-qr]{width:60px!important;height:60px!important}
 body[data-screen=board] .score-panel .all-game-total span{font-size:9px}
 body[data-screen=board] .score-panel .all-game-total strong{font-size:12px}
}
.breakdown table{min-width:760px;font-size:14px;white-space:nowrap}
.breakdown th,.breakdown td{padding:9px 8px;text-align:center}
.breakdown thead th{background:#001147;color:#fff8e7}
.breakdown tbody th:first-child{position:sticky;left:0;z-index:1;background:#fff8e7;text-align:left;white-space:normal;min-width:110px}
.saved-session{text-align:center}
.host-panel .board-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}

/* V3.20: optional tutorial, in normal flow below both modes. */
.tutorial-row{display:flex;align-items:center;justify-content:center;gap:10px 18px;flex-wrap:wrap;margin:18px 0 0;text-align:center}
.tutorial-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 20px;border:2px solid #ffdb83;border-radius:999px;background:#001147;color:#fff8e7;font-size:15px;font-weight:900;text-decoration:none;box-shadow:0 0 12px #00d9ef55;line-height:1.2}
.tutorial-link:hover{background:#006d7a}.tutorial-link:focus-visible{outline:3px solid #fff;outline-offset:4px}
.tutorial-row span{font-size:14px;color:#fff8e7;text-shadow:0 2px 4px #001147}
@media(min-width:900px){body[data-screen=home] .mode-card{height:32.5cqw}.tutorial-row{margin:1cqw 0 0;gap:.7cqw 1.1cqw}.tutorial-link{font-size:clamp(12px,.85cqw,17px);padding:7px 16px;min-height:38px}.tutorial-row span{font-size:clamp(12px,.8cqw,16px)}body[data-screen=home] .welcome-footer{margin-top:.8cqw}}
@media(max-width:600px){.tutorial-row{flex-direction:column;gap:8px;margin-top:24px}.tutorial-link{width:100%;max-width:360px;box-sizing:border-box}.tutorial-row span{font-size:13px}}

/* V3.21: only the tutorial link beneath the two mode cards. */
body[data-screen=home] .tutorial-row{margin-top:18px}
