:root {
  --bg: #05030c;
  --ink: #eaf7ff;
  --dim: #9fb4c8;
  --cyan: #27f5ff;
  --cyan-soft: #8ffbff;
  --magenta: #ff2bd6;
  --violet: #8e5cff;
  --gold: #ffd166;
  --danger: #ff3b6b;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  touch-action: none;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  position: fixed;
  inset: 0;
}

body { padding: 0; }

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  background: radial-gradient(circle at 50% 20%, #120a2b 0%, #05030c 60%);
}

#scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

.fx { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

#vignette {
  background:
    radial-gradient(ellipse at 50% 46%, transparent 42%, rgba(2, 1, 8, 0.42) 78%, rgba(1, 1, 5, 0.78) 100%);
  mix-blend-mode: multiply;
}

#scanlines {
  opacity: 0.16;
  background: repeating-linear-gradient(to bottom, rgba(160, 240, 255, 0.10) 0 1px, transparent 1px 4px);
  mix-blend-mode: overlay;
}

#bulletVignette {
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: 3;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(20, 120, 190, 0.16) 62%, rgba(10, 240, 255, 0.34) 100%),
    linear-gradient(90deg, rgba(12, 240, 255, 0.28), transparent 18%, transparent 82%, rgba(255, 43, 214, 0.22));
  box-shadow: inset 0 0 120px rgba(18, 226, 255, 0.28);
}
body.bullet-time #bulletVignette { opacity: 1; animation: pulseEdge 0.7s ease-in-out infinite alternate; }
@keyframes pulseEdge { from { filter: brightness(0.85); } to { filter: brightness(1.35); } }

#hitFlash {
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(255, 32, 90, 0.55) 100%);
  transition: opacity 280ms ease;
  z-index: 4;
}
#hitFlash.on { opacity: 1; transition: opacity 40ms ease; }

#stormFlash {
  opacity: 0;
  background: linear-gradient(180deg, rgba(198, 235, 255, 0.95), rgba(106, 152, 255, 0.35) 45%, transparent 78%);
  mix-blend-mode: screen;
  transition: opacity 380ms ease;
  z-index: 2;
}

