/* Pulse-Rush Arena - Mobile-First Clash Royale Layout & Cyberpunk Aesthetics */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;800;900&family=Rajdhani:wght@600;700&display=swap');

:root {
  --bg-color: #06070d;
  --panel-bg: #0e111f;
  --panel-card: #13172b;
  --cyan-neon: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.4);
  --pink-neon: #ff007f;
  --pink-glow: rgba(255, 0, 127, 0.4);
  --yellow-gold: #ffd700;
  --gold-glow: rgba(255, 215, 0, 0.45);
  --text-main: #f1f5f9;
  --text-dim: #8b95b5;
  --border-subtle: #1e2646;
  --nav-height: 64px;
  --topbar-height: 52px;

  /* Spacing scale (4px / 8px grid) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;

  /* Consistent corner radii */
  --radius-pill: 20px;
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-sm: 6px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(0, 240, 255, 0.08) 0%, transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(255, 0, 127, 0.07) 0%, transparent 60%),
    linear-gradient(180deg, #070810 0%, #0b0d18 100%);
}

/* On mobile/small screens: no centering, fill the whole viewport */
@media (max-width: 899px) {
  body {
    justify-content: flex-start;
    align-items: flex-start;
  }
}

/* Mobile-First Shell */
.mobile-app-container {
  /* On mobile: always fill 100% of the viewport, no portrait centering */
  width: 100%;
  max-width: 100%;
  height: 100%;
  height: 100dvh;
  background: #090c17;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  overscroll-behavior: none;
  border: none;
}

/* On desktop portrait (>= 900px wide, portrait orientation): show as centered portrait card */
@media (min-width: 900px) and (orientation: portrait) {
  body {
    justify-content: center;
    align-items: center;
  }
  .mobile-app-container {
    max-width: 460px;
    height: 94vh;
    border-radius: 20px;
    border: 2px solid #1c2340;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.1);
    border-left: 1px solid rgba(0, 240, 255, 0.15);
    border-right: 1px solid rgba(255, 0, 127, 0.15);
  }
}

/* === FULL VIEWPORT LANDSCAPE: 100% edge-to-edge, zero margins, no card edges === */
@media (orientation: landscape) {
  html, body {
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }
  body {
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }
  .mobile-app-container {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* When In-Match: always expand fully regardless of screen size */
.mobile-app-container.in-match-wide {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

@media (orientation: landscape) {
  body.is-in-match .top-status-bar {
    height: 36px;
    padding-top: 0;
    padding-bottom: 0;
  }
  body.is-in-match .top-status-bar .credits-badge,
  body.is-in-match .top-status-bar .callsign-badge {
    padding: 3px 8px;
    font-size: 11px;
  }
}

/* --- 1. TOP STATUS BAR (THIN, METALLIC BEZEL HOUSING) --- */
.top-status-bar {
  height: calc(var(--topbar-height) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: max(var(--space-md, 12px), env(safe-area-inset-left, 0px));
  padding-right: max(var(--space-md, 12px), env(safe-area-inset-right, 0px));
  padding-bottom: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md, 12px);
  background: linear-gradient(180deg, #252e3e 0%, #151b27 15%, #0b0f17 88%, #080a10 100%);
  border-bottom: 1.5px solid #242e42;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 242, 254, 0.15),
    0 6px 20px rgba(0, 0, 0, 0.7);
  z-index: 50;
  flex-shrink: 0;
  position: relative;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  flex: 1;
  min-width: 0;
}

.credits-badge,
.callsign-badge {
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  padding: 0 14px;
  border-radius: 20px;
  font-family: 'Orbitron', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  flex: 1;
  max-width: 170px;
  white-space: nowrap;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.credits-badge {
  background: linear-gradient(135deg, rgba(34, 26, 8, 0.94) 0%, rgba(18, 14, 4, 0.96) 100%);
  border: 1.5px solid rgba(255, 215, 0, 0.65);
  color: #ffd700;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 5px rgba(0, 0, 0, 0.8),
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 0 14px rgba(255, 215, 0, 0.25);
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.credits-badge:hover {
  background: linear-gradient(135deg, rgba(48, 36, 12, 0.98) 0%, rgba(26, 20, 6, 0.98) 100%);
  border-color: #ffe033;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 5px rgba(0, 0, 0, 0.8),
    0 4px 14px rgba(0, 0, 0, 0.6),
    0 0 22px rgba(255, 215, 0, 0.55);
  transform: translateY(-1.5px);
}

.credits-badge:active {
  transform: scale(0.96);
}

.topup-plus-btn {
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd700 0%, #ff9900 100%);
  color: #0b0f17;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 2px;
  padding: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.topup-plus-btn:hover {
  transform: scale(1.18) rotate(90deg);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.95);
  filter: brightness(1.15);
}

.topup-plus-btn:active {
  transform: scale(0.9);
}

.callsign-badge {
  background: linear-gradient(135deg, rgba(10, 26, 42, 0.94) 0%, rgba(5, 14, 24, 0.96) 100%);
  border: 1.5px solid rgba(0, 242, 254, 0.65);
  color: #00f2fe;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 5px rgba(0, 0, 0, 0.8),
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 0 14px rgba(0, 242, 254, 0.25);
  text-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
}

.callsign-badge:hover {
  background: linear-gradient(135deg, rgba(16, 38, 62, 0.98) 0%, rgba(8, 20, 34, 0.98) 100%);
  border-color: #38f9d7;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    inset 0 -2px 5px rgba(0, 0, 0, 0.8),
    0 4px 14px rgba(0, 0, 0, 0.6),
    0 0 22px rgba(0, 242, 254, 0.55);
  transform: translateY(-1.5px);
}

.callsign-badge:active {
  transform: scale(0.96);
}

.online-indicator {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00ff88;
  box-shadow: 0 0 10px #00ff88, 0 0 4px #00ff88;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}

.online-indicator::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 1.5px solid #00ff88;
  opacity: 0.8;
  animation: radarPing 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes radarPing {
  0% { transform: scale(0.8); opacity: 0.9; }
  75% { transform: scale(2.2); opacity: 0; }
  100% { transform: scale(2.4); opacity: 0; }
}

.online-indicator.offline {
  background: #718096;
  box-shadow: none;
}
.online-indicator.offline::after {
  display: none;
}

.status-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  flex-shrink: 0;
}

.icon-gear-btn,
.icon-trophy-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  min-height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  cursor: pointer;
  position: relative;
  user-select: none;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.icon-gear-btn {
  background: linear-gradient(135deg, rgba(20, 26, 48, 0.92) 0%, rgba(10, 14, 28, 0.96) 100%);
  border: 1.5px solid rgba(80, 110, 180, 0.5);
  color: #9ab0e0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 2px 6px rgba(0, 0, 0, 0.5);
}

.icon-gear-btn:hover {
  background: linear-gradient(135deg, rgba(32, 43, 82, 0.96) 0%, rgba(18, 24, 48, 0.98) 100%);
  border-color: var(--cyan-neon);
  color: var(--cyan-neon);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 0 14px var(--cyan-glow);
  transform: rotate(35deg) translateY(-1px);
}

.icon-gear-btn:active {
  transform: scale(0.92);
}

.icon-trophy-btn {
  background: linear-gradient(135deg, rgba(36, 29, 16, 0.92) 0%, rgba(19, 15, 8, 0.96) 100%);
  border: 1.5px solid rgba(255, 215, 0, 0.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 12px rgba(255, 215, 0, 0.25);
  color: #ffd700;
}

.icon-trophy-btn:hover {
  background: linear-gradient(135deg, rgba(54, 42, 22, 0.96) 0%, rgba(28, 22, 10, 0.98) 100%);
  border-color: #ffd700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 0 18px rgba(255, 215, 0, 0.6);
  transform: translateY(-1.5px) scale(1.05);
}

.icon-trophy-btn:active {
  transform: scale(0.92);
}

/* --- RANK & TROPHY BANNER (CLASH ROYALE / CYBERPUNK HYBRID) --- */
.rank-trophy-banner {
  width: 100%;
  max-width: 600px;
  margin: 8px auto 14px auto;
  padding: 10px 16px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, rgba(16, 23, 38, 0.92) 0%, rgba(8, 13, 24, 0.96) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  border-radius: 14px;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -2px 6px rgba(0, 0, 0, 0.8),
    0 8px 24px rgba(0, 0, 0, 0.65),
    0 0 18px rgba(0, 240, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  z-index: 5;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.rank-trophy-banner:hover {
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -2px 6px rgba(0, 0, 0, 0.8),
    0 10px 28px rgba(0, 0, 0, 0.75),
    0 0 24px rgba(0, 240, 255, 0.22);
  transform: translateY(-1px);
}

.rank-banner-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.rank-icon-badge {
  font-size: 26px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid rgba(255, 215, 0, 0.65);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 14px rgba(255, 215, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: floatRankBadge 3s ease-in-out infinite;
}

@keyframes floatRankBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.rank-info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rank-tier-name {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ffd700;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
  line-height: 1.1;
}

.rank-trophy-count {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #00f0ff;
  letter-spacing: 0.6px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.rank-progress-wrap {
  flex: 1;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.rank-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-family: 'Orbitron', monospace;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.rank-trophy-ratio {
  color: #00f0ff;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

.rank-next-label {
  color: #ffaa00;
  font-size: 9.5px;
  opacity: 0.9;
}

.rank-progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 6px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.85);
}

.rank-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00f0ff 0%, #00ff88 55%, #ffd700 100%);
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.7);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.rank-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.45) 50%, transparent 100%);
  animation: shimmerProgressBar 2.5s infinite;
}

@keyframes shimmerProgressBar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* --- MAIN CONTENT AREA --- */
.main-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  overflow: hidden; /* No scrolling in lobby or match */
  position: relative;
  min-height: 0; /* important so flex child doesn't overflow */
}

/* In-match: no overflow at all */
.main-content-area.in-match-noscroll {
  overflow: hidden !important;
}

.tab-screen {
  display: none !important;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.tab-screen.active {
  display: flex !important;
}

/* Allow scrolling only in shop and controls screens */
#screenShop.active,
#screenControls.active {
  overflow-y: auto;
}

/* --- SCREEN 1: BATTLE (LOBBY WITH BALANCED SYMMETRICAL COMPOSITION) --- */
#screenBattle.active {
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px max(10px, env(safe-area-inset-bottom, 0px));
  overflow: hidden;
  height: 100%;
  box-sizing: border-box;
  background-color: #030408;
  position: relative; /* needed for absolute-positioned canvas child */
}

/* Lobby animated background canvas — sits behind all content */
#lobbyBgCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  display: block;
}

/* All direct lobby children must be above background and canvas */
#screenBattle > *:not(#lobbyBgCanvas) {
  position: relative;
  z-index: 2;
}

/* Balanced 2-Zone Grid: Left = Character Stage | Right = Battle CTAs */
.lobby-arena-grid {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: end;
  width: 100%;
  gap: 10px;
  min-height: 0;
  margin: 4px 0;
  position: relative;
}

/* === MOBILE LANDSCAPE LOBBY LAYOUT === */
@media (orientation: landscape) {
  /* Compact bottom nav */
  .bottom-nav {
    height: calc(42px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    min-height: 42px !important;
  }
  .nav-item {
    padding: 2px 0 !important;
  }
  .nav-icon { width: 18px !important; height: 18px !important; }
  .nav-svg-icon { width: 16px !important; height: 16px !important; }
  .nav-label { font-size: 9px !important; }

  /* Compact top status bar */
  .top-status-bar {
    height: calc(34px + env(safe-area-inset-top, 0px)) !important;
    min-height: 34px !important;
    padding: 0 12px !important;
  }
  .credits-badge,
  .callsign-badge {
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
    padding: 0 8px !important;
    font-size: 11px !important;
  }
  .icon-gear-btn,
  .icon-trophy-btn {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    font-size: 13px !important;
  }

  /* Lobby Screen */
  #screenBattle.active {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    padding: 2px max(10px, env(safe-area-inset-right, 0px)) 2px max(10px, env(safe-area-inset-left, 0px)) !important;
    overflow: hidden !important;
    height: 100% !important;
    box-sizing: border-box !important;
    gap: 3px !important;
  }

  /* Rank banner: sleek and compact edge-to-edge at top */
  .rank-trophy-banner {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 3px 12px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    border-radius: 8px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
  }
  .rank-banner-left {
    gap: 8px !important;
  }
  .rank-icon-badge {
    font-size: 15px !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    border-radius: 6px !important;
  }
  .rank-tier-name {
    font-size: 11px !important;
    line-height: 1.1 !important;
  }
  .rank-trophy-count {
    font-size: 9px !important;
    line-height: 1.1 !important;
  }
  .rank-trophy-ratio {
    font-size: 9px !important;
  }
  .rank-next-label {
    font-size: 8px !important;
  }
  .rank-progress-bar {
    height: 6px !important;
  }

  /* 2-Zone Flex Row: Left = Hero Stage, Right = Battle CTAs docked to corner */
  .lobby-arena-grid {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-end !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 12px !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 0 2px 0 !important;
    box-sizing: border-box !important;
    position: relative !important;
    z-index: 2 !important;
  }

  /* Left Column: Hero Stage grounded */
  #screenBattle .hero-stage,
  .hero-stage {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
    height: 100% !important;
    min-height: 0 !important;
    gap: 2px !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .hero-rarity-pill {
    font-size: 8px !important;
    padding: 1px 6px !important;
    margin-bottom: 0 !important;
  }

  .hero-skin-title {
    font-size: 12px !important;
    margin-bottom: 0 !important;
    line-height: 1.1 !important;
  }

  .hero-canvas-wrap {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: clamp(110px, 38vh, 175px) !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
  }

  #heroPreviewCanvas {
    width: auto !important;
    height: 100% !important;
    max-height: 165px !important;
    max-width: 200px !important;
    object-fit: contain !important;
  }

  .hero-pedestal-glow {
    bottom: 4px !important;
    width: 140px !important;
    height: 26px !important;
  }

  .lobby-weapon-selector {
    margin-top: 2px !important;
    width: 100% !important;
    max-width: 210px !important;
    height: 26px !important;
    gap: 4px !important;
  }

  .lobby-weapon-nav-btn {
    width: 22px !important;
    height: 24px !important;
    font-size: 9px !important;
  }

  .lobby-weapon-pill-btn {
    height: 24px !important;
    padding: 2px 8px !important;
  }

  .lobby-weapon-tag {
    font-size: 7px !important;
  }

  .lobby-weapon-name {
    font-size: 9px !important;
  }

  .lobby-weapon-icon {
    font-size: 11px !important;
  }

  /* Right Column: CTA Container Docked firmly to the Bottom-Right Corner */
  #screenBattle .cta-container,
  .cta-container {
    flex: 0 0 clamp(280px, 38vw, 360px) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    align-items: stretch !important;
    align-self: flex-end !important;
    margin-left: auto !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
    gap: 6px !important;
    min-height: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    z-index: 5 !important;
  }

  .ranked-format-selector {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 2px 8px !important;
    margin-bottom: 0 !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    box-sizing: border-box !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  .ranked-format-selector .format-label,
  .format-label {
    font-size: 8.5px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    text-align: left !important;
    color: var(--yellow-gold) !important;
    line-height: 1 !important;
  }

  .format-pill-row {
    display: flex !important;
    flex: 1 1 auto !important;
    gap: 5px !important;
    width: auto !important;
    height: 100% !important;
    align-items: center !important;
  }

  .format-pill-btn {
    flex: 1 1 0 !important;
    padding: 0 4px !important;
    font-size: 8.5px !important;
    font-weight: 700 !important;
    min-height: 22px !important;
    height: 22px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
  }

  .battle-cta-btn {
    height: 46px !important;
    min-height: 46px !important;
    font-size: 15px !important;
    border-radius: 9px !important;
    box-shadow: 0 4px 14px rgba(255, 0, 127, 0.4) !important;
    padding: 3px 8px !important;
  }

  .cta-content-row .cta-icon {
    font-size: 16px !important;
  }

  .cta-content-row .cta-text {
    font-size: 15px !important;
    letter-spacing: 1px !important;
  }

  .cta-player-counter {
    font-size: 8px !important;
    margin-top: 1px !important;
  }

  .sub-cta-row {
    display: flex !important;
    gap: 5px !important;
    width: 100% !important;
  }

  .sub-cta-btn {
    flex: 1 !important;
    height: 30px !important;
    min-height: 30px !important;
    font-size: 9.5px !important;
    padding: 2px 6px !important;
    border-radius: 7px !important;
  }

  .sub-cta-icon {
    font-size: 12px !important;
  }

  #screenBattle > footer.game-tips {
    display: none !important;
  }
}

/* Hero switcher tabs */
.hero-toggle-bar {
  display: flex;
  width: 100%;
  max-width: 320px;
  background: #0d1122;
  border-radius: 24px;
  border: 1px solid #1c2444;
  padding: 4px;
  gap: 4px;
}

.hero-toggle-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #7986ad;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 0;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.hero-toggle-btn.active[data-hero="p1"] {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(0, 240, 255, 0.05));
  color: var(--cyan-neon);
  border: 1px solid var(--cyan-neon);
  box-shadow: 0 0 14px var(--cyan-glow);
}

.hero-toggle-btn.active[data-hero="p2"] {
  background: linear-gradient(135deg, rgba(255, 0, 127, 0.25), rgba(255, 0, 127, 0.05));
  color: var(--pink-neon);
  border: 1px solid var(--pink-neon);
  box-shadow: 0 0 14px var(--pink-glow);
}

/* Left Column: Hero Stage */
.lobby-arena-grid > .hero-stage,
.hero-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: visible;
  padding-bottom: 2px;
}

.hero-rarity-pill {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--yellow-gold);
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 2px 8px;
  border-radius: var(--radius-pill, 20px);
  margin-bottom: 2px;
  text-shadow: 0 0 6px var(--gold-glow);
  flex-shrink: 0;
}

