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

:root {
  --bg: #050510;
  --cyan: #00f0ff;
  --magenta: #ff006e;
  --gold: #ffd700;
  --green: #39ff14;
  --purple: #bf00ff;
  --orange: #ff6b00;
  --panel: rgba(8, 12, 30, 0.92);
  --border: rgba(0, 240, 255, 0.25);
  --glow: 0 0 20px rgba(0, 240, 255, 0.4);
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Rajdhani', sans-serif;
  color: #e0e8ff;
  user-select: none;
}

#app {
  position: fixed;
  inset: 0;
  width: 100%;
  height: var(--app-h, 100dvh);
  min-height: 100dvh;
  min-height: -webkit-fill-available;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

.hidden { display: none !important; }

/* ── HUD ── */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 24px;
}

.hud-left, .hud-right {
  display: flex;
  gap: 20px;
}

.score-block .label {
  display: block;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(0, 240, 255, 0.6);
  font-family: 'Orbitron', monospace;
}

.score-block .value {
  font-family: 'Orbitron', monospace;
  font-size: 22px;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.value.gold { color: var(--gold); text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.value.combo { color: var(--magenta); text-shadow: 0 0 10px rgba(255, 0, 110, 0.5); transition: transform 0.1s; }
.value.combo.pulse { transform: scale(1.3); }

.wave-display {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding-top: 4px;
}
.wave-display span { color: var(--cyan); font-size: 28px; font-weight: 900; }
.wave-display span.arena-title {
  font-size: 22px;
  letter-spacing: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hud-bottom {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(700px, 90vw);
}

.hull-bar-wrap, .energy-bar-wrap, .shield-bar-wrap, .xp-bar-wrap {
  flex: 1;
  min-width: 70px;
}
.hull-bar-wrap .label { color: #ff4466; }
.energy-bar-wrap .label { color: var(--cyan); }
.shield-bar-wrap .label { color: var(--purple); }
.xp-bar-wrap .label { color: var(--green); }
.xp-bar-wrap {
  position: relative;
  flex: 1.2;
}
.xp-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.xp-hud-val {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(0, 255, 136, 0.5);
  transition: color 0.4s ease;
}
.xp-hud-val.xp-tick {
  animation: xpHudTick 0.55s ease-out;
}
@keyframes xpHudTick {
  0% { opacity: 0.5; transform: scale(1); }
  40% { opacity: 1; color: #fff; transform: scale(1.12); }
  100% { opacity: 0.55; transform: scale(1); }
}

/* Tier colors — HUD XP bar */
.xp-bar-wrap.xp-tier-rookie .label { color: var(--green); }
.xp-bar-wrap.xp-tier-rookie .xp-hud-val { color: rgba(0, 255, 136, 0.5); }
.xp-bar-wrap.xp-tier-rookie .bar-fill.xp {
  background: linear-gradient(90deg, #006600, var(--green));
  box-shadow: 0 0 8px var(--green);
}

.xp-bar-wrap.xp-tier-pilot .label { color: var(--cyan); }
.xp-bar-wrap.xp-tier-pilot .xp-hud-val { color: rgba(0, 240, 255, 0.55); }
.xp-bar-wrap.xp-tier-pilot .bar-fill.xp {
  background: linear-gradient(90deg, #004466, var(--cyan));
  box-shadow: 0 0 10px var(--cyan);
}

.xp-bar-wrap.xp-tier-veteran .label { color: var(--purple); }
.xp-bar-wrap.xp-tier-veteran .xp-hud-val { color: rgba(191, 0, 255, 0.55); }
.xp-bar-wrap.xp-tier-veteran .bar-fill.xp {
  background: linear-gradient(90deg, #440066, var(--purple));
  box-shadow: 0 0 10px var(--purple);
}

.xp-bar-wrap.xp-tier-elite .label { color: var(--gold); }
.xp-bar-wrap.xp-tier-elite .xp-hud-val { color: rgba(255, 215, 0, 0.6); }
.xp-bar-wrap.xp-tier-elite .bar-fill.xp {
  background: linear-gradient(90deg, #886600, var(--gold), #ffcc44);
  box-shadow: 0 0 12px var(--gold);
}

.xp-rank-flash {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 4px 10px;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  white-space: nowrap;
  color: #fff;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 4px;
  box-shadow: 0 0 16px rgba(255, 200, 0, 0.35);
  pointer-events: none;
  z-index: 5;
  animation: xpRankFlash 2.6s ease-out forwards;
}
.xp-bar-wrap.xp-rank-up .xp-bar-track {
  animation: xpBarRankPulse 0.7s ease-in-out 3;
}
.xp-bar-wrap.xp-rank-up .bar-fill.xp {
  animation: xpBarRankGlow 1s ease-in-out 2;
}
@keyframes xpRankFlash {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.85); }
  12% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.08); }
  25% { transform: translateX(-50%) scale(1); }
  75% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}
@keyframes xpBarRankPulse {
  0%, 100% { box-shadow: 0 0 0 transparent; border-color: rgba(255, 255, 255, 0.1); }
  50% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.45); border-color: rgba(255, 215, 0, 0.55); }
}
@keyframes xpBarRankGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.6); }
}

.hud-bottom .label {
  font-size: 9px;
  letter-spacing: 2px;
  font-family: 'Orbitron', monospace;
  display: block;
  margin-bottom: 3px;
}

.bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.15s ease-out;
  width: 100%;
}
.bar-fill.energy { background: linear-gradient(90deg, #0066aa, var(--cyan)); box-shadow: 0 0 8px var(--cyan); }
.bar-fill.hull { background: linear-gradient(90deg, #aa2244, #ff4466); box-shadow: 0 0 8px #ff4466; }
.bar-fill.shield { background: linear-gradient(90deg, #4400aa, var(--purple)); box-shadow: 0 0 8px var(--purple); }
.bar-fill.xp { background: linear-gradient(90deg, #006600, var(--green)); box-shadow: 0 0 8px var(--green); }
.bar-fill.boost { background: linear-gradient(90deg, #cc5500, #ffcc00, #ff6600); box-shadow: 0 0 10px #ff9900; }
.boost-bar-wrap .bar-track { border-color: rgba(255, 153, 0, 0.35); }

.mini-map-wrap {
  position: fixed;
  bottom: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  pointer-events: none;
  z-index: 20;
}
.mini-map-label {
  font-family: Orbitron, monospace;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(0, 240, 255, 0.6);
}
.mini-map {
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
  background: rgba(5, 5, 16, 0.9);
}
.safe-zone-banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 16px;
  background: rgba(0, 80, 40, 0.75);
  border: 1px solid rgba(0, 255, 140, 0.5);
  border-radius: 4px;
  font-family: Orbitron, monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #00ff88;
  z-index: 20;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.safe-zone-timer {
  margin-top: 2px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  color: #ccffdd;
  text-shadow: 0 0 12px rgba(0, 255, 140, 0.45);
}
.dock-btn {
  position: fixed;
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  background: rgba(0, 60, 80, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.5);
  border-radius: 4px;
  font-family: Orbitron, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: #00f0ff;
  cursor: pointer;
  z-index: 21;
}
.dock-btn:hover {
  background: rgba(0, 100, 120, 0.9);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}
.dock-panel {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 148px;
  padding-bottom: 24px;
  overflow-y: auto;
  pointer-events: auto;
}
.dock-panel-inner {
  background: linear-gradient(135deg, rgba(8, 12, 28, 0.98), rgba(4, 8, 20, 0.98));
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  padding: 24px 28px;
  min-width: 320px;
  max-width: 420px;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.15);
}
.dock-title {
  font-family: Orbitron, monospace;
  font-size: 14px;
  color: #00f0ff;
  margin: 0 0 16px;
  letter-spacing: 0.1em;
}
.dock-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-bottom: 20px;
  font-family: Rajdhani, sans-serif;
  font-size: 15px;
}
.dock-stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.dock-stat .label { color: rgba(255, 255, 255, 0.5); }
.dock-stat .val { color: #fff; font-weight: 600; }
.dock-pickups h4 {
  font-family: Orbitron, monospace;
  font-size: 10px;
  color: rgba(0, 240, 255, 0.7);
  letter-spacing: 0.12em;
  margin: 0 0 8px;
}
.dock-pickups ul {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.dock-pickups li {
  font-family: Rajdhani, sans-serif;
  font-size: 14px;
  padding: 4px 0;
  color: rgba(255, 255, 255, 0.85);
}
.dock-close {
  width: 100%;
  padding: 10px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 4px;
  font-family: Orbitron, monospace;
  font-size: 11px;
  color: #00f0ff;
  cursor: pointer;
}
.dock-close:hover { background: rgba(0, 240, 255, 0.2); }
.kill-feed-item.pickup-feed {
  color: #00ff88;
  border-left-color: #00ff88;
}

.powerup-slots {
  display: flex;
  gap: 6px;
}

.weapon-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.weapon-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.weapon-level {
  font-size: 9px;
  letter-spacing: 0.12em;
  color: rgba(255, 215, 0, 0.85);
  line-height: 1;
}
.weapon-slot {
  width: 36px;
  height: 36px;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow);
}
.weapon-name {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: rgba(0, 240, 255, 0.85);
  text-transform: uppercase;
}

.powerup-slot {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.powerup-slot .buff-icon {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.35);
}
.powerup-slot.active { border-color: var(--cyan); box-shadow: var(--glow); }
.powerup-slot .buff-timer {
  position: absolute;
  bottom: 1px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 8px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Orbitron', monospace;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.9);
}
.powerup-slots:not(.hidden) {
  margin-top: 6px;
}
.powerup-slot .key-hint {
  position: absolute;
  bottom: -2px;
  right: 2px;
  font-size: 8px;
  color: rgba(255,255,255,0.4);
  font-family: 'Orbitron', monospace;
}

.kill-feed {
  position: absolute;
  top: 80px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.kill-feed-item {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  animation: fadeUp 2s forwards;
  font-family: 'Orbitron', monospace;
}
.kill-feed-item .pts { color: var(--gold); }

@keyframes fadeUp {
  0% { opacity: 1; transform: translateY(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-20px); }
}

.wave-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', monospace;
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 900;
  color: var(--cyan);
  text-shadow: 0 0 24px var(--cyan), 0 0 48px var(--cyan);
  letter-spacing: 0.12em;
  animation: waveIn 2.5s forwards;
  pointer-events: none;
  max-width: 92vw;
  text-align: center;
}
@keyframes waveIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.2); }
}

/* ── Overlays / Menus ── */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  background: rgba(5, 5, 16, 0.88);
  backdrop-filter: blur(8px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: max(16px, env(safe-area-inset-top, 16px)) max(12px, env(safe-area-inset-right, 12px))
           max(16px, env(safe-area-inset-bottom, 16px)) max(12px, env(safe-area-inset-left, 12px));
}

.menu-bg-effects {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 240, 255, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(255, 0, 110, 0.06) 0%, transparent 50%);
  animation: bgPulse 4s ease-in-out infinite alternate;
}
@keyframes bgPulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.menu-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: clamp(24px, 4vw, 48px);
  max-width: min(920px, 96vw);
  width: 100%;
  margin: auto 0;
}

.game-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
}
.title-cosmo {
  color: var(--cyan);
  text-shadow: 0 0 30px var(--cyan), 0 0 60px rgba(0, 240, 255, 0.3);
}
.title-clash {
  color: var(--magenta);
  text-shadow: 0 0 30px var(--magenta), 0 0 60px rgba(255, 0, 110, 0.3);
}

.tagline {
  font-size: clamp(14px, 2.5vw, 18px);
  letter-spacing: clamp(2px, 1vw, 6px);
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: clamp(20px, 4vw, 32px);
  text-transform: uppercase;
  line-height: 1.5;
}

.menu-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-bottom: 36px;
}
.stat { text-align: center; }
.stat-val {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--cyan);
}
.stat-lbl {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.4);
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.btn {
  font-family: 'Orbitron', monospace;
  font-size: clamp(13px, 2.2vw, 15px);
  letter-spacing: 2px;
  padding: clamp(12px, 2.5vw, 16px) clamp(28px, 6vw, 48px);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(0, 240, 255, 0.08);
  color: var(--cyan);
  min-width: min(260px, 100%);
}
.btn:hover {
  background: rgba(0, 240, 255, 0.18);
  box-shadow: var(--glow);
  transform: translateY(-2px);
}
.btn-primary {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(255, 0, 110, 0.2));
  border-color: var(--cyan);
  font-size: clamp(15px, 2.8vw, 18px);
  padding: clamp(14px, 3vw, 20px) clamp(32px, 7vw, 56px);
}
.btn-glow {
  animation: btnPulse 2s ease-in-out infinite;
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 15px rgba(0, 240, 255, 0.3); }
  50% { box-shadow: 0 0 30px rgba(0, 240, 255, 0.6), 0 0 60px rgba(255, 0, 110, 0.2); }
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  min-width: min(200px, 100%);
  padding: clamp(10px, 2vw, 14px) clamp(20px, 5vw, 36px);
  font-size: clamp(12px, 2vw, 14px);
}

.version {
  margin-top: 24px;
  font-size: 11px;
  color: rgba(255,255,255,0.2);
  letter-spacing: 2px;
}

.section-title {
  font-family: 'Orbitron', monospace;
  font-size: clamp(24px, 5vw, 36px);
  letter-spacing: clamp(2px, 1.2vw, 6px);
  color: var(--cyan);
  margin-bottom: clamp(12px, 2vw, 20px);
  text-shadow: var(--glow);
  line-height: 1.2;
}

.credits-display {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  color: var(--gold);
  margin-bottom: 20px;
}
.credits-display span { font-size: 24px; }

.hangar-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
}
.tab {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 8px 24px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
}
.tab.active, .tab:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
}

.ship-grid, .upgrade-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px;
  margin-bottom: 20px;
}

.ship-card, .upgrade-card {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 16px;
  background: rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.ship-card:hover, .upgrade-card:hover {
  border-color: var(--cyan);
  box-shadow: var(--glow);
}
.ship-card.selected {
  border-color: var(--green);
  box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
}
.ship-card.locked { opacity: 0.5; cursor: not-allowed; }
.ship-card .ship-name {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: var(--cyan);
  margin-bottom: 4px;
}
.ship-card .ship-desc {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
  line-height: 1.4;
}
.ship-card .ship-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ship-stat {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.6);
}
.ship-card .ship-price {
  margin-top: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  color: var(--gold);
}
.ship-card .ship-badge {
  display: inline-block;
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--green);
  color: #000;
  font-weight: 700;
  margin-left: 6px;
}

.upgrade-card .upgrade-name {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  color: var(--purple);
  margin-bottom: 4px;
}
.upgrade-card .upgrade-desc { font-size: 11px; color: rgba(255,255,255,0.5); margin-bottom: 6px; }
.upgrade-card .upgrade-level {
  font-size: 11px;
  color: var(--green);
  margin-bottom: 4px;
}
.upgrade-card .upgrade-price { font-family: 'Orbitron', monospace; font-size: 12px; color: var(--gold); }
.upgrade-card.maxed { opacity: 0.4; cursor: not-allowed; }

.back-btn { margin-top: 8px; }

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  text-align: left;
  margin-bottom: 20px;
}
.control-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.control-item kbd {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  background: rgba(0,0,0,0.4);
  color: var(--cyan);
  min-width: 80px;
  text-align: center;
}
.tip {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 16px;
  font-style: italic;
}

.gameover-title { color: var(--magenta) !important; text-shadow: 0 0 30px var(--magenta); }
.gameover-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.go-stat { text-align: center; }
.go-stat span {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--cyan);
}
.go-stat.highlight span { color: var(--magenta); }
.go-stat label {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.4);
}
.new-record {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  color: var(--gold);
  animation: btnPulse 1s infinite;
  margin-bottom: 16px;
}

.levelup-content { max-width: 700px; }
.levelup-sub { color: rgba(255,255,255,0.5); margin-bottom: 24px; font-size: 14px; }
.levelup-choices {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.levelup-choice {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 20px;
  width: 180px;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  transition: all 0.2s;
  pointer-events: all;
}
.levelup-choice:hover {
  border-color: var(--gold);
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.3);
  transform: scale(1.05);
}
.levelup-choice .icon { font-size: 36px; margin-bottom: 8px; }
.levelup-choice .name {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 4px;
}
.levelup-choice .desc { font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.4; }

.hangar-content { max-width: 800px; }

