@font-face{font-family:Barlow;src:url('./fonts/barlow-bold.woff2') format('woff2');font-weight:700;font-display:swap}
@font-face{font-family:Source;src:url('./fonts/source-sans.ttf') format('truetype');font-weight:200 900;font-display:swap}
:root{color-scheme:dark;--ink:#071e29;--line:#46616a;--text:#f1f6ee;--soft:#c0d2d1;--mint:#a0ebd4;--edge:clamp(15px,3.3vw,65px);background:var(--ink);color:var(--text);font:500 16px/1.35 Source,"Segoe UI",sans-serif}
*{box-sizing:border-box}
body{margin:0;height:100vh;height:100dvh;min-height:260px;overflow:hidden;display:grid;grid-template-rows:auto minmax(0,1fr) auto}
body:fullscreen{background:var(--ink)}
button,select{font:inherit;color:inherit}
button{background:transparent;border:0;cursor:pointer;touch-action:manipulation}
button:disabled{cursor:default;opacity:.55}
button:focus-visible,select:focus-visible,canvas:focus-visible{outline:3px solid #ffd18c;outline-offset:2px}
.symbols,[hidden]{display:none!important}
button svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round;flex:none}
.mast,.instrument-bar{position:relative;z-index:2;display:flex;align-items:center;gap:18px;background:var(--ink);padding-inline:max(var(--edge),env(safe-area-inset-left)) max(var(--edge),env(safe-area-inset-right))}
.mast{min-height:67px;border-bottom:1px solid #34515b;justify-content:space-between;padding-top:env(safe-area-inset-top)}
.identity,.mast-tools,.stage-tools,.light-switch,.camera-switch{display:flex;align-items:center}
.identity{gap:clamp(10px,1.8vw,27px);min-width:0}
.identity img{width:94px;height:auto;display:block}
.identity>span{width:1px;height:24px;background:var(--line)}
.identity h1{font:700 clamp(25px,2.1vw,38px)/1 Barlow,"Arial Narrow",sans-serif;letter-spacing:-.025em;margin:0}
.mast-tools,.stage-tools{gap:8px;flex:none}
.light-switch,.camera-switch{gap:2px;padding:3px;border:1px solid #526e77;border-radius:30px}
.light-switch button,.camera-switch button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:35px;padding:5px 13px;border-radius:22px;font-weight:650}
.light-switch button{font-size:15px}
.light-switch button svg{width:16px;height:16px}
.light-switch button[aria-pressed=true]{background:#e1eee4;color:#0c2d38}
[data-light=night] .light-switch button[aria-pressed=true]{background:var(--mint)}
.light-switch button[aria-pressed=false]:hover,.camera-switch button[aria-pressed=false]:hover{background:#234551}
.icon-button{display:grid;place-items:center;min-width:40px;min-height:40px;padding:6px;border-radius:50%;color:var(--soft)}
.icon-button:hover:enabled{color:white;background:#203e48}
.stage{isolation:isolate;position:relative;overflow:hidden;min-width:0;min-height:0;background:radial-gradient(ellipse at 53% 38%,#2a606b,#153e4e 53%,#0a2b3a 98%)}
.stage::before{content:"";position:absolute;inset:0;background:url('./media/depth-lines.webp') center/cover;opacity:.33;pointer-events:none;z-index:-1}
[data-light=night] .stage{background:radial-gradient(ellipse at 51% 48%,#153348,#071a2a 80%)}
.stage[data-mode=fly]::before{opacity:0}
#reef,.poster{position:absolute;inset:0;display:block;width:100%;height:100%;padding:0;border:0}
.poster{object-fit:contain;pointer-events:none}
#reef{touch-action:none;cursor:grab;opacity:0}
.stage[data-ready=true] #reef{opacity:1}
.stage[data-ready=true] .poster{visibility:hidden}
#reef:active{cursor:grabbing}
#reef[data-camera-mode=fly]{cursor:crosshair}
#reef:focus-visible{outline-offset:-4px}
.load-state,.no-script{position:absolute;z-index:1;bottom:18px;left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:9px;background:#092732ef;border:1px solid #59717a;border-radius:20px;padding:6px 14px;color:var(--text);font-size:14px;text-align:center}
.load-dot{height:8px;width:8px;flex:none;border-radius:50%;background:var(--mint)}
.load-state:has([data-retry]:not([hidden])){border-radius:10px;width:max-content;max-width:calc(100% - 32px);flex-wrap:wrap;justify-content:center}
[data-retry]{color:var(--mint);text-decoration:underline;text-underline-offset:3px;min-height:36px}
.no-script{z-index:3;bottom:64px}
.instrument-bar{min-height:72px;padding-block:8px max(8px,env(safe-area-inset-bottom));border-top:1px solid #395761}
.camera-switch{flex:none;background:#0a2632}
.camera-switch button{min-height:39px;padding-inline:17px}
.camera-switch button[aria-pressed=true]{background:var(--mint);color:#092e34}
#mode-hint{font-size:15px;color:var(--soft);margin:0 auto 0 4px;text-wrap:balance}
.stage-tools{margin-left:auto}
.touch-controls{display:none;pointer-events:none;position:absolute;inset:auto 0 0;padding:0 max(20px,env(safe-area-inset-left)) 18px;align-items:flex-end;justify-content:space-between}
@media(any-pointer:coarse){.stage[data-mode=fly][data-ready=true] .touch-controls{display:flex}}
.stick-base,.height-control{pointer-events:auto;touch-action:none;user-select:none;-webkit-user-select:none}
.stick-base{position:relative;width:92px;height:92px;border:1px solid #c8e5dae0;border-radius:50%;background:#082632c9;color:#e4f4ea}
.stick-base::before{content:"";position:absolute;inset:7px;border:1px dashed #719196;border-radius:50%}
.stick-base::after{content:"";position:absolute;left:calc(50% - 3px);top:9px;width:5px;height:5px;border-top:1px solid currentColor;border-left:1px solid currentColor;transform:rotate(45deg)}
[data-flight-stick]{position:absolute;left:50%;top:50%;width:36px;height:36px;margin:-18px;background:#b5e8dbe6;border:1px solid #dcfff0;border-radius:50%;transform:translate(var(--stick-x,0px),var(--stick-y,0px))}
.height-control{display:grid;gap:6px}
.height-control button{width:45px;height:40px;display:grid;place-items:center;background:#092833d9;border:1px solid #a2c4bf;border-radius:18px;touch-action:none}
.height-control button:active{background:var(--mint);color:var(--ink)}
[data-flight-sink] svg{transform:rotate(180deg)}
.help-sheet{max-width:min(440px,calc(100vw - 28px));width:420px;max-height:87dvh;margin:auto;padding:22px 25px;color:var(--text);background:#102d39;border:1px solid #60828a;border-radius:16px;box-shadow:0 22px 70px #03161f99;overscroll-behavior:contain}
.help-sheet::backdrop{background:#031720b8}
.help-heading,.language{display:flex;align-items:center;justify-content:space-between;gap:12px}
.help-heading h2{margin:0;font:700 34px/1 Barlow,"Arial Narrow",sans-serif}
.help-sheet h3{color:var(--mint);font-weight:650;font-size:17px;margin:20px 0 5px}
.help-sheet p{margin:0;color:var(--soft)}
.key-list{margin:4px 0 10px}
.key-list div{display:grid;grid-template-columns:minmax(130px,.86fr) 1fr;align-items:center;gap:8px;border-bottom:1px solid #365760;padding-block:6px}
.key-list dd{margin:0}
kbd{display:inline-block;background:#183c47;border:1px solid #51747d;border-radius:4px;padding:0 5px;color:#f3f6ed;font:600 13px/1.6 Source,sans-serif}
.language{margin-top:18px;padding-top:15px;border-top:1px solid #47656d}
.language select{background:#102e3a;border:1px solid #729097;border-radius:5px;padding:6px 12px;min-height:40px}
@media(max-width:760px){
  .mast{min-height:56px}.identity{gap:11px}.identity img{width:78px}
  .camera-switch button{padding-inline:12px}
  .instrument-bar{gap:10px}
}
@media(max-width:610px){
  .identity h1{font-size:25px}.mast,.instrument-bar{gap:6px}
  .mast-tools,.stage-tools{gap:1px}
  .mast .icon-button,.stage-tools .icon-button{min-width:37px;min-height:40px}
  .light-switch button{padding:4px 8px;font-size:14px;gap:4px;min-height:32px}
  .light-switch button svg{width:14px;height:14px}
  .instrument-bar{display:grid;grid-template-columns:1fr auto;min-height:62px;row-gap:4px}
  .camera-switch{justify-self:start}.camera-switch button{font-size:15px;min-height:36px;padding:4px 10px;gap:5px}
  #mode-hint{grid-row:2;grid-column:1/-1;text-align:center;width:100%;margin:0;font-size:13px}
  .stage-tools{grid-row:1;grid-column:2}
}
@media(max-width:460px){
  .light-switch button{position:relative;min-width:32px}
  .light-switch button svg{width:17px;height:17px}
  .light-switch button span{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
}
@media(max-width:355px){
  :root{--edge:10px}.identity{gap:8px}.identity img{width:62px}.identity h1{font-size:22px}
  .camera-switch button{padding-inline:7px;gap:4px}.camera-switch button svg{width:17px}
  .stage-tools .icon-button{min-width:32px}
}
@media(max-height:520px){
  .mast{min-height:45px}.instrument-bar{min-height:48px;padding-block:3px}
  .touch-controls{padding-bottom:8px}.stick-base{width:74px;height:74px}
}
