:root{color-scheme:dark;font-family:"Lucida Console","DejaVu Sans Mono",monospace;background:#000;color:#d2ebf0;font-size:16px}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden}button,input{font:inherit}button{cursor:pointer;color:inherit;background:#061117d9;border:1px solid #376979;border-radius:4px;padding:.5rem .75rem;font-size:.875rem;min-height:36px}button:hover{border-color:#00fff3;background:#092329}button:focus-visible,a:focus-visible,input:focus-visible{outline:2px solid #ffcf00;outline-offset:3px}button[aria-pressed=true]{color:#fff3a6;border-color:#bd9532}button:disabled{cursor:wait;opacity:.65}a{color:inherit;text-underline-offset:3px}[hidden]{display:none!important}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}p{margin:.5rem 0}#game{position:relative;width:100%;height:100%;height:100dvh;isolation:isolate;outline:none}#scene,#fx{position:absolute;inset:0;width:100%;height:100%;display:block}#fx{pointer-events:none;z-index:2}#boot{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;z-index:20;background:#000;padding:2rem;text-align:center}#boot strong{font-size:clamp(1.5rem,5vw,3rem);letter-spacing:.1em;color:#00fff2}#boot p{max-width:600px;line-height:1.6}
#title{position:absolute;inset:0;pointer-events:none;z-index:3}#start{position:absolute;top:max(3%,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(760px,92%);height:54px;background:transparent;border:0;padding:0;pointer-events:auto}#start canvas{width:100%;height:100%;display:block}.title-info{position:absolute;bottom:max(72px,10%);left:50%;transform:translateX(-50%);width:min(880px,94%);padding:.7rem 1rem;background:#000a;text-align:center;border:1px solid #00b9c077;border-radius:12px;line-height:1.45;font-size:.875rem;pointer-events:auto}.title-info b{font-weight:normal;color:#a3fff9}.title-info span{color:#507e83;padding:0 .5rem}.title-info .credits{font-size:.8125rem;color:#a6bcc2}.title-info #title-stats{color:#95b9c4}
#hud{position:absolute;top:max(10px,env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));padding:.7rem .85rem;border:1px solid #785630;border-radius:8px;background:#000c;z-index:3;min-width:330px;max-width:calc(100% - 20px);font-size:.875rem;line-height:1.3}#hud strong{font-size:1rem;color:#fff5b1}#hud p{margin:.4rem 0}#score,#records{color:#93aeb4}#integrity-warning{color:#ffba53}#integrity-warning:empty{display:none}#timer{position:absolute;right:14px;top:16px;text-align:right;color:#fff9ce;font-size:1.5rem;z-index:3;text-shadow:0 2px #000}#timer{white-space:pre-line}#recovery{white-space:pre-line}#notice{position:absolute;left:50%;transform:translateX(-50%);top:18%;width:94%;text-align:center;color:#f1edb0;font-weight:bold;z-index:4;text-shadow:0 2px 3px #000;pointer-events:none}#recovery{padding:.65rem 1rem;min-width:300px;max-width:95%;text-align:center;border:1px solid #a7a02d;border-radius:5px;background:#080800d9;color:#fff04d;font-size:.875rem;line-height:1.6}#danger{position:absolute;top:28%;left:50%;transform:translateX(-50%);background:#07192ddd;border:2px solid #6bbeff;padding:.7rem 1rem;font-weight:bold;color:#adf1ff;z-index:4;text-align:center;max-width:95%}#danger.hot{background:#430b03df;border-color:#ff5415;color:#ffb34c}
#toolbar{display:flex;justify-content:center;gap:6px;max-width:98%;flex-wrap:wrap}#toolbar button{background:#000c;font-size:.8125rem;color:#a8ccd4}#audio-status{width:100%;padding:0 12px;text-align:center;color:#a9b8c0;font-size:.8125rem;pointer-events:none}#card{position:absolute;inset:0;z-index:3;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:5vw;color:#090909;pointer-events:none}#card h1{font-size:clamp(2rem,5.8vw,4.5rem);margin:0 0 1.1rem;line-height:1.15;overflow-wrap:anywhere}#card p{font-size:clamp(1rem,2.1vw,1.5rem);white-space:pre-line;line-height:1.65}#card #card-detail{font-size:clamp(.875rem,1.5vw,1.1rem)}#card button{margin-top:2rem;background:transparent;color:inherit;border-color:currentColor;pointer-events:auto}#card.ready{color:#67fff4}#card.rebuilding{justify-content:flex-end;padding-bottom:20%;color:#111}#card.rebuilding h1{font-size:clamp(1.1rem,3vw,2rem)}
dialog{color:#d2ebf0;background:#030a0f;border:1px solid #39c4cf;border-radius:9px;width:min(720px,94vw);max-height:85dvh;overflow:auto;padding:1.5rem;z-index:30}dialog::backdrop{background:#000b}dialog h2{font-size:1.25rem;color:#8bfff4;line-height:1.5;margin:0 0 1rem}dialog p{font-size:1rem;line-height:1.6}#modal-body table{border-collapse:collapse;width:100%;font-size:.875rem;line-height:1.6}#modal-body td{border-bottom:1px solid #18333e;padding:.45rem .35rem;vertical-align:top}#modal-body td:first-child{color:#fff2a6;width:40%}#modal-actions{display:flex;flex-wrap:wrap;gap:.65rem;margin-top:1.3rem}#console{width:min(1050px,96vw)}#console header{display:flex;align-items:center;justify-content:space-between;gap:1rem}#console header h2{margin:0}#console-log{height:min(45vh,380px);overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5;font-size:.875rem;color:#b4dbcb}#console-form{display:flex;gap:.5rem;align-items:center}#console-input{width:100%;color:#fff7b1;background:#071820;border:1px solid #37616e;padding:.55rem;outline-offset:2px}#console>p{font-size:.8125rem;color:#8da8b3}#touch-controls{display:flex;justify-content:space-between;gap:24px;pointer-events:none}.touch-pad{display:grid;grid-template-columns:repeat(2,1fr);gap:5px;pointer-events:auto}.touch-pad button{min-width:58px;min-height:44px;touch-action:none;user-select:none;-webkit-user-select:none;background:#020a13cb;font-size:.8125rem}.touch-pad button.held{background:#205e67;border-color:#75fff3}
@media(max-width:700px){#hud{min-width:0;font-size:.8125rem;padding:.5rem .65rem;max-width:72%}#hud strong{font-size:.875rem}#timer{font-size:1.1rem;right:10px}#records{display:none}#toolbar button{padding:.35rem .5rem;min-height:36px}#notice{top:22%;font-size:.875rem}#recovery{min-width:0;width:max-content;font-size:.8125rem}#danger{font-size:.875rem;width:max-content}.title-info{bottom:100px;padding:.55rem;font-size:.8125rem}.title-info span{padding:0 .1rem}.title-info .credits{font-size:.75rem}#start{top:5%;height:45px}#audio-status{}#card{padding:5vw}dialog{padding:1rem}}
@media(max-height:560px){.title-info{bottom:55px;padding:.3rem .75rem}.title-info p{margin:.2rem}.title-info .credits{display:none}#start{top:2%;height:34px}#hud{padding:.35rem .55rem}#hud p{margin:.2rem}#notice{top:23%}#recovery{}#audio-status{}.touch-pad button{min-height:36px}#touch-controls{}#card.rebuilding{padding-bottom:12%}}

/* White tracing keeps both reassembly labels legible over the moving pieces. */
#card.rebuilding { padding: 0; }
#card.rebuilding #card-copy {
  position: absolute;
  left: var(--reassembly-label-x, 50%);
  top: var(--reassembly-label-y, 65%);
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 2rem);
  margin: 0;
  color: #111;
  text-shadow:
    -1px 0 0 #fff, 1px 0 0 #fff,
    0 -1px 0 #fff, 0 1px 0 #fff,
    -1px -1px 0 #fff, 1px -1px 0 #fff,
    -1px 1px 0 #fff, 1px 1px 0 #fff;
}
#card.rebuilding #card-title { margin: 0; }
#card.rebuilding #card-subtitle { margin: .4rem 0 0; font-size: clamp(.8rem, 2vw, 1rem); }
#card.rebuilding p:empty { display: none; }

/* Reserve actual space for every bottom overlay, including wrapped toolbars. */
#bottom-ui {
  position: absolute;
  inset-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  z-index: 8;
  pointer-events: none;
}
#bottom-ui #recovery { min-width: 0; width: max-content; max-width: 100%; }
#bottom-ui #toolbar { max-width: 100%; pointer-events: auto; }
#bottom-ui #touch-controls { width: 100%; }
#bottom-ui #audio-status:empty { display: none; }
#countdown {
  --countdown-period: 1.26s;
  width: max-content;
  max-width: 100%;
  padding: .65rem 1rem;
  border: 2px solid #ffbf3f;
  border-radius: 5px;
  background: #211500f5;
  color: #ffe4a3;
  text-align: center;
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 16px #ff9e0033;
  animation: countdown-blink var(--countdown-period) linear infinite;
}
#countdown.critical { color: #fff1e8; border-color: #ff6047; background: #390b05f5; box-shadow: 0 0 20px #ff402344; }
#time-reset {
  width: max-content;
  max-width: 100%;
  padding: .55rem .85rem;
  border: 2px solid #80eee2;
  border-radius: 5px;
  background: #061d20f5;
  color: #d6fff8;
  text-align: center;
  font-size: clamp(.875rem, 2vw, 1.1rem);
  font-weight: bold;
  line-height: 1.4;
  animation: countdown-blink .5s linear infinite;
}
#countdown.is-paused { animation-play-state: paused; }
@keyframes countdown-blink {
  0%, 40%, 100% { opacity: 1; }
  60%, 80% { opacity: .45; }
}
@media (max-height: 560px) {
  #bottom-ui { gap: .25rem; bottom: max(8px, env(safe-area-inset-bottom)); }
  #countdown { padding: .4rem .65rem; font-size: 1rem; }
  #bottom-ui #recovery { padding: .35rem .55rem; }
}
@media (prefers-reduced-motion: reduce) {
  #countdown, #time-reset { animation: none; }
}

