/* ==========================================================================
   NEON BREACH // 霓虹突围
   UI shell — all visuals are CSS + native canvas, no external assets.
   ========================================================================== */

:root {
  --bg: #04070f;
  --bg-soft: #07101d;
  --panel: rgba(7, 16, 29, 0.82);
  --panel-solid: #08111f;
  --line: rgba(104, 232, 255, 0.18);
  --line-strong: rgba(104, 232, 255, 0.42);
  --cyan: #5ef4ff;
  --cyan-hot: #b9fbff;
  --blue: #2f8cff;
  --magenta: #ff3d9a;
  --orange: #ffb45c;
  --green: #7dffb2;
  --red: #ff5c6c;
  --text: #eafcff;
  --muted: #7f9caf;
  --dim: #43586b;
  --display: "Bahnschrift", "DIN Alternate", "Arial Narrow", "Microsoft YaHei", sans-serif;
  --body: "Bahnschrift", "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SFMono-Regular", monospace;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button { font-family: inherit; }

#app {
  position: fixed;
  inset: 0;
  isolation: isolate;
  background:
    radial-gradient(circle at 75% 32%, rgba(35, 112, 190, 0.12), transparent 44%),
    radial-gradient(circle at 18% 78%, rgba(134, 28, 101, 0.13), transparent 42%),
    var(--bg);
}

#game {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  z-index: 1;
  touch-action: none;
  cursor: crosshair;
}

body.is-playing #game { cursor: none; }

/* ---------- full-screen atmosphere ---------- */

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

.fx-scanlines {
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.018) 0px,
    rgba(255, 255, 255, 0.018) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  opacity: 0.8;
}

.fx-vignette {
  background:
    radial-gradient(ellipse at 50% 50%, transparent 52%, rgba(0, 0, 0, 0.46) 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent 12%, transparent 88%, rgba(0, 0, 0, 0.5));
}

.fx-grain {
  opacity: 0.045;
  background-image:
    radial-gradient(rgba(255,255,255,0.9) 0.5px, transparent 0.6px),
    radial-gradient(rgba(255,255,255,0.6) 0.5px, transparent 0.6px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 2px;
  animation: grain-shift 0.5s steps(2) infinite;
}

@keyframes grain-shift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1px, 1px); }
  50% { transform: translate(1px, 0); }
  75% { transform: translate(0, -1px); }
  100% { transform: translate(0, 0); }
}

#damage-flash {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(255, 26, 74, 0.5) 100%);
}

#damage-flash.flash { animation: damage-flash 0.38s ease-out; }

@keyframes damage-flash {
  0% { opacity: 0.95; }
  100% { opacity: 0; }
}

/* ---------- utility ---------- */

.is-hidden { display: none !important; }

kbd {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(112, 226, 255, 0.28);
  border-bottom-color: rgba(112, 226, 255, 0.14);
  border-radius: 3px;
  background: rgba(11, 31, 49, 0.72);
  color: #b9e9f4;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
  letter-spacing: 0.03em;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   HUD
   ========================================================================== */

.hud {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  padding:
    calc(20px + env(safe-area-inset-top))
    calc(26px + env(safe-area-inset-right))
    calc(18px + env(safe-area-inset-bottom))
    calc(26px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.hud-top {
  display: flex;
  align-items: flex-start;
  gap: clamp(18px, 4vw, 56px);
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(94, 244, 255, 0.12);
  position: relative;
}

.hud-top::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 150px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  box-shadow: 0 0 12px var(--cyan);
}

.mini-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(224, 250, 255, 0.82);
}

.mini-brand em {
  color: var(--cyan);
  font-style: normal;
  margin-left: 3px;
  text-shadow: 0 0 14px rgba(94, 244, 255, 0.55);
}

.mini-brand-glyph {
  width: 18px;
  height: 18px;
  border: 1px solid var(--cyan);
  transform: rotate(45deg);
  position: relative;
  box-shadow: 0 0 12px rgba(94, 244, 255, 0.4), inset 0 0 8px rgba(94, 244, 255, 0.2);
}

.mini-brand-glyph::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--cyan);
  opacity: 0.8;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 66px;
}

.hud-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.hud-value {
  font-family: var(--display);
  font-size: clamp(20px, 2.2vw, 30px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: 0.06em;
  color: #eaffff;
  text-shadow: 0 0 18px rgba(94, 244, 255, 0.3);
}

.hud-sub {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--dim);
  white-space: nowrap;
}

