:root{font:500 16px/1.35 system-ui,sans-serif;color:#fff8ce;background:#6a995a;color-scheme:dark}
*{box-sizing:border-box}body,h1,p{margin:0}body{overflow:hidden}
main{position:relative;height:100svh;overflow:hidden;isolation:isolate;background:#34564e}
#world,#world canvas{position:absolute;inset:0}
#world canvas{display:block;touch-action:none}
header,footer{position:absolute;left:50%;translate:-50% 0;z-index:5;width:min(31rem,calc(100% - 1rem));padding:.36rem .7rem;border:1px solid #e9d08f99;background:#233a2bef;border-radius:.8rem;box-shadow:0 3px 16px #18291f66}
header{top:max(.45rem,env(safe-area-inset-top));text-align:center}
header p{font-size:.7rem;font-weight:700;color:#ffe6a2}
h1{font-size:clamp(1rem,3vw,1.45rem);line-height:1.18}
footer{bottom:max(.45rem,env(safe-area-inset-bottom));font-size:clamp(.75rem,2vw,.92rem)}
nav{display:flex;justify-content:space-between;gap:.2rem;flex-wrap:wrap}
button{font:inherit;font-weight:750;min-height:44px;padding:0 .43rem;color:#ffefbc;background:none;border:0;border-radius:.4rem;cursor:pointer}
button:hover{background:#ffffff22}button:focus-visible{outline:3px solid #99ffff;outline-offset:-3px}
@media(max-height:490px){header{left:.5rem;translate:none;width:25vw}footer{left:auto;right:.5rem;translate:none;width:29vw}nav{flex-wrap:wrap}}

.explorer-picker{display:flex;align-items:center;gap:.24rem;font-size:.75rem;color:#ffe9a8}
select{font:inherit;color:#fff1c2;background:#304b3b;border:1px solid #e9d08f99;border-radius:.4rem;min-height:44px;padding:0 .2rem;max-width:26vw}

@media(max-width:520px){
  nav{flex-wrap:nowrap;gap:.1rem}
  nav button{padding-inline:.25rem;font-size:.76rem;white-space:nowrap}
  .explorer-picker span{display:none}
  select{max-width:29vw;font-size:.73rem}
}

#landmarks{position:absolute;inset:0;pointer-events:none;z-index:2}
.landmark{position:absolute;left:0;top:0;min-width:44px;min-height:44px;border-radius:50%;pointer-events:auto;color:#fff5c0;background:radial-gradient(circle,#665062e6,#765680bb 55%,#e4b3ec99 63%,#804e9600 72%);font-size:1.35rem;text-shadow:0 0 .45rem #ffdcaa}
.landmark::before{content:"";position:absolute;inset:-4px;border-radius:50%}
.landmark:hover{background:radial-gradient(circle,#987599,#91689ae6 51%,#ffe0aa 64%,transparent 72%)}
.landmark.solved{color:#e4ffc4;filter:hue-rotate(35deg)}
#mission-game{width:min(60rem,98vw);height:96svh;max-height:96svh;padding:.45rem;background:#233a2b;color:#fff8ce;border:1px solid #e9d08f;border-radius:.9rem}
#mission-game::backdrop{background:#172717a8}
#mission-game[open]{display:grid;grid-template-rows:auto minmax(0,1fr)}
#mission-game section{display:flex;justify-content:space-between;align-items:center;gap:.5rem}
#mission-game h2{font-size:clamp(.95rem,3vw,1.35rem);margin:0}
#game-frame,#game-frame iframe{width:100%;height:100%;border:0}
#review-parent{display:block;color:#fff2bc;font-weight:750;width:fit-content;min-height:44px;align-content:center}
#review-parent[hidden]{display:none}

.game-actions{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:.25rem}
.game-actions button{min-height:44px}

#restart-adventure{margin-top:.3rem;padding-inline:.65rem;font-size:.82rem;border:1px solid #e9d08f99;background:#304b3b}
#restart-adventure:hover:not(:disabled){background:#47634b}
#restart-adventure:disabled,#restart-confirmation button:disabled{opacity:.55;cursor:wait}
#restart-confirmation{width:min(26rem,calc(100% - 2rem));padding:1rem;background:#233a2b;color:#fff8ce;border:1px solid #e9d08f;border-radius:.9rem}
#restart-confirmation::backdrop{background:#172717bb}
#restart-confirmation h2{margin:0 0 .5rem;font-size:1.2rem}
#restart-confirmation .game-actions{margin-top:.75rem;gap:.5rem}
#restart-confirmation button{padding-inline:.8rem;border:1px solid #e9d08f99}
#confirm-restart{background:#e9d08f;color:#233a2b}
#confirm-restart:hover:not(:disabled){background:#ffe6a2}
#restart-error{margin-top:.5rem;color:#ffd0ae}

main{background:radial-gradient(ellipse at 50% 51%,#344a45,#172722 74%)}
.adventure-tools,.camera-controls{display:flex;align-items:center;justify-content:center;gap:.28rem;flex-wrap:wrap}
.adventure-tools{margin-top:.3rem}
#restart-adventure{margin-top:0}
.camera-controls button{padding-inline:.55rem;font-size:.79rem;border:1px solid #e9d08f99;background:#304b3b;white-space:nowrap}
.camera-controls button:hover{background:#47634b}
#landmarks .landmark{touch-action:none}
@media(min-aspect-ratio:5/4) and (min-width:740px){
  header{left:.6rem;translate:none;width:min(23vw,17rem)}
  footer{left:auto;right:.6rem;translate:none;width:min(24vw,19rem)}
  footer nav{justify-content:center}
}
@media(max-width:360px){
  .adventure-tools{gap:.2rem}
  #restart-adventure,.camera-controls button{padding-inline:.33rem;font-size:.73rem}
}
@media(max-width:520px){
  .adventure-tools,.camera-controls{flex-wrap:nowrap;gap:.2rem}
  #restart-adventure,.camera-controls button{padding-inline:.34rem;font-size:.73rem}
}
#adventure-sound[aria-pressed=false]{background:#253a32;color:#e7dfb8}
@media(max-width:520px){
  .adventure-tools,.camera-controls{flex-wrap:wrap}
}

/* These environments are landscape paintings, with HUD space above and below. */
header{left:50%;translate:-50% 0;width:min(32rem,calc(100% - 1rem))}
footer{left:50%;right:auto;translate:-50% 0;width:min(32rem,calc(100% - 1rem))}

#environment-games{display:flex;gap:.35rem;margin-top:.22rem}
#environment-games button{flex:1;background:#304b3b;border:1px solid #e9d08f99}
#environment-games button[aria-disabled=true]{opacity:.62}
.station-landmark::before{inset:-10px}

#adventure-controls{margin-top:.2rem}
#adventure-controls summary{display:list-item;width:max-content;margin:auto;padding:.48rem .6rem;min-height:44px;cursor:pointer;font-size:.81rem;font-weight:750}
#adventure-controls nav{margin-top:.2rem;justify-content:center}
#status:not([data-speaking]){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#status[data-speaking]{white-space:normal}
#environment-games button{min-height:44px;font-size:.8rem;line-height:1.2}
.crystal-target,.crystal-target:hover{background:none;box-shadow:none;color:#fff6c3;text-shadow:0 0 7px #ffe2a8;font-size:1rem}
.crystal-target::before{inset:-10px}
.crystal-target.solved{filter:none;color:#e5ffc9}
@media(max-width:520px){
  header{width:max-content;max-width:calc(100% - 1rem);padding:.27rem .6rem}
  header > p{display:none}
  footer{width:min(28rem,calc(100% - 1rem));padding:.25rem .45rem}
}

#chapter-actions:not(:empty){display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:.3rem}
#chapter-actions button:not([hidden]),#chapter-actions a{background:#304b3b;border:1px solid #e9d08f99;border-radius:.4rem}
#chapter-actions a{color:inherit;padding:.52rem;text-decoration:none}
#phase-story{width:min(30rem,calc(100% - 2rem));background:#233a2b;color:#fff8ce;border:1px solid #e9d08f;border-radius:.8rem}
#phase-story p+p{margin-top:.65rem}
#phase-story-close{margin-top:.45rem}
