/* App-only adaptation. Shared art and other games remain immutable. */
:root{--safe-top:max(8px,env(safe-area-inset-top,0px));--safe-bottom:max(8px,env(safe-area-inset-bottom,0px));--safe-left:max(12px,env(safe-area-inset-left,0px));--safe-right:max(12px,env(safe-area-inset-right,0px))}
button{min-width:44px;min-height:44px;touch-action:manipulation}
.round-button,.settings-actions .round-button,.play-header>.round-button{min-width:44px;min-height:44px}
.app-shell{padding-left:var(--safe-left);padding-right:var(--safe-right)}
.hud{padding-left:2px;padding-right:2px;gap:10px}
.dock{padding-left:0;padding-right:0}
.app-shell:has(.save-notice:not([hidden])){grid-template-rows:calc(var(--hud) + var(--safe-top)) auto minmax(0,1fr) calc(var(--dock) + var(--safe-bottom))}
.save-notice{position:relative;z-index:11;background:#fff2c9;color:#704c1d;border-radius:10px;padding:7px 12px;font-size:11px;line-height:1.5;text-align:center}
.buddy-illustration{display:block;max-width:100%;flex-shrink:0;line-height:0}
.buddy-illustration>img{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none}
.avatar>.buddy-illustration{width:100%;height:100%;transform:scale(1.15);transform-origin:50% 25%}
.scene-hero>.buddy-illustration{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.hero-detail>.buddy-illustration{grid-column:1;grid-row:1;width:190px;height:230px;align-self:center;filter:drop-shadow(0 8px 2px #277b8b25)}
.hero-card>.buddy-illustration{width:80px;height:80px;max-width:100%}
.hero-card.selected::before{display:grid}
.guide-dino>.buddy-illustration,.delivery-buddy>.buddy-illustration,.result-hero>.buddy-illustration{width:100%;height:100%}
.age-badge{border:2px solid #fff;min-height:44px;cursor:pointer;letter-spacing:.03em}
.mission-dots button,.mission-dots button.active{min-height:44px;min-width:44px}
.rating-stars{gap:0}
.outfit-button{min-width:44px;min-height:44px;font-size:11px}
.play-screen,.result-screen{padding-left:calc(16px + var(--safe-left));padding-right:calc(16px + var(--safe-right))}
.guide-close{right:calc(12px + var(--safe-right))}
.play-screen[data-job="garden"] .play-pips span:last-child small{font-size:9px}

.count-parcel{position:relative;display:grid;place-items:center;width:100%;height:100%;padding:4px 0 20px;background:transparent;border:2px solid transparent;border-radius:16px}
.count-parcel svg{width:100%;height:100%;min-height:30px}
.count-parcel b{position:absolute;bottom:0;left:50%;transform:translateX(-50%);border:2px solid white;border-radius:20px;background:#fff9db;padding:2px 8px;white-space:nowrap;font-size:11px;color:#705a2d}
.count-parcel.counted{background:#c9f1d8;border-color:#70bf93}
.count-parcel.counted b{background:#67bd8c;color:white}
.parcel-row>[role="listitem"]{min-width:44px}
.settings-screen>.settings-content{width:100%;max-width:660px;margin:auto;display:flex;flex:1;min-height:0;flex-direction:column;gap:10px;justify-content:center}
.settings-screen .setting-row{min-height:58px;flex-shrink:0}
.settings-screen .secondary{min-height:44px}
.settings-screen .settings-parent{display:flex;flex-direction:column;gap:9px;padding:14px 20px;min-height:0;flex-shrink:1}
.settings-parent>strong{font-size:15px}
.settings-parent>p{font-size:12px;line-height:1.7;text-align:center}
.settings-parent>button{width:100%;max-width:340px;margin:auto}
.parents-screen{max-width:1050px;padding:20px 24px;gap:16px}
.parents-screen>.panel-heading{flex-shrink:0}
.parents-screen .panel-heading h1{font-size:clamp(19px,2.6vw,30px)}
.parent-card{display:grid;grid-template-columns:minmax(120px,30%) minmax(0,1fr);align-items:center;gap:25px;flex:1;min-height:0;padding:24px 28px;background:#fffdf0;border:3px solid white;border-radius:30px;box-shadow:0 6px 0 #62b5c044;overflow:auto;overscroll-behavior:contain}
.parent-illustration{display:grid;place-items:center;min-height:0}
.parent-illustration>svg{width:100%;max-width:190px;max-height:240px}
.parent-text{min-width:0}
.parent-age{display:inline-block;background:#d4f0e2;color:#237b69;border-radius:20px;padding:5px 12px;font-size:12px;margin-bottom:10px}
.parent-text h2{font-size:clamp(18px,2vw,25px);line-height:1.5;margin-bottom:12px}
.parent-text p{font-size:15px;line-height:1.9;font-weight:700}
.parent-text .parent-note{margin-top:12px;font-size:12px;color:#536d7a;line-height:1.8}
.talk-prompt{margin-top:14px;padding:10px 14px;border-left:4px solid #edbe4b;background:#fff2c5;border-radius:0 12px 12px 0}
.parent-controls{display:flex;align-items:center;justify-content:center;gap:15px;flex-shrink:0}
.parent-controls>.secondary{margin-right:auto;min-height:48px;display:flex;gap:6px;align-items:center;justify-content:center}
.parent-controls>.secondary svg{width:20px;height:20px}
.parent-controls>span{font-size:12px;min-width:34px;text-align:center}
.keepsake-content{display:flex;flex-direction:column;min-height:0;flex:1;gap:14px}
.keepsake-shelf{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));align-items:center;flex:1;min-height:130px;padding:15px 18px 24px;border-radius:28px;background:linear-gradient(#edfff7 85%,#debc83 85%,#b78a57 91%,#edd5a4 91%);border:3px solid white;box-shadow:0 5px 0 #8dbab74d}
.keepsake{display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:6px;height:100%;min-height:0;text-align:center}
.keepsake-art{display:grid;place-items:center;max-height:210px;height:70%;width:100%;min-height:60px;filter:drop-shadow(0 7px 3px #89745126)}
.keepsake-art>svg{width:100%;height:100%;max-width:200px}
.keepsake>strong{font-size:15px}
.keepsake>small{font-size:11px;color:#658486}
.empty-shelf{grid-column:1/-1;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px}
.empty-shelf>svg{height:90px;width:90px}
.empty-shelf>h2{font-size:21px}
.empty-shelf>p{font-size:13px}
.empty-shelf>.primary{min-height:44px;font-size:15px}
.shelf-paging{display:flex;align-items:center;justify-content:center;gap:20px;flex-shrink:0}
.shelf-paging span{font-size:12px;min-width:35px;text-align:center}
.discovery-shelf{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;flex-shrink:0}
.discovery-token{min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border:3px solid white;border-radius:20px;padding:9px 4px;background:#e3f5fb;box-shadow:0 4px 0 #77b6c555;color:#477b90;min-height:115px}
.discovery-token.discovered{background:linear-gradient(#fff6cc,#fce7a5);color:#866524}
.discovery-token>svg{width:57px;height:57px}
.discovery-token strong{font-size:12px;white-space:nowrap}
.discovery-token small{font-size:10px}
#toast{left:calc(50% + (var(--safe-left) - var(--safe-right))/2);max-width:calc(100% - var(--safe-left) - var(--safe-right) - 16px)}
.goodbye-screen{background:radial-gradient(ellipse at center,#fffbdd 0,transparent 70%)}
.goodbye-screen .guide-copy{max-width:28em}
.hero-speech{left:60%;top:-12%;z-index:1;max-width:150px;font-size:12px}
.keepsake-shelf{grid-template-columns:1fr}
.keepsake{justify-content:center}
.keepsake-art{width:100%;max-width:240px}
.memory-star{display:grid;place-items:center;width:100%;height:100%}
.memory-star>svg{width:100%;height:100%;max-width:190px;fill:#ffda54;stroke:#bf8b2c;stroke-width:2;filter:drop-shadow(0 5px 0 #c6a16a40)}
.reward-strip{display:grid;grid-template-columns:22px minmax(0,1fr);gap:3px 9px;text-align:left;align-items:center;min-width:260px}
.reward-strip>svg{grid-column:1;grid-row:1/3;width:22px;height:22px}
.reward-strip>strong{grid-column:2;grid-row:1;font-size:13px;line-height:1.4}
.reward-strip>span{grid-column:2;grid-row:2;font-size:10px;line-height:1.5;margin:0}
@media(max-width:760px) and (min-height:501px){
 .hud{gap:5px}.hud-actions{gap:4px}.player-chip{min-width:0;padding-right:8px;gap:4px}.player-info{min-width:71px}.player-info strong{font-size:12px}.player-info small{font-size:8px}.resource-pill{min-width:58px;gap:2px}.hud-actions>.round-button{padding:7px;width:44px;height:44px}.game-logo{display:none}
 .hero-detail>.buddy-illustration{width:125px;height:170px}.hero-card>.buddy-illustration{width:63px;height:68px}.hero-roster{gap:7px}
 .outfit-button{padding:5px 4px;font-size:9px}.hero-bio .outfit-row{gap:4px}
 .parents-screen{padding:12px 10px;gap:10px}.parent-card{display:flex;flex-direction:column;justify-content:center;gap:10px;padding:16px 18px;border-radius:25px}.parent-illustration>svg{height:90px;width:90px}.parent-text h2{font-size:19px;margin-bottom:8px}.parent-text p{font-size:13px;line-height:1.8}.parent-text .parent-note{font-size:11px;margin-top:10px}.parent-age{font-size:11px;padding:4px 11px;margin-bottom:8px}.talk-prompt{margin-top:10px;padding:8px 10px}.parent-controls{gap:8px}.parent-controls>.secondary{font-size:10px;min-width:0;padding:6px 9px}
 .keepsake-content{gap:10px}.keepsake-shelf{min-height:130px;padding:10px 7px 22px;gap:6px}.keepsake-art{max-height:180px}.keepsake>strong{font-size:10px}.keepsake>small{font-size:9px}.discovery-shelf{gap:5px}.discovery-token{min-height:92px;border-radius:15px;padding:6px 1px;border-width:2px}.discovery-token>svg{width:43px;height:43px}.discovery-token strong{font-size:8px}.discovery-token small{font-size:8px}
 .settings-screen>.settings-content{gap:9px}.settings-screen .setting-row{min-height:54px;padding:6px 12px}.settings-screen .settings-parent{padding:12px 14px;gap:8px}.settings-parent>strong{font-size:13px}.settings-parent>p{font-size:11px}
 .play-screen,.result-screen{padding-left:calc(6px + var(--safe-left));padding-right:calc(6px + var(--safe-right))}
}


@media(max-width:760px) and (min-height:501px) and (max-height:720px){
 .hero-detail>.buddy-illustration{width:107px;height:145px}.hero-card>.buddy-illustration{width:55px;height:56px}.hero-detail .primary{min-height:44px}.outfit-button{min-height:44px}.hero-bio p{font-size:9px}
 .parent-illustration>svg{height:55px;width:55px}.parent-card{padding:12px 16px;gap:6px}.parent-text p{font-size:12px;line-height:1.65}.parent-text .parent-note{font-size:10px;line-height:1.65}.parent-text h2{font-size:17px;margin-bottom:5px}.parent-age{margin-bottom:5px}.parents-screen .panel-heading h1{font-size:18px}
 .settings-screen .settings-parent{padding:9px 12px;gap:6px}.settings-screen>.settings-content{gap:6px}.settings-parent>p{font-size:10px}.settings-parent>strong{font-size:12px}.settings-screen .setting-row{min-height:52px}
 .keepsake>small{font-size:8px}.discovery-token{min-height:83px}.discovery-token>svg{height:36px;width:36px}.empty-shelf{gap:8px}.empty-shelf>svg{width:65px;height:65px}.empty-shelf>h2{font-size:18px}.empty-shelf>p{font-size:11px}
 .result-screen:not(.guide-screen) .result-buttons{gap:8px}.result-buttons .secondary{min-height:44px}.result-screen .reward-strip{font-size:10px}.result-screen .reward-strip>span{font-size:8px}.result-rays{max-height:145px}
}
@media(max-height:500px) and (min-width:520px){
 :root{--safe-left:max(28px,env(safe-area-inset-left,0px));--safe-right:max(28px,env(safe-area-inset-right,0px))}
 .hud{padding-left:0;padding-right:0}.hud-actions>.round-button{width:44px;height:44px}.player-chip{min-height:44px}.game-logo{font-size:24px}
 .hero-detail>.buddy-illustration{width:98px;height:150px}.hero-card>.buddy-illustration{width:54px;height:54px}.hero-detail .primary{min-height:44px}.hero-detail .outfit-row{gap:3px}.outfit-button{min-height:44px;font-size:8px;min-width:44px}.hero-detail{grid-template-columns:98px minmax(0,165px)}
 .mission-dots{height:15px;margin:4px 0 10px}.mission-dots button{height:44px}.mission-switcher{gap:8px}.mission-heading h2{font-size:17px}
 .play-screen,.result-screen{padding-left:var(--safe-left);padding-right:var(--safe-right)}.play-body{grid-template-rows:54px minmax(0,1fr) 49px 17px;grid-template-columns:minmax(0,1fr) 255px}.play-header{min-height:44px}.play-header .play-pips small{font-size:7px}.play-screen[data-job="garden"] .play-pips span:last-child small::after{font-size:7px}
 .parents-screen{padding:7px 14px;gap:7px}.parents-screen .panel-heading small{font-size:8px}.parents-screen .panel-heading h1{font-size:20px}.parent-card{padding:10px 18px;gap:18px;grid-template-columns:100px minmax(0,1fr);border-radius:22px}.parent-illustration>svg{height:90px;width:90px}.parent-age{font-size:9px;padding:3px 8px;margin-bottom:4px}.parent-text h2{font-size:16px;margin-bottom:4px}.parent-text p{font-size:11px;line-height:1.65}.parent-text .parent-note{font-size:9px;line-height:1.6;margin-top:5px}.talk-prompt{padding:4px 9px;margin-top:5px}.parent-controls{gap:12px}.parent-controls>.secondary{min-height:44px;font-size:11px;padding:6px 14px}
 .settings-screen>.settings-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:repeat(3,minmax(0,1fr)) 14px;max-width:850px;gap:7px 15px}.settings-screen .setting-row{grid-column:1;min-height:0;padding:5px 12px}.settings-screen .settings-parent{grid-column:2;grid-row:1/4;min-height:0;padding:8px 14px;gap:5px}.settings-parent>p{font-size:10px;line-height:1.5}.settings-parent>strong{font-size:12px}.settings-parent>button{min-height:44px;font-size:10px;padding:4px 8px}.settings-screen .section-summary{grid-column:1/-1;grid-row:4}
 .keepsake-content{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:minmax(0,1fr) 44px;gap:5px 18px}.keepsake-shelf{grid-column:1;grid-row:1/3;min-height:0;padding:7px 6px 22px}.shelf-paging{grid-column:2;grid-row:2}.discovery-shelf{grid-column:2;grid-row:1;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}.discovery-token{min-height:0;padding:3px;border-radius:13px;gap:2px}.discovery-token>svg{width:31px;height:31px}.discovery-token strong{font-size:8px}.discovery-token small{font-size:7px}.keepsake-art{height:65%;min-height:40px}.keepsake>strong{font-size:9px}.keepsake>small{font-size:8px}.empty-shelf{gap:5px}.empty-shelf>svg{width:55px;height:55px}.empty-shelf>h2{font-size:16px}.empty-shelf>p{font-size:9px}.empty-shelf>.primary{font-size:12px}
 .result-screen{grid-template-rows:16px 40px minmax(35px,1fr) 22px 34px 18px 104px;gap:3px 12px}.result-screen .result-buttons{display:grid;grid-template-columns:1fr 1fr;gap:5px;width:100%}.result-screen .result-buttons .primary{grid-column:1/-1;min-height:44px;font-size:12px}.result-screen .result-buttons .secondary{min-height:44px;font-size:10px}.result-screen .reward-strip{font-size:10px}.result-screen .reward-strip span{font-size:8px}.result-screen .mastery-label{font-size:9px}.result-rays{max-height:245px}.guide-screen{display:flex;padding-left:35%;gap:10px}.guide-screen .result-hero{height:170px;width:170px;left:5%}.guide-screen .result-buttons{display:flex;flex-direction:column;max-width:310px}.guide-screen .result-title{font-size:23px}.guide-copy{font-size:12px}.goodbye-screen .result-hero{height:160px;width:160px}
}
/* Enlarged text or unusually short viewports may scroll inside a panel to preserve controls. */
@media(max-width:300px),(max-height:279px){
 #screen,.panel-screen,.play-screen,.play-body,.result-screen,#overlay-content{overflow:auto;overscroll-behavior:contain}.panel-screen{min-height:460px}.play-screen,.result-screen{min-height:520px}.home-screen{min-height:430px}.parents-screen .parent-card{overflow:visible;flex-shrink:0}.hero-roster{flex-shrink:0}
}

/* Keep settings and every actionable target within the same usable viewport. */
.dock .dock-button,.quest-card .claim,.result-screen .result-buttons .secondary,.settings-screen .setting-row .secondary,.action-bar .secondary{min-height:44px}
.settings-screen{padding:14px 18px;max-width:1000px;gap:12px}
.settings-screen>.settings-content{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:repeat(3,64px) 20px;align-content:center;gap:12px;max-width:850px;overflow:auto;overscroll-behavior:contain}
.settings-screen .setting-row{grid-column:1;height:auto;min-height:56px;padding:5px 12px}
.settings-screen .settings-parent{grid-column:2;grid-row:1/4;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto 44px;align-content:center;gap:8px;padding:14px;flex:none;overflow:visible}
.settings-parent>strong,.settings-parent>p{grid-column:1/-1}
.settings-parent>strong{font-size:13px;text-align:center}
.settings-parent>p{font-size:11px}
.settings-parent>button{width:100%;max-width:none;min-width:0;min-height:44px;padding:5px;font-size:10px;margin:0}
.settings-screen .section-summary{grid-column:1/-1;grid-row:4}
@media(max-width:760px) and (min-height:501px){
 .settings-screen>.settings-content{grid-template-columns:1fr;grid-template-rows:repeat(3,56px) 140px 20px;gap:8px}
 .settings-screen .settings-parent{grid-column:1;grid-row:4;grid-template-rows:18px 32px 44px;padding:10px;gap:6px}
 .settings-screen .section-summary{grid-row:5}
 .settings-parent>p{font-size:10px;line-height:1.6}
}
@media(max-height:500px) and (min-width:520px){
 .settings-screen{padding:6px 16px;gap:5px}
 .settings-screen>.settings-content{grid-template-rows:repeat(3,56px) 14px;gap:5px 12px}
 .settings-screen .settings-parent{padding:9px;gap:6px}
 .settings-parent>p{font-size:10px;line-height:1.5}
 .settings-screen .setting-row>span{font-size:11px}
 .parent-text:has(.talk-prompt){display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:3px 16px;align-items:center}
 .parent-text:has(.talk-prompt)>.parent-age{grid-column:1;grid-row:1;justify-self:start;margin:0}
 .parent-text:has(.talk-prompt)>h2{grid-column:1;grid-row:2;margin:0}
 .parent-text:has(.talk-prompt)>p:not([class]){grid-column:1;grid-row:3}
 .parent-text:has(.talk-prompt)>.talk-prompt{grid-column:2;grid-row:1/4;margin:0;padding:8px 12px;font-size:11px}
 .parent-text:has(.talk-prompt)>.parent-note{grid-column:1/-1;grid-row:4;margin:0}
}

/* 2026-10-19: Apple HIG / Android touch and adaptive-layout review.
   Native points/dp are references; this web game chooses 48 CSS px targets. */
:root{--tap-target:48px}
button,.age-badge,.round-button,.mission-switcher>.round-button,.side-tools button,
.mission-dots button,.mission-dots button.active,.play-header>.round-button,
.outfit-button,.hero-bio .primary,.dock .dock-button,.quest-card .claim,
.result-screen .result-buttons .primary,.result-screen .result-buttons .secondary,
.settings-screen .secondary,.settings-screen .setting-row .secondary,
.action-bar .primary,.action-bar .secondary,.settings-actions .round-button{
 min-width:var(--tap-target);min-height:var(--tap-target)
}
.hud{padding:calc(6px + var(--safe-top)) 0 6px;gap:8px}
.player-chip{height:52px;min-height:52px;min-width:0;padding:3px 8px 3px 3px;gap:6px;border-width:2px}
.avatar{width:40px;height:40px}
.player-info{min-width:0}.player-info small{white-space:nowrap}
.hud-actions{gap:4px;min-width:0}
.hud-actions>.round-button{width:48px;height:48px;padding:8px}
.resource-pill{min-width:0;padding:0 6px;gap:3px;flex-shrink:0;font-size:14px}
.resource-pill svg{width:21px;height:21px}
#star-total{font-variant-numeric:tabular-nums}
.mission-dots{height:48px;min-height:48px;margin:2px 0;gap:0}
.mission-dots button,.mission-dots button.active{width:48px;height:48px;flex:0 0 48px}
.mission-heading h2{white-space:normal;overflow-wrap:anywhere;line-height:1.3}
.hero-speech{width:150px;height:auto;min-height:0;line-height:1.5;white-space:normal}
.hero-speech::after{pointer-events:none}
.parents-screen>.parent-card{min-height:0;overflow:auto}
.dock .dock-button,.panel-heading small,.panel-heading p,.hero-bio p,
.mission-heading small,.quick-tip,.section-summary,.quest-text p,
.keepsake>small,.parent-text .parent-note,.play-pips small{color:#24566d}
.dock .dock-button.active{color:#684819}
.feedback,.result-praise{color:#24566d}
@media(max-width:380px){.player-chip{gap:4px;padding-right:5px}.player-info{min-width:36px}.xp-track{display:none}}
@media(max-width:900px){.game-logo{display:none}}
@media(max-width:760px) and (min-height:501px){
 :root{--hud:64px;--dock:64px}
 .player-info strong{font-size:12px}.player-info small{display:none}.xp-track{margin-top:4px}
 .dock{padding:5px 2px calc(5px + var(--safe-bottom));gap:4px}
 .dock .dock-button{font-size:10px;padding:3px;min-height:52px}
 .mission-select{width:calc(100% - 16px);bottom:10px;padding:10px;border-width:3px}
 .mission-switcher{gap:6px}.mission-heading h2{font-size:clamp(17px,4.8vw,21px);letter-spacing:0}
 .mission-launch.primary{min-height:56px}
 .hero-detail .outfit-row{gap:4px;flex-wrap:nowrap}.outfit-button{font-size:10px;padding:4px}
 .settings-screen .setting-row{padding:2px 8px;border-width:2px}
 .settings-screen .settings-parent{grid-template-rows:18px 32px 48px}
 .parents-screen .parent-controls{gap:6px}
 .parent-controls>.secondary{font-size:10px;padding:5px 8px}
 .play-title h1{white-space:normal;overflow-wrap:anywhere}
}
@media(max-width:760px) and (min-height:501px) and (max-height:720px){
 .home-screen .side-tools{top:100px;left:6px;gap:8px}
 #quick-collection{display:none}
 .home-screen .side-tools button{width:48px;height:48px;padding:7px;border-radius:16px}
 .home-screen .side-tools button svg{width:27px;height:27px}
 .scene-hero{left:57%;bottom:220px;width:160px;height:170px}
 .chapter-label{top:6px;left:8px;padding:4px 10px;font-size:10px}
 .chapter-title{top:62px;left:10px;font-size:27px}
 .hero-speech{left:32%;top:-5%;max-width:140px;font-size:11px}
 .hero-detail{min-height:0;grid-template-columns:95px minmax(0,1fr);gap:5px}
 .hero-detail>.buddy-illustration{width:95px;height:130px}
 .hero-roster{gap:5px}.hero-card{height:78px}.hero-card>.buddy-illustration{height:50px;width:50px}
 .hero-bio .hero-description{font-size:10px;line-height:1.5}
 .hero-bio .primary{font-size:11px}
 .panel-heading p{font-size:10px}.panel-heading h1{font-size:21px}
 .keepsake-content{gap:5px}.discovery-shelf{gap:4px}
 .discovery-token{min-width:48px;min-height:78px;padding:3px 0}.discovery-token>svg{width:30px;height:30px}
 .empty-shelf{gap:5px}.empty-shelf>svg{height:48px;width:48px}.empty-shelf>p{font-size:10px}
 .settings-screen>.settings-content{grid-template-rows:repeat(3,56px) 140px 18px;gap:5px}
 .settings-screen{padding:8px 12px;gap:6px}.settings-screen .panel-heading small{display:none}
 .parents-screen .parent-illustration{display:none}
 .parents-screen .parent-card{justify-content:flex-start;padding:14px}
 .parent-text h2{font-size:18px}.parent-text p{font-size:12px;line-height:1.7}
 .parent-text .parent-note{font-size:11px;line-height:1.65}
}
@media(max-height:500px) and (min-width:520px){
 :root{--hud:52px;--dock:56px}
 .hud{padding:calc(2px + var(--safe-top)) 0 2px;gap:6px}
 .player-chip{height:48px;min-height:48px;padding:2px 7px 2px 2px}
 .avatar{height:36px;width:36px}.player-info small{display:none}
 .dock{padding:2px 4px calc(2px + var(--safe-bottom));gap:5px}
 .dock .dock-button{min-height:48px;font-size:10px;padding:4px;flex:1;max-width:145px;width:auto}
 .mission-select{right:8px;bottom:8px;width:52%;max-width:320px;padding:8px;border-width:3px}
 .mission-heading h2{font-size:17px}.mission-heading small{font-size:8px;letter-spacing:0}
 .mission-heading .rating-stars{display:none}
 .mission-launch.primary{min-height:48px;padding:5px;font-size:18px}
 .scene-hero{left:25%;bottom:6px;width:clamp(130px,26vw,225px);height:min(220px,calc(100% - 48px))}
 .hero-speech{left:30%;width:140px;font-size:11px}
 .play-screen{gap:6px;padding-top:calc(6px + var(--safe-top));padding-bottom:calc(6px + var(--safe-bottom))}
 .play-header{gap:8px;min-height:48px}
 .play-header>.round-button{width:48px;height:48px}
 .play-title{min-width:0}.play-title h1{font-size:16px;white-space:normal;line-height:1.3}
 .play-body{grid-template-columns:minmax(0,1fr) minmax(220px,42%);grid-template-rows:72px minmax(48px,1fr) 48px 32px;gap:6px 12px}
 .play-instruction{min-height:0;gap:4px}.play-instruction .guide-dino{display:none}
 .play-prompt{font-size:16px;line-height:1.3}.play-instruction p{font-size:11px;line-height:1.5}
 .choice-row{gap:6px;align-self:center}
 .choice-row .choice{display:grid;grid-template-columns:24px minmax(0,1fr);align-items:center;justify-content:center;gap:3px;width:0;min-width:48px;flex:1 1 0;min-height:48px;height:48px;padding:4px 3px;border-width:2px}
 .choice-row .choice>svg{width:24px;height:28px;max-width:100%}
 .choice-row .choice>strong{font-size:10px;white-space:normal;line-height:1.2}
 .choice-row .choice.number-choice{display:flex;flex-direction:row;gap:3px}
 .choice-row .choice.number-choice strong{font-size:26px}
 .choice-row .choice.number-choice small{font-size:10px}
 .action-bar{padding:0;gap:6px}.action-bar .primary,.action-bar .secondary{min-height:48px;padding:4px 7px;font-size:11px}
 .feedback{font-size:11px;line-height:1.4;height:auto;min-height:0;white-space:normal}
 .parcel-row{display:grid;grid-template-columns:repeat(3,minmax(48px,1fr));gap:6px;width:100%;padding:10px}
 .parcel-row>[role="listitem"]{width:auto;height:auto;min-width:0}
 .parcel-row .count-parcel{height:64px;min-height:64px;padding:2px 2px 18px}
 .parcel-row .count-parcel svg{height:40px;width:100%;min-height:0}
 .star-field{display:grid;grid-template-columns:repeat(3,minmax(48px,1fr));grid-template-rows:repeat(3,minmax(48px,1fr));align-items:center;justify-items:center;padding:36px 5px 4px;gap:0}
 .star-field .catch-star{position:relative;left:auto!important;top:auto!important;width:48px;height:48px;min-width:48px;min-height:48px}
 .catch-counter{top:4px;right:8px;min-height:24px;line-height:1.3}
}
@media(max-height:420px) and (min-width:520px){
 .panel-screen{min-height:0;padding:4px 10px 6px;gap:4px}
 .panel-heading{padding:0}.panel-heading h1{font-size:18px;line-height:1.3}
 .panel-heading small,.panel-heading p{display:none}
 .chapter-title{display:none}.chapter-label{left:4px;top:4px;font-size:9px;padding:3px 8px}
 .side-tools{left:4px;top:auto;bottom:4px;gap:4px}
 .side-tools button{width:48px;height:48px;padding:7px;border-radius:14px}
 .side-tools button svg{width:27px;height:27px}
 #quick-collection,.hero-speech{display:none}
 .scene-hero{width:160px;height:min(160px,calc(100% - 60px));bottom:4px}
 .hero-detail{width:42%;padding:0;grid-template-columns:68px minmax(0,1fr);grid-template-rows:24px 48px 48px;gap:4px;align-content:center}
 .hero-detail>.buddy-illustration{width:68px;height:72px;grid-column:1;grid-row:1/3}
 .hero-detail>.hero-bio{display:contents}
 .hero-bio>h2{grid-column:2;grid-row:1;font-size:16px;margin:0}
 .hero-bio>.hero-description{display:none}
 .hero-bio>.primary{grid-column:2;grid-row:2;font-size:10px;padding:4px}
 .hero-bio>.outfit-row{grid-column:1/-1;grid-row:3;display:flex;gap:4px;margin:0;justify-content:center;flex-wrap:nowrap}
 .outfit-row .outfit-button{min-height:48px;min-width:48px;font-size:10px;padding:4px;flex:1}
 .hero-roster{width:54%;grid-auto-rows:64px;gap:6px}
 .hero-card{height:64px;min-height:48px;padding:3px;gap:1px}
 .hero-card>.buddy-illustration{width:40px;height:40px}.hero-card strong{font-size:10px}
 .quest-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;flex:1;min-height:0}
 .quest-card{display:grid;grid-template-rows:minmax(0,1fr) 48px;gap:4px;min-height:0;height:100%;padding:5px;border-width:2px;align-items:stretch}
 .quest-card>.quest-icon{display:none}.quest-card h2{font-size:12px;line-height:1.3}
 .quest-card .quest-text p{font-size:9px;line-height:1.4}.quest-text>small{font-size:8px}
 .quest-card>.quest-reward{display:flex;flex-direction:row;width:auto;min-width:0;gap:4px;flex:none}
 .quest-card .quest-reward>span{font-size:10px;gap:2px}.quest-reward>span>svg{width:15px;height:15px}
 .quest-card .quest-reward .claim{width:auto;min-width:48px;min-height:48px;flex:1;font-size:10px;padding:3px}
 .section-summary{font-size:9px;line-height:1.4}
 .keepsake-content{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;grid-template-rows:minmax(0,1fr) 52px;gap:4px}
 .keepsake-shelf{grid-column:2;grid-row:1;min-height:0;padding:4px;border-width:2px}
 .keepsake{gap:1px}.keepsake-art{height:calc(100% - 27px);min-height:0;max-height:100px}.keepsake>strong{font-size:10px}.keepsake>small{font-size:9px}
 .shelf-paging{display:contents}.shelf-paging>button:first-child{grid-column:1;grid-row:1;align-self:center}.shelf-paging>button:last-child{grid-column:3;grid-row:1;align-self:center}
 .shelf-paging>span{position:absolute;top:4px;right:58px;width:auto;font-size:9px;z-index:2}
 .discovery-shelf{grid-column:1/-1;grid-row:2;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
 .discovery-token{display:grid;grid-template-columns:20px minmax(0,1fr);gap:3px;min-width:48px;min-height:48px;height:52px;padding:4px;border-width:2px}
 .discovery-token>svg{width:20px;height:24px}.discovery-token strong{white-space:normal;font-size:9px;line-height:1.2}.discovery-token small{display:none}
 .empty-shelf{display:grid;grid-template-columns:48px minmax(0,1fr);grid-template-rows:20px 48px;gap:4px;min-height:0}
 .empty-shelf>svg{grid-column:1;grid-row:1/3;width:44px;height:44px}.empty-shelf>h2{grid-column:2;grid-row:1;font-size:14px}.empty-shelf>p{display:none}.empty-shelf>.primary{grid-column:2;grid-row:2;min-height:48px;font-size:12px;padding:4px}
 .settings-screen>.settings-content{grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:76px 48px 14px;gap:5px;max-width:850px}
 .settings-screen .setting-row{grid-column:auto;display:flex;flex-direction:column;gap:2px;height:76px;min-height:76px;padding:4px;border-width:2px}
 .settings-screen .setting-row>span{font-size:10px;gap:3px;white-space:nowrap}.setting-row>span>svg{width:16px;height:16px}
 .settings-screen .setting-row .secondary{min-height:48px;padding:3px 7px;font-size:11px}
 .settings-screen .settings-parent{grid-column:1/-1;grid-row:2;grid-template-columns:1fr 1fr;grid-template-rows:48px;gap:8px;padding:0;border:0;box-shadow:none;background:none}
 .settings-parent>strong,.settings-parent>p{display:none}.settings-parent>button{min-height:48px;font-size:11px}
 .settings-screen .section-summary{grid-row:3}
 .parents-screen{padding:4px 10px 6px;gap:4px}.parents-screen .panel-heading h1{font-size:18px}
 .parent-card{padding:10px;gap:10px;grid-template-columns:64px minmax(0,1fr);align-items:start}
 .parent-illustration>svg{width:56px;height:56px}.parent-text h2{font-size:16px}.parent-text p{font-size:12px;line-height:1.65}.parent-text .parent-note{font-size:11px;line-height:1.5}
 .parent-text:has(.talk-prompt){display:block}.parent-text:has(.talk-prompt)>.talk-prompt{font-size:12px;padding:5px 8px;margin-top:5px}
 .parent-controls{gap:6px}.parent-controls>.secondary{font-size:11px;min-height:48px}.parent-controls>span{font-size:11px}
 .result-screen:not(.guide-screen){display:grid;grid-template-columns:minmax(0,36%) minmax(0,64%);grid-template-rows:34px 22px 46px minmax(104px,1fr);gap:6px 12px;padding-top:calc(8px + var(--safe-top));padding-bottom:calc(8px + var(--safe-bottom))}
 .result-screen .result-kicker,.result-screen .result-stars{display:none}
 .result-screen:not(.guide-screen) .result-title{grid-column:2;grid-row:1;font-size:24px;line-height:1.3}
 .result-screen:not(.guide-screen) .result-rays{grid-column:1;grid-row:1/5;width:100%;height:100%;max-height:100%;padding-bottom:32px}
 .result-screen:not(.guide-screen) .result-praise{grid-column:2;grid-row:2;font-size:11px;line-height:1.4;align-self:center}
 .result-screen:not(.guide-screen) .reward-strip{grid-column:2;grid-row:3;width:100%;min-width:0;min-height:0;padding:4px 8px;align-self:center}
 .reward-strip>strong{font-size:12px}.reward-strip>span{font-size:10px}
 .result-screen:not(.guide-screen) .mastery-label{grid-column:1;grid-row:4;font-size:10px;line-height:1.4;align-self:end}
 .result-screen:not(.guide-screen) .result-buttons{grid-column:2;grid-row:4;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:48px 48px;gap:8px;width:100%;align-self:center}
 .result-screen .result-buttons .primary,.result-screen .result-buttons .secondary{min-height:48px;font-size:11px;padding:5px}
 .result-screen.guide-screen{display:grid;grid-template-columns:minmax(0,30%) minmax(0,70%);grid-template-rows:auto minmax(0,1fr) auto auto;gap:8px 12px;padding:calc(8px + var(--safe-top)) var(--safe-right) calc(8px + var(--safe-bottom)) var(--safe-left);align-content:center}
 .guide-screen>.result-hero{position:static;transform:none;grid-column:1;grid-row:1/5;width:100%;height:100%;max-height:180px}
 .guide-screen .result-title{grid-column:2;grid-row:1;font-size:22px;line-height:1.3}
 .guide-screen:has(.guide-close)>.result-title{padding-right:52px}
 .guide-screen .guide-copy{grid-column:2;grid-row:2;font-size:12px;line-height:1.6;align-self:center}
 .guide-screen>.mastery-label{grid-column:2;grid-row:3;font-size:11px}
 .guide-screen .result-buttons{grid-column:2;grid-row:4;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:48px;gap:8px;width:100%;max-width:none}
 .guide-screen:not(.change-screen) .result-buttons .primary{grid-column:auto}
 .change-screen .result-buttons{grid-template-rows:48px 48px}.change-screen .result-buttons .primary{grid-column:1/-1}
 #goodbye-home{grid-column:2;grid-row:3;min-height:48px}
}
/* Use the remaining play area, including system insets and save notices. */
#screen{container-type:size}
.home-screen .quick-tip{display:none}
.parent-controls>.secondary{min-height:48px}
.scene-hero{animation-name:buddy-arrive;transition:filter .16s}
.number-choice>strong,.choice-row .choice.number-choice>strong{line-height:1.3}
@keyframes buddy-arrive{from{opacity:0}to{opacity:1}}
.keepsake-art{overflow:hidden;display:flex;align-items:center;justify-content:center}
.memory-star{min-height:0;max-height:100%}
.memory-star>svg{max-height:100%;min-height:0}
@media(max-width:760px) and (min-height:501px){
 .dock .dock-button{height:52px;min-height:52px;gap:2px;padding:3px}
 .dock .dock-button svg{width:24px;height:24px;flex-shrink:0}
 .dock .dock-button strong{line-height:12px}
}
@media(max-height:420px) and (min-width:520px){
 .mission-select{width:64%;max-width:360px;padding:6px}
 .mission-heading small{display:none}
 .scene-hero{left:20%;width:130px}
}
@media(orientation:landscape){
 @container(max-height:200px){
  .home-screen .mission-dots{display:none}
  .hero-roster{grid-auto-rows:58px}.hero-card{height:58px}.hero-card>.buddy-illustration{width:34px;height:34px}
  .settings-screen>.panel-heading{display:none}
  .collection-screen .empty-shelf{display:flex;min-height:0;justify-content:center;gap:0}
  .empty-shelf>svg,.empty-shelf>h2,.empty-shelf>p{display:none}
  .empty-shelf>.primary{min-height:48px;font-size:11px;padding:4px}
 }
}
@media(orientation:portrait){
 @container(max-height:420px) and (max-width:500px){
  .home-screen{display:grid;grid-template-columns:56px minmax(0,1fr);grid-template-rows:48px minmax(48px,1fr) auto;gap:6px;padding:4px}
  .home-screen .chapter-label{position:static;grid-column:1/-1;grid-row:1;justify-self:start;align-self:start}
  .home-screen .chapter-title,.home-screen .hero-speech,.home-screen .quick-tip{display:none}
  .home-screen .side-tools{position:static;grid-column:1;grid-row:2;align-self:center;justify-self:center}
  .home-screen #quick-collection{display:none}
  .home-screen .side-tools button{width:48px;height:48px;padding:7px}
  .home-screen .scene-hero{position:relative;left:auto;bottom:auto;transform:none;grid-column:2;grid-row:2;align-self:center;justify-self:center;width:100%;height:100%;max-height:150px;animation:none}
  .home-screen .mission-select{position:static;transform:none;grid-column:1/-1;grid-row:3;width:100%;max-width:none;padding:6px}
  .mission-heading .rating-stars{display:none}.mission-heading h2{font-size:17px}
  .panel-screen{padding:6px 8px;gap:6px}
  .panel-heading h1{font-size:20px;line-height:1.3}.panel-heading small,.panel-heading p{display:none}
  .friends-screen .hero-detail{display:grid;grid-template-columns:72px minmax(0,1fr);grid-template-rows:20px 48px 48px;gap:4px;min-height:124px;flex-shrink:0}
  .hero-detail>.buddy-illustration{grid-column:1;grid-row:1/3;width:72px;height:72px}
  .hero-detail>.hero-bio{display:contents}
  .hero-bio>h2{grid-column:2;grid-row:1;font-size:17px;margin:0}
  .hero-bio>.hero-description{display:none}
  .hero-bio>.primary{grid-column:2;grid-row:2;font-size:11px;padding:4px}
  .hero-bio>.outfit-row{grid-column:1/-1;grid-row:3;margin:0;display:flex;gap:4px}
  .outfit-row .outfit-button{flex:1;font-size:10px;min-height:48px;padding:3px}
  .hero-roster{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:60px;gap:6px}
  .hero-card{height:60px;min-height:48px;padding:3px;gap:1px}
  .hero-card>.buddy-illustration{width:37px;height:37px}.hero-card strong{font-size:10px}
  .keepsake-content{display:grid;grid-template-rows:minmax(0,1fr) 48px 64px;gap:5px}
  .keepsake-shelf{min-height:0;padding:4px 6px 12px}
  .keepsake-art{min-height:0;height:calc(100% - 30px)}
  .empty-shelf{min-height:0;gap:4px}.empty-shelf>svg{width:32px;height:32px}.empty-shelf>h2{font-size:16px}.empty-shelf>p{display:none}.empty-shelf>.primary{min-height:48px;font-size:12px;padding:4px 8px}
  .discovery-token{min-height:64px;height:64px;padding:2px;gap:2px}
  .discovery-token>svg{width:26px;height:26px}.discovery-token strong{font-size:8px;white-space:normal;line-height:1.2}.discovery-token small{display:none}
  .settings-screen>.settings-content{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:104px 48px auto;gap:6px;align-content:center}
  .settings-screen .setting-row{display:flex;flex-direction:column;gap:4px;min-height:104px;padding:4px;grid-column:auto;justify-content:center}
  .settings-screen .setting-row>span{font-size:10px;flex-direction:column;gap:3px;white-space:nowrap}
  .settings-screen .setting-row>span>svg{width:18px;height:18px}
  .settings-screen .setting-row .secondary{min-height:48px;min-width:48px;padding:3px;font-size:10px;width:100%}
  .settings-screen .settings-parent{grid-column:1/-1;grid-row:2;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:48px;gap:6px;padding:0;border:0;background:none;box-shadow:none}
  .settings-parent>strong,.settings-parent>p{display:none}.settings-parent>button{min-height:48px;font-size:10px}
  .settings-screen .section-summary{grid-column:1/-1;grid-row:3;font-size:10px}
 }
}