.hud-wave .hud-value { color: var(--cyan); }
.hud-score { min-width: 120px; }
.hud-best .hud-value { color: rgba(179, 207, 220, 0.72); font-size: 16px; padding-top: 3px; }

.icon-btn {
  pointer-events: auto;
  width: 36px;
  height: 36px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(94, 244, 255, 0.24);
  background: rgba(7, 20, 33, 0.6);
  cursor: pointer;
  color: var(--cyan);
  transition: background 0.2s, border-color 0.2s;
}

.icon-btn:hover { background: rgba(18, 50, 72, 0.72); border-color: var(--cyan); }
.icon-btn span { display: block; width: 3px; height: 11px; background: currentColor; }

/* boss bar */

.boss-bar {
  align-self: center;
  width: min(560px, 60vw);
  margin-top: 22px;
  animation: boss-in 0.55s var(--ease) both;
}

@keyframes boss-in {
  from { opacity: 0; transform: translateY(-8px) scaleX(0.9); }
  to { opacity: 1; transform: none; }
}

.boss-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 7px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.13em;
  color: var(--magenta);
}

.boss-meta #boss-name {
  color: #ffd8ea;
  font-weight: 700;
  margin-right: auto;
}

.boss-tag { opacity: 0.8; display: inline-flex; align-items: center; gap: 6px; }

.boss-sigil {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
  box-shadow: 0 0 8px currentColor;
  position: relative;
}

.boss-sigil::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: currentColor;
}
#boss-hp-text { font-variant-numeric: tabular-nums; }

.boss-track {
  height: 7px;
  background: rgba(255, 61, 154, 0.12);
  border: 1px solid rgba(255, 61, 154, 0.3);
  padding: 1px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}

.boss-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff2b78, #ff77b5);
  box-shadow: 0 0 16px rgba(255, 61, 154, 0.72);
  transition: width 0.18s ease-out;
}

/* bottom HUD */

.hud-bottom {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.vitals-panel {
  width: min(290px, 40vw);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.vital-row {
  display: grid;
  grid-template-columns: 42px 1fr 40px;
  align-items: center;
  gap: 9px;
}

.vital-label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.vital-track {
  height: 9px;
  padding: 1px;
  border: 1px solid rgba(94, 244, 255, 0.2);
  background: rgba(4, 12, 21, 0.6);
  clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}

.vital-fill {
  height: 100%;
  width: 100%;
  transition: width 0.18s ease-out;
}

.vital-fill.hull {
  background: linear-gradient(90deg, #ff3d66, #ff8a7d);
  box-shadow: 0 0 10px rgba(255, 80, 100, 0.55);
}

.vital-fill.shield {
  background: linear-gradient(90deg, #1a7bff, #5ef4ff);
  box-shadow: 0 0 10px rgba(94, 244, 255, 0.5);
}

.vital-text {
  font-family: var(--mono);
  font-size: 10px;
  color: #b9dce8;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.combo-row {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 3px;
  height: 16px;
}

.combo-label {
  width: 42px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.combo-value {
  min-width: 38px;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--orange);
  opacity: 0.45;
  transition: opacity 0.2s, transform 0.2s;
}

.combo-value.active { opacity: 1; text-shadow: 0 0 12px rgba(255, 180, 92, 0.7); transform: scale(1.04); }

.combo-track {
  flex: 1;
  max-width: 120px;
  height: 2px;
  background: rgba(255, 180, 92, 0.15);
}

.combo-fill {
  height: 100%;
  width: 0;
  background: var(--orange);
  box-shadow: 0 0 8px var(--orange);
}

.ability-panel {
  display: flex;
  gap: 18px;
  align-items: flex-end;
}

.ability {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.92;
}

.ability-key {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border: 1px solid rgba(94, 244, 255, 0.3);
  background: rgba(7, 22, 35, 0.72);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--cyan);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px);
}

.ability-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 84px;
}

.ability-name {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #a9c8d5;
  white-space: nowrap;
}

.ability-track {
  height: 3px;
  width: 100%;
  background: rgba(94, 244, 255, 0.12);
}

.ability-fill {
  height: 100%;
  width: 100%;
  transition: width 0.1s linear;
}

.ability-fill.dash { background: var(--cyan); box-shadow: 0 0 8px rgba(94, 244, 255, 0.7); }
.ability-fill.emp { background: var(--magenta); box-shadow: 0 0 8px rgba(255, 61, 154, 0.7); width: 0; }
.ability-fill.skill { background: var(--skill-color, var(--magenta)); box-shadow: 0 0 8px var(--skill-color, var(--magenta)); width: 100%; }

#skill-ability .ability-key {
  border-color: color-mix(in srgb, var(--skill-color, var(--magenta)) 50%, transparent);
  color: var(--skill-color, var(--magenta));
}

