/* ============================
   PONG MINI PLAYER — STYLES
   ============================ */

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

:root {
  --accent:       #00f0ff;
  --accent2:      #bf00ff;
  --bg:           #07080d;
  --surface:      rgba(255,255,255,0.04);
  --surface-2:    rgba(255,255,255,0.08);
  --border:       rgba(255,255,255,0.08);
  --text:         #e8eaf0;
  --text-muted:   #6b7280;
  --win:          #22c55e;
  --lose:         #ef4444;
  --glow-cyan:    0 0 20px rgba(0,240,255,0.4);
  --glow-purple:  0 0 20px rgba(191,0,255,0.4);
  --radius:       16px;
  --canvas-w:     600px;
  --canvas-h:     380px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* ---- PARTICLES ---- */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  animation: float linear infinite;
}

@keyframes float {
  0%   { transform: translateY(100vh) scale(0); opacity: 0; }
  10%  { opacity: 0.15; }
  90%  { opacity: 0.1; }
  100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ---- LAYOUT ---- */
.wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem 3rem;
  gap: 1.2rem;
  min-height: 100dvh;
}

/* ---- HEADER ---- */
.header {
  text-align: center;
}

.logo {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  letter-spacing: 0.25em;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(0,240,255,0.5));
  line-height: 1;
}

.tagline {
  font-size: 0.75rem;
  font-weight: 300;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ---- SCOREBOARD ---- */
.scoreboard {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 2.5rem;
  backdrop-filter: blur(12px);
}

.score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform 0.2s ease;
}

.score-block.pulse {
  animation: scorePulse 0.4s ease;
}

@keyframes scorePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.player-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}

.score {
  font-family: 'Orbitron', monospace;
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
}

#score-left { color: var(--accent); text-shadow: var(--glow-cyan); }
#score-right { color: var(--accent2); text-shadow: var(--glow-purple); }

.divider {
  font-family: 'Orbitron', monospace;
  font-size: 1.8rem;
  color: var(--text-muted);
  user-select: none;
}

/* ---- CANVAS CONTAINER ---- */
.canvas-container {
  position: relative;
  width: var(--canvas-w);
  max-width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(0,240,255,0.1),
    0 0 60px rgba(0,240,255,0.05),
    0 20px 60px rgba(0,0,0,0.6);
}

#pongCanvas {
  display: block;
  width: 100%;
  height: auto;
  background: #080c12;
}

/* ---- OVERLAYS ---- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 8, 13, 0.88);
  backdrop-filter: blur(8px);
  z-index: 10;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  display: none;
}

.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem;
  text-align: center;
}

.overlay-content h2 {
  font-family: 'Orbitron', monospace;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(0,240,255,0.4));
}

.overlay-content p {
  color: var(--text-muted);
  font-size: 0.9rem;
  max-width: 280px;
  line-height: 1.6;
}

/* ---- BUTTONS ---- */
.btn-primary, .btn-ghost {
  font-family: 'Orbitron', monospace;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.75rem 2rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #07080d;
  box-shadow: 0 0 20px rgba(0,240,255,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 0 35px rgba(0,240,255,0.5);
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-ghost {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

/* ---- KBD ---- */
kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  color: var(--accent);
}

/* ---- CONTROLS BAR ---- */
.controls-bar {
  display: flex;
  gap: 1.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  justify-content: center;
}

/* ---- SETTINGS ---- */
.settings-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem 2rem;
  backdrop-filter: blur(12px);
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  background: var(--surface-2);
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,240,255,0.6);
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  :root {
    --canvas-w: 100%;
  }

  .scoreboard { padding: 0.8rem 1.5rem; gap: 1rem; }
  .controls-bar { gap: 0.8rem; font-size: 0.7rem; }
  .settings-row { gap: 1rem; }
}
