:root { --ink: #ecebe6; --muted: #a9a79f; --accent: #e3b552; --panel: rgba(8, 10, 14, 0.62); --line: rgba(255, 255, 255, 0.14); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; overflow: hidden; overscroll-behavior: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.82)); z-index: 20; overflow-y: auto; }
#loading { background: #000; z-index: 30; }
.card { background: rgba(10, 12, 16, 0.86); border: 1px solid var(--line); border-radius: 16px; padding: 26px 28px; max-width: 860px; width: 100%; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); max-height: calc(100vh - 32px); overflow-y: auto; }
.loading-card { max-width: 420px; text-align: center; }
.brand { font-size: 30px; font-weight: 700; letter-spacing: 0.04em; margin-bottom: 10px; }
.bar { height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; margin-top: 16px; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.2s; }
h1 { margin: 0 0 6px; font-size: clamp(30px, 6vw, 52px); letter-spacing: 0.02em; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); margin: 18px 0 10px; }
.tagline { color: var(--muted); font-size: 17px; line-height: 1.45; margin: 0 0 6px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 720px) { .cols { grid-template-columns: 1fr; gap: 0; } .card { padding: 18px; } }
.controls { list-style: none; padding: 0; margin: 0; font-size: 14px; line-height: 2; color: var(--ink); }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; margin-right: 3px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; text-align: center; background: rgba(255, 255, 255, 0.05); }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; font-size: 14px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; flex-wrap: wrap; }
.seg button { background: transparent; color: var(--muted); border: 0; padding: 7px 10px; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: rgba(227, 181, 82, 0.2); color: var(--ink); }
.actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.actions.vertical { flex-direction: column; }
button { font: inherit; }
.primary { background: var(--accent); color: #1a1406; border: 0; border-radius: 10px; padding: 12px 22px; font-weight: 700; font-size: 16px; cursor: pointer; }
.primary:hover { filter: brightness(1.08); }
.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 11px 18px; font-size: 15px; cursor: pointer; }
.ghost:hover { background: rgba(255, 255, 255, 0.06); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.pause-card { max-width: 360px; }
.credits-card { max-width: 640px; font-size: 14px; line-height: 1.55; }
.credits-card p { margin: 0 0 10px; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-family: ui-monospace, Menlo, Consolas, monospace; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.suit { position: absolute; left: max(12px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); width: 264px; font-size: 12px; }
.nav { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); width: 264px; font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.lbl { color: var(--accent); width: 52px; flex: none; letter-spacing: 0.06em; }
.val { color: var(--ink); width: 40px; text-align: right; }
.val.wide { width: auto; text-align: left; }
.meter { flex: 1; height: 8px; background: rgba(255, 255, 255, 0.1); border-radius: 4px; overflow: hidden; }
.meter span { display: block; height: 100%; width: 100%; background: #6fd3a0; }
.meter span.warn { background: #e9a23b; }
.meter span.low { background: #e5534b; }
#compass { position: absolute; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); width: min(480px, 54vw); height: 56px; }
.top-buttons { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); display: flex; gap: 8px; pointer-events: auto; }
.icon { width: 40px; height: 40px; border-radius: 10px; background: var(--panel); color: var(--ink); border: 1px solid var(--line); cursor: pointer; font-size: 16px; }
.icon.off { color: #e5534b; }
.prompt { position: absolute; left: 50%; bottom: 22%; transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; font-size: 14px; white-space: nowrap; }
.toast { position: absolute; left: 50%; top: 90px; transform: translateX(-50%); background: rgba(227, 181, 82, 0.92); color: #1a1406; padding: 8px 14px; border-radius: 10px; font: 600 14px system-ui, sans-serif; max-width: 80vw; text-align: center; }
.poi { position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); width: min(380px, 44vw); font-family: system-ui, -apple-system, sans-serif; }
.poi h3 { margin: 2px 0 6px; font-size: 15px; color: var(--accent); }
.poi p { margin: 0; font-size: 13.5px; line-height: 1.45; }
.visor { position: fixed; inset: 0; pointer-events: none; z-index: 5; background: radial-gradient(ellipse 75% 70% at 50% 48%, rgba(0, 0, 0, 0) 62%, rgba(20, 14, 0, 0.35) 82%, rgba(0, 0, 0, 0.9) 100%); }
.photo-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 15; display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 13px; }

/* Touch */
.touch { position: fixed; inset: 0; z-index: 12; pointer-events: none; }
.stick-zone { position: absolute; left: 0; bottom: 0; width: 42%; height: 62%; pointer-events: auto; touch-action: none; }
.look-zone { position: absolute; right: 0; top: 70px; width: 58%; bottom: 0; pointer-events: auto; touch-action: none; }
.stick-base { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.06); left: 90px; top: calc(100% - 110px); opacity: 0.55; }
.stick-base.on { opacity: 1; }
.stick-knob { position: absolute; left: 35px; top: 35px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.tbtns { position: absolute; right: max(14px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: auto auto; gap: 10px; pointer-events: auto; align-items: end; justify-items: end; }
.tbtn { width: 64px; height: 64px; border-radius: 50%; background: rgba(10, 12, 16, 0.55); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.3); font: 600 12px system-ui, sans-serif; touch-action: none; }
.tbtn.big { width: 80px; height: 80px; font-size: 14px; }
.tbtn.small { width: 52px; height: 52px; font-size: 11px; }
.tbtn.down { background: rgba(227, 181, 82, 0.5); }
body.is-touch .desktop-only { display: none; }
body:not(.is-touch) .touch-only { display: none; }
/* touch layouts: keep the bottom of the screen clear for thumbs */
body.is-touch .suit { width: 196px; font-size: 11px; padding: 6px 8px; }
body.is-touch .suit .row.opt, body.is-touch .nav .row.opt { display: none; }
body.is-touch .nav { top: max(60px, calc(env(safe-area-inset-top) + 50px)); right: max(8px, env(safe-area-inset-right)); left: auto; bottom: auto; width: 176px; font-size: 11px; padding: 6px 8px; }
body.is-touch .nav .lbl, body.is-touch .suit .lbl { width: 44px; }
body.is-touch #compass { width: min(360px, 40vw); }
body.is-touch .poi { left: max(8px, env(safe-area-inset-left)); right: auto; bottom: auto; top: 112px; width: min(320px, 42vw); }
body.is-touch .poi p { font-size: 12px; }
body.is-touch .toast { top: 70px; font-size: 13px; max-width: 56vw; }
@media (orientation: portrait) {
  body.is-touch #compass { top: calc(max(12px, env(safe-area-inset-top)) + 140px); width: 94vw; }
  body.is-touch .toast { top: 214px; }
  body.is-touch .poi { top: 268px; width: auto; right: 8px; }
  body.is-touch .prompt { bottom: 34%; }
}
@media (max-width: 1080px) { body:not(.is-touch) #compass { top: 96px; width: min(480px, 70vw); } body:not(.is-touch) .toast { top: 160px; } }