#skill-ability .ability-name { color: var(--skill-color, var(--magenta)); }

.emp-ready {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  color: var(--magenta);
  padding: 2px 4px;
  border: 1px solid rgba(255, 61, 154, 0.5);
  animation: ready-pulse 1.1s ease-in-out infinite;
}

@keyframes ready-pulse {
  50% { opacity: 0.4; box-shadow: 0 0 12px rgba(255, 61, 154, 0.35); }
}

.hud-hint {
  position: absolute;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 18px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  color: rgba(127, 156, 175, 0.55);
  white-space: nowrap;
}

.hud-hint span { display: inline-flex; align-items: center; gap: 5px; }
.hud-hint kbd { height: 17px; min-width: 17px; font-size: 8px; }

/* wave banner */

.wave-banner {
  position: absolute;
  left: 50%;
  top: 31%;
  transform: translate(-50%, -50%);
  min-width: 360px;
  padding: 18px 60px 16px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(4, 14, 24, 0.85) 18%, rgba(4, 14, 24, 0.85) 82%, transparent);
  border-top: 1px solid rgba(94, 244, 255, 0.35);
  border-bottom: 1px solid rgba(94, 244, 255, 0.18);
}

.wave-banner.show { animation: banner 2.6s var(--ease) both; }

.wave-banner-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.42em;
  color: var(--magenta);
  margin-bottom: 7px;
}

.wave-banner strong {
  display: block;
  font-family: var(--display);
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--cyan-hot);
  text-shadow: 0 0 28px rgba(94, 244, 255, 0.65);
}

.wave-banner-sub {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

@keyframes banner {
  0% { opacity: 0; transform: translate(-50%, -46%) scaleX(0.82); filter: blur(5px); }
  12% { opacity: 1; transform: translate(-50%, -50%) scaleX(1); filter: blur(0); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scaleX(1.03); }
}

/* toast */

.toast {
  position: absolute;
  left: 50%;
  bottom: 118px;
  transform: translate(-50%, 8px);
  padding: 7px 16px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--cyan-hot);
  background: rgba(5, 18, 29, 0.9);
  border: 1px solid rgba(94, 244, 255, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   OVERLAYS / MENU
   ========================================================================== */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 3vw, 42px);
}

.overlay-start {
  background:
    linear-gradient(90deg, rgba(3, 8, 16, 0.9) 0%, rgba(3, 8, 16, 0.62) 48%, rgba(3, 8, 16, 0.28) 100%),
    radial-gradient(ellipse at 70% 45%, rgba(20, 92, 140, 0.16), transparent 52%);
  backdrop-filter: blur(1.5px);
  overflow-y: auto;
  align-items: stretch;
}

.start-frame {
  width: min(1240px, 100%);
  min-width: 0;
  margin: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  min-height: min(760px, calc(100vh - 84px));
  position: relative;
}

.start-frame::before,
.start-frame::after {
  content: "";
  position: absolute;
  width: 56px;
  height: 56px;
  pointer-events: none;
  border-color: rgba(94, 244, 255, 0.4);
  border-style: solid;
}

.start-frame::before { top: -14px; left: -14px; border-width: 1px 0 0 1px; }
.start-frame::after { bottom: -14px; right: -14px; border-width: 0 1px 1px 0; }

.menu-topline {
  display: flex;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(94, 244, 255, 0.14);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.signal { display: flex; align-items: center; gap: 4px; color: var(--green); opacity: 0.8; }
.signal i { width: 12px; height: 2px; background: currentColor; display: block; }
.signal i:nth-child(2) { opacity: 0.65; }
.signal i:nth-child(3) { opacity: 0.35; }

.menu-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.72fr);
  gap: clamp(32px, 6vw, 100px);
  align-items: center;
  flex: 1;
  padding: 20px 8px;
  min-width: 0;
}

.hero { max-width: 680px; min-width: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--cyan);
  margin-bottom: 15px;
}

.eyebrow span {
  width: 28px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

.title {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(66px, 10.5vw, 154px);
  font-weight: 800;
  line-height: 0.78;
  letter-spacing: -0.035em;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-transform: uppercase;
}

.title-neon {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(94, 244, 255, 0.9);
  text-shadow:
    0 0 28px rgba(94, 244, 255, 0.28),
    3px 0 0 rgba(255, 61, 154, 0.18),
    -3px 0 0 rgba(47, 140, 255, 0.16);
  position: relative;
}

.title-neon::after {
  content: "NEON";
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255, 61, 154, 0.22);
  transform: translate(5px, 2px);
  z-index: -1;
  clip-path: polygon(0 28%, 100% 28%, 100% 43%, 0 43%);
}

