/* A clear play surface with optional drawers for the grown-up details. */
.mobile-control,.quest-extra>summary{display:none}
.map-panel-heading{position:relative}
.quest-heading{display:flex;align-items:center;gap:12px}
.quest-heading h1{flex:1}
#repeat-voice{flex:none;width:44px;height:44px;border:1px solid #cbd8bd;border-radius:50%;background:#eff2df;font-size:1.5rem}
.quest-extra{margin-top:12px}
.quest-extra .quest-bottom{margin-top:0}
.valley-drawer h3{font-size:1rem;margin:24px 0 12px}
.valley-drawer>p{margin:12px 0;color:#557261}
.menu-tools{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0 12px}
.menu-tools>*{display:flex;align-items:center;justify-content:center;text-align:center;min-height:52px;padding:12px;border:1px solid #cdd8c1;border-radius:14px;background:#e8eedb;font-size:.875rem;font-weight:800}
.menu-site-links{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:0 0 22px}
.menu-site-links a{display:flex;align-items:center;min-height:46px;padding:9px 11px;border:1px solid #cdd8c1;border-radius:13px;background:#f7f6e9;font-size:.875rem;font-weight:800}
.menu-site-links a[aria-current]{background:#ffedbd;border-color:#d7bb70}
.menu-section{border-top:1px solid #d9e0d0}
.menu-section>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;padding:8px 2px;cursor:pointer;font-weight:900;list-style:none}
.menu-section>summary::-webkit-details-marker{display:none}
.menu-section>summary span{font-size:1.1rem;transition:transform .15s}
.menu-section[open]>summary span{transform:rotate(180deg)}
.menu-section>div{padding-bottom:12px}
.menu-section>nav{padding-bottom:12px}
.menu-sound{margin-top:8px}
.menu-section-label{font-size:.82rem;font-weight:900;color:#557261}
.menu-return{position:sticky;bottom:-28px;margin:10px -22px -28px;padding:12px 22px 28px;background:linear-gradient(transparent 0,#fffdf1 22%)}
.menu-return .solid-button{display:block;width:100%;text-align:center}
#menu-camera .camera-controls{position:static;transform:none;width:auto;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none}
#menu-camera .camera-controls #view-toggle{display:block;width:100%;min-height:48px;margin-bottom:7px;border-radius:14px}
#menu-camera .camera-buttons{display:grid;grid-template-columns:1fr 1.2fr 1fr;gap:6px;margin:0}
#menu-camera .camera-buttons button{min-height:48px}
#menu-camera .camera-controls p{display:none}
#menu-chapters .chapter-trail,#menu-rescues .mission-rail,#friend-choices .team-bar{position:static;transform:none;max-width:none;width:100%;display:grid;gap:8px;padding:0;background:none;box-shadow:none;border:0}
#menu-chapters .chapter-trail{grid-template-columns:1fr}
#menu-chapters .chapter-trail button{padding:13px 12px;min-height:48px;font-size:1rem;background:#e8eedb}
#menu-chapters .chapter-trail .active{background:#ffdb87}
#menu-rescues .mission-rail{grid-template-columns:1fr 1fr}
#menu-rescues .mission-rail button{min-width:0;min-height:52px;font-size:.875rem}
#friend-choices .team-bar{grid-template-columns:1fr 1fr;margin:26px 0 12px}
#friend-choices .team-bar button{display:flex;flex-direction:column;gap:12px;padding:12px;border-radius:18px;border:2px solid #d4dec7;background:#eff1de;text-align:center;font-size:1.15rem}
#friend-choices .team-bar button[aria-pressed=true]{background:#245747;color:#fffdf1;border-color:#245747}
#friend-choices .team-bar img{width:100%;height:auto;aspect-ratio:1.5;object-fit:contain;border-radius:10px}
#friend-choices .team-bar small{display:block;font-size:.8rem;margin-top:4px}

@media(max-width:700px),(max-height:500px){
  #adventure{--safe-bottom:max(12px,env(safe-area-inset-bottom));}
  .site-shell-game #site-menu{display:none!important}
  .mobile-control{display:flex;align-items:center;justify-content:center}
  .game-header{top:max(12px,env(safe-area-inset-top));left:12px;right:12px;gap:10px;z-index:5}
  .game-brand{font-size:1.35rem;line-height:1;text-shadow:0 1px 1px #fff}
  .game-brand>small,.top-actions .game-learning-link,.top-actions #sound-settings,.top-actions #help-open,.top-actions .back-books{display:none}
  .top-actions{gap:7px}
  .top-actions #sound{font-size:.875rem;padding:10px 13px;min-height:44px}
  .top-actions #menu-open{width:44px;height:44px;padding:8px;font-size:1.2rem}
  .quest-card{top:max(70px,calc(env(safe-area-inset-top) + 58px));left:12px;right:12px;width:auto;max-width:none;padding:13px 16px 10px;border-radius:20px;background:#fffdf1f5;box-shadow:0 3px 0 #294d391a;z-index:2;max-height:calc(100dvh - 280px);overflow:auto;overscroll-behavior:contain}
  .quest-card .eyebrow{font-size:.75rem;letter-spacing:.035em}
  .quest-heading{gap:8px}
  .quest-card .quest-heading h1{font-size:1.45rem;margin:5px 0 9px}
  #repeat-voice{width:40px;height:40px;margin-top:-13px;font-size:1.4rem}
  .quest-card #quest-message{font-size:1rem;line-height:1.45;min-height:0}
  .quest-extra{margin-top:2px}
  .quest-extra>summary{display:flex;align-items:center;justify-content:space-between;min-height:40px;cursor:pointer;font-size:.875rem;font-weight:800;list-style:none}
  .quest-extra>summary::-webkit-details-marker{display:none}
  .quest-extra[open]>summary span{transform:rotate(180deg)}
  .quest-extra .quest-bottom{padding-top:6px}
  .quest-bottom button{min-height:44px;font-size:.875rem}
  .quest-bottom>span{font-size:.8rem}
  #adventure:not(.map-view) .movement-pad{left:12px;bottom:calc(var(--safe-bottom) + 54px);grid-template-columns:repeat(3,44px);grid-template-rows:repeat(2,44px);gap:4px;z-index:2}
  .movement-pad button{font-size:1.5rem;border-radius:13px;background:#fffdf1ed;border:1px solid #fff;box-shadow:0 3px 0 #294d3920}
  #adventure:not(.map-view) .camera-controls{left:12px;bottom:var(--safe-bottom);width:140px;z-index:2}
  #adventure:not(.map-view) .camera-controls #view-toggle{min-height:44px;font-size:.875rem}
  #friend-open{position:absolute;right:12px;bottom:var(--safe-bottom);width:calc(100% - 174px);max-width:235px;min-height:44px;gap:10px;border:1px solid #fff;border-radius:14px;background:#fffdf1ed;font-size:.94rem;box-shadow:0 3px 0 #294d3920;z-index:2;padding:5px 10px}
  #friend-open img{width:32px;height:32px;object-fit:contain;border-radius:7px}
  #friend-open span:last-child{margin-left:auto}
  .action-dock{right:12px;bottom:calc(var(--safe-bottom) + 54px);max-width:calc(100% - 174px);z-index:2}
  #action{min-height:58px;padding:12px 16px;font-size:1rem;line-height:1.25;border-radius:22px;gap:7px;box-shadow:0 4px 0 #123e2b80}
  #action-symbol{display:none}
  .action-dock>p{display:none}
  .show-action-hint .action-dock>p{display:block;font-size:.875rem;line-height:1.35;padding:9px 11px;background:#fffdf1f5}
  .action-row{gap:9px}
  .help-meter{width:100%;font-size:.8rem;display:block;padding:8px}
  .help-meter small{margin-top:5px;white-space:normal}
  .arrival{left:12px;right:12px;top:auto;bottom:calc(var(--safe-bottom) + 225px);transform:none;max-width:none;width:auto;font-size:1rem}
  #adventure:not(.map-view) #world-labels{display:none}
  dialog{max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;border-radius:25px}
  .valley-drawer{width:min(480px,calc(100vw - 24px));max-height:min(75dvh,520px);padding:18px 22px;overflow-y:auto;overscroll-behavior:contain}
  .valley-drawer>.eyebrow{display:none}
  .valley-drawer>h2{font-size:1.6rem;margin:0 38px 6px 0}
  .valley-drawer>#menu-progress{margin:4px 0}
  .menu-return{position:static;bottom:auto;margin:8px -22px -18px;padding:10px 22px 18px;background:#fffdf1}
  .menu-section>summary{min-height:44px;padding:6px 2px}
  .menu-sound .menu-section-label{margin:0 0 4px}
  .menu-tools{gap:6px;margin:4px 0 6px}
  .menu-tools>*{min-height:48px;padding:8px;font-size:.8rem}
  .valley-drawer h2{font-size:1.8rem;padding-right:26px}
  #menu-rescues .mission-rail small{display:none}
  .map-view #friend-open,.map-view .quest-card{display:none}
  .map-view #valley{width:100%;height:calc(100% - 96px)}
  .map-view #world-labels{right:0;bottom:96px}
  #map-regions{top:70px;left:10px;right:10px;gap:5px;display:grid;grid-template-columns:1fr 1fr;overflow:visible;padding-bottom:5px}
  #map-regions button{font-size:.875rem;flex:none;min-height:44px;padding:9px 12px;border-radius:13px}
  .map-view .map-note{display:none}
  .map-view .camera-controls{left:12px;bottom:108px;transform:none;width:174px;padding:6px;border-radius:17px}
  .map-view .camera-controls button{min-height:44px;font-size:.8rem}
  .map-view .camera-buttons button:not([data-camera=reset]){font-size:1.25rem}
  #map-panel{left:8px;right:8px;bottom:8px;top:auto;width:auto;height:80px;padding:14px 16px;border-radius:20px;overflow:hidden;z-index:4}
  #map-panel #map-kicker{font-size:.75rem;padding-right:86px}
  #map-panel h2{font-size:1.35rem;margin:6px 86px 0 0;line-height:1.15}
  .map-panel-heading{position:sticky;top:-14px;background:#fffdf1;z-index:2;margin:-14px -16px 0;padding:14px 16px;min-height:80px}
  #map-details-toggle{position:absolute;top:18px;right:12px;min-height:44px;border:1px solid #cbd7be;background:#e6ecd7;border-radius:13px;padding:8px 10px;font-size:.875rem}
  #map-panel:not(.expanded) #map-details{display:none}
  #map-panel.expanded{height:min(53dvh,540px);overflow-y:auto;box-shadow:0 -8px 40px #254b3e33}
  #map-panel.expanded h2{margin-bottom:18px}
  #map-picture{float:none;display:block;width:100%;max-width:none;height:auto;aspect-ratio:1.5;border-radius:15px;margin:0 0 15px}
  #map-description{font-size:1rem;line-height:1.6}
  #map-status,#map-places button,.map-panel-actions button,.map-hear{font-size:.875rem}
  #map-places button{min-height:64px}
  .map-panel-actions{grid-template-columns:1fr}
  #world-labels>button{font-size:.75rem;max-width:calc(100vw - 30px);white-space:normal}
  .map-view #world-labels>button{min-height:44px}
  .map-view #world-labels>.place-label:not([aria-pressed=true]){display:none}
  .map-view #world-labels>.region-label{display:none}
}
@media(max-width:360px){.game-brand{font-size:1.15rem}.top-actions #sound{padding:9px;font-size:.8rem}.quest-card{padding:11px 13px 7px}.quest-card .quest-heading h1{font-size:1.3rem}#friend-open{gap:6px;padding:5px 7px;font-size:.875rem}#action{padding:12px 10px;font-size:.875rem}}
@media(max-height:640px){
  #valley-menu{padding:14px 18px}
  #valley-menu>.eyebrow{display:none}
  #valley-menu>h2{font-size:1.6rem;margin:0 0 6px}
  #valley-menu #menu-progress{margin:4px 0;font-size:.875rem}
  #valley-menu .menu-section>summary{min-height:38px;padding:4px 2px}
  #valley-menu .menu-sound{margin:0}
  #valley-menu .menu-section-label{font-size:.75rem}
  #valley-menu .menu-tools{gap:6px;margin:4px 0 6px}
  #valley-menu .menu-tools>*{min-height:44px;padding:8px;font-size:.8rem}
  #valley-menu .menu-return{margin:6px -18px 0;padding:8px 18px 14px}
}
@media(max-height:500px){
  .map-view #valley{width:100%;height:calc(100% - 92px)}
  .map-view #world-labels{right:0;bottom:92px}
  #map-regions{top:66px;left:12px;right:12px;display:flex;flex-wrap:nowrap;gap:5px;z-index:4}
  #map-regions button{flex:1;min-width:0;min-height:38px;padding:6px;font-size:.72rem}
  .map-view .map-note{display:none}
  #map-panel{top:auto;left:8px;right:8px;bottom:8px;width:auto;height:76px;padding:12px 14px;overflow:hidden}
  #map-panel .map-panel-heading{top:-12px;margin:-12px -14px 0;padding:12px 14px;min-height:76px}
  #map-panel #map-details-toggle{top:16px;right:10px;min-height:40px;padding:7px 10px}
  #map-panel h2{font-size:1.3rem;margin:5px 88px 0 0}
}
@media(max-height:500px) and (min-width:601px){.quest-card{top:67px;width:310px;right:auto;max-height:calc(100dvh - 230px)}.quest-card #quest-message{font-size:.875rem}.quest-extra>summary{min-height:32px}.quest-card .quest-heading h1{font-size:1.2rem}.quest-card .eyebrow{display:none}.map-view .camera-controls{bottom:105px}#friend-open{width:190px}.action-dock{max-width:220px}.game-header{top:9px}#map-regions{left:345px;top:12px;right:165px}}
@media(max-height:500px) and (min-width:601px){#map-regions{left:12px;right:12px;top:70px;bottom:auto}}
@media(max-width:360px){
  .map-view #map-regions{top:70px;left:8px;right:8px;display:flex;flex-wrap:nowrap;gap:4px}
  .map-view #map-regions button{flex:1;min-width:0;min-height:40px;padding:6px 3px;font-size:0;white-space:nowrap}
  .map-view #map-regions button:after{font-size:.65rem;font-weight:800;line-height:1.2}
  .map-view #map-regions button:nth-child(1):after{content:'Valley'}
  .map-view #map-regions button:nth-child(2):after{content:'Meadow'}
  .map-view #map-regions button:nth-child(3):after{content:'River'}
  .map-view #map-regions button:nth-child(4):after{content:'Headland'}
  .map-view #map-panel:not(.expanded){height:96px}
  .map-view .map-panel-heading{min-height:96px}
}
