/* Loaded after picture buttons: keep the illustrations, budget space for play. */
/* Home camera controls belong to the action panel, outside the playable canvas. */
.home-options .room-controls{position:static;inset:auto;width:100%;margin:6px 0 0;padding:0;display:block}
.home-options .room-view-controls{display:grid;grid-template-columns:44px 44px minmax(0,1fr) 44px;gap:4px;align-items:center;width:100%}
.home-options .room-view-controls button{width:44px;min-width:44px;min-height:44px;padding:3px}
.home-options .room-view-controls .scene-zoom-slider{min-width:0;min-height:44px;padding:0 5px;gap:3px}
.home-options .room-view-controls .scene-zoom-slider input{width:100%;min-width:0;flex:1 1 0}
.home-options .room-hint{position:static;inset:auto;margin:5px 0 0;font-size:10px;line-height:1.25}
@media (max-width:600px), (max-width:1400px) and (max-height:600px) {
  .home-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior:contain}
  .home-tabs button{flex:0 0 auto;min-width:80px;min-height:44px}
  .home-options .room-view-controls .scene-zoom-slider small{display:none}
  .language-picker .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  .app{padding-top:max(4px,env(safe-area-inset-top));gap:4px}
  header{margin:0;min-height:44px}
  .brand .game-logo{width:90px;height:40px;object-fit:contain}
  .tools{gap:4px;flex-wrap:nowrap;min-width:0}
  .tools .round{width:44px;height:44px;min-width:44px;padding:0}
  header .tools .round{font-size:18px;border:0;box-shadow:none;background:radial-gradient(circle at center,#fffdf8 0 15px,#e6e0d8 15px 16px,transparent 16px)}
  .coin{padding:4px 6px;gap:3px;white-space:nowrap;font-size:14px}
  #language{min-height:44px;max-width:80px;font-size:10px;padding:4px}
  header .coin{font-size:12px;padding:3px 5px;gap:2px}
  .shop-panel .product-art{height:38px!important;min-height:38px!important;margin:0!important;display:grid;place-items:center}
  .shop-panel .product-art img{width:34px;height:34px;max-width:34px;object-fit:contain}
  .shop-panel .product-art .food-icon{font-size:28px;line-height:1}
  .shop-panel .product-pick{height:92px;min-height:92px;padding:5px 4px;gap:3px}
  .shop-panel .product-name{font-size:12px;line-height:1.25}
  .shop-panel .product-meta{font-size:11px;gap:3px}
  .scene-tab{min-height:44px;padding:3px 6px;font-size:12px;gap:4px;border-radius:15px}
  .scene-tab::before{width:26px;height:26px;flex:0 0 26px}
  .next-activity-card{grid-template-columns:28px minmax(0,1fr) auto;gap:6px;padding:5px 7px;margin:0 0 5px;border-radius:16px}
  .next-activity-card>span{width:28px;height:28px;font-size:19px}
  .next-activity-card small{display:none}
  .next-activity-card strong{font-size:12px;line-height:1.25}
  .next-activity-card p{font-size:10px;line-height:1.25}
  .next-activity-card button{grid-column:auto;width:auto;min-width:72px;min-height:44px;padding:4px 8px;font-size:12px;border-radius:14px}
  .concert-goals-dialog{max-width:calc(100vw - 24px);max-height:80dvh;overflow:auto;padding:12px}
  .world-controls,.room-controls{gap:4px;padding:3px}
  .world-controls button,.room-controls button{min-width:44px;min-height:44px;width:44px;padding:3px;font-size:20px}
  .world-zoom{min-width:0;gap:4px;padding:4px 7px;font-size:11px}
  .world-zoom input{min-width:50px;width:80px}
  .first-concert-guide{padding:6px 8px;gap:6px;bottom:max(6px,env(safe-area-inset-bottom))}
  .first-concert-guide p{display:none}
  .first-concert-guide strong{font-size:13px}
  .first-concert-guide>span{width:28px;height:28px;font-size:18px}
  .first-concert-guide button{min-height:44px;padding:4px 10px;font-size:12px}
  .first-concert-guide .guide-close{width:44px;min-width:44px}
}




@media (max-width:600px) and (orientation:portrait) {
  .app{height:100dvh;min-height:0;padding-inline:max(6px,env(safe-area-inset-left));padding-bottom:max(4px,env(safe-area-inset-bottom))}
  #view{flex:1;min-height:0;overflow:auto}
  #nav{gap:3px}
  #nav button,body[data-friend-picker=true] #nav button{min-height:62px;padding:3px 1px 6px;font-size:10px;border-radius:16px}
  #nav button::before,body[data-friend-picker=true] #nav button::before{width:30px;height:30px}
  .scene-tabs.with-quick-tools{gap:3px;min-height:52px;margin-bottom:4px}
  .with-quick-tools>.scene-tab{min-height:52px;font-size:10px;padding:2px;gap:1px}
  .with-quick-tools>.scene-tab::before{width:24px;height:24px;flex-basis:24px}
  body[data-scene=town] .welcome h1{font-size:18px;margin:2px 0}
  body[data-scene=town] .welcome p{display:none}
  body[data-scene=town] .town-map.world-three{height:clamp(210px,calc(100dvh - 290px),440px)!important;min-height:210px!important}
  .home-care-entry{min-height:76px;padding:8px 12px;grid-template-columns:48px 1fr}
  .home-care-entry>span{font-size:34px}
  .home-care-entry>b{font-size:18px}
  .music-garden .sound-keyboard{margin:8px 0}
  footer{margin-top:0;padding:2px;font-size:9px}
}

/* A short phone needs independent scroll areas, not a desktop-sized page clipped by body. */
@media (orientation:landscape) and (max-width:1400px) and (max-height:600px) {
  html,body{height:100%;overflow:hidden}
  .app{width:100%;max-width:none;height:100dvh;min-height:0;display:grid;grid-template-columns:90px minmax(0,1fr);grid-template-rows:44px minmax(0,1fr);gap:4px;padding:4px max(6px,env(safe-area-inset-right)) max(4px,env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-left))}
  header{grid-column:1/-1;grid-row:1;height:44px;min-height:44px}
  #nav{grid-column:1;grid-row:2;display:flex;flex-direction:column;flex-wrap:nowrap;justify-content:flex-start;align-items:stretch;align-content:start;gap:3px;overflow-y:auto;overflow-x:hidden;height:100%;max-height:100%;min-height:0;overscroll-behavior-y:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;margin:0;padding:0 2px 8px}
  #nav button,body[data-friend-picker=true] #nav button{flex:0 0 44px;height:44px;min-height:44px;display:flex;flex-direction:row;gap:2px;padding:2px;font-size:10px;line-height:1.15;border-radius:13px;border-bottom-width:2px;touch-action:pan-y}
  #nav button::before,body[data-friend-picker=true] #nav button::before{width:25px;height:25px}
  #nav button::after{bottom:2px}
  #view{grid-column:2;grid-row:2;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0}
  footer{display:none}
  #view:has(>.adventure-tools),#view:has(>.quick-camera){padding-right:50px}
  #view>.adventure-tools,#view>.quick-camera{position:absolute;right:0;top:0;display:flex;flex-direction:column;gap:4px;width:46px;height:auto;margin:0;padding:0}
  #view>.adventure-tools button,#view>.quick-camera button{width:44px;height:44px;min-height:44px;padding:0}
  .scene-tabs,.scene-tabs.with-quick-tools{padding:0;margin:0 0 4px;gap:4px;min-height:44px}
  .scene-tabs.with-quick-tools{grid-template-columns:repeat(3,minmax(0,1fr)) auto}
  .with-quick-tools>.adventure-tools{position:static;flex-direction:row;height:44px;margin:0}
  .panel,.life-panel,.town{min-height:0!important;padding:5px!important;border-radius:18px}
  .panel>h1,.memory-album>h1{font-size:17px;margin:2px 0}
  body[data-scene=town] .welcome{display:none}
  body[data-scene=town] .next-activity-card{min-height:44px;box-shadow:none}
  body[data-scene=town] .next-activity-card p{display:none}
  body[data-scene=town] .town-map.world-three{height:max(150px,calc(100dvh - 180px))!important;min-height:150px!important}
  .world-controls{top:3px;right:3px}
  .home-panel>h1{display:none}
  .home-tabs{margin:0 0 4px;gap:4px}
  .home-tabs button{min-height:44px;padding:3px 8px;font-size:12px}
  .storybook-home .home-content{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);align-items:start;gap:6px}
  .storybook-home .home-preview{min-height:0!important;width:100%;margin:0;padding:0}
  .storybook-home .home-preview.object-room .room-stage{height:max(150px,calc(100dvh - 126px))!important;min-height:150px!important;max-height:none!important;aspect-ratio:auto}
  .home-options{min-width:0;padding:0!important}
  .home-options .scene-tabs{gap:3px}
  .home-options .scene-tab{font-size:11px;padding:2px;gap:2px}
  .home-options .scene-tab::before{width:22px;height:22px;flex-basis:22px}
  .home-action-rail{padding:2px}
  .home-care-entry{width:100%;min-height:64px;padding:5px 10px;grid-template-columns:44px 1fr;border-radius:18px;box-shadow:0 3px 0 #b9829330}
  .home-care-entry>span{font-size:32px}
  .home-care-entry>b{font-size:17px}
  .home-care-entry>small{font-size:11px}
  .home-options .home-play{gap:4px;margin:5px 0}
  .home-options .home-play button{min-height:44px;padding:5px;font-size:11px}
  .shop-world{min-height:150px!important;height:max(150px,calc(100dvh - 145px))!important;margin:4px 0}
  body[data-friend-picker=true] .compact-friend-picker{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px}
  .compact-friend-picker>h1,.compact-friend-picker>.friend-grid{grid-column:1/-1}
  .compact-friend-picker>p{display:none}
  .ensemble-counts{margin:0;gap:4px;min-height:44px;align-items:center;justify-content:flex-start}
  .ensemble-counts span{padding:3px 8px;font-size:11px;border-width:1px}
  .concert-goals-open{min-height:44px;width:auto;padding:3px 8px;margin:0;font-size:12px;justify-self:end;align-self:center}
  .concert-goals-open::before{width:24px;height:24px;flex-basis:24px}
  .compact-friend-picker .friend-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;width:100%;max-width:600px;margin:0 auto}
  .compact-friend-picker .friend-card{padding:3px;min-height:100px;border-radius:16px}
  .compact-friend-picker .friend-model-preview{height:70px;min-height:55px}
  .compact-friend-picker .friend-card b{font-size:12px}
  .compact-friend-picker .friend-card small{display:block;font-size:10px;margin:0}
  .selection-bottom{margin:0;gap:6px}
  .compact-friend-picker>.page-controls{margin:0;gap:6px}
  .compact-friend-picker>.page-controls button{min-width:44px;min-height:44px;padding:3px 8px}
  .compact-friend-picker:not(:has(>.page-controls))>.selection-bottom{grid-column:1/-1}
  #choose-song{min-height:44px;padding:4px 12px;font-size:14px}
  .music-garden{grid-template-columns:100px minmax(0,1fr);gap:4px}
  .music-garden .garden-friend{min-width:0}
  .music-garden .garden-friend.garden-three{height:150px;min-height:0;margin:0}
  .music-garden .sound-keyboard{min-width:0;margin:3px 0}
  .music-garden .garden-actions button,.music-garden .echo-play button{min-height:44px;padding:4px 10px}
  .memory-album .memory-grid{margin:4px 0}
  .memory-album .memory-card{padding:5px}
  .memory-album .page-controls{margin:3px 0;gap:8px}
  .memory-album .page-controls button{min-height:44px;padding:4px 12px}
  .first-concert-guide{grid-template-columns:auto 1fr auto auto;max-width:560px}
  .first-concert-guide .primary,.first-concert-guide .guide-close{grid-column:auto;grid-row:auto}
}