.hero-skin-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(13px, 2.8vw, 16px);
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 1.5px;
  margin-bottom: 2px;
  text-shadow: 
    0 0 4px #00f2fe,
    0 0 12px rgba(0, 242, 254, 0.95),
    0 0 24px rgba(0, 242, 254, 0.5);
  text-align: center;
  flex-shrink: 0;
  animation: neonFlicker 6s infinite ease-in-out;
}

.hero-canvas-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 1 auto;
  max-height: 250px;
  margin: -4px 0 0;
  width: 100%;
}

#heroPreviewCanvas {
  display: block;
  width: 100%;
  max-width: 220px;
  max-height: clamp(150px, 30vh, 240px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
  z-index: 2;
}

.hero-pedestal-glow {
  position: absolute;
  bottom: 8px;
  width: 180px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.45) 0%, rgba(157, 0, 255, 0.2) 60%, transparent 80%);
  filter: blur(4px);
  z-index: 1;
  animation: pedestalPulse 2.8s ease-in-out infinite alternate;
}

@keyframes pedestalPulse {
  from {
    transform: scale(0.92);
    opacity: 0.6;
  }
  to {
    transform: scale(1.08);
  }
}

/* Lobby Weapon In-Hand Selector */
.lobby-weapon-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  max-width: 240px;
  margin-top: 4px;
  z-index: 5;
}

.lobby-weapon-nav-btn {
  background: rgba(14, 20, 38, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #00f0ff;
  border-radius: 6px;
  width: 26px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.18s ease;
  outline: none;
}

.lobby-weapon-nav-btn:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.45);
  transform: scale(1.08);
}

.lobby-weapon-pill-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(16, 22, 42, 0.9), rgba(24, 32, 60, 0.9));
  border: 1px solid rgba(0, 240, 255, 0.4);
  border-radius: 8px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(0, 240, 255, 0.1);
  outline: none;
}

.lobby-weapon-pill-btn:hover {
  border-color: #00f0ff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35), inset 0 0 16px rgba(0, 240, 255, 0.2);
  transform: translateY(-1px);
}

.lobby-weapon-tag {
  font-family: 'Orbitron', monospace;
  font-size: 7.5px;
  font-weight: 800;
  color: #7d8ea8;
  letter-spacing: 0.8px;
}

.lobby-weapon-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.lobby-weapon-icon {
  font-size: 13px;
  filter: drop-shadow(0 0 4px #00f0ff);
}

.lobby-weapon-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.8px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

/* Right Column: Match Actions (Docked to Bottom-Right) */
.lobby-arena-grid > .cta-container,
.cta-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  gap: 8px;
  padding-bottom: 4px;
}

/* Tactile Composite Primary CTA: FIND MATCH (Electric Pink to Cyan Gradient) */
.battle-cta-btn {
  position: relative;
  width: 100%;
  height: 58px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #ff007f 0%, #d10077 32%, #550bb5 65%, #00f2fe 100%);
  color: #ffffff;
  font-family: 'Orbitron', sans-serif;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 1.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 
    0 5px 0 #1b022b,
    0 8px 22px rgba(255, 0, 127, 0.45),
    0 0 20px rgba(0, 242, 254, 0.25),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.65),
    inset 0 -2px 4px rgba(0, 0, 0, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease;
  padding: 0 6px;
}

.cta-etched-watermark {
  position: absolute;
  right: 8px;
  bottom: -4px;
  font-family: 'Orbitron', monospace;
  font-size: 34px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.08);
  letter-spacing: 2px;
  pointer-events: none;
  user-select: none;
  line-height: 1;
  z-index: 1;
}

.cta-content-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 10px rgba(255, 255, 255, 0.4);
}

.cta-icon {
  font-size: 18px;
}

.cta-text {
  font-size: 17px;
  letter-spacing: 1px;
}

.cta-mode-badge {
  font-size: 10px;
  padding: 2px 5px;
}

.cta-player-counter {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.pulsing-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #00ffcc;
  box-shadow: 0 0 6px #00ffcc;
  animation: pulseDot 1.5s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.battle-cta-btn:hover {
  filter: brightness(1.08);
  box-shadow: 
    0 5px 0 #1b022b,
    0 10px 28px rgba(255, 0, 127, 0.6),
    0 0 28px rgba(0, 242, 254, 0.4),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.8);
}

.battle-cta-btn:active {
  transform: translateY(3px);
  box-shadow: 
    0 2px 0 #1b022b,
    0 4px 12px rgba(255, 0, 127, 0.4),
    0 0 15px rgba(0, 242, 254, 0.25),
    inset 0 1.5px 1px rgba(255, 255, 255, 0.5);
}

.cta-glow-fx {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transform: skewX(-25deg);
  animation: shineSweep 3.2s infinite;
}

@keyframes shineSweep {
  0% { left: -100%; }
  25% { left: 160%; }
  100% { left: 160%; }
}

.cta-icon {
  font-size: 26px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.cta-text {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* Secondary CTA: PRACTICE (vs Bot) */
.practice-cta-btn {
  width: 100%;
  height: 48px;
  background: #11172e;
  border: 1.5px solid var(--cyan-neon);
  border-radius: 12px;
  color: var(--cyan-neon);
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
  transition: all 0.2s ease;
}

.practice-cta-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.4);
  color: #ffffff;
  border-color: #ffffff;
}

.practice-cta-btn:active {
  transform: scale(0.98);
}

.practice-diff-badge {
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid rgba(0, 240, 255, 0.4);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
}

.game-tips {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.4;
}

.game-tips span {
  color: var(--yellow-gold);
  font-weight: 700;
}

/* --- SCREEN 2: SHOP (SKINS) --- */
#screenShop, #screenControls {
  overflow-y: auto;
  padding-bottom: 24px;
}

.screen-header {
  margin-bottom: 14px;
}

.screen-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  color: var(--cyan-neon);
  letter-spacing: 1px;
}

.screen-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 2px;
}

.shop-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

@media (max-width: 700px) {
  .shop-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .shop-tabs {
    grid-template-columns: repeat(2, 1fr);
  }
}

.shop-tab-btn {
  background: rgba(16, 21, 38, 0.85);
  border: 1px solid rgba(45, 56, 96, 0.6);
  color: #8b99c2;
  padding: 9px 6px;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
}