.mp-form { text-align: left; max-width: min(420px, 100%); margin: 0 auto clamp(20px, 4vw, 28px); }
.mp-label {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: clamp(11px, 2vw, 13px);
  letter-spacing: 1.5px;
  color: rgba(0, 240, 255, 0.75);
  margin-bottom: 8px;
  margin-top: 16px;
}
.mp-hint { color: rgba(255,255,255,0.45); font-size: clamp(11px, 1.8vw, 13px); }
.mp-input {
  width: 100%;
  padding: clamp(12px, 2.5vw, 16px) clamp(14px, 3vw, 18px);
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 6px;
  color: #e0e8ff;
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(16px, 3.5vw, 20px);
  outline: none;
}
.mp-input:focus { border-color: var(--cyan); box-shadow: var(--glow); }
.mp-note { font-size: 12px; color: rgba(255,255,255,0.35); margin-top: 12px; line-height: 1.4; }
.mp-status { font-family: 'Orbitron', monospace; font-size: 12px; color: var(--gold); margin-top: 12px; text-align: center; }
.mp-status.error { color: #ff4466; }

/* ── Mobile: rotate prompt ── */
.rotate-prompt {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(5, 5, 16, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: max(32px, env(safe-area-inset-top)) 28px max(32px, env(safe-area-inset-bottom));
  pointer-events: auto;
}
body.needs-rotate #pauseMenu,
body.needs-rotate .touch-controls,
body.fullscreen-prompt-open .touch-controls {
  visibility: hidden !important;
  pointer-events: none !important;
}
.rotate-icon {
  font-size: 72px;
  margin-bottom: 28px;
  animation: rotate-hint 2.4s ease-in-out infinite;
}
@keyframes rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  45%, 55% { transform: rotate(90deg); }
}
.rotate-prompt h2 {
  font-family: Orbitron, monospace;
  font-size: clamp(20px, 5vw, 26px);
  color: var(--cyan);
  margin-bottom: 16px;
  letter-spacing: 0.08em;
  line-height: 1.3;
}
.rotate-prompt p {
  font-size: clamp(15px, 3.5vw, 18px);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.55;
  max-width: 320px;
}
.rotate-prompt p strong { color: #00f0ff; }
.rotate-steps {
  margin-top: 14px;
  font-size: clamp(13px, 3vw, 15px) !important;
  color: rgba(255, 255, 255, 0.55) !important;
}

/* ── Mobile: touch controls ── */
.touch-controls {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
}
.touch-cluster {
  position: absolute;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.touch-left {
  left: 16px;
  bottom: 16px;
  align-items: center;
}
.joystick-zone {
  position: relative;
  width: 150px;
  height: 150px;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
.joystick-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(0, 255, 140, 0.55);
  background: rgba(8, 12, 30, 0.72);
  box-shadow: 0 0 24px rgba(0, 255, 140, 0.2), inset 0 0 20px rgba(0, 240, 255, 0.08);
}
.joystick-ring::before {
  content: 'MOVE';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: Orbitron, monospace;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(0, 255, 140, 0.35);
  pointer-events: none;
}
.joystick-ring::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 14%;
  width: 3px;
  height: 36%;
  margin-left: -1.5px;
  background: rgba(0, 255, 140, 0.35);
  border-radius: 2px;
  pointer-events: none;
}
.joystick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  border: 3px solid rgba(0, 255, 140, 0.75);
  background: radial-gradient(circle at 35% 35%, rgba(0, 255, 140, 0.55), rgba(0, 80, 60, 0.9));
  box-shadow: 0 0 18px rgba(0, 255, 140, 0.45);
  pointer-events: none;
  will-change: transform;
}
.build-tag {
  position: fixed;
  bottom: 4px;
  left: 4px;
  font-family: Orbitron, monospace;
  font-size: 8px;
  color: rgba(0, 255, 140, 0.45);
  z-index: 60;
  pointer-events: none;
}
.touch-right {
  right: 12px;
  bottom: 12px;
  align-items: flex-end;
  gap: 8px;
}
.touch-row {
  display: flex;
  gap: 8px;
}
.touch-btn {
  border: 2px solid rgba(0, 240, 255, 0.45);
  background: rgba(8, 12, 30, 0.75);
  color: #e0e8ff;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-family: Orbitron, monospace;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.touch-btn:active, .touch-btn.active {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4);
}
.touch-thrust {
  border-color: rgba(0, 255, 140, 0.5);
  background: rgba(0, 60, 40, 0.7);
}
.touch-thrust:active { background: rgba(0, 255, 140, 0.3); border-color: #00ff88; }
.touch-fire {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  font-size: 13px;
  letter-spacing: 0.05em;
  border-color: rgba(255, 0, 110, 0.6);
  background: rgba(80, 0, 40, 0.75);
  color: #ff88bb;
}
.touch-fire:active { background: rgba(255, 0, 110, 0.35); }
.touch-boost {
  width: 64px;
  height: 48px;
  border-radius: 8px;
  font-size: 10px;
  border-color: rgba(255, 153, 0, 0.6);
  color: #ffaa44;
}
.touch-bomb, .touch-repel {
  width: 48px;
  height: 48px;
  font-size: 20px;
}
.touch-pause, .touch-dock {
  width: 40px;
  height: 40px;
  font-size: 14px;
  align-self: flex-end;
  opacity: 0.8;
}
.touch-dock { border-color: rgba(0, 255, 140, 0.5); }

/* ── Mobile: install banner ── */
.install-banner {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  right: max(10px, env(safe-area-inset-right));
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(8, 12, 30, 0.94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}
.install-banner-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
  text-align: left;
}
.install-banner-text strong {
  font-family: Orbitron, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan);
}
.install-banner-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.install-banner-btn {
  padding: 8px 12px !important;
  font-size: 10px !important;
  letter-spacing: 0.06em !important;
  white-space: nowrap;
}
.install-banner-dismiss {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}
body.is-standalone .install-banner { display: none !important; }

/* ── Mobile: full screen prompt ── */
.fullscreen-prompt {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: rgba(5, 5, 16, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  pointer-events: auto;
}
body.needs-rotate .fullscreen-prompt,
body.fullscreen-prompt-open .install-banner {
  display: none !important;
}
.fullscreen-prompt-icon {
  font-size: 56px;
  margin-bottom: 20px;
  color: var(--cyan);
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.5);
}
.fullscreen-prompt h2 {
  font-family: Orbitron, monospace;
  font-size: clamp(20px, 5vw, 26px);
  color: var(--cyan);
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}
.fullscreen-prompt p {
  font-size: clamp(14px, 3.5vw, 17px);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.55;
  max-width: 340px;
}
.fullscreen-sub {
  margin-top: 10px !important;
  font-size: clamp(12px, 3vw, 14px) !important;
  color: rgba(255, 255, 255, 0.55) !important;
}
.fullscreen-sub strong { color: rgba(0, 240, 255, 0.9); }
.fullscreen-prompt-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: min(320px, 100%);
  margin-top: 24px;
}
.fullscreen-prompt-actions .btn {
  width: 100%;
  min-height: 48px;
}
.fullscreen-skip {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.45);
  font-family: Rajdhani, sans-serif;
  font-size: 14px;
  padding: 10px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.expand-screen-btn {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: max(52px, calc(44px + env(safe-area-inset-right)));
  z-index: 55;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid rgba(0, 240, 255, 0.45);
  background: rgba(8, 12, 30, 0.88);
  color: var(--cyan);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.expand-screen-btn:active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan);
}
body.is-browser-fs .expand-screen-btn,
body.is-standalone .expand-screen-btn {
  display: none !important;
}
body.is-mobile.is-in-game .expand-screen-btn {
  top: max(8px, env(safe-area-inset-top));
  right: max(8px, env(safe-area-inset-right));
}
html:fullscreen,
html:-webkit-full-screen {
  width: 100%;
  height: 100%;
}
html:fullscreen body,
html:-webkit-full-screen body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
html:fullscreen #app,
html:-webkit-full-screen #app {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