/* Phone collections use separate, paged sections rather than one long album. */
.compact-settings-open{display:none}
.compact-settings-dialog{max-width:calc(100vw - 24px);padding:12px;border:2px solid #dfc9d2;border-radius:20px;background:#fff8ef;color:#68596c}
.compact-settings-dialog::backdrop{background:#42324755}
.compact-settings-dialog>button{min-height:44px;margin-bottom:8px}
.compact-settings-dialog>.tools{display:flex;gap:8px;align-items:center}
.compact-settings-dialog #language{min-height:44px;max-width:120px;font-size:14px}
.compact-settings-dialog .round{min-width:44px;min-height:44px}
@media (max-width:600px), (max-width:1400px) and (max-height:600px){
 .compact-album>h1,.compact-album>p{display:none}
 .compact-album>.memory-sections{margin:0 0 4px;gap:4px}
 .compact-album .memory-sections>.scene-tab{font-size:12px;min-height:44px;padding:4px;flex:1}
 .compact-album .memory-sections>.scene-tab::before{display:none}
 .compact-album>.screen-pane{padding:0!important}
 .compact-album .memory-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 .compact-album .memory-card{min-width:0;min-height:0!important;padding:6px;border-radius:16px;align-items:center}
 .compact-album .memory-card>span{font-size:24px;line-height:1}
 .compact-album .memory-character-portrait{width:44px;height:44px;margin:0 auto}
 .compact-album .memory-card h2{font-size:13px;margin:4px 0}
 .compact-album .memory-card p,.compact-album .memory-card time,.compact-album .memory-card small,.compact-album .memory-card b{font-size:10px;margin:3px 0}
 .compact-album .memory-stamps{gap:8px;margin:3px 0}
 .compact-album .memory-stamps>span{font-size:18px}
 .compact-album .page-controls{min-height:44px;margin:3px 0}
 .compact-album .page-controls button{min-width:44px;min-height:44px;padding:4px 8px}
 .compact-album #album-home{min-height:44px;font-size:12px;padding:4px 10px;margin:3px 0}
 .compact-album .friend-collection,.compact-album .concert-ideas{margin:0;padding:4px;border-radius:14px}
 .compact-album .friend-collection>h2,.compact-album .concert-ideas>h2{font-size:14px;margin:0 0 4px}
 .compact-album .friend-collection>p,.compact-album .concert-ideas>p{display:none}
 .compact-album .friend-collection-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 .compact-album .friend-collection-card{min-height:0!important;padding:5px;border-radius:14px}
 .compact-album .friend-character-portrait,.compact-album .friend-silhouette{width:42px;height:42px;margin:0 0 3px}
 .compact-album .friend-silhouette i{width:28px;height:18px;bottom:0}
 .compact-album .friend-collection-card strong{font-size:12px}
 .compact-album .friend-collection-card small{min-height:0;font-size:10px}
 .compact-album .friend-instrument{font-size:10px}
 .compact-album .friend-goals{margin-top:3px;gap:2px}
 .compact-album .friend-goals span{padding:2px;font-size:10px}
 .compact-album .friend-collection-card button{min-height:44px;padding:4px 8px;font-size:11px}
 .compact-album .concert-idea-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
 .compact-album .concert-idea-list button{min-height:100px;padding:6px;font-size:12px}
 .compact-album .concert-idea-list button>span{font-size:24px}
 .compact-album .concert-idea-list small{font-size:10px}
}
@media (orientation:landscape) and (max-width:1400px) and (max-height:600px){
 .app:has(>header.compact-header){grid-template-rows:68px minmax(0,1fr)}
 .app>header.compact-header{grid-column:1;grid-row:1;display:grid;grid-template-columns:1fr;grid-template-rows:44px 20px;gap:4px;height:68px;min-height:0;align-items:center}
 .compact-header .brand{grid-column:1;padding:0;min-width:0;min-height:44px;height:44px}
 .compact-header .game-logo{width:80px;height:28px}
 .compact-header>.coin{grid-column:1;grid-row:2;text-align:center;justify-self:center;min-width:0;padding:2px 6px;font-size:12px}
 #nav>.compact-settings-open{display:flex;min-height:44px}
 #nav>.compact-settings-open::before{content:'⚙';font-size:21px;background:none!important;display:grid;place-items:center;width:25px;height:25px}
 .app:has(>header.compact-header)>#view{grid-row:1/-1}
 .town .world-canvas{height:max(150px,calc(100dvh - 130px))!important}
 .shop-panel{position:relative}
 .shop-panel>.shop-return{position:absolute;top:8px;left:8px;z-index:8;margin:0}
 .shop-return>button{width:44px;height:44px;min-width:44px;min-height:44px;padding:0;font-size:0;border-radius:14px}
 .shop-return>button::before{content:'←';font-size:20px;width:auto;height:auto;background:none;margin:0}
 .shop-world{height:max(150px,calc(100dvh - 50px))!important;margin:0}
 .compact-album .friend-collection-grid,.compact-album .concert-idea-list{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* The left navigation and tappable 3D buildings already provide these routes. */
.world-town .destination-concert,.world-town .destination-home{display:none!important}
