/* Reserve separate rows for scores, the 3D scene, progress and actions.
   No game panel is positioned over the canvas. */
.game-shell{width:100%;grid-template-columns:minmax(0,1fr)}
.game-shell .board-section{
 position:relative;inset:auto;height:100%;min-height:0;
 display:grid;grid-template-areas:'overview' 'campus' 'progress' 'actions';
 grid-template-rows:auto minmax(0,1fr) 40px auto;
 padding:0 24px 12px;gap:0;
}
.campus-top{grid-area:overview;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:16px 0 4px;min-width:0}
.game-shell .adventure-title{position:static;inset:auto;flex-shrink:0}
.game-shell .adventure-title h1,.game-shell.has-session .adventure-title h1{font-size:22px;line-height:1.2;margin:4px 0}
.game-shell .adventure-title h1 br{display:none}.game-shell .adventure-title h1 em:before{content:' '}
.game-shell .adventure-title p{margin:4px 0;font-size:11px}
.game-shell .adventure-title .eyebrow{font-size:8px}
.game-shell .house-hud{position:static;inset:auto;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:7px;min-width:0}
.game-shell .hud-house{min-width:83px;background:#fff9e9;padding:8px}
.game-shell #campusBoardContainer{grid-area:campus;position:relative;inset:auto;min-height:0;min-width:0}
.game-shell .campus-stage{display:grid;grid-template-columns:minmax(0,1fr) 42px;grid-template-rows:minmax(0,1fr) 27px;column-gap:7px}
.game-shell .campus-viewport{position:relative;inset:auto;grid-area:1/1;min-height:0;min-width:0}
.game-shell .map-tools{position:static;inset:auto;grid-area:1/2;align-self:start;gap:6px;padding-top:8px}
.game-shell .map-tools button{width:38px;height:38px;background:#fff8e8}
.game-shell .map-caption{position:static;inset:auto;grid-area:2/1;align-self:center;justify-self:start}
.game-shell .map-caption small{display:none}
.game-shell .map-hint{position:static;inset:auto;grid-area:2/1;align-self:center;justify-self:end;margin:0;font-size:10px}
.game-shell .space-picker{position:static;inset:auto;grid-area:2/1;justify-self:center;align-self:center;width:auto;display:flex;align-items:center;gap:7px}
.game-shell .space-picker label{font-size:9px;margin:0}.game-shell .space-picker select{max-width:150px;padding:3px}
.game-shell .phase-strip,.game-shell.in-class .phase-strip{grid-area:progress;position:static;inset:auto;transform:none;justify-self:center;align-self:center;margin:0;padding:6px 18px;background:#e5edda;border-color:#a3bea140;gap:16px}
.game-shell .local-flow,.game-shell .round-panel{
 grid-area:actions;position:static;inset:auto;transform:none;justify-self:center;
 width:min(820px,100%);margin:0;max-height:min(220px,32dvh);min-height:0;
 padding:14px 18px;border-radius:17px;box-shadow:0 4px 0 #23544025;
}
.game-shell .local-flow{gap:12px}.game-shell .local-copy h2{font-size:15px}
.game-shell .round-panel h3{font-size:16px;margin:5px 0}
.game-shell .round-panel p{font-size:12px;margin:5px 0}
.game-shell .round-panel .round-list{max-height:80px}
.game-shell .round-panel .round-roll,.game-shell .round-panel .round-countdown{font-size:25px}
.game-shell .all-house-rolls{row-gap:9px}
.game-shell .house-die{min-height:47px;padding:5px 7px}
.game-shell .house-die svg{width:24px;height:29px}
.game-shell .campus-inspector{top:12px;bottom:auto;left:12px;max-width:calc(100% - 70px)}
.game-shell .board-wrapper{padding:10px;height:100%;overflow:auto}
@media(max-width:1000px){
 .campus-top{flex-direction:column-reverse;gap:7px;padding:10px 0 0;align-items:stretch}
 .game-shell .house-hud{width:100%;gap:6px}
 .game-shell .hud-house{min-width:0;padding:5px 8px;grid-template-columns:27px 1fr;gap:0 4px}
 .game-shell .hud-house svg{width:27px;height:32px}
 .game-shell .adventure-title h1,.game-shell.has-session .adventure-title h1{font-size:15px;text-align:center;margin:0}
 .game-shell .adventure-title .eyebrow,.game-shell .adventure-title p{display:none}
 .game-shell .space-picker{display:none}
}
@media(max-width:600px){
 .game-shell{grid-template-rows:58px minmax(0,1fr) 53px 20px}
 .game-shell .game-topbar{padding:8px 10px;min-width:0}
 .game-shell .board-section{padding:0 10px 9px;grid-template-rows:auto minmax(0,1fr) 38px auto}
 .campus-top{padding-top:9px;gap:8px}
 .game-shell .house-hud{gap:5px}
 .game-shell .hud-house{padding:6px 4px;grid-template-columns:23px 1fr;gap:0 3px;border-radius:9px;min-height:44px}
 .game-shell .hud-house svg{width:23px;height:29px}
 .game-shell .hud-house svg{grid-row:1;height:21px;width:21px}.game-shell .hud-house span{font-size:8px}.game-shell .hud-house b{grid-column:1/-1;text-align:center;font-size:8px;white-space:nowrap;line-height:1.2}.game-shell .hud-house small{display:none}
 .game-shell .adventure-title h1,.game-shell.has-session .adventure-title h1{font-size:12px;color:#45664e;letter-spacing:0}
 .game-shell .campus-stage{grid-template-columns:minmax(0,1fr) 32px;grid-template-rows:minmax(0,1fr);column-gap:3px}
 .game-shell .map-tools{gap:5px;padding-top:12px}
 .game-shell .map-tools button{width:30px;height:34px;font-size:20px;border-radius:9px}
 .game-shell .map-caption,.game-shell .map-hint{display:none}
 .game-shell .phase-strip,.game-shell.in-class .phase-strip{gap:9px;padding:5px 11px}
 .game-shell .phase-strip span,.game-shell .phase-strip b{font-size:8px}
 .game-shell .local-flow,.game-shell .round-panel{padding:10px 12px;max-height:29dvh;width:100%;border-radius:14px}
 .game-shell .local-copy h2{font-size:12px;margin:3px 0}.game-shell .local-copy p{font-size:10px;line-height:1.35}.game-shell .local-copy small{font-size:7px}
 .game-shell .local-avatar{width:30px;height:40px}.game-shell .local-flow>.primary{font-size:9px;padding:9px 10px;min-width:100px;min-height:43px}
 .game-shell .all-house-rolls{gap:7px}.game-shell .all-house-rolls .local-avatar{display:none}
 .game-shell .house-dice-row{gap:5px}.game-shell .house-die{min-height:45px;padding:3px;gap:0}.game-shell .house-die b{font-size:17px}.game-shell .house-die span{font-size:8px}
 .game-shell .device-round-note{font-size:8px;line-height:1.3}
 .game-shell .round-panel .round-phase{font-size:8px}.game-shell .round-panel h3{font-size:14px}.game-shell .round-panel p{font-size:11px}.game-shell .round-panel .primary{font-size:10px;min-height:43px;padding:10px}
 .game-shell .game-nav{gap:5px}.game-shell .game-nav button{font-size:10px}.game-shell .game-nav button span{font-size:19px}
}
@media(max-height:600px){
 .game-shell .adventure-title{display:none}
 .campus-top{padding-top:6px;padding-bottom:4px}
 .game-shell .local-flow,.game-shell .round-panel{max-height:30dvh;padding:8px 12px}
 .game-shell .local-copy p,.game-shell .device-round-note{display:none}
}
/* Desktop and projector: the campus uses the full height; the round panel sits in a column on the right */
@media(min-width:1100px) and (min-height:620px){
 .game-shell .board-section{
  grid-template-areas:'overview overview' 'campus actions' 'progress actions';
  grid-template-columns:minmax(0,1fr) clamp(320px,25vw,420px);
  grid-template-rows:auto minmax(0,1fr) 44px;
  column-gap:22px;
 }
 .game-shell .local-flow,.game-shell .round-panel{
  width:100%;max-height:none;align-self:center;justify-self:stretch;
  margin:10px 0;max-height:calc(100% - 20px);
 }
 .game-shell .local-flow{flex-direction:column;align-items:stretch;text-align:center}
 .game-shell .local-avatar{align-self:center;width:64px;height:74px}
 .game-shell .local-copy h2{font-size:20px}.game-shell .local-copy p{font-size:14px}
 .game-shell .local-flow>.primary{min-width:0;width:100%}
 .game-shell .round-panel h3{font-size:22px}.game-shell .round-panel p{font-size:15px}
 .game-shell .round-panel .round-list{max-height:none}
 .game-shell .round-panel .round-list li{font-size:14px}
 .game-shell .round-panel .round-roll,.game-shell .round-panel .round-countdown{font-size:48px}
 .game-shell .house-dice-row{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* Very large screens (projectors at 1080p and up): bigger HUD and captions so the back row can read them */
@media(min-width:1600px) and (min-height:850px){
 .game-shell .hud-house{padding:10px 12px}.game-shell .hud-house span{font-size:13px}.game-shell .hud-house b{font-size:13px}
 .game-shell .hud-house svg{width:38px;height:42px}
 .game-shell .adventure-title h1,.game-shell.has-session .adventure-title h1{font-size:30px}
 .game-shell .phase-strip span,.game-shell .phase-strip b{font-size:12px}
}
/* Full-screen projector mode hides the app chrome around the campus */
:root:fullscreen .game-shell{grid-template-rows:72px minmax(0,1fr) 0 0}
:root:fullscreen .game-nav,:root:fullscreen .game-status{display:none}
/* CAP logo: gold badge with the party star breaking out of the corner */
.game-topbar .brand-logo{width:50px;height:50px;padding:0;background:none;box-shadow:none;border-radius:0;flex-shrink:0}
.brand-logo svg{width:100%;height:100%;display:block;overflow:visible}
.brand-logo .brand-star{transform-origin:51px 12px;transition:transform .3s}
.brand-logo:hover .brand-star,.brand-logo:focus-visible .brand-star{transform:rotate(18deg) scale(1.12)}
@media(max-width:600px){.game-topbar .brand-logo{width:42px;height:42px}}
/* Teacher's join QR: big enough to scan from the back of the room on the projector */
.round-panel .round-qr{display:block;width:min(100%,300px);aspect-ratio:1;margin:10px auto 4px;border-radius:12px;image-rendering:pixelated;background:#fff;box-shadow:0 3px 0 #23544030}
.round-panel .round-qr-link{text-align:center;font-size:12px!important;overflow-wrap:anywhere}
.qr-dialog{width:min(860px,calc(100% - 24px));text-align:center}
.qr-dialog h2{font-size:40px;margin:6px 0}
.qr-dialog img{display:block;width:min(64vh,80vw);aspect-ratio:1;margin:10px auto;image-rendering:pixelated;border-radius:16px;background:#fff}
.qr-dialog #qrDialogLink{font-size:20px;color:#173e35;overflow-wrap:anywhere;margin:6px 0}
.qr-dialog .qr-dialog-tip{font-size:15px}