/* ── Mobile: menus & touch layout ── */
body.is-mobile .overlay {
  align-items: flex-start;
  padding-top: max(48px, calc(env(safe-area-inset-top) + 36px));
  padding-bottom: max(20px, env(safe-area-inset-bottom));
}
body.is-mobile .menu-content {
  padding: clamp(22px, 5vw, 36px) clamp(18px, 4vw, 28px);
  margin: 0 auto 24px;
}
body.is-mobile .menu-buttons {
  gap: 14px;
  width: 100%;
  max-width: min(400px, 100%);
}
body.is-mobile .btn {
  min-height: 48px;
  padding: 14px 20px;
}
body.is-mobile .pilot-tagline { display: none; }
body.is-mobile .pilot-greeting { font-size: clamp(20px, 4.5vw, 26px); margin-bottom: 10px; }
body.is-mobile .pilot-meta { margin-bottom: 16px; line-height: 1.5; }
body.is-mobile .pilot-stats {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
body.is-mobile .pilot-stat { padding: 10px 8px; }
body.is-mobile .pilot-actions { gap: 12px; }
body.is-mobile .auth-content .mp-input,
body.is-mobile .friends-search-input,
body.is-mobile .guest-name-input {
  min-height: 48px;
  font-size: 16px;
}
body.is-mobile .guest-play-block { margin-top: 8px; }
body.is-mobile .guest-hud-banner {
  top: max(6px, env(safe-area-inset-top));
  max-width: calc(100vw - 24px);
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  font-size: 10px;
  padding: 8px 12px;
}

/* ── Mobile: in-game HUD (compact bottom strip) ── */
body.is-mobile.is-in-game .hud-top {
  padding: max(4px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 2px max(8px, env(safe-area-inset-left));
}
body.is-mobile.is-in-game .hud-left,
body.is-mobile.is-in-game .hud-right { gap: 10px; flex-wrap: wrap; }
body.is-mobile.is-in-game .hud-center { display: none; }
body.is-mobile.is-in-game .hud-right .score-block:first-child { display: none; }
body.is-mobile.is-in-game .score-block .label { font-size: 8px; letter-spacing: 1px; }
body.is-mobile.is-in-game .score-block .value { font-size: 15px; }
body.is-mobile.is-in-game .score-mult { display: none !important; }

/* Stat bars: single row pinned to bottom, between joystick and fire cluster */
body.is-mobile.is-in-game .hud-bottom {
  left: max(132px, calc(124px + env(safe-area-inset-left) + 8px));
  right: max(80px, calc(72px + env(safe-area-inset-right)));
  bottom: max(4px, env(safe-area-inset-bottom));
  top: auto;
  transform: none;
  width: auto;
  max-width: none;
  flex-wrap: nowrap;
  flex-direction: row;
  align-items: flex-end;
  justify-content: stretch;
  gap: 4px;
  padding: 0;
}
body.is-mobile.is-in-game .xp-bar-wrap,
body.is-mobile.is-in-game .adrenaline-wrap { display: none !important; }
body.is-mobile.is-in-game .hull-bar-wrap,
body.is-mobile.is-in-game .shield-bar-wrap,
body.is-mobile.is-in-game .energy-bar-wrap,
body.is-mobile.is-in-game .boost-bar-wrap {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}
body.is-mobile.is-in-game .hull-bar-wrap .label,
body.is-mobile.is-in-game .shield-bar-wrap .label,
body.is-mobile.is-in-game .energy-bar-wrap .label,
body.is-mobile.is-in-game .boost-bar-wrap .label {
  font-size: 6px;
  letter-spacing: 0.04em;
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.is-mobile.is-in-game .bar-track { height: 4px; border-radius: 2px; }

/* Weapon + power-ups: slim row just above stat bars (out of flex wrap) */
body.is-mobile.is-in-game .weapon-hud {
  position: fixed;
  bottom: max(20px, calc(14px + env(safe-area-inset-bottom)));
  left: max(132px, calc(124px + env(safe-area-inset-left) + 8px));
  margin: 0;
  flex: none;
  width: auto;
  z-index: 11;
  gap: 4px;
}
body.is-mobile.is-in-game .weapon-hud .weapon-slot {
  width: 24px;
  height: 24px;
}
body.is-mobile.is-in-game .weapon-hud .weapon-abbr { font-size: 8px; }
body.is-mobile.is-in-game .weapon-name { display: none; }
body.is-mobile.is-in-game .weapon-level { font-size: 7px; line-height: 1; }

body.is-mobile.is-in-game .powerup-slots {
  position: fixed;
  bottom: max(20px, calc(14px + env(safe-area-inset-bottom)));
  left: max(186px, calc(178px + env(safe-area-inset-left)));
  margin: 0;
  flex: none;
  z-index: 11;
  gap: 3px;
}
body.is-mobile.is-in-game .powerup-slots:not(.hidden) { margin-top: 0; }
body.is-mobile.is-in-game .powerup-slot {
  width: 24px;
  height: 24px;
}
body.is-mobile.is-in-game .powerup-slot .buff-icon { font-size: 8px; }
body.is-mobile.is-in-game .powerup-slot .buff-timer { font-size: 6px; }

body.is-mobile #gameCanvas { cursor: default; }
body.is-mobile .dock-btn { display: none; }
body.is-mobile .dock-panel { padding-top: max(112px, calc(env(safe-area-inset-top) + 96px)); }
body.is-mobile .safe-zone-timer { font-size: 12px; }

body.is-mobile.is-in-game .mini-map-wrap {
  top: max(48px, calc(env(safe-area-inset-top) + 40px));
  bottom: auto;
  right: max(8px, env(safe-area-inset-right));
  transform: none;
}
body.is-mobile.is-in-game .mini-map { width: 64px; height: 64px; }
body.is-mobile.is-in-game .mini-map-label { font-size: 7px; }

body.is-mobile.is-in-game .kill-feed {
  top: max(48px, calc(env(safe-area-inset-top) + 40px));
  left: max(8px, env(safe-area-inset-left));
  right: auto;
  bottom: auto;
  align-items: flex-start;
  max-width: min(160px, 36vw);
  font-size: 9px;
}
body.is-mobile.is-in-game .safe-zone-banner {
  top: max(42px, calc(env(safe-area-inset-top) + 34px));
  font-size: 9px;
  padding: 5px 10px;
}
body.is-mobile.is-in-game .hud-contract { display: none !important; }

/* ── Mobile: chat (bottom sheet above touch controls) ── */
body.is-mobile .chat-toggle {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  z-index: 8600;
}
body.is-mobile.is-in-game .chat-toggle {
  top: max(8px, env(safe-area-inset-top));
  left: max(8px, env(safe-area-inset-left));
  bottom: auto;
  width: 48px;
  height: 48px;
  font-size: 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
body.is-mobile:not(.is-in-game) .chat-toggle {
  bottom: max(72px, calc(64px + env(safe-area-inset-bottom)));
  left: max(12px, env(safe-area-inset-left));
  width: 48px;
  height: 48px;
  font-size: 20px;
}
body.is-mobile.chat-open .chat-toggle {
  opacity: 0.55;
}

body.is-mobile .chat-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8990;
  background: rgba(0, 0, 0, 0.5);
  touch-action: none;
}
body.is-mobile .chat-backdrop.hidden { display: none !important; }

body.is-mobile.chat-open .chat-sheet {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: min(46vh, 340px);
  pointer-events: auto;
}
body.is-mobile.is-in-game.chat-open .chat-sheet {
  bottom: max(128px, calc(120px + env(safe-area-inset-bottom)));
}
body.is-mobile:not(.is-in-game).chat-open .chat-sheet {
  bottom: max(8px, env(safe-area-inset-bottom));
  max-height: min(52vh, 400px);
}

body.is-mobile.chat-open .chat-panel {
  position: relative;
  left: auto;
  right: auto;
  top: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: none;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  border-radius: 14px 14px 0 0;
  border-bottom: none;
  display: flex;
  flex-direction: column;
}
body.is-mobile.chat-open .chat-panel.hidden { display: flex !important; }
body.is-mobile.chat-open .chat-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 11px;
  flex-shrink: 0;
}
body.is-mobile .chat-panel-title { flex: 1; }
body.is-mobile .chat-hint-desktop { display: none; }
body.is-mobile .chat-panel-close {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
}
body.is-mobile.chat-open .chat-log-body {
  flex: 1 1 auto;
  min-height: 80px;
  max-height: none;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.5;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
body.is-mobile.chat-open .chat-line { margin-bottom: 8px; }
body.is-mobile.chat-open .chat-meta { font-size: 10px; display: block; margin-bottom: 2px; }

body.is-mobile.chat-open .command-bar {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  max-width: none;
  flex-shrink: 0;
  border-radius: 0 0 14px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  gap: 8px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35);
}
body.is-mobile.chat-open .command-bar.hidden { display: flex !important; }
body.is-mobile .command-send {
  display: none;
  flex-shrink: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid rgba(0, 240, 255, 0.45);
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--cyan);
  font-family: Orbitron, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  touch-action: manipulation;
}
body.is-mobile.chat-open .command-send { display: block; }
body.is-mobile.chat-open .command-input {
  font-size: 16px;
  min-height: 44px;
}
body.is-mobile.chat-open .command-close { display: none; }
body.is-mobile.chat-open .command-prefix { font-size: 18px; }

body.is-mobile.is-in-game .chat-toast {
  top: max(56px, calc(env(safe-area-inset-top) + 48px));
  font-size: 13px;
  max-width: calc(100vw - 80px);
}

body.is-mobile.is-in-game .touch-left,
body.is-mobile.is-in-game .touch-right {
  transition: opacity 0.15s ease;
}
body.is-mobile.is-in-game.chat-open .touch-controls {
  opacity: 0.35;
  pointer-events: none;
}

body.is-mobile .touch-left {
  left: max(10px, env(safe-area-inset-left));
  bottom: max(10px, env(safe-area-inset-bottom));
}
body.is-mobile .touch-right {
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  gap: 10px;
}
body.is-mobile .joystick-zone {
  width: 128px;
  height: 128px;
}
body.is-mobile .joystick-knob {
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
}
body.is-mobile .touch-fire {
  width: 72px;
  height: 72px;
  font-size: 11px;
}
body.is-mobile .touch-boost {
  width: 58px;
  height: 44px;
}
body.is-mobile .touch-bomb,
body.is-mobile .touch-repel {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
body.is-mobile .touch-pause,
body.is-mobile .touch-dock {
  width: 38px;
  height: 38px;
}
body.is-mobile .audio-controls {
  top: max(8px, env(safe-area-inset-top));
  bottom: auto;
  right: max(8px, env(safe-area-inset-right));
  min-width: 140px;
  padding: 10px 12px;
}
body.is-mobile:not(.is-in-game) .audio-controls {
  top: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
}

.mobile-controls-hint {
  margin-top: 20px;
  padding: 14px;
  border: 1px solid rgba(0, 255, 140, 0.35);
  border-radius: 6px;
  background: rgba(0, 60, 40, 0.2);
  text-align: left;
}
.mobile-controls-hint h3 {
  font-family: Orbitron, monospace;
  font-size: 11px;
  color: #00ff88;
  margin-bottom: 8px;
  letter-spacing: 0.1em;
}
.mobile-controls-hint p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.5;
}

/* ── Auth & Pilot ── */
.auth-content { max-width: min(480px, 96vw); }
.auth-title { font-size: clamp(40px, 10vw, 72px); margin-bottom: 8px; }
.auth-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: clamp(16px, 3vw, 24px) 0 clamp(14px, 2.5vw, 20px);
}
.auth-tab {
  flex: 1;
  max-width: 180px;
  padding: clamp(12px, 2.5vw, 14px) clamp(12px, 3vw, 16px);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.65);
  font-family: Orbitron, monospace;
  font-size: clamp(12px, 2.2vw, 14px);
  letter-spacing: 1px;
  cursor: pointer;
}
.auth-tab.active {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 240, 255, 0.08);
}
.auth-panel .btn { width: 100%; max-width: 420px; margin: 0 auto; }
.auth-panel .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}
.auth-checklist {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  text-align: left;
}
.auth-checklist li {
  font-size: clamp(12px, 2.2vw, 14px);
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.65;
  padding-left: 22px;
  position: relative;
}
.auth-checklist li::before {
  content: '○';
  position: absolute;
  left: 0;
  font-size: 12px;
}
.auth-checklist li.ok {
  color: #00ff88;
}
.auth-checklist li.ok::before {
  content: '✓';
}
.auth-checklist li.fail {
  color: #ff4d6d;
}
.auth-checklist li.fail::before {
  content: '✕';
}
.auth-checklist li.checking {
  color: rgba(255, 255, 255, 0.5);
}
.auth-checklist li.checking::before {
  content: '…';
}
.mp-input.valid {
  border-color: rgba(0, 255, 136, 0.55);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.12);
}
.mp-input.invalid {
  border-color: rgba(255, 77, 109, 0.55);
  box-shadow: 0 0 8px rgba(255, 77, 109, 0.12);
}
.auth-hint {
  font-size: clamp(12px, 2vw, 14px);
  color: rgba(255, 255, 255, 0.5);
  margin: 8px 0 0;
  line-height: 1.5;
}
.auth-status {
  margin-top: 14px;
  font-size: clamp(14px, 2.5vw, 16px);
  color: var(--cyan);
}
.auth-status.error { color: #ff4d6d; }
.auth-logout { margin-top: 10px; opacity: 0.85; }

.guest-play-block {
  margin: 18px 0 14px;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.06);
  text-align: left;
}
.btn-guest-play {
  width: 100%;
  font-size: 15px;
  letter-spacing: 1px;
  border-color: #00f0ff !important;
  margin-bottom: 12px;
}
.guest-name-label { margin-top: 4px; font-size: 10px; }
.guest-name-input { margin-bottom: 8px; }
.guest-play-note {
  margin: 0;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.45;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0 16px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}