.shop-tab-btn:hover {
  color: #ffffff;
  border-color: var(--cyan-neon);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.shop-tab-btn.active {
  border-color: var(--cyan-neon);
  color: #ffffff;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2) 0%, rgba(157, 0, 255, 0.2) 100%);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.35);
}

/* --- LOADOUT DUAL-PANE SHOWCASE & CATALOG LAYOUT --- */
.loadout-split-view {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: stretch;
  width: 100%;
  margin-top: 4px;
}

/* Left Pane: Interactive 2D Live Preview Hero Showcase */
.loadout-showcase-pane {
  flex: 0 0 320px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
}

.loadout-pedestal-card {
  background: linear-gradient(165deg, rgba(16, 22, 40, 0.95) 0%, rgba(9, 12, 24, 0.98) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.35);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.65), inset 0 0 24px rgba(0, 240, 255, 0.06);
  position: relative;
  overflow: hidden;
  height: 100%;
}

.loadout-pedestal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #00f0ff, #ff007f, transparent);
  pointer-events: none;
}

.loadout-badge-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 6px;
}

.loadout-rarity-badge {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.8px;
  background: rgba(0, 240, 255, 0.15);
  border: 1px solid #00f0ff;
  color: #00f0ff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.loadout-rarity-badge.rare {
  background: rgba(255, 85, 0, 0.18);
  border-color: #ff6600;
  color: #ff8833;
  box-shadow: 0 0 8px rgba(255, 102, 0, 0.35);
}

.loadout-rarity-badge.epic {
  background: rgba(168, 36, 255, 0.2);
  border-color: #a824ff;
  color: #d187ff;
  box-shadow: 0 0 10px rgba(168, 36, 255, 0.4);
}

.loadout-rarity-badge.legendary {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 100, 0, 0.2) 100%);
  border-color: #ffd700;
  color: #ffe066;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.5);
  animation: goldBadgeGleam 2.5s infinite alternate;
}

@keyframes goldBadgeGleam {
  0% { filter: drop-shadow(0 0 4px #ffd700); }
  100% { filter: drop-shadow(0 0 12px #ffbb00); }
}

.loadout-status-badge {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid #00ff88;
  color: #00ff88;
}

.loadout-status-badge.locked {
  background: rgba(255, 59, 20, 0.15);
  border-color: #ff3b14;
  color: #ff6644;
}

.loadout-status-badge.owned {
  background: rgba(0, 240, 255, 0.15);
  border-color: #00f0ff;
  color: #00f0ff;
}

.loadout-canvas-wrap {
  position: relative;
  width: 280px;
  height: 250px;
  margin: 2px 0 6px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 60%, rgba(20, 30, 60, 0.45) 0%, transparent 70%);
  border-radius: 12px;
}

#loadoutPreviewCanvas {
  width: 280px;
  height: 250px;
  display: block;
}

.loadout-canvas-overlay-label {
  position: absolute;
  top: 8px;
  right: 10px;
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  font-weight: 700;
  color: rgba(0, 240, 255, 0.7);
  letter-spacing: 1.5px;
  pointer-events: none;
  background: rgba(11, 14, 26, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.25);
  padding: 2px 7px;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.15);
}

/* Color Palette Selector (Multi-Part & Custom Picker) */
.loadout-color-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(14, 18, 35, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 9px;
  padding: 8px 10px;
  margin: 3px 0 6px 0;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
}

.loadout-color-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.loadout-color-title {
  font-family: 'Orbitron', monospace;
  font-size: 8.5px;
  font-weight: 800;
  color: #7d8ea8;
  letter-spacing: 0.8px;
}

.loadout-active-color-name {
  font-family: 'Orbitron', monospace;
  font-size: 9.5px;
  font-weight: 800;
  color: #00f0ff;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

/* Multi-Part Armor Tabs (Head, Body, Legs, All) */
.loadout-part-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
}

.part-tab-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(20, 26, 48, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  padding: 4px 2px;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
}

.part-tab-btn:hover {
  background: rgba(30, 40, 70, 0.85);
  border-color: rgba(0, 240, 255, 0.4);
}

.part-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(120, 0, 255, 0.22));
  border-color: #00f0ff;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.35);
}

.part-tab-btn .part-icon {
  font-size: 11px;
}

.part-tab-btn .part-name {
  font-family: 'Orbitron', monospace;
  font-size: 8.5px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.part-color-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid #ffffff;
  box-shadow: 0 0 5px currentColor;
  flex-shrink: 0;
}

.loadout-color-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.reset-skin-colors-btn {
  background: rgba(255, 31, 61, 0.15);
  border: 1px solid rgba(255, 31, 61, 0.4);
  color: #ff4d6d;
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  font-weight: 800;
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  outline: none;
}

.reset-skin-colors-btn:hover {
  background: rgba(255, 31, 61, 0.35);
  border-color: #ff1f3d;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 31, 61, 0.45);
}

.loadout-preset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 2px;
}

.loadout-preset-header .preset-label {
  font-family: 'Orbitron', monospace;
  font-size: 7.5px;
  font-weight: 800;
  color: #7d8ea8;
  letter-spacing: 0.6px;
}

.loadout-color-swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  width: 100%;
  padding: 3px 0;
}

.color-swatch-btn {
  width: 100%;
  aspect-ratio: 1;
  max-width: 28px;
  max-height: 28px;
  margin: 0 auto;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.color-swatch-btn:hover {
  transform: scale(1.22);
  border-color: #ffffff;
  box-shadow: 0 0 10px var(--swatch-color, #00f0ff);
  z-index: 5;
}

.color-swatch-btn.active {
  border-color: #ffffff !important;
  transform: scale(1.24);
  box-shadow: 0 0 10px var(--swatch-color, #00f0ff), 0 0 18px var(--swatch-color, #00f0ff);
  z-index: 4;
}

.color-swatch-btn.active::after {
  content: '✓';
  font-size: 9px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.color-swatch-btn.locked {
  opacity: 0.75;
}

.color-swatch-btn.locked:hover {
  opacity: 1.0;
}

.color-swatch-btn.locked::after {
  content: '🔒';
  font-size: 8.5px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

.loadout-details-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  margin-top: 4px;
}

.loadout-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  width: 100%;
}

.loadout-item-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 0.5px;
  margin: 0;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.loadout-item-price {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 800;
  color: var(--yellow-gold);
  white-space: nowrap;
}

.loadout-feature-tagline {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 700;
  color: #00f0ff;
  line-height: 1.35;
  background: rgba(0, 240, 255, 0.08);
  padding: 4px 8px;
  border-radius: 6px;
  border-left: 2px solid #00f0ff;
}

.loadout-item-desc {
  font-size: 11px;
  color: #9ba7c5;
  line-height: 1.4;
  margin: 0;
  min-height: 28px;
}

.loadout-primary-btn {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.loadout-primary-btn.equipped {
  background: rgba(0, 255, 136, 0.15);
  border-color: #00ff88;
  color: #00ff88;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.25);
  cursor: default;
}

.loadout-primary-btn.equip {
  background: linear-gradient(135deg, #00e5ff 0%, #0088ff 100%);
  border-color: #ffffff;
  color: #060913;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
}

.loadout-primary-btn.equip:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.8);
}

.loadout-primary-btn.buy {
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  border-color: #fff275;
  color: #06080e;
  box-shadow: 0 0 18px rgba(255, 215, 0, 0.5);
}

.loadout-primary-btn.buy:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 26px rgba(255, 215, 0, 0.8);
}

/* Right Pane: Responsive Catalog Grid */
.loadout-catalog-pane {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.skin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
  padding-bottom: 12px;
}

/* Custom Scrollbar for Catalog */
.skin-grid::-webkit-scrollbar {
  width: 6px;
}
.skin-grid::-webkit-scrollbar-track {
  background: rgba(10, 14, 26, 0.6);
  border-radius: 4px;
}
.skin-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 4px;
}
.skin-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.6);
}

.skin-card {
  background: rgba(13, 17, 34, 0.9);
  border: 1.5px solid rgba(40, 52, 92, 0.65);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.skin-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.skin-card.inspected {
  border-color: #00f0ff !important;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.4), inset 0 0 8px rgba(0, 240, 255, 0.15) !important;
  background: rgba(18, 26, 52, 0.95);
}

.skin-card.selected {
  border-color: #00ff88 !important;
  box-shadow: 0 0 14px rgba(0, 255, 136, 0.35);
}

.skin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 4px;
}

.skin-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 75px;
}

.skin-tag {
  font-family: monospace;
  font-size: 8px;
  font-weight: bold;
  color: var(--yellow-gold);
  background: rgba(255, 215, 0, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
}

.skin-tag.rare {
  color: #ff8833;
  background: rgba(255, 102, 0, 0.18);
}

.skin-tag.epic {
  color: #d187ff;
  background: rgba(168, 36, 255, 0.2);
}

.skin-tag.legendary {
  color: #ffe066;
  background: rgba(255, 215, 0, 0.25);
}

.skin-preview-wrap {
  margin: 4px 0;
  width: 100%;
  display: flex;
  justify-content: center;
}

.skin-preview-canvas {
  background: #070914;
  border-radius: 6px;
  border: 1px solid rgba(40, 52, 92, 0.7);
  width: 90px;
  height: 80px;
  display: block;
}

.skin-card-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
}

.skin-price {
  font-family: 'Orbitron', monospace;
  font-size: 10.5px;
  font-weight: bold;
  color: var(--yellow-gold);
}

.unlocked-text {
  color: #00ff88;
  font-size: 9.5px;
  font-family: 'Orbitron', monospace;
}

.skin-action-btn {
  width: 100%;
  padding: 5px 0;
  border-radius: 5px;
  font-family: 'Orbitron', sans-serif;
  font-size: 9.5px;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-align: center;
}

.skin-action-btn.buy {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #000;
}

.skin-action-btn.select {
  background: #192247;
  color: var(--cyan-neon);
  border-color: var(--cyan-neon);
}

.skin-action-btn.equipped {
  background: rgba(0, 255, 136, 0.12);
  color: #00ff88;
  border-color: #00ff88;
  cursor: default;
}

/* Responsive Media Queries for Mobile Screens (Landscape & Portrait) */

/* 1. Mobile Portrait (Width <= 768px, portrait mode) */
@media (max-width: 768px) and (orientation: portrait) {
  .loadout-split-view {
    flex-direction: column;
    gap: 12px;
  }

  .loadout-showcase-pane {
    flex: none;
    width: 100%;
    max-width: 100%;
  }

  .loadout-pedestal-card {
    padding: 10px 14px;
  }

  .loadout-canvas-wrap {
    width: 100%;
    max-width: 260px;
    height: 190px;
  }

  #loadoutPreviewCanvas {
    width: 100%;
    height: 190px;
  }

  .loadout-item-desc {
    font-size: 10.5px;
    min-height: auto;
  }

  .skin-grid {
    max-height: 380px;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
}

/* 2. Mobile Landscape (Height <= 520px, landscape mode — Primary Mobile Gaming View) */
@media (max-height: 520px) and (orientation: landscape) {
  .loadout-header {
    margin-bottom: 2px;
    padding-bottom: 0px;
  }

  .loadout-header h2 {
    font-size: 14px;
    margin: 0;
  }

  .loadout-header .screen-subtitle {
    display: none;
  }

  .shop-tabs {
    margin-bottom: 4px;
    gap: 4px;
  }

  .shop-tab-btn {
    padding: 3px 8px;
    font-size: 9.5px;
  }

  .loadout-split-view {
    flex-direction: row;
    gap: 10px;
    margin-top: 0;
    height: calc(100vh - 170px);
    max-height: calc(100vh - 170px);
    margin-bottom: 54px;
  }

  .loadout-showcase-pane {
    flex: 0 0 210px;
    max-width: 220px;
    height: 100%;
  }

  .loadout-pedestal-card {
    padding: 6px 8px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
  }

  .loadout-badge-row {
    margin-bottom: 2px;
  }

  .loadout-rarity-badge, .loadout-status-badge {
    font-size: 8px;
    padding: 1px 5px;
  }

  .loadout-canvas-wrap {
    width: 100%;
    max-width: 180px;
    height: 105px;
    margin: 0 auto;
  }

  #loadoutPreviewCanvas {
    width: 100%;
    height: 105px;
  }

  .loadout-color-section {
    padding: 2px 5px;
    gap: 2px;
    margin: 1px 0;
  }

  .loadout-color-title {
    font-size: 7px;
  }

  .loadout-active-color-name {
    font-size: 7.5px;
  }

  .loadout-color-swatches {
    gap: 2px;
  }

  .color-swatch-btn {
    width: 18px;
    height: 18px;
    border-width: 1.5px;
  }

  .color-swatch-btn.active::after {
    font-size: 8px;
  }

  .color-swatch-btn.locked::after {
    font-size: 6.5px;
  }

  .loadout-details-box {
    gap: 2px;
    margin-top: 1px;
  }

  .loadout-item-title {
    font-size: 11.5px;
  }

  .loadout-item-price {
    font-size: 10px;
  }

  .loadout-feature-tagline {
    font-size: 7.5px;
    padding: 1.5px 4px;
    line-height: 1.2;
  }

  .loadout-item-desc {
    display: none;
  }

  .loadout-primary-btn {
    padding: 4px 8px;
    font-size: 9.5px;
    margin-top: 2px;
  }

  .skin-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 6px;
    height: 100%;
    max-height: 100%;
    padding-bottom: 4px;
  }

  .skin-card {
    padding: 5px;
    border-radius: 8px;
  }

  .skin-card canvas {
    width: 60px !important;
    height: 52px !important;
  }

  .skin-name {
    font-size: 9px;
    max-width: 55px;
  }

  .skin-price {
    font-size: 9px;
  }

  .skin-action-btn {
    padding: 3px 0;
    font-size: 8.5px;
  }
}

