@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;600;700&family=Press+Start+2P&display=swap');

/* ========================================
   CSS VARIABLES & RESET
   ======================================== */
:root {
  --bg-dark: #070c0a;
  --bg-panel: rgba(14, 24, 19, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --accent-green: #38ce9b;
  --accent-green-dim: rgba(56, 206, 155, 0.3);
  --accent-green-glow: rgba(56, 206, 155, 0.15);
  --accent-cyan: #70c4b3;
  --accent-red: #ff4757;
  --accent-gold: #feca57;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.65);
  --text-dim: rgba(255, 255, 255, 0.35);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(56, 206, 155, 0.25);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(56, 206, 155, 0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font-main: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-retro: 'Press Start 2P', monospace;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  user-select: none;
  -webkit-user-select: none;
  cursor: none;
}

/* ========================================
   GAME CANVAS
   ======================================== */
#gameCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-dark);
}

/* Custom cursor */
.custom-cursor {
  position: fixed;
  width: 24px;
  height: 24px;
  border: 2px solid var(--accent-green);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease, border-color 0.2s;
  mix-blend-mode: screen;
}

.custom-cursor::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: var(--accent-green);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.custom-cursor.boosting {
  border-color: var(--accent-red);
  transform: translate(-50%, -50%) scale(1.3);
}

.custom-cursor.boosting::after {
  background: var(--accent-red);
}

/* ========================================
   START SCREEN — RETRO ARCADE
   ======================================== */
#startScreen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 80px;
  z-index: 1000;
  background:
    radial-gradient(ellipse at 60% 20%, rgba(56,206,155,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 20% 80%, rgba(112,196,179,0.06) 0%, transparent 50%),
    linear-gradient(180deg, #050a07 0%, #070c0a 60%, #040806 100%);
  overflow: hidden;
}

/* --- Scanlines overlay --- */
.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.18) 2px,
    rgba(0, 0, 0, 0.18) 4px
  );
  animation: scanlineFlicker 8s linear infinite;
}

@keyframes scanlineFlicker {
  0%   { opacity: 0.85; }
  48%  { opacity: 0.85; }
  50%  { opacity: 0.6; }
  52%  { opacity: 0.85; }
  96%  { opacity: 0.85; }
  98%  { opacity: 0.5; }
  100% { opacity: 0.85; }
}

/* --- CRT Vignette --- */
.crt-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(
    ellipse at center,
    transparent 55%,
    rgba(0,0,0,0.75) 100%
  );
}

/* --- Floating particles --- */
.retro-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.retro-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent-green);
  border-radius: 0;
  animation: particleDrift linear infinite;
  opacity: 0;
}

@keyframes particleDrift {
  0%   { transform: translateY(100vh) translateX(0); opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-60px) translateX(40px); opacity: 0; }
}


/* --- Navbar --- */
.start-navbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  background: rgba(0, 0, 0, 0.9);
  border-bottom: 2px solid var(--accent-green);
  box-shadow: 0 0 20px rgba(56, 206, 155, 0.25);
  z-index: 10;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-logo {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(56, 206, 155, 0.7));
  image-rendering: pixelated;
}

.navbar-title {
  font-family: var(--font-retro);
  font-size: 0.85rem;
  letter-spacing: 1px;
  color: var(--accent-green);
  text-shadow: 0 0 12px rgba(56, 206, 155, 0.8), 2px 2px 0 rgba(0,0,0,0.9);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 16px;
}

.orynth-badge img {
  display: block;
  height: 36px;
  width: auto;
  transition: transform 0.2s ease;
}

.orynth-badge:hover img {
  transform: scale(1.05);
}

.navbar-subtitle {
  font-family: var(--font-retro);
  font-size: 0.45rem;
  color: var(--text-secondary);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --- Retro Hero Section --- */
.retro-hero {
  position: relative;
  z-index: 5;
  text-align: center;
  margin-top: 12px;
  margin-bottom: 24px;
  animation: fadeInUp 0.6s ease both;
}

.retro-badge {
  display: inline-block;
  font-family: var(--font-retro);
  font-size: 0.45rem;
  color: var(--accent-green);
  border: 2px solid var(--accent-green);
  padding: 6px 14px;
  letter-spacing: 3px;
  margin-bottom: 20px;
  box-shadow: 0 0 10px rgba(56,206,155,0.3), inset 0 0 10px rgba(56,206,155,0.05);
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 8px rgba(56,206,155,0.3); }
  50% { box-shadow: 0 0 20px rgba(56,206,155,0.6); }
}

.retro-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.1;
  user-select: none;
}