.guest-hud-banner {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.5px;
  color: rgba(255, 230, 180, 0.95);
  background: rgba(255, 140, 0, 0.15);
  border: 1px solid rgba(255, 180, 80, 0.45);
  z-index: 19;
  white-space: nowrap;
}
.guest-hud-link {
  background: none;
  border: none;
  color: #ffd700;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 2px;
}

.guest-recap-content { max-width: 440px; text-align: center; }
.guest-recap-pilot { font-size: 18px; margin: 8px 0; color: #00f0ff; }
.guest-recap-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.5;
  margin-bottom: 18px;
}
.guest-recap-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.guest-recap-stats div {
  padding: 12px 8px;
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
}
.guest-recap-stats span {
  display: block;
  font-family: Orbitron, monospace;
  font-size: 22px;
  color: #fff;
}
.guest-recap-stats label {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
}

.pending-guest-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.35);
  font-size: 12px;
  color: rgba(255, 230, 180, 0.95);
  line-height: 1.45;
}

.score-mult {
  display: block;
  font-size: 11px;
  color: #ffd700;
  letter-spacing: 1px;
  margin-top: 2px;
}
.score-mult.hidden { display: none; }

.adrenaline-wrap {
  margin-top: 6px;
  min-width: 120px;
}
.adrenaline-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
}
.bar-fill.adrenaline {
  background: linear-gradient(90deg, #0066ff, #00f0ff);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  transition: width 0.12s linear;
}
.adrenaline-wrap.adrenaline-hot .bar-fill.adrenaline {
  background: linear-gradient(90deg, #ff006e, #ffd700);
  box-shadow: 0 0 12px rgba(255, 0, 110, 0.6);
}

.hud-contract {
  position: absolute;
  left: 16px;
  bottom: 120px;
  width: 220px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(8, 8, 24, 0.88);
  border: 1px solid rgba(255, 215, 0, 0.35);
  z-index: 12;
  pointer-events: none;
}
.hud-contract-title {
  font-size: 9px;
  letter-spacing: 2px;
  color: #ffd700;
  margin-bottom: 4px;
}
.hud-contract-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 6px;
  line-height: 1.3;
}
.hud-contract-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.hud-contract-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd700, #ff8800);
  transition: width 0.2s ease;
}
.hud-contract-foot {
  margin-top: 5px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
}

@media (max-width: 768px) {
  .hud-contract { display: none !important; }
  .adrenaline-wrap { display: none !important; }
}

.challenge-banner {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 10px;
  background: rgba(255, 0, 110, 0.12);
  border: 1px solid rgba(255, 0, 110, 0.45);
  text-align: center;
}
.challenge-banner span {
  display: block;
  font-size: 13px;
  color: rgba(255, 220, 240, 0.95);
  margin-bottom: 10px;
  line-height: 1.45;
}
.btn-challenge-play {
  width: 100%;
  font-size: 13px;
}

.weekly-rank-card {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.35);
  font-size: 12px;
  color: rgba(255, 235, 200, 0.95);
}
.weekly-rank-icon { font-size: 18px; }
.weekly-rank-link {
  margin-left: auto;
  background: none;
  border: none;
  color: #ffd700;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.weekly-rank-card.hidden { display: none; }

.lb-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin: -4px 0 12px;
  text-align: center;
}
.lb-me-row {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.35);
  font-size: 12px;
  text-align: center;
  color: rgba(200, 255, 255, 0.95);
}
.lb-me-row.hidden { display: none; }

.btn-share {
  letter-spacing: 0.5px;
}
.audio-hint {
  font-size: clamp(12px, 2vw, 14px);
  color: rgba(0, 240, 255, 0.65);
  letter-spacing: 0.06em;
  margin: 0 0 12px;
  animation: audioHintPulse 2s ease-in-out infinite;
  line-height: 1.45;
}
.audio-hint.hidden { display: none; }
@keyframes audioHintPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.audio-controls {
  position: absolute;
  bottom: 16px;
  right: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(5, 5, 16, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  min-width: 160px;
}
.audio-controls.hidden { display: none; }
.audio-control {
  display: flex;
  align-items: center;
  gap: 10px;
}
.audio-control label {
  flex: 0 0 52px;
  font-family: Orbitron, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: rgba(0, 240, 255, 0.75);
}
.audio-control input[type="range"] {
  flex: 1;
  height: 4px;
  accent-color: var(--cyan);
  cursor: pointer;
}
.audio-track-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 240, 255, 0.12);
}
.audio-track-name {
  font-family: Orbitron, monospace;
  font-size: 9px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}
.audio-track-btn {
  padding: 6px 8px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 4px;
  color: var(--cyan);
  font-family: Orbitron, monospace;
  font-size: 8px;
  letter-spacing: 0.08em;
  cursor: pointer;
}
.audio-track-btn:hover {
  background: rgba(0, 240, 255, 0.15);
}