#modal[data-kind="help"] { width: min(1120px, 96vw); }
.keyboard-help { margin: 1rem 0 1.25rem; }
.keyboard-map-scroll { overflow-x: auto; border: 1px solid #263e4b; border-radius: 9px; }
.keyboard-map-scroll:focus-visible { outline: 2px solid #ffcf00; outline-offset: 3px; }
.keyboard-map-scroll img { display: block; width: 100%; min-width: 840px; height: auto; }
.keyboard-help figcaption { margin-top: .65rem; font-size: .875rem; line-height: 1.6; color: #adc5cf; }
#opening {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: #fff;
  color: #111;
  text-align: center;
  pointer-events: none;
}
#opening p {
  margin: 1.1em 0;
  font-size: clamp(1rem, 2.3vw, 1.65rem);
  line-height: 1.65;
  opacity: 0;
}
.version-note, #modal .version-note { font-size: .875rem; color: #a6bcc2; }
#ending {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem;
  overflow: auto;
  background: #fff;
  color: #111;
  text-align: center;
}
#ending h1 { font-size: clamp(1.8rem, 5vw, 3.6rem); margin: 0 0 1rem; line-height: 1.25; }
#ascension-subtitle { font-size: clamp(1.1rem, 2.8vw, 1.65rem); }
#ascension-title, #ascension-subtitle { opacity: 0; }
#thank-you-copy { opacity: 0; }
#thank-you-copy p { font-size: clamp(1rem, 3vw, 1.5rem); margin: 0 0 1.25rem; }
#thank-you-copy h1 { font-weight: 400; letter-spacing: .08em; }
#ending-next { flex-shrink: 0; background: #fff; color: #111; border-color: #444; line-height: 1.5; }
#ending-next:hover { background: #ececec; }
#run-summary { width: min(640px, 100%); max-height: 70dvh; min-height: 0; overflow: auto; }
#run-summary h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
#summary-values { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0; text-align: left; line-height: 1.5; font-size: 1rem; }
#summary-values dt, #summary-values dd { margin: 0; padding: .45rem .35rem; border-bottom: 1px solid #ddd; }
#summary-values dd { font-weight: bold; text-align: right; font-variant-numeric: tabular-nums; }

