/* Every screen fits the viewport; long companion content uses explicit pages. */
html,body{height:100%;height:100dvh;min-height:0;overflow:hidden}
.app,body.game-active .app{height:100dvh;min-height:0;display:flex;flex-direction:column;padding: max(8px,env(safe-area-inset-top)) 10px max(12px,env(safe-area-inset-bottom));overflow:hidden}
.topbar,body.game-active .topbar{height:52px;flex:0 0 52px;grid-template-columns:44px minmax(0,1fr) 44px;gap:4px}
.icon-button{width:42px;height:42px}.brand{min-width:0;padding:8px;font-size:13px;gap:4px}.brand-icon{font-size:20px}
.screen.active{flex:1;min-height:0}.hero{padding:8px 0;text-align:center}.hero-friends{font-size:40px}.hero h1{font-size:28px;line-height:1.04;margin:6px 0}.hero p{font-size:15px;margin:5px 0}
#homeScreen.active{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:10px}
#numberChoices{grid-template-columns:1fr;gap:10px;min-height:0}.game-card{min-height:0;padding:8px 12px;display:grid;grid-template-columns:75px 1fr;grid-template-rows:1fr 1fr;border-width:3px;border-radius:22px}.card-picture{grid-row:1/3;min-height:0;font-size:40px;letter-spacing:-10px;padding-right:10px}.game-card strong{font-size:23px;margin:0;align-self:end}.game-card>span:last-child{font-size:17px;align-self:start}
.activities-home-link,.grownup-link{margin:0 auto;padding:10px 12px;font-size:14px;box-shadow:none}.activities-home-link{border-width:3px}.grownup-link{min-height:42px}
#menuScreen.active{display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:8px}
#menuScreen .hero-friends{display:none}#menuScreen .hero h1{font-size:25px}#menuScreen .hero h1 br{display:none}#menuScreen .hero h1 span:before{content:' '}
.sets-grid{min-height:0;gap:8px;grid-template-rows:repeat(3,minmax(0,1fr))}.set-card{min-height:0;padding:6px;border-width:3px;gap:2px;border-radius:20px;box-shadow:0 4px 0 #0001}.set-emojis{font-size:27px;letter-spacing:0}.set-card strong{font-size:21px}.set-sub{font-size:16px}.activities-link{margin:0 auto;padding:8px 12px;border-width:3px;box-shadow:none}.activities-link strong{font-size:16px}.activities-sub{font-size:13px}
.round-top{flex-wrap:wrap;gap:8px;margin:6px 0 8px}.mode-switch{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px}.mode-pill{font-size:15px;padding:10px 5px}.pill-button{font-size:14px;padding:9px 12px}
.prompt{overflow:visible;margin:4px 0 10px;gap:3px}.prompt-q{font-size:21px}.prompt-sub{font-size:16px}.replay-button{margin:3px 0 4px;padding:7px 16px;font-size:17px}
.find-board{height:auto;max-height:100%;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));padding:12px;gap:12px;aspect-ratio:1.2;width:min(100%,480px)}.find-choice{font-size:min(22cqw,22cqh);border-width:3px;border-radius:22px;min-height:0}.find-choice:last-child{grid-column:1/3;width:calc(50% - 6px);justify-self:center}
.explore-board,#playArea[data-set] .explore-board{grid-template-columns:1fr;grid-template-rows:repeat(5,minmax(0,1fr));grid-auto-flow:row;padding:10px;gap:8px}.explore-tile{grid-template-columns:55px 1fr;grid-template-rows:1fr 1fr;padding:5px 12px;column-gap:12px;border-width:3px}.tile-emoji{grid-row:1/3;font-size:min(10cqh,42px)}.tile-es{font-size:23px;align-self:end}.tile-sub{font-size:17px;white-space:normal;overflow:visible;text-overflow:clip;align-self:start}
.speech-card{padding:7px 10px;margin-top:10px}.speech-status{font-size:14px;line-height:1.3}
.progress-panel{margin:8px auto;padding:14px;max-height:100%;width:100%;box-shadow:none}.progress-mascot{font-size:40px}.progress-panel h2{font-size:25px}.progress-panel>p{font-size:15px;margin:6px 0}.progress-grid{margin:12px 0;gap:8px}.progress-grid>div{padding:10px 5px}.progress-grid strong{font-size:30px}.progress-grid span{font-size:14px}.number-progress{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.number-progress div{padding:8px}.number-progress span{font-size:14px}.primary-button{font-size:16px;margin-top:12px;padding:12px}
.progress-pages{display:flex;justify-content:space-between;align-items:center;gap:5px;margin-top:12px}.progress-pages button{border:0;border-radius:14px;background:#eeeaff;padding:10px;font-size:15px;min-height:42px}
@media(max-height:700px){.hero-friends{font-size:30px}.hero h1{font-size:24px}.hero{padding:4px 0}.game-card strong{font-size:21px}.game-card>span:last-child{font-size:16px}.speech-controls{margin:6px 0}.mic-button{width:70px;height:70px;font-size:35px}.answer-card{margin-top:10px}.judge-buttons{gap:5px}.judge-button{padding:8px 6px;font-size:13px}.speech-status{font-size:13px}.tile-es{font-size:21px}.tile-sub{font-size:16px}.prompt-q{font-size:20px}}

.topbar .brand{grid-column:2;grid-row:1}.topbar #soundButton{grid-column:3;grid-row:1}.topbar #homeButton{grid-column:1;grid-row:1}

/* Compact grown-up progress at short phone heights: keep return reachable. */
@media(max-height:600px){
 .progress-panel{padding:10px;margin:4px auto}
 .progress-mascot{font-size:24px}
 .progress-panel h2{font-size:21px}
 .progress-panel>p{font-size:13px;margin:4px 0}
 .progress-grid{margin:8px 0;gap:6px}
 .progress-grid>div{padding:7px 4px}
 .progress-grid strong{font-size:25px}
 .progress-grid span{font-size:13px}
 .number-progress{gap:6px}
 .number-progress div{padding:6px}
 .progress-pages{margin-top:8px}
 .progress-pages button{padding:7px;font-size:13px}
 .progress-panel .primary-button{margin-top:8px;padding:9px}
}
/* Grid's auto minimum must not expand exploration beyond its clipped parent. */
.explore-board,#playArea[data-set] .explore-board{min-height:0;height:100%;max-height:100%}
@media(max-height:600px){
 .explore-board,#playArea[data-set] .explore-board{gap:6px;padding:7px}
 .explore-tile{padding:2px 9px;column-gap:8px}
 .explore-tile .tile-es{font-size:19px;line-height:1.05}
 .explore-tile .tile-sub{font-size:14px;line-height:1.05}
}
.find-board{min-height:0;height:100%;max-height:100%;aspect-ratio:auto;grid-template-rows:repeat(2,minmax(0,1fr))}

/* Levels share the existing second toolbar row with next-word. */
.level-switch { display:flex;gap:3px;min-width:0; }
.level-button { border:0;border-radius:12px;background:#fff;font-weight:900;white-space:nowrap; }
.level-button.active { background:#6555ad;color:white; }
#gameScreen .round-top { column-gap:5px; }
#gameScreen .round-top .level-switch { flex:0 0 196px;width:196px; }
#gameScreen .round-top .level-button { font-size:11px;padding:8px 3px; }
#gameScreen .round-top .pill-button { margin-left:0;flex:0 0 auto;max-width:calc(100% - 201px);font-size:11px;padding:8px 4px; }
.word-illustration { width:1.15em;height:1.15em;object-fit:contain;display:inline-block;vertical-align:middle; }
.color-swatch { box-shadow:inset 0 0 0 1px #0002; }