.pilot-content {
  max-width: min(640px, 96vw);
  padding: clamp(20px, 4vw, 32px) clamp(18px, 4vw, 28px);
  max-height: none;
  overflow: visible;
}
.pilot-greeting {
  font-family: Orbitron, monospace;
  font-size: clamp(22px, 5vw, 30px);
  color: #00f0ff;
  margin: 0 0 8px;
  line-height: 1.2;
}
.pilot-meta {
  font-size: clamp(14px, 2.5vw, 17px);
  color: rgba(255, 255, 255, 0.65);
  margin: 0 0 14px;
  letter-spacing: 0.03em;
  line-height: 1.45;
}
.pilot-tier-badge {
  font-family: Orbitron, monospace;
  color: var(--gold);
  font-size: clamp(13px, 2.2vw, 15px);
  letter-spacing: 0.06em;
}
.pilot-xp-block {
  margin-bottom: 12px;
  padding: 0;
  background: none;
  border: none;
}
.pilot-xp-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.pilot-xp-tier {
  font-family: Orbitron, monospace;
  font-size: 13px;
  color: var(--gold);
  letter-spacing: 0.1em;
}
.pilot-xp-val {
  font-family: Orbitron, monospace;
  font-size: 11px;
  color: var(--green);
}
.pilot-xp-track {
  height: clamp(8px, 1.5vw, 10px);
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 136, 0.2);
}
.pilot-xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #006600, var(--green));
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.45);
  border-radius: 4px;
}
.pilot-xp-next {
  margin: 10px 0 0;
  font-size: clamp(12px, 2vw, 14px);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.03em;
}
.pilot-rank-up {
  margin-top: 8px;
  padding: 8px 12px;
  font-family: Orbitron, monospace;
  font-size: clamp(11px, 2vw, 13px);
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(255, 200, 0, 0.1);
  border: 1px solid rgba(255, 200, 0, 0.35);
  border-radius: 4px;
  animation: rankUpPop 0.5s ease-out;
}
@keyframes rankUpPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.pilot-tier {
  font-family: Orbitron, monospace;
  font-size: 12px;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.pilot-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: clamp(8px, 1.5vw, 10px);
  margin-bottom: clamp(16px, 3vw, 20px);
}
.pilot-stat {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 240, 255, 0.12);
  border-radius: 6px;
  padding: clamp(8px, 1.8vw, 12px) clamp(6px, 1.2vw, 8px);
}
.pilot-stat span {
  display: block;
  font-family: Orbitron, monospace;
  font-size: clamp(15px, 3vw, 18px);
  color: var(--cyan);
  margin-bottom: 4px;
}
.pilot-stat label {
  font-size: clamp(9px, 1.6vw, 11px);
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
}
.pilot-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: clamp(8px, 1.5vw, 12px);
  max-width: 100%;
}
.pilot-actions .btn {
  min-width: 0;
  width: 100%;
  padding: clamp(12px, 2.5vw, 14px) clamp(10px, 2vw, 14px);
  font-size: clamp(12px, 2.2vw, 14px);
  letter-spacing: 1px;
}
.pilot-actions .btn-primary {
  grid-column: 1 / -1;
  padding: clamp(14px, 3vw, 18px) clamp(16px, 4vw, 24px);
  font-size: clamp(14px, 2.8vw, 17px);
  letter-spacing: 2px;
}
.pilot-explore-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: clamp(12px, 2.2vw, 14px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}
.pilot-content .daily-reward {
  margin-bottom: 14px;
  padding: clamp(10px, 2vw, 14px) clamp(12px, 2.5vw, 16px);
  gap: 10px;
}
.pilot-content .daily-reward-text {
  font-size: clamp(13px, 2.3vw, 15px);
}
.pilot-content .daily-reward-claim {
  padding: clamp(6px, 1.5vw, 8px) clamp(12px, 2.5vw, 16px);
  font-size: clamp(11px, 2vw, 13px);
}
.mp-pilot-name {
  font-family: Orbitron, monospace;
  font-size: 18px;
  color: #ff006e;
  margin: 0 0 8px;
  padding: 8px 0;
}

@media (max-width: 520px) {
  .pilot-stats { grid-template-columns: repeat(2, 1fr); }
  .pilot-actions { grid-template-columns: 1fr; }
  .verify-banner {
    flex-direction: column;
    align-items: stretch;
    text-align: left;
  }
  .verify-banner-btn { width: 100%; }
  .daily-reward {
    flex-wrap: wrap;
  }
  .daily-reward-claim { width: 100%; margin-top: 4px; }
}

@media (min-width: 768px) {
  .pilot-stats { grid-template-columns: repeat(5, 1fr); }
  .auth-content { max-width: 520px; }
  .pilot-content { max-width: 680px; }
}

/* ── Daily reward banner ── */
.daily-reward {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.12), rgba(255, 215, 0, 0.02));
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.18);
  animation: dailyPulse 2.4s ease-in-out infinite;
}
@keyframes dailyPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.14); }
  50% { box-shadow: 0 0 26px rgba(255, 215, 0, 0.32); }
}
.daily-reward-icon { font-size: 20px; }
.daily-reward-text { flex: 1; font-size: clamp(14px, 2.5vw, 16px); color: rgba(255, 255, 255, 0.9); }
.daily-reward-text strong { color: #ffd700; }
.daily-reward-claim {
  font-family: Orbitron, monospace;
  font-size: clamp(12px, 2.2vw, 14px);
  letter-spacing: 1px;
  padding: 6px 16px;
  border: 1px solid #ffd700;
  border-radius: 6px;
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  cursor: pointer;
  transition: all 0.15s;
}
.daily-reward-claim:hover:not(:disabled) { background: rgba(255, 215, 0, 0.3); box-shadow: 0 0 14px rgba(255, 215, 0, 0.4); }
.daily-reward-claim:disabled { opacity: 0.4; cursor: default; }

.verify-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 140, 0, 0.45);
  background: rgba(255, 140, 0, 0.12);
}
.verify-banner-icon { font-size: 20px; }
.verify-banner-text { flex: 1; font-size: clamp(14px, 2.5vw, 16px); color: rgba(255, 255, 255, 0.92); line-height: 1.5; }
.verify-banner-btn {
  font-family: Orbitron, monospace;
  font-size: clamp(11px, 2vw, 13px);
  letter-spacing: 1px;
  padding: clamp(8px, 1.8vw, 10px) clamp(12px, 2.5vw, 14px);
  border: 1px solid rgba(255, 140, 0, 0.6);
  border-radius: 6px;
  background: rgba(255, 140, 0, 0.2);
  color: #ffd699;
  cursor: pointer;
}
.verify-banner-btn:hover:not(:disabled) { background: rgba(255, 140, 0, 0.35); }
.verify-banner-btn:disabled { opacity: 0.45; cursor: default; }
#btnEnterArena:disabled { opacity: 0.45; cursor: not-allowed; filter: grayscale(0.4); }

