:root {
  color-scheme: dark;
  --ink: #f2f6fb;
  --muted: rgba(231, 241, 248, 0.66);
  --line: rgba(255, 255, 255, 0.2);
  --panel: rgba(9, 21, 35, 0.58);
  --accent: #8bd7d0;
  --safe-top: max(16px, env(safe-area-inset-top));
  --safe-right: max(16px, env(safe-area-inset-right));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
  --safe-left: max(16px, env(safe-area-inset-left));
  font-family: Inter, Pretendard, "Noto Sans KR", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #091827; }
body { min-height: 100svh; min-height: 100dvh; color: var(--ink); -webkit-font-smoothing: antialiased; }
button { font: inherit; }
button:focus-visible { outline: 2px solid #c5fff4; outline-offset: 3px; }

.flight-shell { position: relative; width: 100%; height: 100%; height: 100dvh; min-height: 320px; overflow: hidden; isolation: isolate; background: #84c8dc; user-select: none; -webkit-user-select: none; }
#flight-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#flight-canvas:active { cursor: grabbing; }

.hud { position: absolute; z-index: 5; pointer-events: none; }
.hud-top { inset: var(--safe-top) var(--safe-right) auto var(--safe-left); display: grid; grid-template-columns: minmax(180px, 1fr) minmax(190px, auto) minmax(180px, 1fr); align-items: start; gap: 12px; }
.brand-lockup, .region-readout, .flight-actions { pointer-events: auto; }
.brand-lockup { display: flex; align-items: center; gap: 10px; text-shadow: 0 2px 18px rgba(16, 45, 60, 0.4); }
.brand-mark { font-size: 13px; font-weight: 900; letter-spacing: .15em; }
.brand-divider { width: 1px; height: 17px; background: rgba(255,255,255,.42); }
.brand-game { color: rgba(255,255,255,.72); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.region-readout { justify-self: center; text-align: center; text-shadow: 0 2px 16px rgba(16, 45, 60, 0.38); }
.eyebrow, .modal-kicker { display: block; color: rgba(226, 255, 250, .68); font-size: 9px; font-weight: 800; letter-spacing: .22em; }
.region-readout strong { display: block; margin-top: 3px; font-size: 13px; letter-spacing: .14em; }
.region-readout span:last-child { display: block; margin-top: 4px; color: rgba(255,255,255,.72); font-size: 10px; }
.flight-actions { display: flex; justify-content: flex-end; gap: 8px; }
.icon-button, .pause-button, .close-button { border: 1px solid rgba(255,255,255,.25); color: #effcff; background: rgba(10, 30, 42, .38); box-shadow: 0 8px 22px rgba(4, 18, 25, .16), inset 0 1px rgba(255,255,255,.12); backdrop-filter: blur(12px); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.icon-button { min-width: 44px; min-height: 44px; border-radius: 14px; font-size: 16px; }
.icon-button:hover, .pause-button:hover, .close-button:hover { background: rgba(11, 43, 54, .68); }
.pause-button { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 13px; border-radius: 14px; font-size: 11px; font-weight: 800; }

.telemetry { position: absolute; z-index: 5; top: clamp(74px, 10vh, 96px); right: var(--safe-right); display: flex; gap: 1px; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 13px; background: rgba(10, 29, 41, .42); box-shadow: 0 14px 30px rgba(10, 31, 41, .14); backdrop-filter: blur(12px); pointer-events: none; }
.telemetry-item { min-width: 66px; padding: 7px 8px 8px; border-left: 1px solid rgba(255,255,255,.11); }
.telemetry-item:first-child { border-left: 0; }
.telemetry-item span { display: block; color: rgba(230,245,250,.58); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.telemetry-item strong { display: block; margin-top: 3px; font-size: 13px; font-weight: 750; font-variant-numeric: tabular-nums; }
.telemetry-item small { margin-left: 3px; color: rgba(255,255,255,.58); font-size: 9px; font-weight: 600; }

.flight-reticle { position: absolute; z-index: 3; top: 50%; left: 50%; width: 48px; height: 48px; transform: translate(-50%, -50%); opacity: .72; pointer-events: none; }
.flight-reticle::before, .flight-reticle::after, .flight-reticle span::before, .flight-reticle span::after { content: ""; position: absolute; background: rgba(242,255,252,.82); box-shadow: 0 0 8px rgba(166,255,240,.54); }
.flight-reticle::before, .flight-reticle::after { top: 50%; width: 11px; height: 1px; transform: translateY(-50%); }
.flight-reticle::before { left: 0; } .flight-reticle::after { right: 0; }
.flight-reticle span::before, .flight-reticle span::after { left: 50%; height: 11px; width: 1px; transform: translateX(-50%); }
.flight-reticle span::before { top: 0; } .flight-reticle span::after { bottom: 0; }
.speed-lines { position: absolute; z-index: 2; inset: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity .5s ease; background: radial-gradient(ellipse at center, transparent 34%, rgba(216, 251, 255, .17) 100%); mix-blend-mode: screen; }
.speed-lines::before, .speed-lines::after { content: ""; position: absolute; inset: -30%; background: repeating-conic-gradient(from 10deg at 50% 50%, transparent 0deg 4deg, rgba(226,255,252,.15) 4.4deg 4.8deg, transparent 5deg 18deg); mask-image: radial-gradient(ellipse at center, black 0 22%, transparent 67%); animation: speed-pulse 1.2s linear infinite; }
.speed-lines::after { transform: rotate(7deg) scale(1.15); opacity: .4; animation-duration: 1.8s; }
.speed-lines.is-active { opacity: .52; }
@keyframes speed-pulse { from { transform: scale(.8) rotate(0); } to { transform: scale(1.25) rotate(8deg); } }

.touch-controls { position: absolute; z-index: 6; inset: auto var(--safe-right) var(--safe-bottom) var(--safe-left); display: flex; justify-content: space-between; align-items: end; pointer-events: none; }
.joystick-zone { position: relative; width: clamp(145px, 20vw, 176px); height: clamp(145px, 20vw, 176px); pointer-events: auto; touch-action: none; }
.joystick { position: absolute; inset: 0; border: 1px solid rgba(239,255,251,.3); border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.1), rgba(12,48,60,.2)); box-shadow: inset 0 0 0 16px rgba(255,255,255,.025), inset 0 0 40px rgba(8,35,46,.2), 0 12px 30px rgba(5, 29, 38, .15); }
.joystick-ring { position: absolute; inset: 24%; border: 1px dashed rgba(228,255,251,.28); border-radius: 50%; }
.joystick-knob { position: absolute; top: 50%; left: 50%; width: 31%; aspect-ratio: 1; border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: radial-gradient(circle at 32% 27%, rgba(235,255,249,.82), rgba(112,189,180,.54) 45%, rgba(30,83,87,.74)); box-shadow: 0 8px 19px rgba(6, 37, 44, .3), inset 0 2px rgba(255,255,255,.45); transform: translate(-50%, -50%); transition: transform .14s ease; }
.control-caption { position: absolute; right: 2px; bottom: -19px; color: rgba(242,255,252,.46); font-size: 8px; font-weight: 800; letter-spacing: .16em; }
.flight-buttons { display: flex; align-items: end; gap: clamp(7px, 1vw, 13px); pointer-events: auto; }
.flight-control { display: grid; place-content: center; width: clamp(54px, 7vw, 68px); height: clamp(54px, 7vw, 68px); border: 1px solid rgba(255,255,255,.26); border-radius: 18px; color: #f5fffd; background: rgba(11, 43, 54, .53); box-shadow: 0 10px 26px rgba(6, 28, 35, .23), inset 0 1px rgba(255,255,255,.18); backdrop-filter: blur(10px); cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.flight-control span { font-size: clamp(22px, 3.5vw, 30px); line-height: .9; }
.flight-control small { margin-top: 4px; color: rgba(235,255,251,.7); font-size: 9px; font-weight: 800; }
.flight-control.rise { background: rgba(36, 111, 119, .62); }
.flight-control.boost { color: #fff1b4; background: rgba(119, 84, 48, .62); }
.flight-control.hover { background: rgba(78, 83, 123, .62); }
.flight-control.context-control { color: #fff0ba; background: rgba(118, 78, 45, .72); }
.flight-control.is-pressed { transform: translateY(3px) scale(.96); background: rgba(126, 212, 199, .82); box-shadow: 0 4px 12px rgba(4, 31, 36, .28), inset 0 1px rgba(255,255,255,.4); }
[hidden] { display: none !important; }

.start-screen, .pause-panel, .settings-panel { position: absolute; z-index: 12; inset: 0; display: grid; place-items: center; padding: 24px; background: linear-gradient(90deg, rgba(6,20,31,.45), transparent 68%), radial-gradient(circle at 78% 28%, rgba(185, 238, 223, .18), transparent 28%); }
.start-screen { z-index: 10; place-items: center start; padding-left: clamp(28px, 12vw, 180px); pointer-events: auto; transition: opacity .55s ease, visibility .55s ease; }
.start-screen.is-hidden, .loading-screen.is-hidden { display: none; opacity: 0; visibility: hidden; pointer-events: none; }
.start-card { position: relative; z-index: 2; width: min(420px, 84vw); pointer-events: auto; text-shadow: 0 4px 26px rgba(4,20,30,.26); }
.start-kicker { color: #c4fff0; font-size: 10px; font-weight: 850; letter-spacing: .23em; }
.start-card h1 { margin: 14px 0 15px; color: #f4fbf8; font-size: clamp(47px, 7.5vw, 98px); line-height: .86; letter-spacing: -.07em; }
.start-card h1 em { color: #b4eee0; font-style: normal; font-weight: 350; letter-spacing: -.1em; }
.start-card p { margin: 0; color: rgba(245,255,252,.78); font-size: clamp(14px, 1.7vw, 19px); line-height: 1.6; }
.start-button, .primary-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 45px; min-height: 54px; margin-top: 30px; padding: 0 18px 0 22px; border: 1px solid rgba(218,255,247,.68); border-radius: 15px; color: #0a2d37; background: #d6f7ec; box-shadow: 0 15px 34px rgba(4, 39, 45, .22), inset 0 1px rgba(255,255,255,.78); font-size: 13px; font-weight: 900; cursor: pointer; transition: transform .2s ease, background .2s ease; }
.start-button { min-width: 190px; }
.start-button b { font-size: 20px; }
.start-button:hover, .primary-button:hover { background: #f0fff9; transform: translateY(-2px); }
.start-hint { display: flex; align-items: center; gap: 8px; margin-top: 19px; color: rgba(231,255,249,.58); font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: #9ef0dc; box-shadow: 0 0 12px #9ef0dc; }
.start-orbit { position: absolute; right: 12vw; top: 50%; width: min(43vw, 580px); aspect-ratio: 1.25; transform: translateY(-50%) rotate(-13deg); border: 1px solid rgba(230,255,249,.17); border-radius: 50%; box-shadow: 0 0 70px rgba(163, 238, 224, .1); }
.start-orbit::before, .start-orbit::after { content: ""; position: absolute; inset: 11%; border: 1px solid rgba(230,255,249,.1); border-radius: 50%; transform: rotate(52deg); }
.start-orbit::after { inset: 24%; transform: rotate(-18deg); }
.start-orbit span { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #d8fff3; box-shadow: 0 0 18px 5px rgba(186,255,231,.56); }
.start-orbit span:nth-child(1) { top: 10%; left: 34%; } .start-orbit span:nth-child(2) { right: 16%; bottom: 27%; background: #ffe9b3; } .start-orbit span:nth-child(3) { left: 8%; bottom: 36%; width: 5px; height: 5px; }

.pause-panel, .settings-panel { background: rgba(3,15,25,.48); backdrop-filter: blur(10px); opacity: 0; visibility: hidden; pointer-events: none; touch-action: auto; transition: opacity .25s ease, visibility .25s ease; }
.pause-panel.is-open, .settings-panel.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.modal-card { width: min(390px, calc(100vw - 40px)); padding: 28px; border: 1px solid rgba(230,255,249,.3); border-radius: 22px; background: rgba(11, 33, 44, .84); box-shadow: 0 25px 75px rgba(1, 10, 18, .34), inset 0 1px rgba(255,255,255,.13); text-align: center; }
.modal-card h2 { margin: 10px 0 8px; font-size: 27px; letter-spacing: -.06em; }
.modal-card p { margin: 0; color: rgba(234,250,248,.66); font-size: 12px; line-height: 1.6; }
.primary-button { min-width: 150px; justify-content: center; margin-top: 24px; padding: 0 19px; }
.settings-card { text-align: left; }
.modal-heading { display: flex; align-items: start; justify-content: space-between; }
.modal-heading h2 { margin-bottom: 0; }
.close-button { min-width: 38px; min-height: 38px; border-radius: 12px; font-size: 23px; line-height: 1; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 25px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; font-weight: 750; }
.toggle-button, .quality-options button { min-height: 36px; border: 1px solid rgba(214,255,244,.28); border-radius: 10px; color: rgba(235,255,250,.75); background: rgba(255,255,255,.07); cursor: pointer; font-size: 10px; font-weight: 800; }
.toggle-button { min-width: 54px; } .toggle-button.is-on { color: #082b32; background: #c4f5e8; }
.quality-options { display: flex; gap: 5px; } .quality-options button { padding: 0 10px; } .quality-options button.is-selected { color: #082b32; background: #c4f5e8; }
.settings-note { margin-top: 21px !important; font-size: 10px !important; }
.portrait-note { position: absolute; z-index: 8; top: 50%; left: 50%; display: none; place-items: center; gap: 6px; width: min(260px, calc(100vw - 40px)); padding: 18px; border: 1px solid rgba(255,255,255,.23); border-radius: 18px; background: rgba(7, 26, 38, .68); transform: translate(-50%, -50%); text-align: center; backdrop-filter: blur(10px); pointer-events: none; }
.portrait-note span { color: #c4f4e7; font-size: 26px; } .portrait-note strong { font-size: 13px; } .portrait-note small { color: rgba(238,255,250,.68); font-size: 10px; }
.loading-screen { position: absolute; z-index: 20; inset: 0; display: grid; place-content: center; gap: 9px; background: #0a1b2a; color: #ecfffa; text-align: center; transition: opacity .5s ease, visibility .5s ease; }
.loading-screen span { font-size: 14px; font-weight: 800; } .loading-screen small { color: rgba(232,255,251,.55); font-size: 10px; }
.loading-mark { width: 38px; height: 38px; margin: 0 auto 7px; border: 1px solid rgba(202,255,243,.35); border-top-color: #d5fff3; border-radius: 50%; box-shadow: 0 0 25px rgba(172,255,230,.2); animation: loading-spin 1.1s linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }
.toast { position: absolute; z-index: 8; top: 50%; left: 50%; padding: 10px 15px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; background: rgba(8, 29, 40, .62); color: #eafff8; font-size: 11px; font-weight: 800; opacity: 0; transform: translate(-50%, 22px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; backdrop-filter: blur(10px); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
.flight-footer { position: absolute; z-index: 5; right: var(--safe-right); bottom: 6px; left: var(--safe-left); display: flex; justify-content: space-between; color: rgba(240,255,251,.42); font-size: 8px; font-weight: 800; letter-spacing: .12em; pointer-events: none; }

@media (orientation: portrait) { .portrait-note { display: grid; } .hud-top { grid-template-columns: 1fr auto; } .region-readout { display: none; } .telemetry { top: 78px; left: var(--safe-left); right: auto; } .telemetry-item { min-width: 70px; } .start-screen { place-items: center; padding: 28px; text-align: center; } .start-card { margin: 0 auto; } .start-hint { justify-content: center; } .start-orbit { top: 67%; right: 50%; width: 92vw; transform: translate(50%, -50%) rotate(-13deg); opacity: .48; } .touch-controls { align-items: end; } .joystick-zone { width: 135px; height: 135px; } .flight-buttons { gap: 5px; } .flight-control { width: 56px; height: 56px; border-radius: 17px; } .flight-footer { display: none; } }
@media (max-width: 640px) { .brand-game { display: none; } .pause-text { display: none; } .hud-top { gap: 8px; } .telemetry { transform: scale(.9); transform-origin: top left; } .flight-reticle { transform: translate(-50%, -50%) scale(.82); } .start-card h1 { font-size: clamp(45px, 14vw, 72px); } }
@media (max-height: 540px) and (orientation: landscape) { .hud-top { --safe-top: max(8px, env(safe-area-inset-top)); } .telemetry { top: 65px; } .joystick-zone { width: 112px; height: 112px; } .flight-control { width: 48px; height: 48px; border-radius: 14px; } .flight-control small { font-size: 8px; } .start-card h1 { margin: 9px 0; font-size: clamp(38px, 8vw, 62px); } .start-card p { font-size: 12px; } .start-button { margin-top: 15px; min-height: 45px; } .start-hint { display: none; } }
