/* ============================================================
   E-Players: Reality Virtual Soccer — Styles
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@300;500;700&display=swap');

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

body {
  overflow: hidden;
  background: #000;
  font-family: 'Rajdhani', sans-serif;
  cursor: default;
  user-select: none;
  color: #fff;
}

body.game-active {
  cursor: none;
}

canvas {
  display: block;
}

/* ============================================================
   MENU SYSTEM
   ============================================================ */
#menuContainer {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: center;
  align-items: center;
  background: radial-gradient(ellipse at center, #0a1628 0%, #000 70%);
  overflow-y: auto;
  cursor: default;
}

.menu-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 25px;
  padding: 40px 20px;
  max-width: 1100px;
  width: 100%;
}

.screen-title {
  font-family: 'Orbitron', monospace;
  font-size: 32px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  letter-spacing: 6px;
  text-align: center;
}

.screen-subtitle {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  letter-spacing: 4px;
}

/* --- TITLE SCREEN --- */
.title-logo {
  text-align: center;
  margin-bottom: 10px;
}

.title-main {
  font-family: 'Orbitron', monospace;
  font-size: clamp(40px, 8vw, 80px);
  font-weight: 900;
  background: linear-gradient(135deg, #0ff, #00ff88, #ff6a00, #0ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px rgba(0,255,255,0.4));
  letter-spacing: 8px;
  animation: titleGradient 4s ease infinite;
}

@keyframes titleGradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.title-sub {
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(16px, 3vw, 24px);
  color: rgba(255,255,255,0.5);
  letter-spacing: 12px;
  text-transform: uppercase;
  margin-top: 5px;
}

.title-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  color: rgba(255,255,255,0.35);
  font-size: 14px;
  letter-spacing: 2px;
}

.feat-dot { color: rgba(0,255,255,0.4); font-size: 8px; }

.title-controls-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.2);
  letter-spacing: 1px;
  text-align: center;
  margin-top: 10px;
}

/* --- BUTTONS --- */
.menu-btn {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  padding: 15px 50px;
  border: 2px solid #0ff;
  background: transparent;
  color: #0ff;
  cursor: pointer;
  letter-spacing: 4px;
  transition: all 0.3s;
  text-transform: uppercase;
}

.menu-btn:hover {
  background: rgba(0,255,255,0.15);
  box-shadow: 0 0 30px rgba(0,255,255,0.3);
  transform: translateY(-2px);
}

.primary-btn {
  border-color: #0ff;
  color: #0ff;
}

.multi-btn {
  border-color: #ff6a00;
  color: #ff6a00;
}

.multi-btn:hover {
  background: rgba(255,106,0,0.15);
  box-shadow: 0 0 30px rgba(255,106,0,0.3);
}

/* --- TEAM SELECT --- */
.team-cards {
  display: flex;
  gap: 30px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.team-card, .char-card, .arena-card {
  cursor: pointer;
}

.team-card {
  width: 280px;
  padding: 30px 25px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  transition: all 0.3s;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.team-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.06);
}

.team-alpha:hover { border-color: rgba(0,170,255,0.5); box-shadow: 0 0 30px rgba(0,170,255,0.15); }
.team-omega:hover { border-color: rgba(255,85,0,0.5); box-shadow: 0 0 30px rgba(255,85,0,0.15); }

.team-badge {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 900;
  margin: 0 auto 15px;
}