/* ── Leaderboard ── */
.leaderboard-content, .missions-content, .friends-content { max-width: 560px; width: 92%; }
.friends-sub, .friends-empty, .friends-search-empty {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.85rem;
  margin-bottom: 14px;
  line-height: 1.45;
}
.friends-search-input { margin-bottom: 10px; }
.friends-search-results {
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 8px;
  margin-bottom: 18px;
  max-height: 160px;
  overflow-y: auto;
}
.friend-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.friend-search-row:last-child { border-bottom: none; }
.friend-search-name { font-weight: 600; letter-spacing: 0.5px; }
.friend-add-btn { padding: 4px 12px; font-size: 0.72rem; min-width: 64px; }
.friend-added { color: #00ff88; font-size: 0.75rem; letter-spacing: 1px; }
.friends-list-title {
  font-size: 0.72rem;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  margin: 8px 0 10px;
}
.friends-list {
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 8px;
  margin-bottom: 16px;
  max-height: 280px;
  overflow-y: auto;
}
.friend-row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.friend-row:last-child { border-bottom: none; }
.friend-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.friend-status.online {
  background: #00ff88;
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.6);
}
.friend-name { font-weight: 600; }
.friend-state {
  font-size: 0.72rem;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
}
.friend-row .friend-state { color: rgba(255, 255, 255, 0.45); }
.friend-row:has(.friend-status.online) .friend-state { color: #00ff88; }
.friend-msg {
  border: 1px solid rgba(0, 240, 255, 0.35);
  background: rgba(0, 240, 255, 0.08);
  color: #00f0ff;
  font-family: Orbitron, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.friend-msg:hover { background: rgba(0, 240, 255, 0.18); }
.friend-message-panel {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  text-align: left;
}
.friend-message-input {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  margin-bottom: 10px;
  font-size: 16px;
  line-height: 1.4;
}
.friend-message-hint {
  font-size: 12px;
  color: rgba(255, 180, 80, 0.9);
  margin: -4px 0 10px;
  line-height: 1.4;
}
.friend-message-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.friend-message-actions .btn {
  min-width: 100px;
  padding: 10px 16px;
}
.friend-message-status {
  margin-top: 10px;
  font-size: 13px;
  text-align: center;
}
.friend-message-status.ok { color: #00ff88; }
.friend-message-status.error { color: #ff6b8a; }
.friend-remove {
  border: none;
  background: transparent;
  color: rgba(255, 77, 109, 0.7);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px 6px;
}
.friend-remove:hover { color: #ff4d6d; }
.friends-badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  margin-left: 4px;
  border-radius: 999px;
  background: rgba(0, 255, 136, 0.2);
  color: #00ff88;
  font-size: 0.65rem;
  font-weight: 700;
  vertical-align: middle;
}
.friend-toast { border-color: rgba(0, 255, 136, 0.5); color: #00ff88; }
.friend-invite-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 215, 0, 0.45);
  background: rgba(255, 200, 0, 0.08);
  text-align: center;
}
.friend-invite-text {
  font-size: 15px;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.92);
}
.friend-invite-text strong { color: #ffd700; }
.friend-invite-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 12px;
}
.friend-invite-btn {
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
}
.friend-invite-done {
  font-size: 13px;
  color: #00ff88;
  letter-spacing: 0.04em;
  margin-top: 4px;
}
.lb-tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 14px; }
.lb-tab {
  font-family: Orbitron, monospace;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 7px 16px;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 6px;
  background: transparent;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s;
}
.lb-tab.active { background: rgba(0, 240, 255, 0.15); color: #00f0ff; border-color: #00f0ff; box-shadow: 0 0 12px rgba(0, 240, 255, 0.25); }
.lb-table-wrap { border: 1px solid rgba(0, 240, 255, 0.18); border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.lb-head, .lb-row {
  display: grid;
  grid-template-columns: 44px 1fr 72px 60px 72px;
  align-items: center;
  padding: 8px 12px;
  font-size: 13px;
}
.lb-head {
  background: rgba(0, 240, 255, 0.08);
  font-family: Orbitron, monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
}
.lb-body { max-height: 46vh; overflow-y: auto; }
.lb-row { border-top: 1px solid rgba(255, 255, 255, 0.05); }
.lb-row:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }
.lb-row.me { background: rgba(0, 240, 255, 0.12); color: #00f0ff; }
.lb-rank { font-family: Orbitron, monospace; }
.lb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-col { text-align: right; font-variant-numeric: tabular-nums; }
.lb-loading { padding: 24px; text-align: center; color: rgba(255, 255, 255, 0.4); font-size: 13px; }

/* ── Missions ── */
.missions-sub { text-align: center; font-size: 12px; color: rgba(255, 255, 255, 0.45); margin: -4px 0 16px; }
.mission-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; max-height: 52vh; overflow-y: auto; }
.mission-card {
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
}
.mission-card.complete { border-color: rgba(255, 215, 0, 0.55); box-shadow: 0 0 14px rgba(255, 215, 0, 0.15); }
.mission-card.claimed { opacity: 0.5; }
.mission-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mission-label { font-size: 14px; color: rgba(255, 255, 255, 0.9); }
.mission-reward { font-family: Orbitron, monospace; font-size: 12px; color: #ffd700; }
.mission-bar { height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.mission-bar-fill { height: 100%; background: linear-gradient(90deg, #00f0ff, #6cf); border-radius: 4px; transition: width 0.5s ease-out; }
.mission-card.complete .mission-bar-fill { background: linear-gradient(90deg, #ffd700, #ffb700); }
.mission-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.mission-progress { font-size: 11px; color: rgba(255, 255, 255, 0.55); font-variant-numeric: tabular-nums; }
.mission-claim {
  font-family: Orbitron, monospace;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 5px 14px;
  border: 1px solid #ffd700;
  border-radius: 6px;
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  cursor: pointer;
}
.mission-claim:disabled { opacity: 0.35; cursor: default; border-color: rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.4); background: transparent; }

.event-mission-section {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 107, 53, 0.25);
}
.event-section-title {
  background: linear-gradient(90deg, #ff0044, #ffffff 50%, #0044ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.event-missions-sub { color: rgba(255, 180, 120, 0.75) !important; }
.mission-card.event-mission {
  border: 1px solid rgba(255, 107, 53, 0.45);
  background: linear-gradient(135deg, rgba(255, 0, 68, 0.08), rgba(0, 68, 255, 0.08));
  box-shadow: 0 0 18px rgba(255, 107, 53, 0.12);
}
.mission-card.event-mission.complete {
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 0 0 22px rgba(255, 107, 53, 0.25);
}
.mission-card.event-mission .mission-bar-fill {
  background: linear-gradient(90deg, #ff0044, #ffd700, #0044ff);
}
.mission-event-badge {
  display: inline-block;
  font-family: Orbitron, monospace;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #ff6b35;
  margin-bottom: 6px;
}
.mission-event-title {
  font-family: Orbitron, monospace;
  font-size: 11px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 6px;
}
.event-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 107, 53, 0.45);
  background: linear-gradient(90deg, rgba(255, 0, 68, 0.12), rgba(0, 68, 255, 0.12));
}
.event-banner-emoji { font-size: 1.4rem; }
.event-banner-text { flex: 1; font-size: 13px; color: rgba(255, 255, 255, 0.88); min-width: 180px; }
.event-banner-btn {
  font-family: Orbitron, monospace;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid #ff6b35;
  background: rgba(255, 107, 53, 0.2);
  color: #ffb347;
  cursor: pointer;
}
.fireworks-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  mix-blend-mode: screen;
}

.live-board {
  position: absolute;
  top: 88px;
  right: 12px;
  width: 168px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 8px;
  background: rgba(4, 10, 20, 0.55);
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 5;
}
.live-board-title {
  font-family: Orbitron, monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(0, 240, 255, 0.7);
  margin-bottom: 6px;
  text-align: center;
}
.live-board-list { list-style: none; margin: 0; padding: 0; }
.live-board-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  padding: 2px 0;
  color: rgba(255, 255, 255, 0.75);
}
.live-board-row.me { color: #00f0ff; font-weight: 600; }
.live-board-row.bounty .lb-nm { color: #ffd700; }
.live-board-row.bounty-self .lb-nm { color: rgba(255, 220, 120, 0.92); }
.lb-target {
  font-size: 8px;
  letter-spacing: 0.08em;
  color: rgba(255, 200, 80, 0.85);
  font-family: Orbitron, monospace;
}
.score-block.bounty-target-self .label { color: rgba(255, 180, 60, 0.9); }
.score-block.bounty-target-self .value.gold {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.35);
}
.live-board-row .lb-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-board-row .lb-sc { font-variant-numeric: tabular-nums; flex-shrink: 0; }
.live-board-row .lb-bot { font-size: 8px; opacity: 0.5; letter-spacing: 1px; }

/* ── In-arena daily mission (desktop) ── */
.hud-mission {
  position: absolute;
  bottom: 72px;
  left: 16px;
  width: 228px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 215, 0, 0.28);
  border-radius: 8px;
  background: rgba(4, 10, 20, 0.62);
  backdrop-filter: blur(4px);
  pointer-events: none;
  z-index: 5;
}
.hud-mission-title {
  font-family: Orbitron, monospace;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(255, 215, 0, 0.75);
  margin-bottom: 6px;
}
.hud-mission-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.25;
  margin-bottom: 8px;
}
.hud-mission-bar {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 6px;
}
.hud-mission-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffd700, #ffb700);
  border-radius: 3px;
  transition: width 0.4s ease-out;
}
.hud-mission-safe {
  font-size: 10px;
  line-height: 1.3;
  color: rgba(255, 180, 80, 0.95);
  margin: 4px 0 2px;
  letter-spacing: 0.02em;
}
.hud-mission.mission-paused {
  border-color: rgba(255, 180, 80, 0.45);
}
.hud-mission.mission-paused .hud-mission-fill {
  opacity: 0.55;
}
.hud-mission-foot {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
  font-variant-numeric: tabular-nums;
}
.hud-mission-foot span:last-child {
  color: #ffd700;
  font-family: Orbitron, monospace;
  font-size: 9px;
}

.hud-event-mission {
  top: 118px;
  bottom: auto;
  border-color: rgba(255, 107, 53, 0.5);
  background: linear-gradient(135deg, rgba(255, 0, 68, 0.12), rgba(0, 68, 255, 0.1)), rgba(4, 10, 20, 0.72);
  box-shadow: 0 0 16px rgba(255, 107, 53, 0.15);
}
.hud-event-mission .hud-mission-title {
  color: rgba(255, 180, 120, 0.9);
}
.hud-event-mission .hud-mission-fill {
  background: linear-gradient(90deg, #ff0044, #ffd700, #0044ff);
}
.hud-event-mission .hud-mission-foot span:last-child {
  color: #ffb347;
}

.hud-ctf {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  min-width: 280px;
  max-width: min(92vw, 520px);
  padding: 10px 14px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 10px;
  background: rgba(4, 10, 20, 0.78);
  backdrop-filter: blur(6px);
  pointer-events: none;
  z-index: 6;
  text-align: center;
}
.hud-ctf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.hud-ctf-mode {
  font-family: Orbitron, monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 215, 0, 0.85);
}
.hud-ctf-timer {
  font-family: Orbitron, monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  font-variant-numeric: tabular-nums;
}
.hud-ctf-team {
  font-family: Orbitron, monospace;
  font-size: 11px;
  letter-spacing: 1px;
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.88);
}
.hud-ctf-scores {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
}
.hud-ctf-score {
  font-family: Orbitron, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* ── Streak / multi-kill announcement ── */
.streak-banner {
  position: absolute;
  top: 28%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  font-family: Orbitron, monospace;
  font-size: clamp(20px, 4vw, 30px);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 0 16px currentColor;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
  max-width: min(90vw, 520px);
  text-align: center;
}
.streak-banner.show { animation: streakPop 2.4s ease-out forwards; }
.streak-banner.multi { color: #ff006e; }
.streak-banner.streak { color: #00f0ff; }
.streak-banner.bounty { color: #ffd700; }
.streak-banner.event-live {
  color: #ffb347;
  white-space: normal;
  line-height: 1.35;
  font-size: clamp(15px, 3vw, 22px);
  letter-spacing: 0.06em;
  max-width: min(92vw, 560px);
  text-shadow: 0 0 18px rgba(255, 107, 53, 0.65), 0 0 8px rgba(255, 255, 255, 0.35);
}
.streak-banner.event-live.show { animation: eventLivePop 4.2s ease-out forwards; }

.arena-event-hud {
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: Orbitron, monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffd4b0;
  background: rgba(255, 80, 30, 0.18);
  border: 1px solid rgba(255, 120, 60, 0.55);
  box-shadow: 0 0 16px rgba(255, 100, 50, 0.2);
  animation: eventHudPulse 1.6s ease-in-out infinite;
  pointer-events: none;
  z-index: 18;
  white-space: nowrap;
  max-width: min(92vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes eventHudPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(255, 100, 50, 0.2); }
  50% { box-shadow: 0 0 28px rgba(255, 140, 60, 0.45); }
}
body.view-fpv.game-cursor-hidden #gameCanvas {
  cursor: none !important;
}

body.view-fpv #miniMap {
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}
@keyframes streakPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  25% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -55%) scale(1); }
}
@keyframes eventLivePop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.55); filter: brightness(1.4); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); filter: brightness(1.6); }
  22% { transform: translate(-50%, -50%) scale(1); filter: brightness(1); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(1.02); }
}
.hud-left .value.gold { color: #ffd700; }

@media (max-width: 768px) {
  .live-board { display: none; }
  .hud-mission { display: none !important; }
  .hud-event-mission { display: none !important; }
  .streak-banner {
    font-size: clamp(14px, 3.6vw, 18px);
    letter-spacing: 0.06em;
    white-space: normal;
    line-height: 1.3;
    padding: 0 16px;
  }
  .wave-banner { font-size: clamp(22px, 5.5vw, 30px); }
  .arena-event-hud { font-size: 10px; padding: 5px 12px; }
}

/* Mobile in-game: compact toast-style announcements (not giant center text) */
body.is-mobile.is-in-game .streak-banner {
  top: max(84px, calc(env(safe-area-inset-top) + 76px));
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.35;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(8, 12, 30, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  text-shadow: none;
  white-space: normal;
  max-width: calc(100vw - 96px);
  text-wrap: balance;
}
body.is-mobile.is-in-game .streak-banner.multi {
  color: #ff88bb;
  border-color: rgba(255, 0, 110, 0.45);
}
body.is-mobile.is-in-game .streak-banner.streak {
  color: #88eeff;
  border-color: rgba(0, 240, 255, 0.4);
}
body.is-mobile.is-in-game .streak-banner.bounty {
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.45);
}
body.is-mobile.is-in-game .streak-banner.event-live {
  color: #ffb347;
  border-color: rgba(255, 107, 53, 0.5);
  background: linear-gradient(135deg, rgba(255, 0, 68, 0.2), rgba(0, 68, 255, 0.15)), rgba(8, 12, 30, 0.94);
}
body.is-mobile.is-in-game .streak-banner.show {
  animation: streakPopMobile 2.2s ease-out forwards;
}
body.is-mobile.is-in-game .streak-banner.event-live.show {
  animation: eventLivePopMobile 4.2s ease-out forwards;
}
@keyframes streakPopMobile {
  0% { opacity: 0; transform: translateX(-50%) translateY(6px); }
  12% { opacity: 1; transform: translateX(-50%) translateY(0); }
  82% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-4px); }
}
@keyframes eventLivePopMobile {
  0% { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.96); }
  10% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.02); }
  20% { transform: translateX(-50%) translateY(0) scale(1); }
  78% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(1); }
}