.title-solid {
  background: linear-gradient(180deg, #f4ffff 8%, #a9f6ff 48%, #44c9df 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(94, 244, 255, 0.25));
  letter-spacing: -0.04em;
}

.title-rule {
  width: min(100%, 480px);
  height: 1px;
  margin: 20px 0 12px;
  background: linear-gradient(90deg, var(--cyan), rgba(94, 244, 255, 0.05));
  position: relative;
}

.title-rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: -2px;
  width: 5px;
  height: 5px;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
}

.cn-title {
  margin: 0 0 20px;
  font-size: clamp(16px, 1.8vw, 22px);
  font-weight: 500;
  letter-spacing: 0.55em;
  color: #d8f9ff;
  opacity: 0.86;
}

.lede {
  max-width: 500px;
  margin: 0 0 24px;
  font-size: 13px;
  line-height: 1.9;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* active skill loadout */

.loadout {
  width: min(100%, 560px);
  margin: 0 0 22px;
}

.loadout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.loadout-key {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(94, 244, 255, 0.3);
  color: var(--cyan);
  font-size: 9px;
}

.skill-select {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.skill-chip {
  --chip-accent: var(--cyan);
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(94, 244, 255, 0.15);
  background: rgba(8, 23, 37, 0.6);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease);
}

.skill-chip[data-skill="nova"] { --chip-accent: var(--magenta); }
.skill-chip[data-skill="chrono"] { --chip-accent: var(--cyan); }
.skill-chip[data-skill="aegis"] { --chip-accent: var(--green); }

.skill-chip:hover {
  border-color: rgba(94, 244, 255, 0.4);
  background: rgba(15, 42, 60, 0.7);
  transform: translateY(-2px);
}

.skill-chip.is-active {
  border-color: var(--chip-accent);
  background: linear-gradient(140deg, rgba(24, 58, 76, 0.85), rgba(7, 20, 32, 0.8));
  box-shadow: inset 0 0 20px rgba(94, 244, 255, 0.06);
}

.skill-chip-icon {
  flex: 0 0 auto;
  width: 20px;
  text-align: center;
  color: var(--chip-accent);
  font-size: 18px;
  line-height: 1;
}

.skill-chip-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.skill-chip-text b {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #dffaff;
  white-space: nowrap;
}
.skill-chip-text em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 8px;
  letter-spacing: 0.04em;
  color: var(--dim);
  white-space: nowrap;
}

.skill-desc {
  margin: 8px 0 0;
  min-height: 17px;
  font-size: 10px;
  line-height: 1.65;
  letter-spacing: 0.02em;
  color: var(--dim);
}

.start-actions {
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}

.btn-primary {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
  padding: 0 22px 0 28px;
  border: 1px solid rgba(94, 244, 255, 0.9);
  background: linear-gradient(100deg, rgba(17, 99, 123, 0.8), rgba(12, 44, 62, 0.82));
  color: var(--cyan-hot);
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  box-shadow: 0 0 24px rgba(94, 244, 255, 0.12), inset 0 0 26px rgba(94, 244, 255, 0.06);
  transition: background 0.2s, box-shadow 0.2s, color 0.2s;
}

.btn-primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(94, 244, 255, 0.22), transparent 55%);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(100deg, rgba(26, 148, 176, 0.9), rgba(17, 63, 84, 0.9));
  box-shadow: 0 0 38px rgba(94, 244, 255, 0.28), inset 0 0 26px rgba(94, 244, 255, 0.12);
}

.btn-primary:hover::before { opacity: 1; }

.btn-primary:active { transform: translateY(1px); }