.retro-title-line {
  display: block;
  font-family: var(--font-retro);
  font-size: clamp(2rem, 6vw, 3.8rem);
  font-weight: 400;
  color: #ffffff;
  text-shadow:
    0 0 10px rgba(255,255,255,0.3),
    3px 3px 0px #1a4a35,
    6px 6px 0px #0f2d20;
  letter-spacing: 4px;
  position: relative;
  animation: titleGlitch 6s infinite;
}

.retro-title-accent {
  color: var(--accent-green);
  text-shadow:
    0 0 20px rgba(56,206,155,0.7),
    0 0 40px rgba(56,206,155,0.3),
    3px 3px 0px #1a5a3a,
    6px 6px 0px #0a2518;
  animation: titleGlitchAccent 6s infinite;
}

@keyframes titleGlitch {
  0%, 90%, 100% { transform: translate(0, 0); clip-path: none; }
  91% { transform: translate(-2px, 1px); }
  92% { transform: translate(2px, -1px); color: #7effd4; }
  93% { transform: translate(0, 0); }
  95% { transform: translate(1px, 2px); clip-path: inset(30% 0 50% 0); }
  96% { transform: translate(-1px, -1px); clip-path: none; }
}

@keyframes titleGlitchAccent {
  0%, 88%, 100% { transform: translate(0, 0); }
  89% { transform: translate(3px, 0); filter: hue-rotate(30deg); }
  90% { transform: translate(-2px, 1px); }
  91% { transform: translate(0, 0); }
}

.retro-tagline {
  font-family: var(--font-retro);
  font-size: 0.5rem;
  color: var(--text-secondary);
  letter-spacing: 6px;
  margin-top: 16px;
  text-transform: uppercase;
}


/* --- Retro Card --- */
.start-container {
  position: relative;
  z-index: 5;
  text-align: center;
  width: 90%;
  max-width: 400px;
  animation: fadeInUp 0.8s ease 0.1s both;
}

.retro-card {
  background: rgba(5, 12, 8, 0.95);
  border: 2px solid var(--accent-green);
  box-shadow:
    0 0 0 4px rgba(56,206,155,0.08),
    0 0 30px rgba(56,206,155,0.2),
    inset 0 0 40px rgba(56,206,155,0.03);
  padding: 28px 28px 20px;
  position: relative;
}

/* Pixel corner decorations */
.retro-card::before,
.retro-card::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent-green);
}
.retro-card::before { top: -2px; left: -2px; }
.retro-card::after  { bottom: -2px; right: -2px; }

.retro-card-header {
  font-family: var(--font-retro);
  font-size: 0.5rem;
  color: var(--accent-green);
  letter-spacing: 3px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(56,206,155,0.2);
  text-shadow: 0 0 8px rgba(56,206,155,0.6);
}

.retro-label {
  display: block;
  font-family: var(--font-retro);
  font-size: 0.4rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 8px;
  text-align: left;
}

/* --- Marquee ticker --- */
.retro-marquee-wrap {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(56,206,155,0.2);
  border-left: 3px solid var(--accent-green);
  border-right: 3px solid var(--accent-green);
  background: rgba(56,206,155,0.04);
  padding: 7px 0;
}

.retro-marquee {
  display: inline-block;
  white-space: nowrap;
  font-family: var(--font-retro);
  font-size: 0.4rem;
  color: var(--accent-green);
  letter-spacing: 2px;
  animation: marqueeScroll 18s linear infinite;
  text-shadow: 0 0 6px rgba(56,206,155,0.5);
}

@keyframes marqueeScroll {
  from { transform: translateX(100vw); }
  to   { transform: translateX(-100%); }
}


@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.start-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

/* --- Retro Input Group --- */
.input-group {
  position: relative;
  margin-bottom: 4px;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  font-family: var(--font-retro);
  font-size: 0.55rem;
  font-weight: 400;
  color: var(--accent-green);
  background: rgba(0,0,0,0.8);
  border: 2px solid rgba(56,206,155,0.35);
  border-radius: 0;
  outline: none;
  transition: all 0.2s ease;
  letter-spacing: 1px;
  caret-color: var(--accent-green);
}

.input-group input::placeholder {
  color: rgba(56,206,155,0.3);
  font-size: 0.5rem;
}

.input-group input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 2px rgba(56,206,155,0.15), 0 0 20px rgba(56,206,155,0.15);
  background: rgba(0,12,6,0.9);
}