#bonus-instructions { padding: .5rem .8rem; background: #071821ed; border: 1px solid #6c9da5; border-radius: 5px; text-align: center; font-size: clamp(.75rem, 1.6vw, .9rem); line-height: 1.5; color: #edfbe7; }
.bonus-help { padding: .8rem; border: 1px solid #ddd283; color: #fff3af; background: #211d0a; }

#modal[data-kind="update"] { text-align: center; }
#modal[data-kind="update"] p { white-space: pre-line; }
#modal[data-kind="update"] #modal-actions { justify-content: center; }
.update-instructions { color: #fff6b8; }

#modal[data-kind="mobile"] { text-align: center; }
#modal[data-kind="mobile"] p { white-space: pre-line; color: #fff6b8; }
#modal[data-kind="mobile"] #modal-actions { justify-content: center; }
.shake-setting { display: flex; align-items: center; gap: .65rem; width: fit-content; min-height: 44px; margin-bottom: .75rem; cursor: pointer; font-size: 1rem; }
.shake-setting input { width: 20px; height: 20px; margin: 0; accent-color: #75e8d6; cursor: pointer; }

#controller-status{color:#a3ffb2;font-size:.8125rem}.controller-help{margin:1rem 0 1.5rem}.controller-help h3{color:#a3ffb2;font-size:1.05rem}.controller-help table{margin-bottom:1rem}button:focus,a:focus,input:focus{outline:2px solid #ffcf00;outline-offset:3px}

/* Keep section tabs and the return button visible; only the active panel scrolls. */
#modal[data-kind="help"][open] { display:flex; flex-direction:column; height:min(850px,85dvh); overflow:hidden; }
#modal[data-kind="help"] #modal-title { flex:none; margin-bottom:.6rem; }
#modal[data-kind="help"] #modal-body { display:flex; flex:1; min-height:0; }
#modal[data-kind="help"] #modal-body>div { display:flex; flex-direction:column; width:100%; min-width:0; min-height:0; }
.help-tabs { display:flex; flex-direction:column; flex:1; min-height:0; min-width:0; }
.help-tab-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.5rem; padding:.25rem .25rem .7rem; flex:none; }
.help-tab-list button { min-width:0; min-height:44px; padding:.5rem .3rem; font-size:clamp(.7rem,2.2vw,.95rem); letter-spacing:.02em; }
.help-tab-list button[aria-selected="true"] { background:#143c40; border-color:#8bfff4; color:#bafff5; box-shadow:inset 0 -3px #8bfff4; }
.help-panels { flex:1; min-height:0; }
.help-panel { height:100%; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; padding:.3rem .75rem .75rem .25rem; }
.help-panel:focus-visible { outline:2px solid #ffcf00; outline-offset:-2px; }
.help-panel h3 { color:#a3ffb2; font-size:1.05rem; margin:.5rem 0; }
.help-panel .controller-help { margin:0; }
.help-panel .shake-setting { margin:1rem 0; width:100%; }
.help-panel details { margin-top:1.5rem; border-top:1px solid #37616e; padding-top:1rem; }
.help-panel summary { cursor:pointer; color:#8bfff4; line-height:1.5; }
.help-credits { flex:none; padding-top:.6rem; border-top:1px solid #18333e; }
#modal[data-kind="help"] .help-credits p { font-size:.7rem; line-height:1.35; margin:.15rem 0; overflow-wrap:anywhere; }
#modal[data-kind="help"] #modal-actions { flex:none; margin-top:.6rem; }
@media(max-height:560px) { #modal[data-kind="help"] { padding:.65rem; } #modal[data-kind="help"] #modal-title { font-size:1rem; margin-bottom:.2rem; } .help-tab-list { padding-bottom:.35rem; } .help-credits { padding-top:.3rem; } }

/* Touch beta. Keep every active target inside the device's safe area. */
.help-tab-list{grid-template-columns:repeat(4,minmax(0,1fr))}
.input-mode-options{display:flex;gap:.5rem;flex-wrap:wrap;margin:.7rem 0 1.4rem}
.input-mode-options button{min-height:44px}
.touch-help-map{display:block;width:100%;height:auto;border:1px solid #263e4b;border-radius:9px;margin:1rem 0}
#game[data-mobile-mode=true] #scene,#touch-controls{touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html,body{overscroll-behavior:none}
#game[data-mobile-mode=true] .title-keyboard-tip{display:none}
#game[data-mobile-mode=true] #controller-status{display:none}
#game[data-mobile-mode=true] #toolbar button{min-height:44px;touch-action:manipulation}
#game[data-mobile-mode=true] #timer{right:max(18px,env(safe-area-inset-right));pointer-events:none}
#game[data-mobile-mode=true] #hud{pointer-events:none;max-width:66%;min-width:0;font-size:.72rem}
#game[data-mobile-mode=true] #hud strong{font-size:.82rem}
#game[data-mobile-mode=true] #records{display:none}
#game[data-mobile-mode=true] #title-touch-tip{line-height:1.5}
#touch-controls{position:absolute;inset-inline:max(22px,env(safe-area-inset-left)) max(22px,env(safe-area-inset-right));bottom:calc(76px + env(safe-area-inset-bottom));display:flex;align-items:flex-end;justify-content:space-between;gap:12px;z-index:7;pointer-events:none}
.touch-left,.touch-right{pointer-events:none;display:flex;align-items:flex-end;gap:12px}
#touch-steer,#touch-depth,#touch-c{pointer-events:auto;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#touch-steer{width:108px;height:108px;border:2px solid #92a3a58c;border-radius:50%;background:#051319b8;display:flex;align-items:center;justify-content:center;flex-direction:column;color:#cfdddd;box-shadow:inset 0 0 0 18px #b7c4c408}
#touch-steer span{font-size:36px;line-height:1.1}#touch-steer small{font-size:12px;margin-top:8px}
#touch-depth{width:68px;height:142px;background:#061820c9;border:1px solid #618a92;border-radius:28px;display:flex;flex-direction:column;justify-content:space-around;text-align:center;padding:9px 3px;font-size:10px;color:#acccce}
#touch-depth strong{font-size:11px;color:#fff}
#touch-recoup-wrap{display:flex;align-items:center;flex-direction:column;gap:5px;min-width:82px;font-size:11px;color:#d1eee9;text-shadow:0 1px 3px #000}
#touch-c{width:76px;height:76px;border:2px solid #9fffea;border-radius:50%;padding:12px;background:#0c4947de;box-shadow:0 0 14px #70ffd525}
#touch-c svg{width:100%;height:100%;fill:#acd4c833;stroke:#cbfff3;stroke-width:2;stroke-linejoin:round}
#touch-c:disabled{cursor:default;opacity:.4;background:#252d30;box-shadow:none;border-color:#8b979a}
#touch-recouple-status{font-size:10px;color:#a9c5c4;min-height:12px}
#touch-steer.held,#touch-depth.held{border-color:#a3fff0;background:#123d43bf}
#touch-guide{position:absolute;inset:0;width:100%;height:100%;overflow:hidden;z-index:6;pointer-events:none}
#touch-grab{fill:transparent;stroke:#d6fff152;stroke-width:1.5;stroke-dasharray:4 7}
#touch-ring{fill:#a8afb50d;stroke:#92999be6;stroke-width:2;stroke-dasharray:6 5}
#touch-tether{stroke:#89ffeac0;stroke-width:2}
#touch-knob{fill:#c7fff1;stroke:#052122;stroke-width:2}
#touch-rush-label{font-size:11px;fill:#dae2e4;paint-order:stroke;stroke:#000;stroke-width:3px;stroke-linejoin:round}
#touch-guide.rushing #touch-ring{stroke:#fff2ad;fill:#ffca2215;stroke-dasharray:none}
#touch-guide.rushing #touch-rush-label{fill:#fff2ad}
#game[data-mobile-mode=true] #bottom-ui{gap:4px;padding-bottom:176px}
#game[data-mobile-mode=true] #toolbar{position:absolute;bottom:0;max-width:100%}
#game[data-mobile-mode=true] #bottom-ui:has(#toolbar[hidden]){display:none}
#game[data-mobile-mode=true]:has(#title:not([hidden])) #bottom-ui{padding-bottom:0}
#game[data-mobile-mode=true] #recovery,#game[data-mobile-mode=true] #bonus-instructions{font-size:.68rem;line-height:1.35;padding:.4rem .5rem}
#game[data-mobile-mode=true] #notice,#game[data-mobile-mode=true] #danger{font-size:.75rem;pointer-events:none}
#game[data-mobile-mode=true] #danger{padding:.4rem .6rem}
#game[data-mobile-mode=true] #card h1{font-size:clamp(1.4rem,5vw,3.3rem)}
#game[data-mobile-mode=true] #card button{min-height:44px}
@media (min-width:600px) and (max-height:600px){
 #game[data-mobile-mode=true] #bottom-ui{padding-bottom:52px}
 #game[data-mobile-mode=true] #bottom-ui>:not(#toolbar){max-width:calc(100% - 350px)}
 #game[data-mobile-mode=true] #hud p{margin:.2rem 0}
 #game[data-mobile-mode=true] #time-reset,#game[data-mobile-mode=true] #countdown{font-size:.75rem;padding:.3rem .5rem}
 #game[data-mobile-mode=true] .title-info{bottom:62px;font-size:.75rem;padding:.3rem .7rem}
 #game[data-mobile-mode=true] .title-info p{margin:.15rem 0}
 #game[data-mobile-mode=true] #start{height:32px}
}
@media (max-width:380px){
 #touch-controls{inset-inline:max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-right));gap:8px}
 #touch-steer{width:108px;height:108px}.touch-right{gap:8px}
 #touch-depth{width:56px;height:130px}#touch-c{width:68px;height:68px}#touch-recoup-wrap{min-width:74px}
 .help-tab-list{gap:.2rem}.help-tab-list button{font-size:.64rem}
 #game[data-mobile-mode=true] #toolbar{gap:3px}#game[data-mobile-mode=true] #toolbar button{font-size:.68rem;padding:.3rem .4rem}
}
#touch-grab{fill:url(#touch-orb-fill);stroke:#cfebeb75;stroke-dasharray:none}
#touch-axes line{stroke-width:1.5;opacity:.5}
#touch-axes circle{fill:#061217e8;stroke-width:1.5}
#touch-axes text{font-size:11px;font-weight:bold;paint-order:stroke;stroke:#061217;stroke-width:2px;fill:#fff}
#touch-axes .axis-x{stroke:#88eaff}#touch-axes .axis-y{stroke:#ffdb75}#touch-axes .axis-z{stroke:#f4a7ed}
#touch-axes text.axis-x{fill:#88eaff;stroke:#061217}#touch-axes text.axis-y{fill:#ffdb75;stroke:#061217}#touch-axes text.axis-z{fill:#f4a7ed;stroke:#061217}
#touch-axes .selected{stroke-width:3px;opacity:1}#touch-axes circle.selected{fill:#285456ef}
#settings{font-size:1.3rem;padding:.2rem .65rem;min-width:44px}
#game[data-mobile-mode=true] #help{display:none}
#game[data-mobile-mode=true] #toolbar button{width:44px;min-width:44px;min-height:44px;font-size:.65rem;padding:2px}
#game[data-mobile-mode=true] #settings{font-size:1.4rem}
#game[data-mobile-mode=true] #locate,#game[data-mobile-mode=true] #mute,#game[data-mobile-mode=true] #fullscreen,#game[data-mobile-mode=true] #menu{font-size:0}
#game[data-mobile-mode=true] #locate::before{content:'◎';font-size:24px}
#game[data-mobile-mode=true] #mute::before{content:'♪';font-size:25px}
#game[data-mobile-mode=true] #mute[aria-pressed=true]::before{content:'♪̸'}
#game[data-mobile-mode=true] #fullscreen::before{content:'⛶';font-size:24px}
#game[data-mobile-mode=true] #menu::before{content:'⌂';font-size:24px}
#modal[data-kind="mobile"][open]{display:flex;flex-direction:column;max-height:calc(100dvh - 24px)}
#modal[data-kind="mobile"] #modal-title,#modal[data-kind="mobile"] #modal-actions{flex:none}
#modal[data-kind="mobile"] #modal-body{min-height:0;overflow:auto;overscroll-behavior:contain}
#modal[data-kind="mobile"] #modal-actions button{min-height:44px}
@media(max-height:500px){#modal[data-kind="mobile"]{padding:.75rem}#modal[data-kind="mobile"] p{font-size:.83rem;line-height:1.4}#modal[data-kind="mobile"] #modal-title{font-size:1.05rem;margin-bottom:.4rem}#modal[data-kind="mobile"] #modal-actions{margin-top:.6rem}}

/* The title fitter measures this entire group, including a saved-run choice. */
#title-actions{position:absolute;top:max(3%,env(safe-area-inset-top));left:50%;transform:translateX(-50%);width:min(760px,92%);text-align:center;pointer-events:auto}
#title-actions #start{position:relative;top:auto;left:auto;transform:none;width:100%}
#new-run{min-height:44px;margin:0 .5rem;padding:.35rem .9rem}
#save-note{margin:.3rem auto 0;max-width:42rem;color:#a6bcc2;font-size:.8rem;line-height:1.3}
@media(max-height:560px){#title-actions{top:max(2%,env(safe-area-inset-top))}#new-run{min-height:36px}#save-note{font-size:.7rem;margin-top:.1rem}}

/* Shared action circles: both touch layouts and keyboard/controller play. */
.touch-left,.touch-right{flex-direction:column}
#touch-steer,#touch-depth{margin-bottom:10px}
#touch-recoup-wrap,#panic-wrap{display:flex;align-items:center;flex-direction:column;gap:5px;min-width:96px;min-height:136px;font-size:12px;color:#d1eee9;text-shadow:0 1px 3px #000}
#panic-button{pointer-events:auto;touch-action:none;user-select:none;width:76px;height:76px;border:2px solid #d6e4e5;border-radius:50%;padding:10px;background:#24353ee8;box-shadow:0 0 14px #b6e8ff25}
#panic-button svg{width:100%;height:100%;fill:#adcfdb30;stroke:#e7faff;stroke-width:2;stroke-linejoin:round}
#panic-button:disabled{cursor:default;opacity:.4;background:#252d30;box-shadow:none;border-color:#8b979a}
#panic-button.panic-flash{background:#682b20;border-color:#ffb260;box-shadow:0 0 18px #ff743655}
#panic-button.panic-flash svg{stroke:#ffe0a6;fill:#ffb26044}
#panic-button.panic-flash:disabled{opacity:.55}
#panic-status,#touch-recouple-status{font-size:12px;min-height:15px;white-space:nowrap;color:#bdced2}
.action-key{font-size:12px;color:#92adb4}
#game[data-mobile-mode=true] .action-key{display:none}
#game[data-mobile-mode=true] #touch-recoup-wrap,#game[data-mobile-mode=true] #panic-wrap{min-height:116px}
#game[data-mobile-mode=false] #bottom-ui>:not(#toolbar){max-width:calc(100% - 250px)}