/* --- SCREEN 3: CONTROLS & SETTINGS --- */
.setting-card {
  background: #0e1224;
  border: 1px solid #1c2448;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 14px;
}

.setting-card-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--yellow-gold);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.diff-btn-group {
  display: flex;
  gap: 8px;
}

.diff-select-btn,
.cyber-setting-btn {
  flex: 1;
  background: #141930;
  border: 1.5px solid #232c52;
  border-radius: 8px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.diff-select-btn .diff-name,
.cyber-setting-btn .diff-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #9eb2e0;
}

.diff-select-btn .diff-desc,
.cyber-setting-btn .diff-desc {
  font-size: 10px;
  color: #6a779e;
  margin-top: 2px;
}

.diff-select-btn:hover,
.cyber-setting-btn:hover {
  background: #181f3d;
  border-color: #3d4f8a;
}

.diff-select-btn.active,
.cyber-setting-btn.active {
  border-color: var(--cyan-neon);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 12px var(--cyan-glow);
}

.diff-select-btn.active .diff-name,
.cyber-setting-btn.active .diff-name {
  color: var(--cyan-neon);
}

.remap-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}

.remap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: #13172e;
  border-radius: 6px;
}

.remap-row span {
  font-size: 13px;
  font-weight: 600;
}

.key-bind-btn {
  background: #1d2342;
  color: var(--cyan-neon);
  border: 1px solid #2f3a69;
  padding: 5px 14px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  min-width: 90px;
  text-align: center;
}

.key-bind-btn.waiting {
  background: var(--pink-neon);
  color: #fff;
  border-color: #fff;
  animation: pulseWait 0.8s infinite alternate;
}

@keyframes pulseWait {
  from { opacity: 0.6; }
  to { opacity: 1.0; }
}

.remap-actions {
  display: flex;
  justify-content: flex-end;
}

/* --- SCREEN 4: IN-GAME MATCH VIEW --- */
#screenMatch {
  padding: 0;
  justify-content: flex-start;
  align-items: stretch;
  background: #000;
  position: relative;
  overflow: hidden;
  flex: 1;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  /* Force fill parent main-content-area */
  flex-grow: 1;
  flex-shrink: 1;
  flex-basis: 0;
}

/* When in-match, make main content area fill all remaining height */
body.is-in-match .main-content-area,
.mobile-app-container.in-match-wide .main-content-area {
  flex: 1;
  height: 100%;
  overflow: hidden;
}

/* Floating overlay bar for pause & emote buttons (positioned cleanly between center badge and P2) */
.match-hud-bar {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: calc(50% + 112px);
  right: auto;
  display: flex;
  align-items: center;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  z-index: 40;
  pointer-events: none;
}

.match-mode-indicator {
  display: none !important;
}

.match-hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.pause-btn {
  background: rgba(16, 22, 44, 0.62);
  border: 1.5px solid rgba(0, 240, 255, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 14px;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  transition: transform 0.1s, background 0.2s, border-color 0.2s;
}

.pause-btn:hover,
.pause-btn:active {
  background: rgba(0, 240, 255, 0.28);
  border-color: var(--cyan-neon);
  box-shadow: 0 0 12px var(--cyan-glow);
  transform: scale(0.94);
}

.emote-hud-btn {
  background: rgba(16, 22, 44, 0.62) !important;
  border: 1.5px solid rgba(255, 215, 0, 0.5) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 11px !important;
  font-weight: 700;
  padding: 6px 12px !important;
  height: 36px;
  border-radius: 8px;
  pointer-events: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
  transition: transform 0.1s, background 0.2s;
}

.emote-hud-btn:active {
  transform: scale(0.94);
  background: rgba(255, 215, 0, 0.25) !important;
}

/* Arcade frame: fills 100% of the screen */
.arcade-frame,
.arcade-frame.aspect-fill {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100% !important;
  height: 100% !important;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #0d0f1a 0%, #05060a 100%);
  overflow: hidden;
  touch-action: none;
}

/* Game canvas: high-DPI rendering edge-to-edge full screen */
#gameCanvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  background: #0b0c14;
  image-rendering: auto;
  image-rendering: -webkit-optimize-contrast;
  touch-action: none;
}

/* In landscape or match mode, hide the outer top-status-bar and bottom-nav to maximize screen */
.mobile-app-container.in-match-wide > .top-status-bar,
.mobile-app-container.in-match-wide > .bottom-nav,
body.is-in-match .top-status-bar,
body.is-in-match .bottom-nav {
  display: none !important;
}

/* When body is in-match, the appContainer and screenMatch fill everything */
body.is-in-match #appContainer {
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  width: 100vw;
  border-radius: 0;
  border: none;
}

body.is-in-match #screenMatch {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column;
}



/* --- IN-BATTLE SETTINGS OVERLAY MODE --- */
#screenControls.overlay-mode {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  background: rgba(8, 10, 20, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex !important;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  border-top: 2px solid var(--cyan-neon);
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.35);
  animation: overlaySlideFade 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes overlaySlideFade {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.in-battle-settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(19, 25, 48, 0.95);
  border: 1.5px solid var(--cyan-neon);
  box-shadow: 0 0 16px var(--cyan-glow);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.resume-overlay-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 10px 20px;
  min-height: 44px;
  background: linear-gradient(135deg, #00f0ff, #0088ff);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
  transition: transform 0.15s, box-shadow 0.15s;
}

.resume-overlay-btn:active {
  transform: scale(0.96);
  box-shadow: 0 0 24px #00f0ff;
}

.in-battle-pause-tag {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow-gold);
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 6px 12px;
  border-radius: 6px;
}

/* --- VIRTUAL ON-SCREEN TOUCH CONTROLS --- */
/* The touch layer is an absolute overlay INSIDE .arcade-frame, NOT the screenMatch.
   This keeps it above the canvas but scoped to the game area. */
.touch-controls-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30; /* above canvas (z-index not set) and above hud (z-index 20) */
  box-sizing: border-box;
  overflow: visible;
}

/* FLOATING JOYSTICK FULL LEFT-HALF TRACK AREA (Layout 2: Floating) */
.touch-floating-track-area {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 25;
}

.touch-controls-layer.mode-floating .touch-floating-track-area {
  display: block;
  pointer-events: auto;
}

.touch-controls-layer.mode-floating .touch-joystick-zone {
  z-index: 26;
}

.touch-controls-layer.mode-floating .touch-joystick-zone.floating-active {
  opacity: min(1, calc(var(--ctrl-opacity, 0.52) + 0.45));
  transition: opacity 0.15s ease-out;
}

/* LEFT SIDE: VIRTUAL JOYSTICK
   Anchored to bottom-left safe area using responsive units */
/* LEFT SIDE: COMPACT VIRTUAL JOYSTICK
   Anchored tightly to bottom-left safe area with sleek translucent ghost aesthetics */
.touch-joystick-zone {
  position: absolute;
  bottom: max(6px, env(safe-area-inset-bottom, 0px));
  left: max(8px, env(safe-area-inset-left, 0px));
  /* Large comfortable responsive size */
  width: clamp(96px, 14vw, 130px);
  height: clamp(96px, 14vw, 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: var(--ctrl-opacity, 0.52);
  transform: scale(var(--ctrl-scale, 1));
  transform-origin: center center;
  transition: opacity 0.2s, transform 0.1s;
}

.touch-joystick-zone:active,
.touch-joystick-zone.active {
  opacity: min(1, calc(var(--ctrl-opacity, 0.52) + 0.38));
}

.touch-joystick-base {
  position: relative;
  width: 90%;
  height: 90%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(12, 18, 38, 0.22) 0%, rgba(6, 10, 24, 0.45) 70%, rgba(0, 240, 255, 0.1) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2), inset 0 0 12px rgba(180, 40, 255, 0.15);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.touch-joystick-zone.active .touch-joystick-base {
  border-color: #00f0ff;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.5), inset 0 0 18px rgba(180, 40, 255, 0.28);
}

.touch-joystick-guide-x {
  position: absolute;
  width: 80%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.4), transparent);
  pointer-events: none;
}

.touch-joystick-guide-y {
  position: absolute;
  height: 80%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(0, 240, 255, 0.4), transparent);
  pointer-events: none;
}

.touch-joystick-ring {
  position: absolute;
  width: 56%;
  height: 56%;
  border-radius: 50%;
  border: 1px dashed rgba(180, 40, 255, 0.35);
  pointer-events: none;
}

.touch-joystick-stick {
  position: absolute;
  width: clamp(32px, 4.8vw, 42px);
  height: clamp(32px, 4.8vw, 42px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(0, 240, 255, 0.8) 0%, rgba(22, 38, 80, 0.6) 65%, rgba(8, 16, 36, 0.6) 100%);
  border: 1.5px solid #00f0ff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.5), 0 3px 8px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.04s ease-out;
}

.touch-joystick-core {
  width: 35%;
  height: 35%;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 8px #00f0ff, 0 0 12px rgba(180, 40, 255, 0.7);
}

/* RIGHT SIDE: MOBA RADIAL ACTION CLUSTER (Independent Repositionable Buttons)
   Transparent and non-intrusive so players and arena remain 100% visible */
.touch-moba-cluster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.touch-moba-btn {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  opacity: var(--ctrl-opacity, 0.52);
  transform: scale(var(--ctrl-scale, 1));
  transform-origin: center center;
  transition: opacity 0.2s, transform 0.08s ease, box-shadow 0.08s ease;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.touch-moba-btn:active,
.touch-moba-btn.touch-active {
  transform: scale(calc(var(--ctrl-scale, 1) * 0.92));
  opacity: min(1, calc(var(--ctrl-opacity, 0.52) + 0.4));
}

.touch-moba-btn .moba-icon {
  font-size: clamp(11px, 2vw, 15px);
  line-height: 1;
}

.touch-moba-btn .moba-label {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(6.5px, 0.9vw, 8px);
  font-weight: 800;
  letter-spacing: 0.4px;
  margin-top: 1px;
}

/* PRIMARY ATTACK / SLASH */
.touch-moba-btn.moba-attack {
  width: clamp(58px, 8.8vw, 76px);
  height: clamp(58px, 8.8vw, 76px);
  right: calc(3% + env(safe-area-inset-right, 0px));
  bottom: calc(4% + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 35% 35%, rgba(255, 0, 127, 0.35) 0%, rgba(26, 8, 24, 0.48) 75%);
  border: 2px solid rgba(255, 0, 127, 0.75);
  box-shadow: 0 0 14px rgba(255, 0, 127, 0.38), inset 0 0 10px rgba(255, 0, 127, 0.25);
  color: #fff;
  z-index: 2;
}

.touch-moba-btn.moba-attack .moba-icon-main {
  font-size: clamp(20px, 3.2vw, 26px);
  line-height: 1;
  filter: drop-shadow(0 0 4px #ff007f);
}

.touch-moba-btn.moba-attack .moba-label-main {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(8px, 1.1vw, 10px);
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #ff99cc;
  margin-top: 1px;
}

.touch-moba-btn.moba-attack:active,
.touch-moba-btn.moba-attack.touch-active {
  transform: scale(0.92);
  background: rgba(255, 0, 127, 0.55);
  box-shadow: 0 0 24px rgba(255, 0, 127, 0.85), inset 0 0 14px rgba(255, 0, 127, 0.5);
}

/* JUMP */
.touch-moba-btn.moba-jump {
  width: clamp(40px, 6vw, 52px);
  height: clamp(40px, 6vw, 52px);
  right: calc(3.5% + env(safe-area-inset-right, 0px));
  bottom: calc(16% + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 35% 35%, rgba(255, 215, 0, 0.28) 0%, rgba(28, 22, 8, 0.45) 75%);
  border: 1.5px solid rgba(255, 215, 0, 0.75);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3), inset 0 0 8px rgba(255, 215, 0, 0.18);
  color: #ffd700;
}

.touch-moba-btn.moba-jump:active,
.touch-moba-btn.moba-jump.touch-active {
  transform: scale(0.92);
  background: rgba(255, 215, 0, 0.45);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.8), inset 0 0 10px rgba(255, 215, 0, 0.45);
}