.btn-text {
  position: relative;
  z-index: 1;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.btn-key {
  position: relative;
  z-index: 1;
  padding-left: 22px;
  border-left: 1px solid rgba(94, 244, 255, 0.28);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(94, 244, 255, 0.62);
}

.btn-corner {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  z-index: 2;
}

.btn-corner.tl { top: -1px; left: -1px; }
.btn-corner.br { bottom: -1px; right: -1px; }

.best-line {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.best-line b {
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.12em;
  color: rgba(226, 251, 255, 0.74);
  font-variant-numeric: tabular-nums;
}

.brief {
  position: relative;
  padding: 22px 24px 20px;
  border: 1px solid rgba(94, 244, 255, 0.16);
  background:
    linear-gradient(160deg, rgba(10, 29, 45, 0.68), rgba(5, 13, 23, 0.5)),
    repeating-linear-gradient(0deg, transparent 0 23px, rgba(94, 244, 255, 0.025) 23px 24px);
  backdrop-filter: blur(8px);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}

.brief::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44%;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

.brief-head {
  display: flex;
  justify-content: space-between;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(94, 244, 255, 0.13);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--cyan);
}

.brief-head span:last-child { color: var(--dim); }

.control-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 6px;
}

.control-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(94, 244, 255, 0.07);
}

.control-row:last-child { border-bottom: 0; }

.keys { display: flex; gap: 3px; align-items: center; }
.keys kbd { min-width: 19px; height: 19px; padding: 0 4px; font-size: 8px; }
.keys kbd:first-child { margin-left: 0; }

.control-row > div:last-child { display: flex; flex-direction: column; gap: 3px; }

.control-row b {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  color: #d9f4fb;
}

.control-row span {
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.02em;
}

.mouse-icon {
  width: 15px;
  height: 22px;
  margin-left: 3px;
  border: 1px solid rgba(94, 244, 255, 0.42);
  border-radius: 8px;
  position: relative;
  display: block;
}

.mouse-icon::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4px;
  width: 1px;
  height: 5px;
  background: var(--cyan);
  transform: translateX(-50%);
}

.mouse-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  height: 9px;
  background: rgba(94, 244, 255, 0.22);
  transform: translateX(-50%);
}

.brief-tip {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  padding: 11px;
  background: rgba(255, 61, 154, 0.055);
  border-left: 1px solid rgba(255, 61, 154, 0.55);
}

.tip-mark {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 61, 154, 0.6);
  color: var(--magenta);
  font-family: var(--mono);
  font-size: 9px;
}

.brief-tip p {
  margin: 0;
  font-size: 10px;
  line-height: 1.75;
  color: #8c9faf;
  letter-spacing: 0.02em;
}

.mobile-note {
  display: none;
  margin-top: 14px;
  font-size: 10px;
  line-height: 1.7;
  color: var(--cyan);
  opacity: 0.7;
}

.menu-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 13px;
  border-top: 1px solid rgba(94, 244, 255, 0.1);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: rgba(67, 88, 107, 0.8);
}

.footer-center { color: rgba(94, 244, 255, 0.36); }

/* ==========================================================================
   MODALS
   ========================================================================== */

.overlay-modal {
  z-index: 30;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(6, 18, 32, 0.72), rgba(2, 5, 11, 0.9)),
    rgba(2, 5, 11, 0.66);
  backdrop-filter: blur(7px);
}

.modal {
  width: min(880px, 100%);
  padding: clamp(26px, 4vw, 48px);
  position: relative;
  border: 1px solid rgba(94, 244, 255, 0.2);
  background:
    linear-gradient(150deg, rgba(11, 29, 46, 0.95), rgba(5, 12, 22, 0.97));
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6), inset 0 0 80px rgba(45, 132, 180, 0.05);
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
  animation: modal-in 0.4s var(--ease) both;
}

.modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 44%;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-kicker {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--cyan);
  margin-bottom: 12px;
}

.modal-kicker.danger { color: var(--magenta); }

.modal-title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(30px, 4.4vw, 50px);
  line-height: 1;
  letter-spacing: 0.08em;
  color: #effeff;
  text-shadow: 0 0 26px rgba(94, 244, 255, 0.26);
}

.modal-sub {
  margin: 0 0 28px;
  max-width: 580px;
  font-size: 12px;
  line-height: 1.8;
  letter-spacing: 0.03em;
  color: var(--muted);
}

/* upgrade cards */

.upgrade-modal { width: min(980px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }

.upgrade-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.upgrade-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 238px;
  padding: 21px 19px 18px;
  border: 1px solid rgba(94, 244, 255, 0.16);
  background:
    linear-gradient(165deg, rgba(14, 40, 58, 0.72), rgba(5, 14, 24, 0.86));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
  transition: border-color 0.2s, transform 0.25s var(--ease), background 0.2s;
  overflow: hidden;
}

.upgrade-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(94, 244, 255, 0.1), transparent 48%);
  opacity: 0;
  transition: opacity 0.2s;
}

.upgrade-card:hover,
.upgrade-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(94, 244, 255, 0.66);
  outline: none;
  background: linear-gradient(165deg, rgba(21, 59, 80, 0.9), rgba(6, 18, 30, 0.94));
}

