﻿:root {
  --blue: #1c4aa6;
  --blue-dark: #163c86;
  --red: #e53935;
  --yellow: #f7d32b;
  --cell: #f1f5f9;
  --bg: radial-gradient(1200px 800px at 15% -10%, #132347 0%, #0b142c 45%, #05060b 100%);
  --text: #e2e8f0;
  --neon-cyan: rgba(56, 189, 248, 0.65);
  --neon-pink: rgba(244, 114, 182, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Gill Sans", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(500px 300px at 20% 15%, var(--neon-cyan), transparent 60%),
    radial-gradient(420px 260px at 85% 10%, var(--neon-pink), transparent 65%),
    radial-gradient(300px 220px at 75% 70%, rgba(94, 234, 212, 0.35), transparent 60%);
}

body::after {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.04) 0px,
      rgba(255, 255, 255, 0.04) 1px,
      transparent 1px,
      transparent 6px
    ),
    radial-gradient(800px 400px at 50% 120%, rgba(56, 189, 248, 0.12), transparent 70%);
  opacity: 0.5;
}

.app {
  max-width: 980px;
  margin: 32px auto 48px;
  padding: 0 16px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.title h1 {
  margin: 0 0 6px 0;
  font-size: 36px;
  letter-spacing: 0.5px;
}

.title p {
  margin: 0;
  opacity: 0.75;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  background: var(--blue);
  color: white;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 6px 16px rgba(28, 74, 166, 0.25);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.secondary {
  background: rgba(15, 23, 42, 0.65);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: none;
}

.status {
  margin: 18px 0 20px;
  padding: 12px 16px;
  background: rgba(12, 20, 38, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 12px;
  font-weight: 600;
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.55);
}

.board-wrap {
  display: flex;
  justify-content: center;
}

.board {
  display: grid;
  --cell-size: clamp(40px, 10.8vw, 84px);
  --cell-gap: clamp(6px, 1.2vw, 10px);
  grid-template-columns: repeat(7, var(--cell-size));
  grid-template-rows: repeat(6, var(--cell-size));
  gap: var(--cell-gap);
  padding: 18px;
  background: linear-gradient(180deg, var(--blue), var(--blue-dark));
  border-radius: 24px;
  box-shadow:
    inset 0 10px 30px rgba(0, 0, 0, 0.35),
    0 18px 38px rgba(15, 23, 42, 0.4),
    0 0 30px rgba(56, 189, 248, 0.22);
  position: relative;
}

.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  border-radius: 50%;
  background: var(--cell);
  position: relative;
  cursor: pointer;
  transition: transform 120ms ease;
}

.cell:hover {
  transform: translateY(-2px);
}

.disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
  box-shadow: inset 0 8px 14px rgba(255, 255, 255, 0.25), inset 0 -10px 20px rgba(0, 0, 0, 0.25);
  opacity: 0;
}

.disc.red {
  background: radial-gradient(circle at 30% 30%, #ff7875 0%, var(--red) 45%, #b71c1c 100%);
}

.disc.yellow {
  background: radial-gradient(circle at 30% 30%, #fff3a0 0%, var(--yellow) 45%, #f5b800 100%);
}

.disc.set {
  opacity: 1;
}

.drop-disc {
  position: absolute;
  border-radius: 50%;
  z-index: 4;
  box-shadow: inset 0 8px 14px rgba(255, 255, 255, 0.25), inset 0 -10px 20px rgba(0, 0, 0, 0.25);
  opacity: 1;
}

.cell.winning {
  outline: 4px solid #ffffff;
  outline-offset: -4px;
}

.disc.winning {
  animation: winFlash 700ms ease-in-out infinite;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.6), 0 0 18px rgba(255, 255, 255, 0.65);
  filter: brightness(1.1) saturate(1.2);
}

@keyframes winFlash {
  0% {
    transform: scale(1) translateY(0);
  }
  50% {
    transform: scale(1.06) translateY(0);
  }
  100% {
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 820px) {
  .board {
    padding: 14px;
  }
}

@media (max-width: 520px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
  }

  .board {
    padding: 14px;
  }
}