/* DASH */
.touch-moba-btn.moba-dash {
  width: clamp(40px, 6vw, 52px);
  height: clamp(40px, 6vw, 52px);
  right: calc(10.5% + env(safe-area-inset-right, 0px));
  bottom: calc(14% + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 35% 35%, rgba(180, 40, 255, 0.28) 0%, rgba(22, 10, 32, 0.45) 75%);
  border: 1.5px solid rgba(180, 40, 255, 0.75);
  box-shadow: 0 0 12px rgba(180, 40, 255, 0.3), inset 0 0 8px rgba(180, 40, 255, 0.18);
  color: #d166ff;
}

.touch-moba-btn.moba-dash:active,
.touch-moba-btn.moba-dash.touch-active {
  transform: scale(0.92);
  background: rgba(180, 40, 255, 0.45);
  box-shadow: 0 0 20px rgba(180, 40, 255, 0.8), inset 0 0 10px rgba(255, 0, 127, 0.45);
}

/* PARRY */
.touch-moba-btn.moba-parry {
  width: clamp(40px, 6vw, 52px);
  height: clamp(40px, 6vw, 52px);
  right: calc(11.5% + env(safe-area-inset-right, 0px));
  bottom: calc(4% + env(safe-area-inset-bottom, 0px));
  background: radial-gradient(circle at 35% 35%, rgba(0, 240, 255, 0.28) 0%, rgba(8, 24, 32, 0.45) 75%);
  border: 1.5px solid rgba(0, 240, 255, 0.75);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3), inset 0 0 8px rgba(0, 240, 255, 0.18);
  color: #00f0ff;
}

.touch-moba-btn.moba-parry:active,
.touch-moba-btn.moba-parry.touch-active {
  transform: scale(0.92);
  background: rgba(0, 240, 255, 0.45);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.8), inset 0 0 10px rgba(0, 240, 255, 0.45);
}

/* --- 6. BOTTOM NAVIGATION BAR (METALLIC CHASSIS WITH HAPTIC TOUCHPOINTS) --- */
.bottom-nav {
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(14px, env(safe-area-inset-left, 0px));
  padding-right: max(14px, env(safe-area-inset-right, 0px));
  background: linear-gradient(180deg, #222b3b 0%, #121824 25%, #090c13 100%);
  border-top: 1.5px solid #29364d;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 -8px 24px rgba(0, 0, 0, 0.75);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 50;
  flex-shrink: 0;
  gap: 8px;
}

.nav-tab {
  flex: 1;
  height: calc(100% - 10px);
  max-height: 48px;
  background: rgba(14, 19, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #7b8ea8;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.nav-haptic-rail {
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: transparent;
  border-radius: 2px;
  transition: all 0.22s ease;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: transform 0.2s;
}

.nav-svg-icon {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: all 0.2s ease;
}

.nav-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-tab:hover {
  color: #a4bde6;
  background: rgba(20, 28, 44, 0.8);
}

.nav-tab.active {
  background: linear-gradient(180deg, rgba(0, 242, 254, 0.22) 0%, rgba(10, 16, 26, 0.85) 100%);
  border-color: rgba(0, 242, 254, 0.55);
  color: #00f2fe;
  box-shadow: 
    0 0 16px rgba(0, 242, 254, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transform: translateY(-2px);
}

.nav-tab.active .nav-haptic-rail {
  background: #00f2fe;
  left: 10%;
  right: 10%;
  box-shadow: 0 0 8px #00f2fe, 0 0 14px #00f2fe;
}

.nav-tab.active .nav-icon {
  transform: translateY(-1px);
}

.nav-tab.active .nav-svg-icon {
  filter: drop-shadow(0 0 6px rgba(0, 242, 254, 0.8));
}

.nav-tab:active {
  transform: scale(0.96);
  filter: brightness(1.2);
}

/* --- MODALS (PRE-BATTLE & PAUSE) --- */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(6, 8, 16, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-card {
  background: #0d1124;
  border: 1.5px solid var(--cyan-neon);
  box-shadow: 0 0 35px var(--cyan-glow);
  border-radius: 14px;
  width: 90%;
  max-width: 440px;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #1c2444;
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-family: 'Orbitron', sans-serif;
  color: var(--cyan-neon);
  font-size: 17px;
  letter-spacing: 1px;
}

.close-btn {
  background: transparent;
  border: none;
  color: #7986ab;
  font-size: 28px;
  cursor: pointer;
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #ff3366;
}

.pre-battle-section {
  margin-bottom: 16px;
}

.section-label {
  display: block;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--yellow-gold);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.mode-selector-group {
  display: flex;
  gap: 10px;
}

.mode-select-pill {
  flex: 1;
  background: #141a33;
  border: 1.5px solid #232d54;
  color: #8fa0cf;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  padding: 10px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-select-pill.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(157, 0, 255, 0.2));
  border-color: var(--cyan-neon);
  color: var(--cyan-neon);
  box-shadow: 0 0 14px var(--cyan-glow);
}

.matchmaking-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cyber-btn {
  padding: 10px 18px;
  border-radius: 8px;
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.cyber-btn.primary {
  background: linear-gradient(135deg, #00f0ff 0%, #0099ff 100%);
  color: #050711;
  box-shadow: 0 0 16px var(--cyan-glow);
}

.cyber-btn.primary:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 24px var(--cyan-glow);
}

.cyber-btn.secondary {
  background: #141a33;
  border-color: var(--pink-neon);
  color: var(--pink-neon);
  box-shadow: 0 0 12px var(--pink-glow);
}

.cyber-btn.secondary:hover {
  background: rgba(255, 0, 127, 0.2);
}

.cyber-btn.danger {
  background: rgba(255, 51, 102, 0.15);
  border-color: #ff3366;
  color: #ff3366;
}

.cyber-btn.danger:hover {
  background: #ff3366;
  color: #fff;
}

.large-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 14px;
}

.large-btn span {
  font-size: 15px;
}

.large-btn small {
  font-size: 11px;
  opacity: 0.8;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  margin-top: 2px;
}

.net-status-box {
  margin-top: 14px;
  padding: 10px;
  background: #121730;
  border-radius: 8px;
  border: 1px solid #273463;
  text-align: center;
}

.net-status-text {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  color: var(--yellow-gold);
}

.net-room-display {
  font-size: 14px;
  font-weight: bold;
  color: var(--cyan-neon);
  margin-top: 4px;
}

/* Pause Menu Styling */
.pause-modal-card {
  max-width: 380px;
  text-align: center;
}

.pause-bot-diff-row {
  margin-bottom: 16px;
  padding: 10px;
  background: #121730;
  border-radius: 8px;
}

.pause-bot-diff-row label {
  display: block;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: bold;
  color: var(--yellow-gold);
  margin-bottom: 6px;
}

.diff-btn-group.small {
  gap: 6px;
}

.diff-select-btn-mini {
  flex: 1;
  background: #181f3d;
  border: 1px solid #283461;
  color: #8da0cf;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: bold;
  padding: 8px 4px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
}

.diff-select-btn-mini.active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--cyan-neon);
  color: var(--cyan-neon);
}

.pause-action-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pause-action-btn {
  width: 100%;
  padding: 12px 0;
  font-size: 14px;
}

/* --- RANKED MODE & MATCHMAKING STYLES --- */

/* Trophy & Rank Tier Banner (Integrated Sleek Dark Metallic Bezel) */
.rank-trophy-banner {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, #222b3b 0%, #131925 25%, #090c13 100%);
  border: 1.5px solid #2a374c;
  border-radius: var(--radius-card, 12px);
  padding: 7px 12px;
  margin: var(--space-xs, 4px) 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md, 12px);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    inset 0 -1px 0 rgba(0, 242, 254, 0.12),
    0 6px 20px rgba(0, 0, 0, 0.65);
  box-sizing: border-box;
}

.rank-banner-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm, 8px);
  flex-shrink: 0;
}

.rank-icon-badge {
  font-size: 26px;
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.rank-info-text {
  display: flex;
  flex-direction: column;
}

.rank-tier-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--yellow-gold);
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.rank-trophy-count {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: #9cb1e6;
  font-weight: 700;
  line-height: 1.2;
}

.rank-progress-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rank-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-xs, 4px);
  width: 100%;
}

.rank-trophy-ratio {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 800;
  color: var(--yellow-gold);
  letter-spacing: 0.5px;
}

.rank-next-label {
  font-size: 10px;
  color: var(--text-dim);
  text-align: right;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600;
  white-space: nowrap;
}

.rank-progress-bar {
  width: 100%;
  height: 16px;
  background: #0b0e1c;
  border-radius: var(--radius-btn, 8px);
  border: 1px solid #1e2952;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  position: relative;
}

.rank-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8c00, #ffd700);
  border-radius: var(--radius-btn, 8px);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
  transition: width 0.5s ease;
}

/* Dual Sub-CTA Row */
.sub-cta-row {
  display: flex;
  gap: 6px;
  width: 100%;
}

.sub-cta-btn {
  flex: 1;
  min-width: 0;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  background: #11172e;
  border: 1.5px solid #232f58;
  border-radius: var(--radius-btn, 8px);
  color: #9ab0e0;
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 4px;
  cursor: pointer;
  box-sizing: border-box;
  transition: all 0.2s ease;
  position: relative;
  white-space: nowrap;
}

.sub-cta-btn:hover {
  background: #182245;
  border-color: var(--cyan-neon);
  color: #ffffff;
  box-shadow: 0 0 12px var(--cyan-glow);
}

.sub-cta-btn.practice-btn {
  border-color: rgba(0, 240, 255, 0.4);
}

.sub-cta-btn.custom-room-btn {
  border-color: rgba(255, 0, 127, 0.4);
}

.sub-cta-btn.custom-room-btn:hover {
  border-color: var(--pink-neon);
  box-shadow: 0 0 12px var(--pink-glow);
}

.sub-cta-icon {
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  flex-shrink: 0;
}

.sub-cta-label {
  display: inline-block;
  line-height: 1;
  white-space: nowrap;
  font-size: 8.5px;
  letter-spacing: 0.3px;
}

.sub-cta-badge {
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid rgba(0, 240, 255, 0.4);
  font-size: 7.5px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: var(--radius-sm, 6px);
  color: #fff;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 1px;
}

/* Matchmaking Radar Modal */
.matchmaking-modal-card {
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 26px 20px;
}

.radar-wrap {
  width: 150px;
  height: 150px;
  position: relative;
  margin-bottom: 18px;
}

.radar-scanner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(0, 240, 255, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.08) 0%, #080a17 80%);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.25);
  overflow: hidden;
}

.radar-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(0, 240, 255, 0.35);
}

.radar-circle.c1 { width: 45px; height: 45px; }
.radar-circle.c2 { width: 95px; height: 95px; }
.radar-circle.c3 { width: 140px; height: 140px; }

.radar-sweep {
  position: absolute;
  top: 0;
  left: 50%;
  width: 50%;
  height: 50%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.5) 0%, transparent 70%);
  transform-origin: 0% 100%;
  animation: radarSpin 1.8s linear infinite;
}