.upgrade-card:hover::before { opacity: 1; }

.upgrade-card.rarity-rare { border-color: rgba(255, 61, 154, 0.35); }
.upgrade-card.rarity-rare:hover { border-color: rgba(255, 61, 154, 0.85); }
.upgrade-card.rarity-rare::before { background: linear-gradient(140deg, rgba(255, 61, 154, 0.12), transparent 48%); }

.upgrade-card.rarity-epic { border-color: rgba(255, 180, 92, 0.37); }
.upgrade-card.rarity-epic:hover { border-color: rgba(255, 180, 92, 0.9); }
.upgrade-card.rarity-epic::before { background: linear-gradient(140deg, rgba(255, 180, 92, 0.13), transparent 48%); }

.card-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.card-index {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--dim);
  border: 1px solid rgba(94, 244, 255, 0.18);
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
}

.card-rarity {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--cyan);
  opacity: 0.8;
}

.rarity-rare .card-rarity { color: var(--magenta); }
.rarity-epic .card-rarity { color: var(--orange); }

.card-icon {
  width: 42px;
  height: 42px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(94, 244, 255, 0.25);
  background: rgba(94, 244, 255, 0.055);
  color: var(--cyan);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
}

.rarity-rare .card-icon { border-color: rgba(255, 61, 154, 0.35); background: rgba(255, 61, 154, 0.06); color: #ff9cce; }
.rarity-epic .card-icon { border-color: rgba(255, 180, 92, 0.38); background: rgba(255, 180, 92, 0.07); color: var(--orange); }

.card-name {
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.card-en {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.16em;
  color: var(--dim);
  margin-bottom: 13px;
  text-transform: uppercase;
}

.card-desc {
  font-size: 11px;
  line-height: 1.74;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.card-max {
  margin-top: auto;
  padding-top: 16px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  color: rgba(255, 180, 92, 0.72);
  position: relative;
  z-index: 1;
}

.modal-hint {
  text-align: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--dim);
}

.modal-hint kbd { margin: 0 1px; }

.upgrade-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -4px 0 16px;
}

.reroll-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.reroll-btn b {
  color: var(--orange);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.reroll-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.reroll-btn kbd { height: 18px; min-width: 18px; font-size: 8px; }

.upgrade-note {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--dim);
  text-align: right;
}

/* pause */

.pause-modal { width: min(480px, 100%); text-align: center; }
.pause-modal .modal-sub { margin-left: auto; margin-right: auto; }

.pause-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 100%;
  max-width: 330px;
  margin: 0 auto 26px;
}

.pause-actions .btn-primary { justify-content: space-between; }

.btn-ghost {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(94, 244, 255, 0.14);
  background: rgba(9, 25, 40, 0.55);
  color: #9fc0cd;
  font-size: 11px;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-ghost:hover {
  border-color: rgba(94, 244, 255, 0.45);
  color: #e4fcff;
  background: rgba(16, 45, 65, 0.66);
}

.pause-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(94, 244, 255, 0.11);
  padding-top: 18px;
}

