:root {
  --bg: #080b15;
  --bg-2: #141a2d;
  --glow-1: rgba(27, 201, 255, 0.25);
  --glow-2: rgba(255, 154, 71, 0.28);
  --text: #f7f2e9;
  --muted: rgba(247, 242, 233, 0.64);
  --panel: rgba(13, 18, 36, 0.72);
  --panel-border: rgba(173, 215, 255, 0.2);
  --human: #ffb14a;
  --human-deep: #e07d00;
  --ai: #5fe5ff;
  --ai-deep: #2186b2;
  --board: #2d3c6c;
  --board-deep: #1a2342;
  --hole: #0c1228;
  --hole-soft: #27335c;
  --shadow: rgba(0, 0, 0, 0.45);
}

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

body {
  min-height: 100vh;
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, rgba(18, 72, 120, 0.8), transparent 35%),
    radial-gradient(circle at 85% 20%, rgba(255, 144, 66, 0.3), transparent 38%),
    linear-gradient(160deg, var(--bg), var(--bg-2));
  overflow-x: hidden;
}

.scene {
  padding: 2.5rem 6vw 4rem;
  position: relative;
}

.scene::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 80px 80px;
  mix-blend-mode: screen;
  pointer-events: none;
  opacity: 0.25;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.08rem;
  text-transform: uppercase;
}

.back-link:hover {
  color: var(--text);
}

.hero {
  margin-top: 2rem;
  max-width: 720px;
}

.hero-top {
  font-size: 0.85rem;
  letter-spacing: 0.4rem;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  font-family: "Russo One", sans-serif;
  font-size: clamp(2.6rem, 5vw, 4.3rem);
  margin: 0.6rem 0;
  text-transform: uppercase;
}

.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 520px;
}

.arena {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(220px, 0.8fr);
  gap: 2.5rem;
  margin-top: 3rem;
  align-items: start;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.score-card {
  background: linear-gradient(150deg, rgba(40, 52, 92, 0.95), rgba(18, 24, 48, 0.8));
  border-radius: 16px;
  padding: 1rem 1.4rem;
  border: 1px solid rgba(111, 167, 255, 0.2);
  box-shadow: 0 16px 40px var(--shadow);
  text-align: center;
}

.score-label {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
}

.score-value {
  font-family: "Russo One", sans-serif;
  font-size: 2.2rem;
  margin-top: 0.5rem;
}

.status {
  background: rgba(15, 22, 44, 0.7);
  border: 1px solid rgba(82, 116, 184, 0.4);
  border-radius: 999px;
  padding: 0.65rem 1.2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 500;
  box-shadow: 0 10px 28px var(--shadow);
  margin-bottom: 1.6rem;
}

.board-wrap {
  position: relative;
  width: min(84vw, 680px);
}

.column-controls {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.8rem;
}

.column-controls button {
  border: none;
  background: rgba(25, 36, 70, 0.9);
  color: var(--muted);
  border-radius: 12px;
  padding: 0.55rem 0;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.4), 0 10px 20px var(--shadow);
  transition: transform 0.2s ease, color 0.2s ease;
}

.column-controls button:hover:not(:disabled) {
  transform: translateY(-2px);
  color: var(--text);
}

.column-controls button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(6, 1fr);
  gap: 0.7rem;
  background: linear-gradient(160deg, var(--board), var(--board-deep));
  padding: 1.4rem;
  border-radius: 28px;
  border: 2px solid rgba(127, 171, 255, 0.3);
  box-shadow: 0 28px 50px rgba(2, 6, 18, 0.7);
  transform: perspective(900px) rotateX(8deg);
}

.cell {
  position: relative;
  padding-top: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--hole-soft), var(--hole));
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.7);
}

.cell .disc {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  transform: translateY(-120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.cell .disc.filled {
  transform: translateY(0);
  opacity: 1;
}

.cell .disc.human {
  background: radial-gradient(circle at 30% 30%, #ffd59a, var(--human));
  box-shadow: inset 0 5px 12px rgba(255, 255, 255, 0.4),
    inset 0 -8px 18px rgba(108, 55, 0, 0.8),
    0 8px 16px rgba(255, 146, 46, 0.6);
}

.cell .disc.ai {
  background: radial-gradient(circle at 30% 30%, #b6f6ff, var(--ai));
  box-shadow: inset 0 5px 12px rgba(255, 255, 255, 0.4),
    inset 0 -8px 18px rgba(0, 56, 92, 0.9),
    0 8px 18px rgba(95, 229, 255, 0.6);
}

.cell .disc.drop {
  animation: drop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes drop {
  from {
    transform: translateY(-160%);
  }
  to {
    transform: translateY(0);
  }
}

.panel {
  background: var(--panel);
  border-radius: 20px;
  padding: 1.5rem;
  border: 1px solid var(--panel-border);
  box-shadow: 0 20px 40px rgba(2, 4, 12, 0.6);
  backdrop-filter: blur(16px);
}

.panel-header h2 {
  font-family: "Russo One", sans-serif;
  text-transform: uppercase;
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.panel-header p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

.panel-body {
  display: grid;
  gap: 0.8rem;
}

.panel-body button {
  border: none;
  border-radius: 12px;
  padding: 0.75rem 1rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  letter-spacing: 0.04rem;
  cursor: pointer;
  background: rgba(39, 52, 92, 0.8);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(1, 3, 12, 0.6);
  transition: transform 0.2s ease, background 0.2s ease;
}

.panel-body button:hover {
  transform: translateY(-1px);
  background: rgba(56, 80, 143, 0.9);
}

.panel-body .primary {
  background: linear-gradient(135deg, rgba(255, 174, 74, 0.9), rgba(255, 112, 24, 0.9));
  color: #251403;
}

.panel-body .ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.legend {
  margin-top: 1.6rem;
  display: grid;
  gap: 0.7rem;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
}

.legend .disc {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-block;
}

.legend .disc.human {
  background: radial-gradient(circle at 30% 30%, #ffd59a, var(--human));
}

.legend .disc.ai {
  background: radial-gradient(circle at 30% 30%, #b6f6ff, var(--ai));
}

@media (max-width: 980px) {
  .arena {
    grid-template-columns: 1fr;
  }

  .board-wrap {
    width: 100%;
  }

  .scoreboard {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
}

@media (max-width: 640px) {
  .scene {
    padding: 2rem 5vw 3rem;
  }

  .column-controls button {
    font-size: 0.75rem;
  }
}