@keyframes radarSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.radar-center-icon {
  font-size: 28px;
  z-index: 5;
  filter: drop-shadow(0 0 10px var(--yellow-gold));
  animation: iconPulse 1.6s ease-in-out infinite alternate;
}

@keyframes iconPulse {
  from { transform: scale(0.9); }
  to { transform: scale(1.18); }
}

.matchmaking-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  color: var(--cyan-neon);
  margin-bottom: 6px;
  letter-spacing: 1px;
}

.matchmaking-tier-badge {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--yellow-gold);
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 4px 14px;
  border-radius: 12px;
  margin-bottom: 6px;
}

.matchmaking-bracket-info {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.matchmaking-timer {
  font-family: 'Orbitron', monospace;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 18px;
}

.cancel-mm-btn {
  width: 100%;
  max-width: 220px;
}

/* Ranked Results Modal */
.ranked-results-card {
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 20px;
}

.ranked-outcome-header {
  font-family: 'Orbitron', sans-serif;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.ranked-outcome-header.win {
  color: #ffd700;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.ranked-outcome-header.loss {
  color: #ff3366;
  text-shadow: 0 0 20px rgba(255, 51, 102, 0.8);
}

.ranked-opponent-name {
  font-family: 'Orbitron', monospace;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.ranked-trophy-delta {
  font-family: 'Orbitron', monospace;
  font-size: 34px;
  font-weight: 900;
  margin-bottom: 6px;
}

.ranked-trophy-delta.plus {
  color: #00ff88;
  text-shadow: 0 0 16px rgba(0, 255, 136, 0.6);
}

.ranked-trophy-delta.minus {
  color: #ff3366;
  text-shadow: 0 0 16px rgba(255, 51, 102, 0.6);
}

.ranked-reward-credits {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: bold;
  color: var(--yellow-gold);
  margin-bottom: 18px;
}

.ranked-progress-card {
  width: 100%;
  background: #121730;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 20px;
  border: 1px solid #1f2750;
}

.ranked-progress-row {
  display: flex;
  justify-content: space-between;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 6px;
}

.full-w {
  width: 100%;
}

/* --- RANKED MATCH FORMAT SELECTOR (CLEAN COMPACT GLASS INTERFACE) --- */
.ranked-format-selector {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: rgba(12, 17, 30, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(0, 242, 254, 0.28);
  border-radius: var(--radius-card, 10px);
  padding: 4px 6px;
  margin-bottom: 2px;
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 6px 18px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
  gap: 3px;
}

.ranked-format-selector .format-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 8.5px;
  font-weight: 800;
  color: var(--yellow-gold);
  letter-spacing: 0.8px;
  text-align: center;
}

.format-pill-row {
  display: flex;
  gap: 4px;
  width: 100%;
}

.format-pill-btn {
  flex: 1;
  min-width: 0;
  width: auto;
  background: rgba(8, 12, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-btn, 6px);
  color: #8fa0c4;
  font-family: 'Orbitron', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  padding: 4px 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.3px;
  box-sizing: border-box;
}

.format-pill-btn:hover {
  color: #fff;
  border-color: rgba(0, 242, 254, 0.4);
}

.format-pill-btn.active {
  background: linear-gradient(180deg, rgba(0, 242, 254, 0.25) 0%, rgba(0, 150, 255, 0.12) 100%);
  border-color: #00f2fe;
  color: #ffffff;
  box-shadow: 
    0 0 14px rgba(0, 242, 254, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Dedicated Global Leaderboard Modal Styles */
.leaderboard-modal-card {
  max-width: 380px;
  width: 92%;
  background: linear-gradient(180deg, #182030 0%, #0d121c 100%);
  border: 1.5px solid rgba(0, 242, 254, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 242, 254, 0.15);
  border-radius: 16px;
  padding: 18px 16px;
  color: #fff;
}

.leaderboard-season-tag {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 800;
  color: var(--yellow-gold);
  letter-spacing: 1.5px;
  text-align: center;
  margin: 6px 0 14px;
  padding: 4px 10px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 20px;
  display: block;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lb-pilot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: rgba(12, 17, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-family: 'Orbitron', monospace;
}

.lb-rank-badge {
  font-size: 14px;
  font-weight: 900;
  width: 28px;
  text-align: center;
}

.lb-pilot-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-pilot-name {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.lb-tier-tag {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.lb-tier-tag.cyber-legend { color: #00f2fe; }
.lb-tier-tag.master { color: #ff007f; }
.lb-tier-tag.diamond { color: #00ffcc; }
.lb-tier-tag.platinum { color: #a4bde6; }
.lb-tier-tag.bronze { color: #ffaa00; }

.lb-trophies {
  font-size: 12px;
  font-weight: 900;
  color: var(--yellow-gold);
}

.lb-pilot-row.lb-rank-1 {
  border-color: rgba(255, 215, 0, 0.5);
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.15) 0%, rgba(12, 17, 28, 0.7) 100%);
}

.lb-pilot-row.lb-current-player {
  border-color: rgba(0, 242, 254, 0.6);
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.18) 0%, rgba(12, 17, 28, 0.8) 100%);
}

.cta-mode-badge {
  background: rgba(0, 0, 0, 0.4);
  border: 1.5px solid rgba(0, 0, 0, 0.7);
  color: #111;
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
  margin-left: 2px;
}

.ranked-format-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 800;
  color: var(--yellow-gold);
  letter-spacing: 1px;
  margin-bottom: 6px;
}

/* --- ROTATE TO LANDSCAPE OVERLAY --- */
.rotate-device-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 7, 14, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.rotate-device-card {
  background: #0d1226;
  border: 2px solid var(--cyan-neon);
  box-shadow: 0 0 35px var(--cyan-glow);
  border-radius: 16px;
  max-width: 380px;
  width: 100%;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.rotate-phone-anim {
  position: relative;
  width: 70px;
  height: 70px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-icon {
  width: 28px;
  height: 48px;
  border: 2px solid var(--cyan-neon);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: phoneRotateAnim 2.6s infinite ease-in-out;
}

.phone-screen {
  width: 20px;
  height: 38px;
  background: rgba(0, 240, 255, 0.2);
  border-radius: 2px;
}

.rotate-arrow {
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 22px;
  color: var(--pink-neon);
  animation: arrowPulse 1.3s infinite alternate;
}

@keyframes phoneRotateAnim {
  0%, 15% {
    transform: rotate(0deg);
  }
  50%, 80% {
    transform: rotate(90deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

@keyframes arrowPulse {
  from { transform: scale(0.9); opacity: 0.7; }
  to { transform: scale(1.15); opacity: 1; }
}

.rotate-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 800;
  color: var(--cyan-neon);
  letter-spacing: 1.5px;
  margin-bottom: 10px;
}

.rotate-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 18px;
}

.small-btn {
  padding: 8px 16px;
  font-size: 11px;
}


/* ============================================================
   USERNAME CLAIM MODAL
   ============================================================ */
.username-claim-card {
  max-width: 380px;
  padding: 32px 28px 24px;
  text-align: center;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: linear-gradient(175deg, #0e1228 0%, #0b0d18 100%);
  position: relative;
  overflow: hidden;
}

.username-claim-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan-neon), var(--pink-neon), transparent);
  animation: usernameGlowBar 3s ease-in-out infinite;
}

@keyframes usernameGlowBar {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.username-modal-icon {
  font-size: 48px;
  margin-bottom: 12px;
  animation: usernameIconPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px var(--cyan-glow));
}

@keyframes usernameIconPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.username-modal-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 800;
  color: var(--cyan-neon);
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-shadow: 0 0 16px var(--cyan-glow);
}

.username-modal-desc {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 22px;
}

.username-input-wrap {
  position: relative;
  margin-bottom: 12px;
}

.cyber-input {
  width: 100%;
  padding: 14px 60px 14px 16px;
  font-family: 'Orbitron', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-main);
  background: #0a0c19;
  border: 2px solid var(--border-subtle);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.cyber-input::placeholder {
  color: #3a4066;
  text-transform: none;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.cyber-input:focus {
  border-color: var(--cyan-neon);
  box-shadow: 0 0 12px var(--cyan-glow), inset 0 0 8px rgba(0, 240, 255, 0.05);
}

.cyber-input.input-error {
  border-color: #ff1f3d;
  box-shadow: 0 0 12px rgba(255, 31, 61, 0.3);
}

.cyber-input.input-success {
  border-color: #00ff88;
  box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.username-char-count {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-family: 'Orbitron', sans-serif;
  color: var(--text-dim);
  pointer-events: none;
}

.username-error {
  font-size: 12px;
  color: #ff1f3d;
  text-align: left;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: rgba(255, 31, 61, 0.08);
  border-left: 3px solid #ff1f3d;
  border-radius: 4px;
  animation: usernameShake 0.3s ease-in-out;
}

@keyframes usernameShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.username-success {
  font-size: 12px;
  color: #00ff88;
  text-align: left;
  padding: 8px 12px;
  margin-bottom: 12px;
  background: rgba(0, 255, 136, 0.08);
  border-left: 3px solid #00ff88;
  border-radius: 4px;
}

.username-claim-btn {
  margin-bottom: 10px;
  font-size: 14px;
  letter-spacing: 1.5px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.username-claim-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.15), transparent);
  transition: left 0.4s;
}

.username-claim-btn:hover::after {
  left: 100%;
}

.username-claim-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.username-skip-btn {
  font-size: 11px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.username-skip-btn:hover {
  opacity: 1;
}

/* ============================================================
   MULTI-CATEGORY LOADOUT & SHOP STYLES
   ============================================================ */

.loadout-quick-bar {
  display: flex;
  gap: var(--space-sm, 8px);
  justify-content: center;
  align-items: center;
  margin-top: var(--space-sm, 8px);
  margin-bottom: var(--space-lg, 16px);
  width: 100%;
  max-width: 340px;
  flex-shrink: 0;
  z-index: 10;
}

.loadout-tag {
  flex: 1;
  max-width: 108px;
  height: 28px;
  background: rgba(18, 22, 38, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #c9d1d9;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  font-weight: 700;
  padding: 0 var(--space-sm, 8px);
  border-radius: var(--radius-pill, 20px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.1);
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
  transition: all 0.2s ease;
  line-height: 1;
}

.loadout-tag:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--cyan-neon);
  color: #ffffff;
  box-shadow: 0 0 10px var(--cyan-glow);
}

.shop-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

@media (max-width: 680px) {
  .shop-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
}

.shop-tab-btn {
  background: rgba(18, 22, 38, 0.8);
  border: 1px solid rgba(74, 77, 104, 0.5);
  color: #8b949e;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 10px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  white-space: nowrap;
}

.shop-tab-btn:hover {
  color: #fff;
  border-color: var(--cyan-neon);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.shop-tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2) 0%, rgba(157, 0, 255, 0.2) 100%);
  border-color: var(--cyan-neon);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
}

.emote-hud-btn {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 6px;
  margin-right: 8px;
  background: rgba(157, 0, 255, 0.2);
  border-color: rgba(157, 0, 255, 0.5);
  color: #d187ff;
}

.emote-hud-btn:hover {
  background: rgba(157, 0, 255, 0.35);
  color: #fff;
  box-shadow: 0 0 10px rgba(157, 0, 255, 0.5);
}

.match-hud-right {
  display: flex;
  align-items: center;
}

/* --- TOP-UP PLUS BUTTON IN HEADER --- */
.topup-plus-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  background: linear-gradient(135deg, #00f0ff 0%, #ffbb33 100%);
  color: #0b0e1a;
  font-family: 'Orbitron', monospace;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(255, 187, 51, 0.5);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s;
  vertical-align: middle;
}

.topup-plus-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

.topup-plus-btn:hover {
  transform: scale(1.18);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.8), 0 0 24px rgba(255, 187, 51, 0.6);
}

.topup-plus-btn:active {
  transform: scale(0.95);
}

/* --- DIAMOND SHOP TAB --- */
.shop-tab-btn.diamond-shop-tab {
  background: linear-gradient(135deg, rgba(255, 187, 51, 0.15) 0%, rgba(0, 240, 255, 0.15) 100%);
  border-color: rgba(255, 187, 51, 0.5);
  color: #ffd700;
}

.shop-tab-btn.diamond-shop-tab:hover,
.shop-tab-btn.diamond-shop-tab.active {
  background: linear-gradient(135deg, rgba(255, 187, 51, 0.3) 0%, rgba(0, 240, 255, 0.3) 100%);
  border-color: #ffd700;
  color: #ffffff;
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
}

/* --- DIAMOND / GEM GRID & CARDS --- */
.diamond-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  padding: 8px 4px 20px 4px;
  width: 100%;
}

.diamond-card {
  background: rgba(14, 18, 30, 0.88);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.diamond-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan-neon);
  box-shadow: 0 8px 26px rgba(0, 240, 255, 0.3);
}

.diamond-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 4px;
  background: rgba(255, 187, 51, 0.2);
  border: 1px solid #ffbb33;
  color: #ffea79;
  letter-spacing: 0.5px;
}

.diamond-icon-wrap {
  width: 68px;
  height: 68px;
  margin: 12px 0 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  animation: diamondGlowPulse 2.4s infinite alternate;
}

@keyframes diamondGlowPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.4)); }
  100% { transform: scale(1.08); filter: drop-shadow(0 0 18px rgba(255, 215, 0, 0.7)); }
}

