:root { color-scheme: light; --ink: #173e31; --cream: #fff9e9; --muted: #697466; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; color: var(--ink); background: #c5cfaf; }
button, a, canvas { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button, a { touch-action: manipulation; }
button:focus-visible, a:focus-visible, canvas:focus-visible { outline: 3px solid #467e59; outline-offset: 5px; }
button:active, .round-button:active { transform: scale(.95); }
button, a { transition: transform .15s ease, background-color .15s ease; }
[hidden] { display: none !important; }
.game { width: 100%; height: 100%; height: 100dvh; position: relative; isolation: isolate; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.hud-header { position: absolute; inset: max(28px, env(safe-area-inset-top)) max(32px, env(safe-area-inset-right)) auto max(32px, env(safe-area-inset-left)); display: flex; justify-content: space-between; gap: 24px; pointer-events: none; }
.identity { display: flex; gap: 24px; align-items: flex-start; }
.round-button { display: grid; place-items: center; flex-shrink: 0; width: 62px; height: 62px; border: 1px solid #ffffff8a; border-radius: 50%; background: #fff9ecf0; box-shadow: 0 3px 14px #382c2114; pointer-events: auto; }
.round-button:hover { background: #fffdf7; }
.round-button img { width: 34px; height: 34px; opacity: .85; }
h1 { margin: -6px 0 1px; font-size: clamp(28px, 3.05vw, 47px); line-height: 1.28; font-weight: 750; letter-spacing: .04em; text-shadow: 0 1px 8px #fff6dccc, 0 0 25px #fff9e9; }
.identity p { margin: 0; font-size: 18px; letter-spacing: .12em; text-shadow: 0 0 10px #fffbe0, 0 0 18px #fffbe0; }
.game-status { display: flex; gap: 27px; align-items: flex-start; }
#timer { font-size: 34px; font-weight: 650; font-variant-numeric: tabular-nums; padding-top: 7px; text-shadow: 0 0 14px #fff9e9; }
.hud-footer { position: absolute; inset: auto 38px max(32px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; justify-content: space-between; color: #fffbed; pointer-events: none; text-shadow: 0 2px 5px #183520cf, 0 0 18px #243b24a6; }
.desktop-help { display: flex; gap: 13px; align-items: flex-end; font-size: 18px; font-weight: 550; }
.desktop-help > span { padding-bottom: 7px; }
.desktop-help > img { width: 40px; height: 46px; filter: invert(1); margin: 0 0 1px 13px; }
.key-cluster { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.key-cluster div { display: flex; gap: 5px; }
kbd { min-width: 36px; height: 36px; border-radius: 5px; display: grid; place-items: center; background: #fffbe9f0; color: var(--ink); box-shadow: 0 2px 3px #243c2533; font: 650 22px/1 inherit; text-shadow: none; }
.objective { position: absolute; left: 50%; bottom: -2px; transform: translateX(-50%); margin: 0; padding: 10px 23px; border-radius: 24px; background: #18311b36; font-size: 21px; font-weight: 600; letter-spacing: .1em; white-space: nowrap; backdrop-filter: blur(3px); }
.pause-help { font-size: 13px; padding-bottom: 10px; opacity: .8; letter-spacing: .08em; }
.curtain { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: #182a1e24; backdrop-filter: blur(3px); }
.panel { width: min(420px, 100%); padding: 38px 38px 28px; background: #fff9eef2; border: 1px solid #fffcf5; border-radius: 24px; box-shadow: 0 20px 75px #213b2840; text-align: center; }
.panel:focus { outline: none; }
.eyebrow { margin: 0 0 16px; font-size: 12px; letter-spacing: .24em; color: var(--muted); }
h2 { font-size: 31px; margin: 0 0 14px; font-weight: 650; letter-spacing: .05em; }
#panel-description { font-size: 15px; color: #59654f; line-height: 1.9; margin: 0 auto 20px; max-width: 30ch; white-space: pre-line; }
.panel-tip { color: #7b826c; font-size: 12px; line-height: 1.8; margin-bottom: 24px; }
.primary-button { display: block; width: 100%; border: 0; border-radius: 30px; padding: 16px 20px; font-size: 16px; font-weight: 600; letter-spacing: .08em; color: #fff9e9; background: #204a36; box-shadow: 0 5px 14px #204a3621; }
.primary-button:hover { background: #2a5e43; }
.text-button { display: inline-block; color: #66745a; background: none; border: 0; font-size: 13px; padding: 15px 9px 2px; text-decoration: none; }
.text-button:hover { color: #204a36; text-decoration: underline; }
.game[data-state="running"] .curtain { display: none; }
.game[data-state="loading"] #scene, .game[data-state="ready"] .hud-footer { opacity: .6; }
.joystick { position: absolute; width: 118px; height: 118px; border: 1px solid #ffffdaaa; border-radius: 50%; background: #fff9dd29; backdrop-filter: blur(5px); bottom: max(30px, env(safe-area-inset-bottom)); left: max(28px, env(safe-area-inset-left)); touch-action: none; }
.joystick-knob { width: 46px; height: 46px; background: #fff8e0c9; box-shadow: 0 3px 12px #1f381c29; border: 1px solid #ffffefa1; border-radius: 50%; position: absolute; left: 35px; top: 35px; pointer-events: none; }
.touch-look { position: absolute; right: max(28px, env(safe-area-inset-right)); bottom: max(55px, env(safe-area-inset-bottom)); color: #fff7df; text-shadow: 0 1px 5px #214023; font-size: 13px; pointer-events: none; }
.touch-controls { pointer-events: none; }
.touch-controls .joystick { pointer-events: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.no-script { position: fixed; inset: 35% 10%; padding: 24px; background: var(--cream); z-index: 10; text-align: center; }
@media (max-width: 800px) {
  .hud-header { top: max(20px, env(safe-area-inset-top)); left: max(20px, env(safe-area-inset-left)); right: max(20px, env(safe-area-inset-right)); gap: 10px; }
  .identity { gap: 13px; }
  .round-button { width: 46px; height: 46px; }
  .round-button img { width: 26px; height: 26px; }
  h1 { font-size: 29px; margin: -3px 0 3px; }
  .identity p { font-size: 12px; }
  #timer { font-size: 24px; padding-top: 6px; }
  .game-status { gap: 12px; }
  .desktop-help { gap: 7px; font-size: 12px; }
  .desktop-help > img { width: 28px; height: 33px; margin-left: 4px; }
  kbd { min-width: 25px; height: 25px; font-size: 15px; }
  .hud-footer { left: 22px; right: 22px; bottom: 23px; }
  .objective { font-size: 16px; padding: 8px 18px; }
  .pause-help { display: none; }
}
@media (pointer: coarse) { .desktop-help, .pause-help { display: none; } .hud-footer { bottom: max(25px, env(safe-area-inset-bottom)); } }
@media (max-width: 520px) {
  .hud-header { left: 14px; right: 14px; top: max(17px, env(safe-area-inset-top)); }
  .identity { gap: 9px; }
  h1 { font-size: 24px; }
  .round-button { width: 41px; height: 41px; }
  .round-button img { width: 23px; height: 23px; }
  .game-status { gap: 10px; }
  #timer { font-size: 21px; }
  .identity p { letter-spacing: .07em; font-size: 11px; }
  .panel { padding: 30px 25px 22px; }
  h2 { font-size: 28px; }
  .desktop-help { display: none; }
  .touch-look { font-size: 11px; right: 22px; }
  .joystick { width: 104px; height: 104px; left: 22px; }
  .joystick-knob { left: 28px; top: 28px; }
}
@media (max-height: 520px) {
  .panel { padding: 18px 26px; }
  .eyebrow { margin-bottom: 7px; }
  h2 { font-size: 26px; margin-bottom: 8px; }
  #panel-description { margin-bottom: 6px; }
  .panel-tip { margin: 7px 0 13px; }
  .primary-button { padding: 12px; }
  .joystick { width: 94px; height: 94px; bottom: 18px; }
  .joystick-knob { left: 23px; top: 23px; }
}
@media (prefers-reduced-motion: reduce) { button, a { transition: none; } }
