/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; font-family: 'Inter', sans-serif; }

body {
  background: radial-gradient(ellipse at 50% 30%, #1a1a2e 0%, #0d0d1a 60%, #050510 100%);
  display: flex; align-items: center; justify-content: center;
}

/* ===== GAME CONTAINER ===== */
#game-container {
  position: relative;
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
}

#pool-canvas {
  display: block;
  max-width: 100vw; max-height: 100vh;
  cursor: crosshair;
}

/* ===== OVERLAYS ===== */
.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5, 5, 16, 0.88);
  z-index: 10;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.menu-box {
  text-align: center;
  padding: 48px 56px;
  background: linear-gradient(145deg, rgba(30,30,50,0.95), rgba(15,15,30,0.98));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  max-width: 440px;
}

.menu-ball {
  font-size: 64px;
  margin-bottom: 8px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.menu-box h1 {
  font-size: 48px; font-weight: 900;
  letter-spacing: 3px; line-height: 1.1;
  background: linear-gradient(135deg, #ffd700, #ffaa00, #ff8800);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: transparent;
  margin-bottom: 12px;
}

.menu-box h1 span {
  font-size: 36px; letter-spacing: 8px;
  background: linear-gradient(135deg, #e0e0e0, #9e9e9e);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: transparent;
}

.menu-desc {
  color: #8888aa; font-size: 14px; line-height: 1.6;
  margin-bottom: 28px;
}

.btn-primary {
  display: inline-block;
  padding: 14px 48px;
  font-size: 18px; font-weight: 700; letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  border: 2px solid rgba(76, 175, 80, 0.4);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  text-transform: uppercase;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(46,125,50,0.4);
  background: linear-gradient(135deg, #388e3c, #2e7d32);
}

.btn-primary:active { transform: translateY(0); }

.controls-info {
  margin-top: 24px;
  display: flex; flex-direction: column; gap: 6px;
  color: #666680; font-size: 13px;
}

.controls-info strong { color: #9999bb; }

/* ===== HUD ===== */
#hud {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
  z-index: 5;
  pointer-events: none;
}

.hud-player {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.3s;
}

.hud-player.active {
  background: rgba(46, 125, 50, 0.25);
  border-color: rgba(76, 175, 80, 0.5);
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.15);
}

.hud-name {
  font-size: 14px; font-weight: 700;
  color: #ccc;
}

.hud-type {
  font-size: 11px; font-weight: 600;
  color: #888; text-transform: uppercase;
  letter-spacing: 1px;
}

.hud-balls {
  display: flex; gap: 3px;
}

.hud-balls .mini-ball {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 8px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.hud-center {
  text-align: center;
}

.hud-turn {
  font-size: 14px; font-weight: 700;
  color: #ffd700; letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.hud-msg {
  font-size: 12px; font-weight: 600;
  color: #ff5252; margin-top: 2px;
  min-height: 16px;
  transition: opacity 0.3s;
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .menu-box { padding: 32px 28px; }
  .menu-box h1 { font-size: 36px; }
  .menu-box h1 span { font-size: 28px; }
  #hud { padding: 6px 12px; }
  .hud-name { font-size: 12px; }
  .hud-turn { font-size: 12px; }
}