/* --- Retro Play Button --- */
.btn-play {
  width: 100%;
  margin-top: 14px;
  padding: 16px 32px;
  font-family: var(--font-retro);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 3px;
  color: #000000;
  background: var(--accent-green);
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 4px 4px 0 #1a5a3a, 0 0 20px rgba(56,206,155,0.3);
  text-transform: uppercase;
}

.btn-play::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  animation: btnShine 3s ease infinite;
}

@keyframes btnShine {
  0%   { left: -100%; }
  50%  { left: 150%; }
  100% { left: 150%; }
}

.btn-play:hover {
  background: #4aeaae;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #1a5a3a, 0 0 30px rgba(56,206,155,0.5);
}

.btn-play:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #1a5a3a;
}

.controls-hint {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-retro);
  font-size: 0.38rem;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.hint kbd {
  padding: 4px 8px;
  font-family: var(--font-retro);
  font-size: 0.35rem;
  background: rgba(0,0,0,0.8);
  border: 1px solid rgba(56,206,155,0.4);
  border-bottom: 3px solid rgba(56,206,155,0.4);
  border-radius: 0;
  color: var(--accent-green);
  text-shadow: 0 0 6px rgba(56,206,155,0.5);
}

/* ========================================
   TWITTER / X FAB BUTTON
   ======================================== */
.twitter-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 12px;
  background: rgba(5, 12, 8, 0.95);
  border: 2px solid var(--accent-green);
  color: var(--accent-green);
  text-decoration: none;
  font-family: var(--font-retro);
  font-size: 0.4rem;
  letter-spacing: 1px;
  box-shadow:
    4px 4px 0 #1a5a3a,
    0 0 20px rgba(56,206,155,0.2);
  transition: all 0.15s ease;
  cursor: pointer;
}

.twitter-fab:hover {
  background: rgba(56,206,155,0.1);
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #1a5a3a, 0 0 28px rgba(56,206,155,0.4);
  color: #4aeaae;
  border-color: #4aeaae;
}

.twitter-fab:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #1a5a3a;
}

.twitter-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}

.twitter-label {
  white-space: nowrap;
}


/* ========================================
   HUD OVERLAY
   ======================================== */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  display: none;
}

#hud.active {
  display: block;
}

/* Top bar */
.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 20px;
}

.player-count {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(16px);
  font-size: 0.85rem;
  font-weight: 600;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--accent-red); }
  50% { opacity: 0.5; box-shadow: 0 0 10px var(--accent-red); }
}

.player-count span {
  color: var(--text-secondary);
}

.player-count strong {
  color: var(--text-primary);
}

/* Score display */
.score-display {
  text-align: center;
}

.score-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--text-dim);
}

.score-value {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-green);
  text-shadow: 0 0 20px var(--accent-green-dim);
  line-height: 1;
}

/* Music Toggle Button */
.music-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 50%;
  backdrop-filter: blur(16px);
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-primary);
  transition: all 0.25s ease;
  box-shadow: 0 0 12px var(--accent-green-glow);
  outline: none;
  flex-shrink: 0;
}

.music-toggle-btn:hover {
  background: var(--accent-green-dim);
  border-color: var(--accent-green);
  box-shadow: 0 0 20px var(--accent-green-dim);
  transform: scale(1.1);
}

.music-toggle-btn.muted {
  border-color: var(--border-subtle);
  box-shadow: none;
  opacity: 0.5;
}

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 8px var(--accent-green-glow); }
  50%       { box-shadow: 0 0 22px var(--accent-green-dim); }
}

.music-toggle-btn:not(.muted) {
  animation: musicPulse 2.5s ease-in-out infinite;
}

/* Leaderboard */
.leaderboard {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 220px;
  padding: 14px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(16px);
}

.leaderboard-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent-green);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.leaderboard-title::before {
  content: '👑';
  font-size: 0.85rem;
}

.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.leaderboard-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 8px;
  font-size: 0.78rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.leaderboard-list li.self {
  background: var(--accent-green-glow);
  border: 1px solid var(--border-glow);
}

.leaderboard-list li .rank {
  width: 20px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.7rem;
}

.leaderboard-list li .rank.top-3 {
  color: var(--accent-gold);
}

.leaderboard-list li .lb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-weight: 500;
}

.leaderboard-list li.self .lb-name {
  color: var(--accent-green);
}

.leaderboard-list li .lb-score {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-primary);
  margin-left: 8px;
}

/* Minimap */
.minimap-container {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 160px;
  height: 160px;
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.minimap-container canvas {
  width: 100%;
  height: 100%;
}

/* Boost bar */
.boost-bar-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
}

.boost-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 4px;
}

.boost-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.boost-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
  border-radius: 3px;
  transition: width 0.15s ease;
  box-shadow: 0 0 8px var(--accent-green-dim);
}

