:root {
  --bg-top: #f4efe2;
  --bg-bottom: #d6e6f2;
  --panel: rgba(255, 252, 247, 0.82);
  --panel-border: rgba(35, 48, 70, 0.14);
  --text-main: #203047;
  --text-muted: #5f6f86;
  --board-shell: #1e5a92;
  --board-shadow: #143d63;
  --empty-slot: #d7e1ec;
  --player-one: #f5b335;
  --player-two: #e6665f;
  --button-bg: #f7fbff;
  --button-border: #9bb7d1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.9), transparent 30%),
    linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

.page {
  display: flex;
  justify-content: center;
  padding: 32px 16px 48px;
}

.game-shell {
  width: min(960px, 100%);
  padding: 28px;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 24px 70px rgba(32, 48, 71, 0.15);
  backdrop-filter: blur(10px);
}

.game-header {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.game-header h1 {
  margin: 0;
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 0.95;
}

.subtitle {
  max-width: 42rem;
  margin: 12px 0 0;
  font-size: 1rem;
  color: var(--text-muted);
}

.game-panel {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  margin-bottom: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(35, 48, 70, 0.08);
}

.status-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#status-message {
  margin: 0;
  font-size: 1rem;
}

.restart-button,
.column-button {
  border: 1px solid var(--button-border);
  background: var(--button-bg);
  color: var(--text-main);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.restart-button {
  padding: 12px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(32, 48, 71, 0.1);
}

.restart-button:hover,
.column-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(32, 48, 71, 0.12);
}

.players {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(35, 48, 70, 0.08);
  background: rgba(255, 255, 255, 0.72);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.player-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(30, 90, 146, 0.32);
  box-shadow: 0 12px 24px rgba(32, 48, 71, 0.08);
}

.player-card h2,
.board-header h2 {
  margin: 0 0 4px;
  font-size: 1.1rem;
}

.player-card p,
.board-header p {
  margin: 0;
  color: var(--text-muted);
}

.player-chip {
  width: 24px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.player-one .player-chip {
  background: var(--player-one);
}

.player-two .player-chip {
  background: var(--player-two);
}

.board-section {
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(238, 245, 251, 0.9));
  border: 1px solid rgba(35, 48, 70, 0.08);
}

.board-header {
  margin-bottom: 14px;
}

.column-buttons {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.column-button {
  min-height: 44px;
  border-radius: 14px;
}

.column-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
  box-shadow: none;
}

.board-frame {
  padding: 18px;
  border-radius: 28px;
  background: linear-gradient(180deg, var(--board-shell), var(--board-shadow));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.18), 0 18px 36px rgba(20, 61, 99, 0.22);
}

.game-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
}

.cell {
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, var(--empty-slot) 70%);
  box-shadow: inset 0 10px 14px rgba(255, 255, 255, 0.5), inset 0 -10px 14px rgba(32, 48, 71, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.cell.is-filled {
  transform: scale(0.97);
}

.cell.player-one {
  background: radial-gradient(circle at 30% 30%, #ffe7a8, var(--player-one) 68%);
}

.cell.player-two {
  background: radial-gradient(circle at 30% 30%, #ffc5be, var(--player-two) 68%);
}

.cell.is-winning {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.75), 0 0 22px rgba(255, 255, 255, 0.7);
}

@media (max-width: 720px) {
  .game-shell {
    padding: 18px;
    border-radius: 22px;
  }

  .game-panel,
  .players {
    grid-template-columns: 1fr;
  }

  .game-panel {
    display: grid;
  }

  .column-buttons,
  .game-board {
    gap: 6px;
  }

  .board-frame {
    padding: 10px;
  }
}