/* ---------- utility ---------- */
#utility {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  right: calc(var(--safe-right) + 10px);
  display: flex;
  gap: 6px;
  z-index: 30;
}
.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid rgba(160, 226, 255, 0.24);
  background: rgba(8, 12, 24, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font);
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; opacity: 0.9; }
.icon-btn.tiny {
  width: 44px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--cyan-soft);
  font-weight: 700;
}
.icon-btn.muted { color: #ff87a4; border-color: rgba(255, 80, 120, 0.4); }

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  padding: calc(var(--safe-top) + 12px) calc(var(--safe-right) + 14px) calc(var(--safe-bottom) + 14px) calc(var(--safe-left) + 14px);
  display: flex;
  flex-direction: column;
}
.hud-top { display: flex; justify-content: space-between; align-items: flex-start; padding-right: 102px; }
.hud-metric { filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.7)); }
.metric-main { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-main i { font-style: normal; font-size: 11px; color: var(--cyan); margin-left: 4px; letter-spacing: 0.12em; }
.metric-sub { margin-top: 5px; font-size: 10px; letter-spacing: 0.08em; color: var(--dim); text-transform: uppercase; }
.metric-sub b { color: var(--cyan-soft); font-weight: 700; font-variant-numeric: tabular-nums; }
.hud-right { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.mult-badge {
  font-size: 13px;
  font-weight: 800;
  color: #04121a;
  background: linear-gradient(135deg, var(--cyan), #8ef9ff);
  padding: 3px 9px;
  border-radius: 7px;
  box-shadow: 0 0 18px rgba(39, 245, 255, 0.42);
  font-variant-numeric: tabular-nums;
}
.mult-badge.hot { background: linear-gradient(135deg, var(--gold), #fff0b8); box-shadow: 0 0 20px rgba(255, 209, 102, 0.55); }
.storm-pill {
  font-size: 9px;
  letter-spacing: 0.1em;
  padding: 4px 8px;
  color: #ffe7ff;
  border: 1px solid rgba(255, 43, 214, 0.6);
  border-radius: 999px;
  background: rgba(80, 0, 70, 0.42);
  animation: stormPulse 0.8s ease-in-out infinite alternate;
}
@keyframes stormPulse { from { box-shadow: 0 0 0 rgba(255, 43, 214, 0); } to { box-shadow: 0 0 18px rgba(255, 43, 214, 0.48); } }

.bars {
  margin-top: 14px;
  width: min(66%, 270px);
  display: flex;
  flex-direction: column;
  gap: 7px;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.55));
}
.bar-row { width: 100%; }
.bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(224, 245, 255, 0.78);
  margin-bottom: 3px;
  text-transform: uppercase;
}
.bar-label span:last-child { color: var(--cyan-soft); font-variant-numeric: tabular-nums; }
.bar-track {
  height: 5px;
  border-radius: 99px;
  background: rgba(160, 220, 255, 0.14);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(180, 240, 255, 0.1);
}
.bar-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  border-radius: 99px;
  transition: background 220ms linear;
}
.bar-fill.cap { background: linear-gradient(90deg, #1d9bff, var(--cyan)); box-shadow: 0 0 12px rgba(39, 245, 255, 0.7); }
.bar-fill.ovr { background: linear-gradient(90deg, #28ffa8, #b6ff5a); box-shadow: 0 0 10px rgba(90, 255, 160, 0.55); }
.bar-fill.ovr.warn { background: linear-gradient(90deg, #ffb020, var(--danger)); box-shadow: 0 0 14px rgba(255, 59, 107, 0.7); animation: blink 0.42s steps(2, jump-none) infinite; }
.bar-fill.ovr.crit { background: var(--danger); box-shadow: 0 0 18px rgba(255, 40, 90, 0.95); animation: blink 0.2s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0.35; } }

.health-row { display: flex; align-items: center; gap: 7px; margin-top: 2px; }
.health-label { font-size: 9px; letter-spacing: 0.08em; color: rgba(224, 245, 255, 0.55); }
.health-pips { display: flex; gap: 4px; }
.health-pips i { width: 13px; height: 4px; border-radius: 2px; background: rgba(200, 235, 255, 0.16); }
.health-pips i.on { background: var(--cyan); box-shadow: 0 0 8px rgba(39, 245, 255, 0.7); }
.health-pips i.hurt { background: var(--danger); }
.mount-skill { margin-left: auto; font-size: 9px; letter-spacing: 0.04em; color: rgba(180, 225, 250, 0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 145px; }

.combo {
  position: absolute;
  right: calc(var(--safe-right) + 18px);
  top: 34%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-shadow: 0 0 16px rgba(39, 245, 255, 0.7);
  animation: comboIn 260ms cubic-bezier(0.2, 1.5, 0.4, 1);
}
.combo b { font-size: 38px; line-height: 0.9; font-weight: 900; color: var(--cyan); font-style: italic; }
.combo span { font-size: 8px; letter-spacing: 0.24em; color: rgba(220, 250, 255, 0.8); }
@keyframes comboIn { from { transform: scale(1.6) translateX(20px); opacity: 0; } }

.hijack-prompt {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 70px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px 9px 10px;
  border: 1px solid rgba(39, 245, 255, 0.4);
  border-radius: 12px;
  background: rgba(4, 12, 22, 0.66);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 32px rgba(22, 210, 255, 0.22);
  animation: promptIn 180ms ease-out;
  white-space: nowrap;
}
@keyframes promptIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.hijack-prompt > div { display: flex; flex-direction: column; gap: 1px; }
.hijack-prompt b { font-size: 11px; letter-spacing: 0.08em; color: var(--cyan); }
.hijack-prompt em { font-style: normal; font-size: 12px; font-weight: 700; }
.hijack-prompt small { font-size: 8px; color: var(--dim); letter-spacing: 0.03em; }
.reticle-mini {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--cyan);
  box-shadow: inset 0 0 8px rgba(39, 245, 255, 0.4), 0 0 10px rgba(39, 245, 255, 0.4);
  position: relative;
}
.reticle-mini::after { content: ""; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: var(--cyan); inset: 0; margin: auto; }

.toast {
  position: absolute;
  left: 50%;
  top: 26%;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 209, 102, 0.48);
  background: rgba(20, 12, 4, 0.7);
  color: #fff1c7;
  font-size: 11px;
  letter-spacing: 0.06em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toastIn 240ms ease-out;
  white-space: nowrap;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } }

.run-hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 12px);
  transform: translateX(-50%);
  display: flex;
  gap: 14px;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(210, 240, 255, 0.52);
  transition: opacity 700ms ease;
  white-space: nowrap;
}
.run-hint.fade { opacity: 0; }

/* ---------- screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 16px) calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 14px) calc(var(--safe-left) + 16px);
  transition: opacity 260ms ease, visibility 260ms ease;
}
.screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

#menu {
  justify-content: flex-end;
  background: linear-gradient(180deg, rgba(3, 2, 10, 0.06) 0%, rgba(3, 2, 10, 0.12) 34%, rgba(3, 2, 10, 0.82) 100%);
}
.menu-glow {
  position: absolute;
  left: 50%; top: 8%;
  width: 78%; height: 42%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(38, 226, 255, 0.14), rgba(255, 43, 214, 0.07) 46%, transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}
.title-block {
  position: relative;
  margin-bottom: 18px;
  padding-left: 3px;
  text-shadow: 0 3px 30px rgba(0, 0, 0, 0.85);
}
.eyebrow {
  font-size: 8.5px;
  letter-spacing: 0.26em;
  color: rgba(158, 244, 255, 0.72);
  text-transform: uppercase;
  margin-bottom: 7px;
}
h1 {
  font-size: clamp(46px, 14.5vw, 72px);
  line-height: 0.94;
  font-weight: 900;
  letter-spacing: -0.035em;
  background: linear-gradient(100deg, #ffffff 4%, #b8fbff 36%, #4fe6ff 58%, #ff6ae5 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(51, 228, 255, 0.25));
  position: relative;
  width: fit-content;
}
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  background: inherit;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.5;
  pointer-events: none;
}
.glitch::before { transform: translate(-1.5px, 0); color: rgba(255, 43, 214, 0.36); filter: blur(0.4px); }
.glitch::after { transform: translate(1.5px, 0); color: rgba(39, 245, 255, 0.32); }
.subtitle { margin-top: 9px; font-size: 10.5px; color: rgba(205, 231, 246, 0.72); letter-spacing: 0.04em; }

.menu-card {
  position: relative;
  width: 100%;
  border-radius: 20px;
  border: 1px solid rgba(150, 228, 255, 0.18);
  background:
    linear-gradient(150deg, rgba(15, 26, 45, 0.66), rgba(8, 10, 22, 0.78)),
    radial-gradient(circle at 80% 0%, rgba(255, 43, 214, 0.12), transparent 55%);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  padding: 16px;
  box-shadow: 0 -8px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(220, 250, 255, 0.12);
  overflow: hidden;
}
.card-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(120, 240, 255, 0.055) 46%, transparent 60%);
  background-size: 220% 100%;
  animation: scanSweep 7s linear infinite;
  pointer-events: none;
}
@keyframes scanSweep { to { background-position: -220% 0; } }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-head h2 { font-size: 16px; letter-spacing: 0.01em; }
.card-head p { font-size: 10px; margin-top: 4px; color: rgba(190, 218, 235, 0.66); }
.sig { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 7px; letter-spacing: 0.16em; color: rgba(140, 255, 215, 0.65); white-space: nowrap; }
.sig i { width: 6px; height: 6px; border-radius: 50%; background: #35ffb0; box-shadow: 0 0 10px #35ffb0; animation: blink 1.4s ease infinite; }
.sig span { opacity: 0.55; }
.sig b { color: #6dffc5; letter-spacing: 0.2em; }

.gesture-guide { display: flex; flex-direction: column; gap: 1px; margin: 13px 0 14px; }
.gesture { display: flex; align-items: center; gap: 11px; padding: 7px 2px; }
.gesture + .gesture { border-top: 1px solid rgba(150, 220, 255, 0.07); }
.g-icon {
  width: 34px; height: 34px; flex: 0 0 auto;
  border-radius: 10px;
  display: grid; place-items: center;
  color: var(--cyan);
  background: rgba(39, 245, 255, 0.07);
  border: 1px solid rgba(39, 245, 255, 0.2);
}
.g-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gesture b { display: block; font-size: 11.5px; letter-spacing: 0.02em; }
.gesture small { display: block; margin-top: 2px; font-size: 9px; color: rgba(180, 208, 228, 0.62); letter-spacing: 0.01em; }

.start-btn {
  position: relative;
  width: 100%;
  min-height: 60px;
  border-radius: 14px;
  border: 1px solid rgba(180, 252, 255, 0.6);
  background: linear-gradient(112deg, #18d7e8 0%, #42f4ff 42%, #b6fbff 100%);
  color: #031217;
  padding: 9px 54px 10px 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(12, 70, 80, 0.3), 0 9px 34px rgba(14, 220, 255, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: transform 140ms ease, box-shadow 180ms ease;
  pointer-events: auto;
  touch-action: manipulation;
}
.start-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.5) 45%, transparent 58%);
  transform: translateX(-120%);
  animation: btnSheen 3.6s ease-in-out infinite;
}
@keyframes btnSheen { 0%, 55% { transform: translateX(-120%); } 78%, 100% { transform: translateX(120%); } }
.start-btn:active { transform: scale(0.985); box-shadow: 0 0 0 1px rgba(12, 70, 80, 0.3), 0 2px 12px rgba(14, 220, 255, 0.24); }
.start-tag { font-size: 7.5px; letter-spacing: 0.24em; font-weight: 700; opacity: 0.62; }
.start-main { font-size: 20px; font-weight: 900; letter-spacing: 0.07em; }
.start-main em { font-style: normal; font-size: 10px; letter-spacing: 0.12em; opacity: 0.62; margin-left: 5px; }
.start-arrow { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 26px; font-weight: 300; }
.start-btn.compact { min-height: 54px; }

.desktop-hint { display: none; font-size: 9px; line-height: 1.6; color: rgba(170, 215, 235, 0.55); letter-spacing: 0.02em; margin: 10px 0 0; }
.menu-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid rgba(160, 220, 250, 0.2);
  background: rgba(140, 210, 255, 0.05);
  color: rgba(225, 245, 255, 0.9);
  font-size: 10px;
  font-family: var(--font);
  letter-spacing: 0.03em;
  cursor: pointer;
  pointer-events: auto;
  transition: background 160ms ease, border-color 160ms ease;
}
.ghost-btn:active { background: rgba(140, 210, 255, 0.12); }
.ghost-btn svg { width: 14px; height: 14px; fill: currentColor; opacity: 0.7; }
.ghost-btn b { color: var(--cyan); font-size: 9px; }
.ghost-btn.wide { width: 100%; }
.menu-tip { font-size: 8px; color: rgba(170, 198, 218, 0.44); letter-spacing: 0.03em; text-align: right; }

/* ---------- end screen ---------- */
.end-screen { justify-content: center; align-items: center; background: radial-gradient(ellipse at 50% 40%, rgba(20, 10, 40, 0.35), rgba(3, 2, 10, 0.9)); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.end-card {
  width: min(100%, 420px);
  border-radius: 20px;
  border: 1px solid rgba(180, 235, 255, 0.18);
  background: linear-gradient(155deg, rgba(16, 22, 40, 0.92), rgba(7, 8, 18, 0.94));
  padding: 22px 18px 16px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(220, 250, 255, 0.12);
}
.end-card h2 { font-size: 30px; letter-spacing: 0.02em; line-height: 1; }
.end-reason { font-size: 10.5px; color: rgba(190, 216, 235, 0.65); margin-top: 8px; line-height: 1.6; }
.end-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 12px;
}
.end-stats > div {
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(120, 200, 255, 0.055);
  border: 1px solid rgba(140, 220, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.end-stats span { font-size: 8px; letter-spacing: 0.12em; color: rgba(180, 210, 230, 0.55); }
.end-stats b { font-size: 17px; font-variant-numeric: tabular-nums; color: #e9fbff; }
.end-stats b i { font-style: normal; font-size: 9px; color: var(--cyan); }
.end-unlock {
  font-size: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.08);
  border: 1px solid rgba(255, 209, 102, 0.24);
  color: #ffedbd;
  margin-bottom: 12px;
}
.end-unlock b { color: var(--gold); }
.end-actions { display: flex; flex-direction: column; gap: 8px; }
.end-record { margin-top: 12px; font-size: 8px; letter-spacing: 0.02em; color: rgba(160, 190, 210, 0.45); text-align: center; }
.end-record b { color: rgba(39, 245, 255, 0.75); }

/* ---------- garage drawer ---------- */
.drawer-wrap { position: absolute; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(2, 1, 8, 0.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn 180ms ease; }
@keyframes fadeIn { from { opacity: 0; } }
.drawer {
  position: relative;
  width: min(100%, 520px);
  max-height: min(88vh, 800px);
  max-height: min(88dvh, 800px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(150, 225, 255, 0.2);
  border-bottom: none;
  background: linear-gradient(170deg, #101a2c 0%, #080a16 45%, #06060e 100%);
  padding: 18px 16px calc(14px + var(--safe-bottom));
  box-shadow: 0 -30px 80px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(220, 250, 255, 0.12);
  animation: sheetUp 280ms cubic-bezier(0.2, 0.9, 0.3, 1);
  touch-action: pan-y;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0.4; } }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; }
.drawer-head h2 { font-size: 22px; }
.drawer-close {
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid rgba(160, 220, 250, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(230, 248, 255, 0.8);
  font-size: 13px;
  cursor: pointer;
  pointer-events: auto;
}
.drawer-sub { font-size: 9.5px; color: rgba(180, 208, 228, 0.6); line-height: 1.6; margin: 7px 0 13px; }
.garage-list { display: flex; flex-direction: column; gap: 8px; }
.mount-card {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border-radius: 13px;
  border: 1px solid rgba(140, 210, 250, 0.12);
  background: rgba(120, 190, 255, 0.045);
  position: relative;
  overflow: hidden;
}
.mount-card.unlocked { border-color: rgba(39, 245, 255, 0.24); background: linear-gradient(100deg, rgba(39, 245, 255, 0.08), rgba(120, 190, 255, 0.03)); }
.mount-card.selected { border-color: rgba(255, 209, 102, 0.6); box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.24); }
.mount-card.locked { opacity: 0.55; }
.mount-icon {
  width: 46px; height: 46px;
  border-radius: 11px;
  display: grid; place-items: center;
  border: 1px solid rgba(39, 245, 255, 0.22);
  background: radial-gradient(circle at 50% 35%, rgba(39, 245, 255, 0.16), rgba(8, 14, 24, 0.5));
  color: var(--cyan);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.05em;
}
.mount-card.locked .mount-icon { color: #6f7c91; border-color: rgba(160, 190, 220, 0.14); }
.mount-body b { display: block; font-size: 12px; letter-spacing: 0.01em; }
.mount-body b small { font-weight: 500; font-size: 8px; color: rgba(160, 220, 250, 0.5); margin-left: 5px; letter-spacing: 0.08em; }
.mount-body p { font-size: 9px; color: rgba(180, 208, 228, 0.62); line-height: 1.5; margin-top: 3px; }
.mount-stats { display: flex; gap: 7px; margin-top: 4px; font-size: 7.5px; color: rgba(150, 230, 255, 0.5); letter-spacing: 0.03em; }
.mini-btn {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(39, 245, 255, 0.3);
  background: rgba(39, 245, 255, 0.09);
  color: #c9fbff;
  font-size: 9px;
  font-family: var(--font);
  cursor: pointer;
  pointer-events: auto;
  white-space: nowrap;
}
.mini-btn:disabled { opacity: 0.4; border-color: rgba(160, 190, 220, 0.15); background: rgba(160, 190, 220, 0.04); color: #9aa7b8; }
.mini-btn.primary { background: linear-gradient(100deg, #22d9e8, #6ef6ff); color: #041419; border-color: transparent; font-weight: 800; }
.mini-btn.on { border-color: rgba(255, 209, 102, 0.65); color: #ffe9ad; background: rgba(255, 209, 102, 0.1); }
.boot-option {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 9px; padding: 10px 11px;
  border-radius: 12px;
  border: 1px dashed rgba(160, 200, 230, 0.18);
  background: rgba(140, 190, 230, 0.035);
}
.boot-option b { font-size: 11px; display: block; }
.boot-option small { font-size: 8.5px; color: rgba(170, 200, 220, 0.55); }
.drawer-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 13px; }
.drawer-foot span { font-size: 8px; color: rgba(160, 190, 210, 0.4); }

.rotate-hint {
  position: absolute;
  left: 50%; bottom: calc(var(--safe-bottom) + 14px);
  transform: translateX(-50%);
  z-index: 45;
  font-size: 9px; color: rgba(220, 245, 255, 0.7);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(39, 245, 255, 0.25);
  background: rgba(4, 10, 18, 0.7);
  backdrop-filter: blur(8px);
}

.hidden { display: none !important; }
.desktop-only { display: none; }

/* ---------- desktop / landscape ---------- */
@media (min-aspect-ratio: 4/3) {
  .mobile-only { display: none !important; }
  .desktop-only { display: inline !important; }
  #menu {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 440px);
    align-items: center;
    gap: 40px;
    padding: 32px clamp(30px, 5vw, 80px);
    background: linear-gradient(90deg, rgba(3, 2, 10, 0.52) 0%, rgba(3, 2, 10, 0.08) 46%, rgba(3, 2, 10, 0.52) 100%);
  }
  .title-block { margin: 0 0 40px; align-self: end; padding-left: 2px; }
  h1 { font-size: clamp(68px, 10.5vw, 132px); }
  .subtitle { font-size: 13px; max-width: 500px; line-height: 1.7; }
  .eyebrow { font-size: 10px; }
  .menu-card { align-self: end; margin-bottom: 32px; padding: 20px; }
  .menu-glow { left: 25%; top: 20%; width: 50%; height: 60%; }
  .gesture { padding: 8px 2px; }
  .gesture b { font-size: 13px; }
  .gesture small { font-size: 10px; }
  .desktop-hint { display: block; }
  .start-btn { min-height: 66px; }
  .metric-main { font-size: 38px; }
  .metric-sub { font-size: 11px; }
  .bars { width: min(40%, 340px); margin-top: 16px; }
  .bar-label { font-size: 10px; }
  .bar-track { height: 6px; }
  .mount-skill { font-size: 10px; max-width: 190px; }
  .health-label { font-size: 10px; }
  #utility { top: calc(var(--safe-top) + 14px); right: calc(var(--safe-right) + 18px); }
  .hijack-prompt { bottom: calc(var(--safe-bottom) + 60px); }
  .run-hint { font-size: 10px; }
  .drawer { border-radius: 22px; margin-bottom: 4vh; max-width: 620px; }
  .drawer-wrap { align-items: center; }
  .end-card { width: min(100%, 480px); padding: 28px 24px 20px; }
  .end-card h2 { font-size: 36px; }
}

@media (min-aspect-ratio: 4/3) and (min-width: 1100px) {
  #menu { grid-template-columns: minmax(0, 1.2fr) 440px; }
  .title-block { align-self: center; }
  .menu-card { align-self: center; margin-bottom: 0; }
}

@media (max-height: 700px) {
  .title-block { margin-bottom: 10px; }
  h1 { font-size: clamp(38px, 11.5vh, 56px); }
  .subtitle { font-size: 9px; margin-top: 5px; }
  .menu-card { padding: 12px; border-radius: 16px; }
  .gesture-guide { margin: 8px 0 9px; }
  .gesture { padding: 4px 2px; }
  .g-icon { width: 28px; height: 28px; }
  .gesture b { font-size: 10.5px; }
  .gesture small { font-size: 8px; }
  .start-btn { min-height: 52px; }
  .start-main { font-size: 17px; }
  .card-head p { display: none; }
  .menu-foot { margin-top: 7px; }
  .menu-tip { display: none; }
}

@media (max-height: 560px) and (min-aspect-ratio: 4/3) {
  #menu { grid-template-columns: minmax(0, 1fr) 390px; padding: 12px 22px; gap: 24px; }
  .title-block { margin: 0; align-self: center; }
  h1 { font-size: 54px; }
  .eyebrow { font-size: 7.5px; margin-bottom: 4px; }
  .subtitle { display: none; }
  .menu-card { padding: 10px 12px; margin: 0; align-self: center; }
  .card-head p { display: none; }
  .gesture-guide { margin: 6px 0 8px; }
  .gesture { padding: 3px 2px; gap: 8px; }
  .gesture b { font-size: 10.5px; }
  .gesture small { display: none; }
  .g-icon { width: 27px; height: 27px; border-radius: 8px; }
  .g-icon svg { width: 17px; height: 17px; }
  .desktop-hint { display: none; }
  .start-btn { min-height: 52px; }
  .start-main { font-size: 18px; }
  .menu-foot { margin-top: 6px; }
  .end-screen { overflow-y: auto; justify-content: flex-start; padding-top: 14px; }
  .end-card { padding: 14px 16px 12px; }
  .end-card h2 { font-size: 25px; }
  .end-reason { font-size: 9.5px; margin-top: 4px; }
  .end-stats { margin: 10px 0 8px; gap: 6px; }
  .end-stats > div { padding: 6px 8px; }
  .end-stats b { font-size: 15px; }
  .end-actions { gap: 6px; }
  .end-record { display: none; }
}

@media (max-width: 360px) {
  .title-block { margin-bottom: 12px; }
  h1 { font-size: 42px; }
  .gesture small { font-size: 8px; }
  .gesture { gap: 8px; }
  .menu-card { padding: 13px; }
  .metric-main { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after, .card-scan, .start-btn::after, .storm-pill, .bar-fill.ovr.warn, .bar-fill.ovr.crit { animation: none !important; }
}