.pause-stats div { display: flex; flex-direction: column; gap: 4px; }
.pause-stats span { font-family: var(--mono); font-size: 8px; letter-spacing: 0.16em; color: var(--dim); }
.pause-stats b { font-family: var(--display); font-size: 20px; color: #d7f9ff; letter-spacing: 0.06em; }

/* game over */

.gameover-modal { width: min(660px, 100%); }
.gameover-title { color: #ffe8ee; text-shadow: 0 0 30px rgba(255, 61, 154, 0.3); }

.final-score {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid rgba(94, 244, 255, 0.12);
  border-bottom: 1px solid rgba(94, 244, 255, 0.12);
}

.final-score > span:first-child {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.final-score b {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--cyan-hot);
  text-shadow: 0 0 28px rgba(94, 244, 255, 0.4);
  font-variant-numeric: tabular-nums;
}

.new-best {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--orange);
  animation: ready-pulse 1s infinite;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(94, 244, 255, 0.08);
  border: 1px solid rgba(94, 244, 255, 0.08);
  margin-bottom: 26px;
}

.result-grid div {
  background: #071523;
  padding: 14px 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.result-grid span {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.result-grid b {
  font-family: var(--display);
  font-size: 19px;
  letter-spacing: 0.04em;
  color: #d8f4fb;
  font-variant-numeric: tabular-nums;
}

.gameover-actions {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}

.gameover-actions .btn-primary { flex: 1; min-width: 220px; justify-content: space-between; }
.gameover-actions .btn-ghost { min-width: 150px; }

/* ==========================================================================
   TOUCH / MOBILE
   ========================================================================== */

.touch-controls {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.touch-btn {
  pointer-events: auto;
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid rgba(94, 244, 255, 0.35);
  background: rgba(5, 18, 30, 0.62);
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  backdrop-filter: blur(6px);
  -webkit-tap-highlight-color: transparent;
}

.touch-btn:active { background: rgba(42, 126, 155, 0.46); }
.touch-glyph { font-size: 20px; line-height: 1; }

.touch-dash {
  right: calc(26px + env(safe-area-inset-right));
  bottom: calc(36px + env(safe-area-inset-bottom));
}

.touch-emp {
  right: calc(108px + env(safe-area-inset-right));
  bottom: calc(90px + env(safe-area-inset-bottom));
  border-color: rgba(255, 61, 154, 0.4);
  color: var(--magenta);
}

.touch-emp.ready {
  box-shadow: 0 0 24px rgba(255, 61, 154, 0.35);
  animation: ready-pulse 1.1s infinite;
}

.touch-skill {
  right: calc(26px + env(safe-area-inset-right));
  bottom: calc(124px + env(safe-area-inset-bottom));
  border-color: rgba(94, 244, 255, 0.45);
  color: var(--cyan);
}

.touch-skill.cooldown { opacity: 0.4; }

.joystick {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
  z-index: 2;
}

.joystick-base {
  position: absolute;
  left: -46px;
  top: -46px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 1px solid rgba(94, 244, 255, 0.26);
  background: radial-gradient(circle, rgba(94, 244, 255, 0.09), transparent 68%);
}

.joystick-knob {
  position: absolute;
  left: -17px;
  top: -17px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(94, 244, 255, 0.7);
  background: rgba(27, 95, 117, 0.55);
  box-shadow: 0 0 20px rgba(94, 244, 255, 0.3);
}

.rotate-hint {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #04070f;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
}

.rotate-hint span { font-size: 38px; animation: rotate-phone 2s ease-in-out infinite; }
.rotate-hint p { margin: 0; }

@keyframes rotate-phone {
  0%, 20% { transform: rotate(0); }
  60%, 100% { transform: rotate(-90deg); }
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 980px) {
  .menu-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.68fr);
    gap: 28px;
  }

  .title { font-size: clamp(58px, 11vw, 110px); }
  .lede { font-size: 12px; }
  .brief { padding: 18px; }
}

@media (max-width: 760px) {
  .overlay-start { padding: 16px; align-items: flex-start; }
  .start-frame { min-height: calc(100dvh - 32px); gap: 16px; }

  .menu-topline { font-size: 8px; }
  .signal { display: none; }

  .menu-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 6px 2px;
    align-items: start;
  }

  .hero { max-width: none; }
  .title { font-size: clamp(54px, 17vw, 96px); }
  .cn-title { margin-bottom: 12px; font-size: 14px; letter-spacing: 0.42em; }
  .lede { margin-bottom: 16px; font-size: 11px; line-height: 1.8; }
  .loadout { margin-bottom: 16px; }
  .loadout-head { font-size: 8px; margin-bottom: 6px; }
  .skill-select { gap: 6px; }
  .skill-chip { min-height: 43px; padding: 7px 8px; gap: 6px; min-width: 0; }
  .skill-chip-icon { width: 16px; font-size: 15px; }
  .skill-chip-text b { font-size: 9.5px; letter-spacing: 0.02em; white-space: normal; }
  .skill-chip-text em { font-size: 7px; white-space: normal; }
  .skill-desc { margin-top: 6px; font-size: 9px; line-height: 1.55; }
  .start-actions { gap: 14px; }
  .btn-primary { min-height: 50px; padding: 0 18px 0 22px; }
  .btn-text { font-size: 13px; }
  .best-line b { font-size: 17px; }

  .brief { width: 100%; padding: 15px 16px; }
  .brief-head { padding-bottom: 9px; }
  .control-row { padding: 8px 0; grid-template-columns: 78px 1fr; }
  .control-row b { font-size: 11px; }
  .control-row span { font-size: 9px; }
  .brief-tip { display: none; }
  .mobile-note { display: block; }
  .menu-footer { font-size: 7px; }
  .footer-center { display: none; }

  .upgrade-cards { grid-template-columns: 1fr; gap: 9px; }
  .upgrade-card {
    min-height: auto;
    padding: 14px;
    display: grid;
    grid-template-columns: 42px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 12px;
  }
  .card-top { grid-column: 1 / -1; margin-bottom: 9px; }
  .card-icon { grid-row: 2 / span 3; margin: 0; width: 38px; height: 38px; }
  .card-name { font-size: 15px; margin: 0; }
  .card-en { margin-bottom: 7px; }
  .card-desc { font-size: 10px; }
  .card-max { display: none; }
  .modal { padding: 22px 18px; }
  .modal-sub { margin-bottom: 18px; }
  .modal-hint { display: none; }
  .upgrade-actions { margin-bottom: 10px; }
  .upgrade-note { display: none; }

  .result-grid { grid-template-columns: repeat(2, 1fr); }
  .gameover-actions { flex-direction: column; }
  .gameover-actions .btn-ghost { min-height: 42px; }

  .hud { padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); }
  .hud-top { gap: 12px; }
  .mini-brand { font-size: 10px; letter-spacing: 0.1em; gap: 7px; }
  .mini-brand span:last-child { display: inline; }
  .mini-brand em { display: none; }
  .mini-brand-glyph { width: 14px; height: 14px; }
  .hud-value { font-size: 19px; }
  .hud-best { display: none; }
  .hud-score { min-width: 82px; }
  .hud-sub { font-size: 7px; }
  .hud-hint { display: none; }
  .hud-bottom { gap: 10px; }
  .vitals-panel { width: min(225px, 51vw); }
  .ability-panel { gap: 10px; }
  .ability-body { display: none; }
  .ability-key { min-width: 36px; height: 36px; }
  .boss-bar { width: 78vw; margin-top: 12px; }
  .wave-banner { min-width: 280px; padding: 14px 30px 12px; }
  .toast { bottom: 100px; }

  .touch-dash { bottom: calc(26px + env(safe-area-inset-bottom)); }
  .touch-emp { right: calc(98px + env(safe-area-inset-right)); bottom: calc(86px + env(safe-area-inset-bottom)); }
  .touch-skill { right: calc(26px + env(safe-area-inset-right)); bottom: calc(116px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .title { font-size: 52px; }
  .eyebrow { font-size: 8px; }
  .start-frame::before, .start-frame::after { display: none; }
  .kit-line { display: none; }
}

@media (max-width: 1000px) and (min-width: 761px) {
  .ability-body { display: none; }
  .ability-panel { gap: 8px; }
  .ability-key { min-width: 34px; }
}

@media (max-height: 660px) and (orientation: landscape) {
  .overlay-start { align-items: flex-start; padding: 14px 24px; }
  .start-frame { min-height: auto; gap: 8px; }
  .menu-topline { display: none; }
  .menu-layout { padding: 0; gap: 30px; }
  .title { font-size: clamp(56px, 10vh, 100px); }
  .cn-title { margin-bottom: 6px; font-size: 13px; }
  .lede { display: none; }
  .eyebrow { margin-bottom: 10px; }
  .title-rule { margin: 12px 0 8px; }
  .loadout { margin-bottom: 10px; }
  .skill-desc { display: none; }
  .brief { padding: 14px 16px; }
  .control-row { padding: 7px 0; }
  .brief-tip { display: none; }
  .menu-footer { padding-top: 8px; }
  .start-actions { gap: 16px; }
  .btn-primary { min-height: 46px; }
}

@media (max-height: 820px) and (min-height: 661px) and (min-width: 761px) {
  .start-frame { min-height: calc(100vh - 48px); gap: 12px; }
  .menu-layout { padding: 2px 8px; }
  .title { font-size: clamp(58px, 9.6vw, 128px); }
  .title-rule { margin: 14px 0 9px; }
  .cn-title { margin-bottom: 10px; }
  .lede { margin-bottom: 16px; line-height: 1.75; }
  .loadout { margin-bottom: 14px; }
  .skill-desc { margin-top: 6px; }
  .control-row { padding: 9px 0; }
  .menu-footer { padding-top: 8px; }
  .start-actions { gap: 20px; }
}

@media (pointer: coarse) {
  body.is-playing #game { cursor: default; }
  .hud-hint { display: none; }
  .ability-panel { display: none; }
  .touch-dash.cooldown { opacity: 0.4; }
  .touch-emp { opacity: 0.55; }
  .touch-emp.ready { opacity: 1; }
  .fx-grain { display: none; }
  .fx-scanlines { opacity: 0.45; }
  .overlay-start,
  .overlay-modal,
  .brief { backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