.diamond-amount {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
  margin-bottom: 2px;
}

.diamond-pkg-name {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.diamond-bonus-tag {
  font-size: 10px;
  font-weight: bold;
  color: #00ff88;
  margin-bottom: 12px;
  min-height: 14px;
}

.diamond-buy-btn {
  width: 100%;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(255, 187, 51, 0.25) 100%);
  border: 1px solid #00f0ff;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}

.diamond-buy-btn:hover {
  background: linear-gradient(135deg, #00f0ff 0%, #ffbb33 100%);
  color: #0b0e1a;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
  border-color: #ffffff;
}

.diamond-price-sub {
  font-size: 9px;
  opacity: 0.85;
}

.diamond-buy-btn * {
  pointer-events: none;
}

/* --- SINGLE SESSION LOCKED MODAL --- */
.session-locked-backdrop {
  z-index: 99999 !important;
  background: rgba(5, 7, 14, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.session-locked-card {
  max-width: 440px;
  background: linear-gradient(160deg, #161220 0%, #0c0e18 100%);
  border: 1.5px solid #ff3366;
  box-shadow: 0 0 35px rgba(255, 51, 102, 0.4), inset 0 0 20px rgba(255, 51, 102, 0.1);
  text-align: center;
  padding: 28px 24px;
  border-radius: 14px;
  animation: sessionLockShake 0.4s ease-out;
}

@keyframes sessionLockShake {
  0% { transform: scale(0.9) translateY(-10px); opacity: 0; }
  60% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1) translateY(0); }
}

.session-lock-icon {
  font-size: 48px;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 15px rgba(255, 51, 102, 0.8));
  animation: sessionLockIconPulse 2s infinite alternate;
}

@keyframes sessionLockIconPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.session-lock-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 900;
  color: #ff3366;
  text-shadow: 0 0 12px rgba(255, 51, 102, 0.6);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

.session-lock-desc {
  font-size: 13px;
  color: #a4b1cd;
  line-height: 1.6;
  margin-bottom: 18px;
}

.session-lock-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-family: 'Orbitron', monospace;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255, 215, 0, 0.3);
  margin-bottom: 20px;
}

.session-pulse-dot {
  width: 8px;
  height: 8px;
  background: #ff3366;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #ff3366;
  animation: sessionPulseDotAnim 1.2s infinite;
}

@keyframes sessionPulseDotAnim {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* ==========================================================================
   CINEMATIC GAME INTRO SPLASH & GUIDELINES SEQUENCE
   ========================================================================== */
.game-intro-splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #06070f;
  z-index: 100010;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
}

.game-intro-splash.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.intro-bg-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.intro-grid-plane {
  position: absolute;
  inset: -60%;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 0, 127, 0.07) 1px, transparent 1px);
  background-size: 50px 50px;
  transform: perspective(400px) rotateX(65deg) translateY(80px);
  animation: introGridFly 10s linear infinite;
}

@keyframes introGridFly {
  0% { transform: perspective(400px) rotateX(65deg) translateY(0); }
  100% { transform: perspective(400px) rotateX(65deg) translateY(50px); }
}

.intro-glow-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  height: 480px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.22) 0%, rgba(180, 40, 255, 0.15) 40%, transparent 70%);
  filter: blur(50px);
  animation: introCorePulse 4s ease-in-out infinite alternate;
}

@keyframes introCorePulse {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.6; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.intro-scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.4) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.7;
}

.intro-stage {
  position: relative;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 92%;
  max-width: 640px;
  padding: 24px;
  text-align: center;
  animation: introStageIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.intro-stage.active {
  display: flex;
}

@keyframes introStageIn {
  from { opacity: 0; transform: scale(0.94) translateY(12px); filter: blur(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
}

/* Stage 1: Studio Emblem & Logo */
.studio-emblem-wrap {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.studio-cyber-ring {
  position: absolute;
  inset: 10px;
  border: 2px dashed #00f0ff;
  border-radius: 50%;
  animation: studioRingSpin 8s linear infinite;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.studio-cyber-ring.ring-outer {
  inset: 0;
  border: 2px solid rgba(255, 0, 127, 0.6);
  border-top-color: transparent;
  border-bottom-color: transparent;
  animation: studioRingSpinRev 6s linear infinite;
}

@keyframes studioRingSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes studioRingSpinRev {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

.studio-cyber-core {
  font-size: 42px;
  color: #00f0ff;
  text-shadow: 0 0 20px #00f0ff, 0 0 40px #ff007f;
  animation: studioCoreGlitch 2s ease-in-out infinite alternate;
}

@keyframes studioCoreGlitch {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px #00f0ff); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 25px #ff007f); color: #ff007f; }
}

.studio-meta-tag {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  letter-spacing: 4px;
  color: #00f0ff;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.studio-name {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 900;
  letter-spacing: 5px;
  color: #ffffff;
  margin: 0 0 10px;
  text-shadow: 0 0 25px rgba(0, 240, 255, 0.8), 0 0 50px rgba(255, 0, 127, 0.5);
}

.studio-subtext {
  font-family: 'Rajdhani', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #9cb3e6;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.studio-powered-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 20px;
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: #00f0ff;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
}

.intro-tap-hint {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  color: #6377a8;
  animation: introHintBlink 1.5s ease-in-out infinite;
}

@keyframes introHintBlink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; color: #00f0ff; }
}

/* Stage 2: Guidelines & Safety Screen */
.guidelines-header {
  margin-bottom: 18px;
}

.guidelines-protocol-tag {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  color: #ff007f;
  font-weight: 800;
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.6);
  margin-bottom: 4px;
}

.guidelines-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(20px, 4.5vw, 26px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffffff;
  margin: 0 0 6px;
  text-shadow: 0 0 16px rgba(0, 240, 255, 0.7);
}

.guidelines-subtitle {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #8fa5d8;
  margin: 0;
  line-height: 1.3;
}

.guidelines-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-bottom: 20px;
}

.guideline-card {
  padding: 10px 14px;
  background: rgba(12, 17, 38, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 10px;
  text-align: left;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, transform 0.2s;
}

.guideline-card:hover {
  border-color: rgba(0, 240, 255, 0.55);
  transform: translateY(-1px);
}

.guideline-card.card-fairplay {
  border-left: 3px solid #00f0ff;
}

.guideline-card.card-health {
  border-left: 3px solid #ffd700;
}

.guideline-card.card-audio {
  border-left: 3px solid #ff007f;
}

.g-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.g-card-icon {
  font-size: 16px;
}

.g-card-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffffff;
  flex: 1;
}

.g-card-badge {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.g-card-badge.warn {
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border-color: rgba(255, 215, 0, 0.4);
}

.g-card-badge.rec {
  background: rgba(255, 0, 127, 0.15);
  color: #ff007f;
  border-color: rgba(255, 0, 127, 0.4);
}

.g-card-body {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  color: #9ab0e0;
  line-height: 1.4;
  margin: 0;
}

.guidelines-action-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.init-neural-btn {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(180, 40, 255, 0.25));
  border: 1.5px solid #00f0ff;
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.4), inset 0 0 16px rgba(0, 240, 255, 0.2);
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
}

.init-neural-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.4), rgba(255, 0, 127, 0.35));
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.7), 0 0 45px rgba(255, 0, 127, 0.4);
}

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

.init-btn-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 240, 255, 0.4), transparent 70%);
  opacity: 0.6;
  animation: initGlowPulsing 2s infinite alternate;
}

@keyframes initGlowPulsing {
  0% { opacity: 0.3; transform: scale(0.9); }
  100% { opacity: 0.8; transform: scale(1.1); }
}

.init-btn-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.init-btn-icon {
  font-size: 24px;
  color: #00f0ff;
  filter: drop-shadow(0 0 8px #00f0ff);
  animation: initIconFlash 1.5s infinite alternate;
}

@keyframes initIconFlash {
  0% { filter: drop-shadow(0 0 6px #00f0ff); }
  100% { filter: drop-shadow(0 0 16px #ff007f); color: #ff007f; }
}

.init-btn-text-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.init-btn-main {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

.init-btn-sub {
  font-family: 'Orbitron', monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #00f0ff;
  opacity: 0.9;
}

.intro-auto-advance {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  letter-spacing: 1px;
  color: #5d71a0;
}

/* Authentic Fighting Game In-Match Music Toast */
.music-track-toast {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%) translateY(-60px);
  background: rgba(8, 12, 28, 0.88);
  border: 1.5px solid #00f0ff;
  border-radius: 8px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  pointer-events: none;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.4), inset 0 0 10px rgba(0, 240, 255, 0.15);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease-out;
}

.music-track-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.music-toast-icon {
  font-size: 16px;
  color: #00f0ff;
  filter: drop-shadow(0 0 6px #00f0ff);
}

.music-toast-body {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.music-toast-tag {
  font-family: 'Orbitron', monospace;
  font-size: 7.5px;
  letter-spacing: 1.5px;
  color: #ff007f;
  font-weight: 800;
}

.music-toast-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #ffffff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.7);
}

.music-toast-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #00f0ff;
  opacity: 0.9;
}

/* ==========================================================================
   DYNAMIC GAME LOADING SCREEN WITH CYBER PROGRESS BAR
   ========================================================================== */
.game-loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #080a14;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.5s;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.game-loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-bg-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.loading-grid-plane {
  position: absolute;
  inset: -50%;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  transform: perspective(500px) rotateX(60deg) translateY(50px);
  animation: loadingGridScroll 6s linear infinite;
}

@keyframes loadingGridScroll {
  0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
  100% { transform: perspective(500px) rotateX(60deg) translateY(40px); }
}

.loading-glow-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.18) 0%, rgba(180, 40, 255, 0.12) 45%, transparent 70%);
  filter: blur(40px);
  animation: loadingPulseOrb 3s ease-in-out infinite alternate;
}

@keyframes loadingPulseOrb {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.loading-scanline {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.35) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  opacity: 0.6;
}

.loading-center-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 460px;
  width: 90%;
  padding: 24px;
  text-align: center;
}

