/* threejs-ping-pong/styles.css */

:root {
  --bg-top: #0f172a;
  --bg-bottom: #020617;
  --card-bg: rgba(10, 15, 30, 0.78);
  --card-border: rgba(148, 163, 184, 0.22);
  --text-primary: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --hud-bg: rgba(2, 6, 23, 0.62);
  --hud-border: rgba(148, 163, 184, 0.28);
  --shadow: 0 24px 60px rgba(2, 6, 23, 0.55);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(1200px 520px at 20% -10%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(1000px 450px at 90% 110%, rgba(14, 165, 233, 0.14), transparent 60%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}

main,
.app {
  width: min(92vw, 1200px);
  margin: 0 auto;
}

.game-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 82vh;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
  border: 1px solid var(--card-border);
  box-shadow: var(--shadow);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hud,
#hud,
.overlay,
.ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(10px, 2vw, 20px);
}

.scoreboard,
#scoreboard,
.score {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: clamp(10px, 1.7vw, 18px);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--hud-bg);
  border: 1px solid var(--hud-border);
  backdrop-filter: blur(5px);
  font-weight: 700;
  font-size: clamp(0.95rem, 1.35vw, 1.25rem);
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.scoreboard .divider,
.score .divider,
.vs {
  color: var(--text-muted);
  font-weight: 500;
}

.player-score,
.cpu-score,
#playerScore,
#aiScore,
#leftScore,
#rightScore {
  min-width: 1.5ch;
  text-align: center;
  color: #f8fafc;
}

.status,
#status,
.instructions,
#message {
  align-self: center;
  max-width: min(88%, 720px);
  text-align: center;
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  background: rgba(2, 6, 23, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
  font-size: clamp(0.82rem, 1.05vw, 1rem);
  letter-spacing: 0.01em;
  text-wrap: balance;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
}

.title,
h1 {
  margin: 0 0 0.65rem;
  text-align: center;
  font-size: clamp(1.15rem, 2vw, 1.8rem);
  letter-spacing: 0.02em;
  color: #f8fafc;
}

@media (max-width: 900px) {
  body {
    align-items: stretch;
    overflow-y: auto;
    padding: 14px;
  }

  main,
  .app {
    width: 100%;
    margin: auto;
  }

  .game-shell {
    max-height: none;
    min-height: 260px;
  }
}

@media (max-width: 560px) {
  .hud,
  #hud,
  .overlay,
  .ui {
    padding: 10px;
  }

  .scoreboard,
  #scoreboard,
  .score {
    gap: 10px;
    padding: 0.4rem 0.7rem;
  }

  .status,
  #status,
  .instructions,
  #message {
    max-width: 95%;
  }
}
