/* Phone-specific presentation. Shared game state, input and rewards stay in their existing modules. */
@media(max-width:600px) and (orientation:portrait){
 body{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
 body>header{padding:8px 10px;gap:8px;min-height:0}
 header .brand{font-size:19px;gap:5px}header .brand-icon{width:32px;height:32px;font-size:25px;line-height:28px}
 header .top-actions{gap:10px}header .top-actions .icon-btn,header .parent-btn{min-width:48px;min-height:48px;padding:6px;border-radius:16px;font-size:23px}
 header .game-dock{gap:10px}header .game-dock .dock-item,header .home-button{min-height:54px;flex-direction:row;gap:6px;font-size:12px;padding:6px;border-radius:16px}
 header .game-dock .dock-art{width:25px;height:25px}header .home-button>span{font-size:23px}
 main{padding:0 8px 12px}main>.activity-screen{max-width:100%;box-sizing:border-box;padding-left:4px;padding-right:4px}
 /* An animated welcome above a generous, vertically scrollable two-column gallery. */
 #home-screen.home-scene{--rail:0%;--home-preview-height:112px;height:calc(100dvh - var(--home-header,120px));background-position:center top}
 #home-screen.home-scene .home-welcome{left:12px;right:12px;top:12px}
 .home-scene .home-welcome .home-kicker{display:none}.home-scene .home-welcome h1{font-size:29px;margin:0}.home-scene .home-welcome p{font-size:13px;margin:5px 0;padding:4px 12px}
 .home-scene-layer{background-position:center top;background-size:auto 320px;background-repeat:no-repeat}
 .home-scene-layer .home-scene-friends{left:5%;right:5%;top:90px;bottom:auto;height:125px}
 .home-scene-layer .home-scene-friend,.home-scene-layer .home-scene-friend:first-child,.home-scene-layer .home-guest-1,.home-scene-layer .home-guest-2,.home-scene-layer .home-scene-friend:last-child{bottom:0;height:100%;width:27%}
 .home-scene-layer .home-scene-friend:first-child{left:0}.home-scene-layer .home-guest-1{left:24%}.home-scene-layer .home-guest-2{left:49%}.home-scene-layer .home-scene-friend:last-child{left:73%}
 .home-scene-switcher{left:auto;right:12px;top:177px;bottom:auto;max-width:none;gap:6px;flex-wrap:nowrap;transform:scale(.74);transform-origin:right bottom}.home-scene-switcher button{width:40px;height:40px}
 #home-screen.home-scene .game-tiles{inset:228px 0 0;width:100%;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:14px 12px;padding:14px 12px calc(24px + env(safe-area-inset-bottom));border:0;border-top:2px solid #fff9;border-radius:25px 25px 0 0;background:linear-gradient(#e1f3eea6,#ddd9f0d9);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px)}
 #home-screen.home-scene .game-tile{padding:5px 5px 10px;border-radius:20px;min-width:0;height:auto;scroll-snap-align:none}#home-screen.home-scene .game-tile>strong{font-size:14px;min-height:32px;display:grid;place-items:center;margin-top:7px}
 /* Less heading chrome, more usable game space. */
 .activity-screen h1{font-size:26px!important;line-height:1.1}.activity-screen .home-kicker{font-size:9px;letter-spacing:1.5px}
 .doctor-choose{padding:14px 9px}.doctor-patients{gap:11px}.doctor-patient-choice{flex-basis:calc(33% - 12px);min-width:0;padding:4px;border-radius:20px}.doctor-patient-choice svg{height:112px}.doctor-patient-choice strong{font-size:13px;padding:4px 0}
 .doctor-room{grid-template-columns:1fr;gap:12px}.doctor-clinic{height:380px;min-height:0}.doctor-screen .doctor-stage{width:min(90%,310px)}.doctor-tools{grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;padding:10px}.doctor-tools button{min-height:85px}
 .coloring-workspace{padding:10px 7px;gap:9px}.coloring-side-actions{flex-wrap:wrap;justify-content:center;gap:8px}.coloring-color{min-height:58px}.coloring-tools{box-sizing:border-box}.coloring-colors{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 .seasonal-heading{flex-wrap:wrap;gap:8px}.seasonal-table{display:flex;flex-direction:column;gap:12px}.seasonal-board{width:100%;min-height:0;aspect-ratio:4/3}.seasonal-tray-wrap{width:100%;box-sizing:border-box}.seasonal-tray{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 .seasonal-levels{max-width:100%;overflow-x:auto;flex-wrap:nowrap;justify-content:flex-start;padding-bottom:8px}.seasonal-levels button{flex-shrink:0;min-width:48px;min-height:48px}
 #firefly-screen #fw-bugs{grid-template-columns:repeat(4,minmax(0,1fr));margin-left:18%;gap:8px}#firefly-screen .fw-world{min-height:650px}#firefly-screen .fw-firefly{min-height:78px}
 #playground{padding:0 4px 18px}.playground-layout{grid-template-columns:1fr}.sticker-shelf{max-height:330px}.shelf-stickers{grid-template-columns:repeat(4,minmax(0,1fr))}.scene-tools{flex-wrap:wrap}.scene-switcher select{max-width:calc(100vw - 130px)}
 dialog:not(.sticker-book){max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);box-sizing:border-box;overflow-y:auto}.sticker-book{max-width:calc(100vw - 12px);max-height:calc(100dvh - 16px);box-sizing:border-box;overflow-y:auto;padding:10px}.sticker-book .book-title{font-size:24px}.sticker-book button{min-height:44px}
 .family-game-screen{padding:10px 2px 24px}.family-game-head{gap:7px}.family-nav{gap:10px}.family-nav button{min-height:48px}.family-game-panel{padding:10px}.family-modes button{min-height:48px}.family-tiles{gap:12px}.family-tiles .family-tile-art{width:100px;height:100px}
 #celebration .party-card>h2{top:9%;font-size:36px}#celebration .victory-message{top:17%;font-size:15px}#victory-actions{bottom:calc(16px + env(safe-area-inset-bottom));gap:12px}#victory-actions button{min-height:56px;font-size:17px}
}
/* Short landscape phones retain the wide worlds while reclaiming header space. */
@media(orientation:landscape) and (max-height:500px) and (max-width:1000px){
 body>header{display:flex;flex-wrap:nowrap;min-height:58px;padding:5px max(10px,env(safe-area-inset-right));gap:12px}header .brand{font-size:0}header .brand-icon{width:32px;height:32px;font-size:25px}header .game-dock{width:auto;flex:1;gap:10px}header .top-actions{gap:10px}header .game-dock .dock-item,header .home-button{min-height:44px;flex-direction:row;font-size:12px;padding:5px 10px}header .game-dock .dock-art{width:25px;height:25px}header .top-actions .icon-btn,header .parent-btn{min-height:44px;min-width:48px;padding:5px;font-size:22px}.activity-screen h1{font-size:24px!important}.activity-screen .home-kicker{display:none}
 .doctor-clinic{height:300px;min-height:0}.doctor-room{grid-template-columns:minmax(0,1fr) 160px}.doctor-screen .doctor-stage{width:245px}.doctor-tools button{min-height:75px}.doctor-tools{gap:8px;padding:8px}.coloring-workspace{min-height:0}.family-game-head{flex-direction:row;gap:10px}.family-game-screen{padding-top:8px}.family-game-panel{padding:10px}.family-status{margin:5px auto 8px}.tic-board{width:260px}.checkers-board{width:300px}
}
@media(max-width:600px) and (orientation:portrait){
 #home-screen.home-scene .game-tiles{grid-auto-rows:180px;grid-template-rows:none}
 #home-screen.home-scene .game-tile{height:180px;min-height:180px;justify-content:flex-start}
 #home-screen.home-scene .game-tile>.tile-picture{flex:none;width:100%;height:112px;min-height:112px}
}
@media(orientation:landscape) and (max-height:500px) and (max-width:1000px){
 .ocean-screen{padding:0 8px 8px}.ocean-kicker{display:none}.ocean-top{margin-bottom:2px}.ocean-score{min-width:65px;padding:2px 10px}.ocean-score span{display:none}.ocean-size-options{margin:0 0 5px}.ocean-size-options button{min-height:44px}.ocean-game{height:max(180px,calc(100dvh - 176px));min-height:0;padding:10px 35px 16px;box-sizing:border-box}.ocean-cards{gap:7px;max-width:640px}.ocean-message{margin:5px 0;font-size:11px}
}
@media(max-width:360px) and (orientation:portrait){header .brand{font-size:16px}header .game-dock .dock-item,header .home-button{font-size:11px}.home-scene-switcher{right:6px}.doctor-clinic{height:340px}.doctor-patient-choice svg{height:92px}}