.loading-logo-wrap {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.loading-brand-icon {
  font-size: 38px;
  color: #00f0ff;
  filter: drop-shadow(0 0 16px #00f0ff);
  animation: loadingIconBounce 1.5s ease-in-out infinite alternate;
}

@keyframes loadingIconBounce {
  0% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 14px #00f0ff); }
  100% { transform: translateY(-4px) scale(1.08); filter: drop-shadow(0 0 24px #ff007f); color: #ff007f; }
}

.loading-title {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(26px, 5vw, 36px);
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffffff;
  margin: 6px 0 2px;
  text-shadow: 0 0 20px rgba(0, 240, 255, 0.8), 0 0 35px rgba(255, 0, 127, 0.4);
}

.loading-subtitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 4px;
  color: #00f0ff;
  opacity: 0.85;
  font-weight: 700;
}

.loading-bar-container {
  width: 100%;
  margin-bottom: 18px;
}

.loading-bar-track {
  position: relative;
  width: 100%;
  height: 10px;
  background: rgba(14, 20, 42, 0.9);
  border: 1.5px solid #1c2b5c;
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.7), 0 0 12px rgba(0, 240, 255, 0.15);
  overflow: visible;
}

.loading-bar-fill {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #00f0ff, #b428ff 60%, #ff007f 100%);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.8);
  transition: width 0.25s ease-out;
  width: 15%;
}

.loading-bar-glow-tip {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 12px #00f0ff, 0 0 20px #ff007f;
  pointer-events: none;
  transition: left 0.25s ease-out;
}

.loading-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
}

.loading-status-text {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: #8da4d8;
  text-transform: uppercase;
}

.loading-percent-text {
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  font-weight: 800;
  color: #00f0ff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.loading-tips-footer {
  margin-top: 10px;
  padding: 8px 14px;
  background: rgba(14, 20, 44, 0.6);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  font-size: 11px;
  color: #9cb3e6;
  line-height: 1.4;
  backdrop-filter: blur(4px);
}

.tip-badge {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 800;
  color: #ffd700;
  margin-right: 6px;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   TOUCH CONTROLS PRESET SELECTOR (SETTINGS SCREEN)
   ========================================================================== */
.layout-preset-selector {
  display: flex;
  gap: 10px;
  margin: 12px 0 16px;
}

.layout-preset-btn {
  flex: 1;
  padding: 10px 8px;
  background: #10152a;
  border: 1.5px solid #23305c;
  border-radius: 8px;
  color: #8fa5d8;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.layout-preset-btn .preset-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.layout-preset-btn .preset-sub {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #64748b;
  text-transform: uppercase;
  margin-top: -2px;
}

.layout-preset-btn.active .preset-sub {
  color: #7dd3fc;
}

.layout-preset-btn .preset-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #6c7ea6;
}

.layout-preset-btn.active {
  background: rgba(0, 240, 255, 0.12);
  border-color: #00f0ff;
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.3);
}

.layout-preset-btn.active .preset-badge {
  background: #00f0ff;
  color: #080a14;
}

.layout-actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ==========================================================================
   FULLSCREEN TOUCH LAYOUT CUSTOMIZER MODAL
   ========================================================================== */
.touch-editor-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #070914;
  z-index: 999999 !important;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.touch-editor-topbar {
  height: 52px;
  background: rgba(12, 16, 36, 0.95);
  border-bottom: 1.5px solid #212d58;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.touch-editor-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.touch-editor-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 800;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.touch-editor-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.8px;
  margin: 0;
}

.touch-editor-actions {
  display: flex;
  gap: 8px;
}

.touch-editor-stage {
  flex: 1;
  position: relative;
  background: radial-gradient(circle at center, #0e1430 0%, #060814 100%);
  overflow: hidden;
  touch-action: none;
}

.touch-editor-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 240, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
}

.touch-editor-center-cross {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  pointer-events: none;
  opacity: 0.3;
}
.touch-editor-center-cross::before,
.touch-editor-center-cross::after {
  content: '';
  position: absolute;
  background: #00f0ff;
}
.touch-editor-center-cross::before { top: 19px; left: 0; width: 40px; height: 2px; }
.touch-editor-center-cross::after { left: 19px; top: 0; width: 2px; height: 40px; }

.touch-editor-guide-label {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  letter-spacing: 1px;
  color: rgba(0, 240, 255, 0.5);
  pointer-events: none;
}

/* Draggable Items in Editor */
.touch-drag-item {
  position: absolute;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  z-index: 10;
  transform: scale(var(--drag-scale, 1));
  opacity: var(--drag-opacity, 0.7);
  transform-origin: center center;
  transition: transform 0.08s ease, opacity 0.08s ease, filter 0.2s ease;
}

.touch-drag-item:active,
.touch-drag-item.dragging {
  cursor: grabbing;
  z-index: 100;
  filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.9));
}

.touch-drag-item.selected {
  z-index: 50;
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.95)) drop-shadow(0 0 22px rgba(255, 0, 127, 0.65));
}

.touch-drag-item.selected .touch-drag-handle {
  border-color: #00f0ff !important;
  border-style: solid !important;
  border-width: 2.5px !important;
  animation: selectedControlPulse 1.2s infinite alternate ease-in-out;
}

@keyframes selectedControlPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.06); }
}

.touch-drag-handle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  pointer-events: none;
}

.drag-joystick {
  width: clamp(96px, 14vw, 130px);
  height: clamp(96px, 14vw, 130px);
}

.drag-joystick .touch-drag-handle {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(12, 18, 38, 0.4) 0%, rgba(0, 240, 255, 0.15) 100%);
  border: 2px dashed #00f0ff;
}

.drag-joystick-ring {
  width: 50%;
  height: 50%;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 240, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drag-joystick-stick {
  width: 50%;
  height: 50%;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px #00f0ff;
}

.drag-action-btn {
  border-radius: 50%;
}

.drag-action-btn .touch-drag-handle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.drag-attack {
  width: clamp(58px, 8.8vw, 76px);
  height: clamp(58px, 8.8vw, 76px);
}
.drag-attack .touch-drag-handle {
  background: radial-gradient(circle, rgba(255, 0, 127, 0.45) 0%, rgba(26, 8, 24, 0.65) 100%);
  border: 2px dashed #ff007f;
  color: #fff;
}

.drag-jump {
  width: clamp(40px, 6vw, 52px);
  height: clamp(40px, 6vw, 52px);
}
.drag-jump .touch-drag-handle {
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4) 0%, rgba(28, 22, 8, 0.6) 100%);
  border: 2px dashed #ffd700;
  color: #ffd700;
}

.drag-dash {
  width: clamp(40px, 6vw, 52px);
  height: clamp(40px, 6vw, 52px);
}
.drag-dash .touch-drag-handle {
  background: radial-gradient(circle, rgba(180, 40, 255, 0.4) 0%, rgba(22, 10, 32, 0.6) 100%);
  border: 2px dashed #b428ff;
  color: #d166ff;
}

.drag-parry {
  width: clamp(40px, 6vw, 52px);
  height: clamp(40px, 6vw, 52px);
}
.drag-parry .touch-drag-handle {
  background: radial-gradient(circle, rgba(0, 240, 255, 0.4) 0%, rgba(8, 24, 32, 0.6) 100%);
  border: 2px dashed #00f0ff;
  color: #00f0ff;
}

.touch-drag-handle .drag-label {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(6.5px, 0.9vw, 8px);
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.touch-drag-handle .drag-icon {
  font-size: clamp(12px, 2vw, 16px);
  line-height: 1;
}

/* ==========================================================================
   TOUCH EDITOR INSPECTOR (SIZE & OPACITY SLIDERS)
   ========================================================================== */
.touch-editor-inspector {
  height: 64px;
  background: rgba(10, 14, 30, 0.96);
  border-top: 1.5px solid #23315c;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 20;
  backdrop-filter: blur(8px);
}

.inspector-target-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
}

.inspector-target-tag {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  font-weight: 800;
  color: #8da4d8;
}

.inspector-target-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 900;
  color: #00f0ff;
  letter-spacing: 0.8px;
}

.inspector-sliders-group {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  max-width: 540px;
}

.inspector-slider-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inspector-slider-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 11px;
}

.meta-label {
  color: #a0b4e0;
  letter-spacing: 0.6px;
}

.meta-val {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: #ffd700;
  font-weight: 800;
}

/* Custom Cyber Range Slider */
.cyber-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #0d1226;
  border: 1px solid #1f2b54;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
}

.cyber-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #00f0ff 0%, #0077aa 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px #00f0ff;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.cyber-range-slider::-webkit-slider-thumb:hover,
.cyber-range-slider::-webkit-slider-thumb:active {
  transform: scale(1.2);
  box-shadow: 0 0 16px #00f0ff, 0 0 20px #ff007f;
}

.cyber-range-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle, #00f0ff 0%, #0077aa 100%);
  border: 2px solid #ffffff;
  box-shadow: 0 0 10px #00f0ff;
  cursor: pointer;
}

/* ============================================================
   MOBILE-FIRST RELEASE ADDITIONS & PRACTICE MODE END SCREEN
   ============================================================ */

/* Practice Match Results Card */
.practice-results-card {
  max-width: 440px;
  width: 90%;
  padding: 24px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(16, 21, 40, 0.96) 0%, rgba(9, 11, 20, 0.98) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 35px rgba(0, 240, 255, 0.25), inset 0 0 20px rgba(0, 240, 255, 0.05);
  border-radius: 16px;
  animation: cyberModalPop 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes cyberModalPop {
  0% { transform: scale(0.88); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.practice-score-card {
  background: rgba(10, 13, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0;
}

.practice-score-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.practice-score-banner .score-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 12px;
  background: rgba(18, 23, 44, 0.9);
  border-radius: 10px;
}

.practice-score-banner .score-box.p1-score {
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.15);
}

.practice-score-banner .score-box.p1-score .score-number {
  color: var(--cyan-neon, #00f0ff);
  text-shadow: 0 0 12px var(--cyan-glow, rgba(0, 240, 255, 0.6));
}

.practice-score-banner .score-box.p2-score {
  border: 1px solid rgba(255, 0, 127, 0.4);
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.15);
}

.practice-score-banner .score-box.p2-score .score-number {
  color: var(--pink-neon, #ff007f);
  text-shadow: 0 0 12px var(--pink-glow, rgba(255, 0, 127, 0.6));
}

.practice-score-banner .score-player-name {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #8da0cf;
  margin-bottom: 2px;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.practice-score-banner .score-number {
  font-family: 'Orbitron', monospace;
  font-size: 38px;
  font-weight: 900;
  line-height: 1;
}

.practice-score-banner .score-vs-divider {
  font-family: 'Orbitron', monospace;
  font-weight: 900;
  font-size: 18px;
  color: #ffbb33;
  text-shadow: 0 0 8px rgba(255, 187, 51, 0.6);
}

.practice-score-subtext {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #667599;
  margin-top: 8px;
}

.practice-results-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

/* Room Code In-App Touch Input */
.join-room-code-wrap {
  margin-top: 12px;
  padding: 12px;
  background: rgba(12, 16, 32, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 10px;
  animation: cyberModalPop 0.2s ease-out;
}

.room-code-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.room-code-input {
  flex: 1;
  text-transform: uppercase;
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 5px;
  text-align: center;
  min-height: 44px;
  color: #00f0ff;
  background: #090c18;
  border: 1.5px solid #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

/* Reconnecting Modal */
.reconnecting-card {
  max-width: 380px;
  width: 88%;
  padding: 24px;
  text-align: center;
  background: rgba(14, 17, 30, 0.98);
  border: 1.5px solid #ff3366;
  box-shadow: 0 0 30px rgba(255, 51, 102, 0.4);
  border-radius: 14px;
}

.reconnecting-spinner {
  font-size: 38px;
  margin-bottom: 8px;
  display: inline-block;
  animation: reconnectPulse 1.2s infinite ease-in-out;
}

@keyframes reconnectPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; filter: drop-shadow(0 0 10px #ff3366); }
}

.reconnecting-title {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 900;
  color: #ff3366;
  text-shadow: 0 0 12px rgba(255, 51, 102, 0.6);
  margin-bottom: 6px;
}

.reconnecting-desc {
  font-size: 13px;
  color: #9cb0d8;
  margin-bottom: 18px;
}

.reconnecting-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Universal Mobile Touch-Target Safety Minimums (>= 44x44 CSS px) */
.cyber-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mode-select-pill {
  min-height: 44px;
}

.layout-preset-btn {
  min-height: 44px;
}

.callsign-badge {
  min-height: 44px;
}

/* --- AUDIO & VOLUME CONTROLS --- */
.audio-sliders-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.audio-slider-row {
  background: rgba(16, 22, 44, 0.7);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.audio-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #00f0ff;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.audio-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  padding: 2px 8px;
  min-width: 48px;
  text-align: center;
}

.audio-range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: #10162a;
  border-radius: 4px;
  outline: none;
  border: 1px solid #232d56;
  cursor: pointer;
  transition: all 0.2s ease;
}

.audio-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8), 0 0 4px #ffffff;
  border: 2px solid #ffffff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.audio-range-slider::-webkit-slider-thumb:hover,
.audio-range-slider::-webkit-slider-thumb:active {
  transform: scale(1.18);
  box-shadow: 0 0 16px rgba(0, 240, 255, 1), 0 0 6px #ffffff;
}

.audio-range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
  border: 2px solid #ffffff;
  cursor: pointer;
}