body.is-mobile.is-in-game .arena-event-hud {
  top: max(84px, calc(env(safe-area-inset-top) + 76px));
  font-size: 9px;
  padding: 5px 10px;
  letter-spacing: 0.05em;
  max-width: calc(100vw - 96px);
}

body.is-mobile.is-in-game .wave-banner {
  font-size: clamp(18px, 4.5vw, 24px);
  letter-spacing: 0.08em;
  text-shadow: 0 0 16px var(--cyan);
}

body.is-mobile.is-in-game .death-recap-inner {
  padding: 18px 22px;
  max-width: min(320px, 88vw);
}
body.is-mobile.is-in-game .death-recap-title { font-size: 20px; margin-bottom: 8px; }
body.is-mobile.is-in-game .death-recap-cause { font-size: 13px; }
body.is-mobile.is-in-game .death-recap-timer { font-size: 15px; }
body.is-mobile.is-in-game .death-recap-count { font-size: 40px; }

body.game-cursor-hidden #gameCanvas {
  cursor: none !important;
}

.command-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(640px, 92vw);
  padding: 10px 12px;
  background: rgba(8, 12, 30, 0.96);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), var(--glow);
}
.command-prefix {
  font-family: Orbitron, monospace;
  color: var(--magenta);
  font-weight: 700;
}
.command-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-family: Rajdhani, sans-serif;
  font-size: 16px;
  outline: none;
}
.command-close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 18px;
  flex-shrink: 0;
  min-width: 36px;
  min-height: 36px;
}
.command-send {
  display: none;
}
.chat-backdrop { display: none; }
.chat-sheet { display: contents; }
.chat-panel {
  position: fixed;
  left: 12px;
  bottom: 72px;
  z-index: 8500;
  width: min(360px, 88vw);
  max-height: 220px;
  background: rgba(8, 12, 30, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-panel-head {
  padding: 8px 12px;
  font-family: Orbitron, monospace;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--cyan);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.chat-panel-close { display: none; }
.chat-panel-title { flex: 1; }
.chat-hint { color: rgba(255,255,255,0.35); font-weight: 400; }
.chat-hint-desktop { }
.chat-log-body {
  padding: 8px 10px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.45;
  max-height: 180px;
}
.chat-line { margin-bottom: 6px; word-break: break-word; }
.chat-line.chat-sys { color: rgba(255,255,255,0.45); font-style: italic; }
.chat-line.chat-in { color: #b8f0ff; }
.chat-line.chat-out { color: #ffc8e0; }
.chat-meta { color: rgba(255,255,255,0.35); font-size: 11px; margin-right: 4px; }
.chat-toggle {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 8600;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(8, 12, 30, 0.9);
  font-size: 18px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--magenta);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.chat-toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8700;
  max-width: 90vw;
  padding: 10px 16px;
  background: rgba(255, 0, 110, 0.2);
  border: 1px solid rgba(255, 0, 110, 0.5);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  pointer-events: none;
}

.pilot-tagline {
  margin: 0 0 12px;
  font-size: 13px;
  color: rgba(0, 240, 255, 0.75);
  letter-spacing: 0.04em;
  text-align: center;
}

.tutorial-content { max-width: 520px; }
.tutorial-step {
  min-height: 140px;
  margin: 16px 0 24px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}
.tutorial-step h3 {
  margin: 0 0 10px;
  color: var(--cyan);
  font-family: Orbitron, monospace;
  font-size: 16px;
}
.tutorial-step p { margin: 0 0 8px; }
.tutorial-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.death-recap {
  position: fixed;
  inset: 0;
  z-index: 8200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 0, 0, 0.72);
  pointer-events: none;
}
.death-recap-inner {
  text-align: center;
  padding: 28px 36px;
  border: 1px solid rgba(255, 60, 80, 0.45);
  background: rgba(12, 4, 8, 0.92);
  box-shadow: 0 0 40px rgba(255, 0, 60, 0.25);
  max-width: 420px;
}
.death-recap-title {
  font-family: Orbitron, monospace;
  font-size: 28px;
  color: #ff3355;
  text-shadow: 0 0 16px rgba(255, 50, 70, 0.6);
  margin-bottom: 10px;
}
.death-recap-cause {
  font-size: 15px;
  color: rgba(255, 200, 200, 0.9);
  margin-bottom: 8px;
}
.death-recap-reward {
  font-size: 13px;
  color: rgba(0, 240, 255, 0.85);
  margin-bottom: 12px;
}
.death-recap-mission {
  font-size: 12px;
  color: rgba(255, 215, 0, 0.85);
  margin-bottom: 12px;
}
.death-recap-timer {
  font-family: Orbitron, monospace;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.death-recap-timer-label {
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.65);
}
.death-recap-count {
  font-size: 48px;
  line-height: 1;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 80, 100, 0.55);
  font-variant-numeric: tabular-nums;
}
.death-recap-count.respawning {
  font-size: 22px;
  letter-spacing: 2px;
}
