/* ==========================================
   PONG — RETRO ARCADE PREMIUM
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Orbitron:wght@400;700;900&family=Space+Mono:wght@400;700&display=swap');

:root {
  --neon-gold:   #FFD700;
  --neon-pink:   #FF2D78;
  --neon-cyan:   #00F5FF;
  --neon-green:  #39FF14;
  --dark-bg:     #08080F;
  --card-bg:     rgba(255,255,255,0.03);
  --border:      rgba(255,215,0,0.18);
  --text-main:   #FFFDF0;
  --text-dim:    rgba(255,253,240,0.45);
  --glow-gold:   0 0 12px #FFD700, 0 0 30px rgba(255,215,0,0.35);
  --glow-pink:   0 0 12px #FF2D78, 0 0 30px rgba(255,45,120,0.35);
  --glow-cyan:   0 0 12px #00F5FF, 0 0 30px rgba(0,245,255,0.35);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--dark-bg);
  font-family: 'Orbitron', monospace;
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* ── SCANLINE OVERLAY ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0.18) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ── VIGNETTE ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 50%,
    rgba(0,0,0,0.72) 100%
  );
  pointer-events: none;
  z-index: 9998;
}

/* ── WRAP ── */
#gameWrap {
  position: absolute;

  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;

  overflow: hidden;

  border: 2px solid rgba(255,215,0,.18);
  border-radius: 12px;

  background: #000;
}

/* ── CANVAS ── */
#gameCanvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* ── TOP UI ── */
#topUI {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 24px 0;
  z-index: 100;
  pointer-events: none;
}

#turnText {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(20px, 4vw, 38px);
  letter-spacing: 0.12em;
  color: var(--neon-gold);
  text-shadow: var(--glow-gold);
  line-height: 1;
}

#scoreText {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.scorePill {
  font-family: 'Orbitron', monospace;
  font-size: clamp(14px, 2.5vw, 22px);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-bg);
  background: var(--neon-gold);
  border: none;
  padding: 12px 24px;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  text-shadow: none;
  box-shadow: 0 0 0 rgba(255,215,0,0);
}

.scorePill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.10) 3px,
    rgba(0,0,0,0.10) 4px
  );
  pointer-events: none;
}

/* ── START SCREEN ── */
#startScreen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  z-index: 200;
  background: radial-gradient(
    ellipse at 50% 40%,
    rgba(255,215,0,0.06) 0%,
    rgba(8,8,15,0.98) 70%
  );
  animation: fadeInScreen 0.6s ease both;
}

@keyframes fadeInScreen {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

#startScreen h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(72px, 18vw, 160px);
  letter-spacing: 0.08em;
  line-height: 0.9;
  color: var(--neon-gold);
  text-shadow: 
    0 0 10px #FFD700,
    0 0 30px rgba(255,215,0,0.6),
    0 0 80px rgba(255,215,0,0.25);
  animation: titlePulse 2.8s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { text-shadow: 0 0 10px #FFD700, 0 0 30px rgba(255,215,0,0.6), 0 0 80px rgba(255,215,0,0.25); }
  50%       { text-shadow: 0 0 18px #FFD700, 0 0 55px rgba(255,215,0,0.8), 0 0 110px rgba(255,215,0,0.4); }
}

/* decorative line under title */
#startScreen h1::after {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--neon-gold), transparent);
  margin-top: 10px;
  border-radius: 2px;
  animation: lineGlow 2.8s ease-in-out infinite;
}

@keyframes lineGlow {
  0%, 100% { opacity: 0.5; }
  50%       { opacity: 1; }
}

#startScreen > p:not(.smallText) {
  font-family: 'Orbitron', monospace;
  font-size: clamp(11px, 2.2vw, 16px);
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.playerButtons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.playerButtons button {
  font-family: 'Orbitron', monospace;
  font-size: clamp(11px, 1.8vw, 14px);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-bg);
  background: var(--neon-gold);
  border: none;
  padding: 14px 26px;
  cursor: pointer;
  border-radius: 3px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  box-shadow: 0 0 0 rgba(255,215,0,0);
  position: relative;
  overflow: hidden;
}

.playerButtons button::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.22) 0%, transparent 60%);
  pointer-events: none;
}

.playerButtons button:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 6px 24px rgba(255,215,0,0.55), 0 0 0 2px var(--neon-gold);
  background: #ffe94d;
}

.playerButtons button:active {
  transform: translateY(0) scale(0.97);
}

.smallText {
  font-family: 'Space Mono', monospace;
  font-size: clamp(10px, 1.5vw, 12px);
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-align: center;
  max-width: 320px;
  padding: 0 20px;
}

/* ── MESSAGE BOX ── */
#messageBox {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 300;
  pointer-events: none;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(48px, 12vw, 110px);
  letter-spacing: 0.05em;
  line-height: 1.05;
  color: var(--neon-gold);
  text-shadow: var(--glow-gold);
  animation: msgPop 0.35s cubic-bezier(0.22,1.8,0.5,1) both;
}

@keyframes msgPop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}

#messageBox.centerOverlay {
  display: flex;
  background: radial-gradient(
    ellipse at center,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.45) 100%
  );
  backdrop-filter: blur(4px);
}

/* ── NEXT TURN BUTTON ── */
#nextTurnBtn {
  display: none;
  position: absolute;
  bottom: 9vh;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(18px, 4vw, 32px);
  letter-spacing: 0.18em;
  color: var(--dark-bg);
  background: var(--neon-pink);
  border: none;
  padding: 16px 44px;
  cursor: pointer;
  border-radius: 3px;
  box-shadow: 0 0 18px rgba(255,45,120,0.6), 0 0 50px rgba(255,45,120,0.25);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: btnAppear 0.4s cubic-bezier(0.22,1.8,0.5,1) both;
}

@keyframes btnAppear {
  from { opacity: 0; transform: translateX(-50%) translateY(30px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#nextTurnBtn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 55%);
  border-radius: 3px;
  pointer-events: none;
}

#nextTurnBtn:hover {
  transform: translateX(-50%) translateY(-3px) scale(1.04);
  box-shadow: 0 0 28px rgba(255,45,120,0.8), 0 0 70px rgba(255,45,120,0.35);
}

#nextTurnBtn:active {
  transform: translateX(-50%) scale(0.97);
}

/* ── CORNER DECORATIONS ── */
#gameWrap::before,
#gameWrap::after {
  content: '';
  position: absolute;
  width: 60px;
  height: 60px;
  z-index: 101;
  pointer-events: none;
}

#gameWrap::before {
  top: 0;
  left: 0;
  border-top: 2px solid rgba(255,215,0,0.3);
  border-left: 2px solid rgba(255,215,0,0.3);
}

#gameWrap::after {
  top: 0;
  right: 0;
  border-top: 2px solid rgba(255,215,0,0.3);
  border-right: 2px solid rgba(255,215,0,0.3);
}