/* ========================================
   DEATH SCREEN
   ======================================== */
#deathScreen {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  background: rgba(7, 12, 10, 0.8);
  backdrop-filter: blur(12px);
  animation: fadeIn 0.5s ease;
}

#deathScreen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.death-container {
  text-align: center;
  animation: fadeInUp 0.6s ease;
}

.death-container .death-icon {
  font-size: 4rem;
  margin-bottom: 8px;
}

.death-container h2 {
  font-family: var(--font-retro);
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--accent-red);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(255,71,87,0.6), 3px 3px 0 #5a0a14;
}

.death-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin: 20px 0 28px;
}

.death-stat {
  text-align: center;
}

.death-stat .stat-label {
  font-family: var(--font-retro);
  font-size: 0.4rem;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.death-stat .stat-value {
  font-family: var(--font-retro);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent-green);
  text-shadow: 0 0 16px rgba(56,206,155,0.5);
}

.btn-respawn {
  padding: 16px 36px;
  font-family: var(--font-retro);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #000000;
  background: var(--accent-green);
  border: none;
  border-radius: 0;
  cursor: pointer;
  pointer-events: all;
  transition: all 0.15s ease;
  box-shadow: 4px 4px 0 #1a5a3a, 0 0 20px rgba(56,206,155,0.3);
}

.btn-respawn:hover {
  background: #4aeaae;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 #1a5a3a, 0 0 30px rgba(56,206,155,0.5);
}

.btn-respawn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #1a5a3a;
}

/* ========================================
   MOBILE RESPONSIVENESS
   ======================================== */
@media (max-width: 768px) {
  .navbar-subtitle {
    display: none;
  }

  .orynth-badge img {
    height: 28px;
  }

  .game-logo h1 {
    font-size: 2.4rem;
    letter-spacing: 3px;
  }

  .start-container {
    width: 92%;
  }

  .leaderboard {
    width: 170px;
    padding: 10px 12px;
  }

  .leaderboard-list li {
    font-size: 0.7rem;
  }

  .minimap-container {
    width: 110px;
    height: 110px;
  }

  .controls-hint {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .score-value {
    font-size: 1.5rem;
  }

  .death-stats {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .game-logo h1 {
    font-size: 1.8rem;
  }

  .leaderboard {
    display: none;
  }

  .minimap-container {
    width: 90px;
    height: 90px;
  }
}

/* ========================================
   LOADING STATE
   ======================================== */
.connecting {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-retro);
  font-size: 0.45rem;
  color: var(--accent-green);
  margin-top: 16px;
  justify-content: center;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(56,206,155,0.5);
}

.connecting .spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(56,206,155,0.2);
  border-top-color: var(--accent-green);
  border-radius: 0;
  animation: spin 0.6s linear infinite;
  box-shadow: 0 0 6px rgba(56,206,155,0.4);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Kill feed */
.kill-feed {
  position: absolute;
  top: 60px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
}

.kill-msg {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(255, 71, 87, 0.15);
  border: 1px solid rgba(255, 71, 87, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  animation: slideInLeft 0.3s ease, fadeOut 0.5s ease 3s forwards;
  backdrop-filter: blur(8px);
}

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateX(-10px); }
}

/* ========================================
   TOUCH CONTROLS (MOBILE)
   ======================================== */
.touch-controls {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 150;
}

/* Show only on touch devices or screens <= 1024px */
@media (max-width: 1024px), (pointer: coarse) {
  .touch-controls {
    display: block;
  }
  .custom-cursor {
    display: none !important;
  }
  body {
    cursor: auto !important;
  }
}

.joystick-base {
  position: absolute;
  bottom: 45px;
  left: 45px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.04);
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  touch-action: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.joystick-knob {
  width: 54px;
  height: 54px;
  background: radial-gradient(circle at 35% 35%, var(--accent-green) 0%, #207a5b 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(56, 206, 155, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  transition: transform 0.05s ease;
  pointer-events: none;
}

.btn-touch-boost {
  position: absolute;
  bottom: 65px;
  right: 45px;
  width: 80px;
  height: 80px;
  background: rgba(255, 71, 87, 0.15);
  border: 3px solid var(--accent-red);
  border-radius: 50%;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 71, 87, 0.25), 0 8px 30px rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
}

.btn-touch-boost:active {
  background: rgba(255, 71, 87, 0.45);
  transform: scale(0.95);
  box-shadow: 0 0 30px rgba(255, 71, 87, 0.65), 0 4px 16px rgba(0, 0, 0, 0.5);
}