.alpha-badge { background: linear-gradient(135deg, #003366, #0088ff); color: #0ff; }
.omega-badge { background: linear-gradient(135deg, #663300, #ff5500); color: #ffaa00; }

.team-name {
  font-family: 'Orbitron', monospace;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 15px;
}

.team-roster {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roster-member {
  display: flex;
  justify-content: space-between;
  padding: 5px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
}

.member-name {
  font-weight: 700;
  color: rgba(255,255,255,0.8);
}

.member-trait {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: rgba(0,255,204,0.6);
  letter-spacing: 1px;
}

.team-color-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.alpha-bar { background: linear-gradient(90deg, transparent, #00aaff, transparent); }
.omega-bar { background: linear-gradient(90deg, transparent, #ff5500, transparent); }

.vs-divider {
  font-family: 'Orbitron', monospace;
  font-size: 36px;
  font-weight: 900;
  color: rgba(255,255,255,0.15);
  letter-spacing: 4px;
}

/* --- CHARACTER SELECT --- */
.char-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.char-card {
  width: 240px;
  padding: 20px;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
}

.char-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: rgba(0,255,255,0.4);
  background: rgba(0,255,255,0.05);
  box-shadow: 0 0 25px rgba(0,255,255,0.1);
}

.char-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.char-icon {
  font-family: 'Orbitron', monospace;
  font-size: 32px;
  font-weight: 900;
  color: #fff;
}

.char-icon.slim { font-size: 28px; }
.char-icon.heavy { font-size: 38px; }

.char-name {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
}

.char-trait {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: rgba(0,255,204,0.7);
  letter-spacing: 3px;
  margin: 4px 0;
}

.char-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 12px;
}

.char-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stat-label {
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  width: 80px;
  text-align: right;
}

.stat-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}

.speed-bar { background: linear-gradient(90deg, #00ffcc, #00ff88); }
.power-bar { background: linear-gradient(90deg, #ff4400, #ffaa00); }
.stamina-bar { background: linear-gradient(90deg, #aa00ff, #ff00ff); }

/* --- ARENA SELECT --- */
.arena-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.arena-card {
  width: 260px;
  padding: 0;
  border: 2px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  transition: all 0.3s;
  overflow: hidden;
  text-align: center;
}

.arena-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent, #0ff);
  box-shadow: 0 0 25px color-mix(in srgb, var(--accent, #0ff) 30%, transparent);
}

.arena-preview {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.arena-dome-icon {
  width: 80px;
  height: 40px;
  border: 2px solid;
  border-radius: 80px 80px 0 0;
  opacity: 0.5;
}

.arena-name {
  font-family: 'Orbitron', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 12px 15px 4px;
}

.arena-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  padding: 0 15px 15px;
}

/* --- LOADING SCREEN --- */
.loading-screen { gap: 20px; }

.loading-info {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  letter-spacing: 2px;
}

.loading-bar-container {
  width: 400px;
  max-width: 90vw;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0,255,255,0.2);
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ff, #00ff88);
  border-radius: 3px;
  transition: width 0.3s;
}

.loading-text {
  font-size: 14px;
  color: rgba(255,255,255,0.4);
}

.loading-tip {
  font-size: 13px;
  color: rgba(255,170,0,0.5);
  font-style: italic;
  max-width: 500px;
  text-align: center;
  margin-top: 20px;
}

/* --- GAME OVER --- */
.gameover-screen { gap: 20px; }

.final-score {
  display: flex;
  align-items: center;
  gap: 30px;
  font-family: 'Orbitron', monospace;
  font-size: 72px;
  font-weight: 900;
}

.final-blue { color: #00d4ff; text-shadow: 0 0 30px rgba(0,212,255,0.5); }
.final-orange { color: #ff6a00; text-shadow: 0 0 30px rgba(255,106,0,0.5); }
.final-divider { color: rgba(255,255,255,0.3); font-size: 48px; }

.winner-text {
  font-family: 'Orbitron', monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 6px;
  text-shadow: 0 0 20px currentColor;
}

/* ============================================================
   CROSSHAIR
   ============================================================ */
#crosshair {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 100;
  width: 40px; height: 40px;
  display: none;
}

#crosshair::before, #crosshair::after {
  content: '';
  position: absolute;
  background: rgba(0, 255, 255, 0.8);
}

#crosshair::before {
  top: 50%; left: 0; right: 0; height: 2px;
  transform: translateY(-50%);
}

#crosshair::after {
  left: 50%; top: 0; bottom: 0; width: 2px;
  transform: translateX(-50%);
}

#crosshair .dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #0ff;
  box-shadow: 0 0 10px #0ff;
}

/* ============================================================
   HUD
   ============================================================ */
#hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  z-index: 50;
  display: none;
}

.score-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 15px;
}

.team-score {
  font-family: 'Orbitron', monospace;
  font-size: 48px;
  font-weight: 900;
  text-shadow: 0 0 20px currentColor;
}

.team-blue { color: #00d4ff; }
.team-orange { color: #ff6a00; }

.score-divider {
  font-family: 'Orbitron', monospace;
  font-size: 24px;
  color: rgba(255,255,255,0.4);
}

.timer {
  font-family: 'Orbitron', monospace;
  font-size: 20px;
  color: rgba(255,255,255,0.7);
  text-align: center;
  margin-top: -5px;
}

/* --- BOTTOM HUD --- */
#bottomHud {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.energy-bar-container {
  width: 300px;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(0,255,255,0.3);
}

.energy-bar {
  height: 100%;
  background: linear-gradient(90deg, #0ff, #00ff88);
  border-radius: 4px;
  transition: width 0.1s;
  box-shadow: 0 0 10px rgba(0,255,255,0.5);
}

/* --- FLOOR INDICATOR --- */
.floor-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.floor-label {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 2px;
  margin-right: 4px;
}

.floor-num {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  font-weight: 700;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: rgba(255,255,255,0.2);
  transition: all 0.3s;
}

.floor-num.active {
  color: #0ff;
  border-color: rgba(0,255,255,0.6);
  background: rgba(0,255,255,0.1);
  box-shadow: 0 0 10px rgba(0,255,255,0.3);
}

.floor-timer {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  margin-left: 6px;
}

.floor-3.active {
  color: #ff4400;
  border-color: rgba(255,68,0,0.6);
  background: rgba(255,68,0,0.1);
  box-shadow: 0 0 10px rgba(255,68,0,0.3);
}

.floor-2.active {
  color: #ffaa00;
  border-color: rgba(255,170,0,0.6);
  background: rgba(255,170,0,0.1);
  box-shadow: 0 0 10px rgba(255,170,0,0.3);
}

/* --- BALL HOLD BAR --- */
.ball-hold-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ball-hold-bar-bg {
  width: 120px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0,255,204,0.3);
}

.ball-hold-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00ffcc, #00ff88);
  border-radius: 3px;
  transition: width 0.1s;
}

.ball-hold-label {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: rgba(0,255,204,0.7);
  letter-spacing: 2px;
}

.platform-count {
  text-align: center;
  margin-bottom: 4px;
  font-family: 'Orbitron', monospace;
  font-size: 12px;
  color: rgba(0,255,204,0.6);
  letter-spacing: 2px;
}

.big-plat-cooldown {
  text-align: center;
  margin-bottom: 4px;
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: rgba(0,255,136,0.8);
  letter-spacing: 2px;
}

/* --- CHARGE BAR --- */
.charge-container {
  width: 200px;
  margin-top: 4px;
}

.charge-label {
  font-family: 'Orbitron', monospace;
  font-size: 10px;
  color: rgba(255,170,0,0.6);
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 3px;
}

.charge-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(255,255,255,0.1);
  border-radius: 5px;
  overflow: visible;
  border: 1px solid rgba(255,170,0,0.3);
  position: relative;
}

.charge-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ffaa00, #ff4400);
  border-radius: 5px;
  transition: none;
  box-shadow: 0 0 8px rgba(255,170,0,0.5);
}

.charge-sweet-spot {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(0, 255, 0, 0.25);
  border-left: 2px solid rgba(0, 255, 0, 0.6);
  border-right: 2px solid rgba(0, 255, 0, 0.6);
  border-radius: 3px;
  z-index: 1;
  display: none;
  pointer-events: none;
}

.charge-needle {
  position: absolute;
  top: -4px;
  width: 3px;
  height: calc(100% + 8px);
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 6px #fff, 0 0 12px rgba(255,255,255,0.5);
  z-index: 2;
  display: none;
  pointer-events: none;
  transform: translateX(-50%);
}

/* --- CONTROLS HELP --- */
#controls {
  position: fixed;
  bottom: 20px;
  left: 20px;
  pointer-events: none;
  z-index: 50;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  line-height: 1.8;
  display: none;
}

#controls span { color: rgba(0,255,255,0.7); font-weight: 700; }

/* --- BOOST/ENERGY INDICATOR --- */
#boostIndicator {
  position: fixed;
  bottom: 20px;
  right: 20px;
  pointer-events: none;
  z-index: 50;
  text-align: right;
  display: none;
}

.boost-label {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 3px;
}

.boost-value {
  font-family: 'Orbitron', monospace;
  font-size: 36px;
  font-weight: 900;
  color: #0ff;
  text-shadow: 0 0 20px rgba(0,255,255,0.5);
}

.dash-bar-bg {
  width: 60px;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
  margin-left: auto;
  border: 1px solid rgba(255,0,255,0.3);
}

.dash-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff00ff, #ff66cc);
  border-radius: 3px;
  transition: width 0.1s;
  box-shadow: 0 0 8px rgba(255,0,255,0.5);
}

.dash-key {
  font-family: 'Orbitron', monospace;
  font-size: 14px;
  color: rgba(255,0,255,0.7);
  margin-top: 2px;
  text-align: right;
}

/* --- MINIMAP --- */
#minimap {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
  display: none;
}

#minimapCanvas {
  width: 100%;
  height: 100%;
}

/* --- GOAL OVERLAY --- */
#goalOverlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

#goalOverlay.show {
  display: flex;
  animation: goalFlash 2s ease-out forwards;
}

#goalOverlay .goal-text {
  font-family: 'Orbitron', monospace;
  font-size: 120px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 60px currentColor, 0 0 120px currentColor;
  animation: goalScale 0.5s ease-out;
}

@keyframes goalFlash {
  0% { background: rgba(255,255,255,0.3); }
  100% { background: transparent; opacity: 0; }
}

@keyframes goalScale {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* --- SPEED LINES --- */
#speedLines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  background: radial-gradient(ellipse at center,
    transparent 30%,
    rgba(0,255,255,0.03) 70%,
    rgba(0,255,255,0.08) 100%
  );
  transition: opacity 0.3s;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .team-cards { flex-direction: column; }
  .vs-divider { display: none; }
  .char-cards { flex-direction: column; }
  .arena-cards { flex-direction: column; }

  .title-main { letter-spacing: 4px; }
  .title-sub { letter-spacing: 6px; }

  .final-score { font-size: 48px; }
}
