:root {
  color-scheme: dark;
  font: 16px/1.45 "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: #fff2da;
  background: #151d23;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow: hidden; }
#view, #view canvas { width: 100vw; height: 100dvh; display: block; }
#view, .heading, .controls { -webkit-user-select: none; user-select: none; }
#view, .steering, .console { -webkit-touch-callout: none; }
#view { position: fixed; inset: 0; touch-action: none; cursor: grab; }
#view:active { cursor: grabbing; }
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(165deg, #10171fb0, transparent 35%), linear-gradient(0deg, #10151bcc, transparent 25%);
}
.heading, .controls, .message { position: fixed; z-index: 1; }
.heading { inset: max(1.5rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 4rem) auto; pointer-events: none; }
.heading h1 { margin: .85rem 0 .15rem; font: 700 clamp(2.5rem, 5.8vw, 5.5rem)/1.08 "Noto Serif TC", "PMingLiU", serif; letter-spacing: .075em; }
.heading p { margin: .55rem 0 0; letter-spacing: .25em; }
.back { color: inherit; pointer-events: auto; text-underline-offset: .25em; font-size: .9rem; }
.message { inset: 42% 1.25rem auto; text-align: center; }
.controls { inset: auto clamp(1rem, 4vw, 4rem) max(1.2rem, env(safe-area-inset-bottom)); display: grid; justify-items: start; gap: .65rem; pointer-events: none; }
.steering { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.steering button { min-width: 5.5rem; min-height: 2.9rem; padding-inline: .8rem; background: #161c24eb; border-color: #fff2da69; font-weight: 700; touch-action: none; pointer-events: auto; }
.steering-tip { margin: 0 .25rem; font-size: .875rem; text-shadow: 0 1px 4px #10151b; }
.steering button:active { background: #f1bc80; color: #201a19; }
.steering button:disabled { opacity: .5; cursor: default; }
.hint { margin: 0; font-size: .875rem; text-shadow: 0 1px 4px #10151b; }
.console { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem 1rem; padding: .45rem .55rem; border: 1px solid #fff2da45; border-radius: .5rem; background: #161c24db; backdrop-filter: blur(10px); pointer-events: auto; }
.modes, .actions, .lens { display: flex; align-items: center; gap: .3rem; }
.lens { padding-inline: .55rem; gap: .55rem; color: #f3ddb6; font-size: .875rem; white-space: nowrap; }
.lens input { width: clamp(4.2rem, 12vw, 8rem); margin: 0; accent-color: #f1bc80; }
button { min-height: 2.65rem; padding: .25rem .58rem; border: 1px solid transparent; border-radius: .3rem; color: inherit; background: transparent; cursor: pointer; font: inherit; font-size: .875rem; white-space: nowrap; }
button:hover { background: #fff2da19; }
button[aria-pressed="true"] { color: #201a19; background: #f1bc80; }
:focus-visible { outline: 2px solid #f1bc80; outline-offset: 3px; }
@media (max-width: 560px) {
  .heading h1 { margin-top: .65rem; }
  .hint { display: none; }
  .console { gap: .25rem .35rem; }
  .lens { padding-inline: .25rem; }
}
