:root {
  color-scheme: light;
  --bg: #eef3f8;
  --panel: #ffffff;
  --ink: #142033;
  --muted: #5b6675;
  --board: #2366b6;
  --board-dark: #164b8d;
  --cell: #dce7f1;
  --red: #e84855;
  --red-dark: #b72536;
  --yellow: #f5c542;
  --yellow-dark: #d28c0f;
  --green: #14846f;
  --shadow: 0 18px 45px rgb(25 47 76 / 18%);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 70%), rgb(255 255 255 / 0%) 42%),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button {
  font: inherit;
}

.game-shell {
  width: min(100%, 680px);
  display: grid;
  gap: 18px;
}

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 8vw, 4.6rem);
  line-height: 0.9;
}

.icon-button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 8px 20px rgb(22 35 55 / 12%);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease;
}

.icon-button:hover,
.icon-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgb(22 35 55 / 18%);
}

.icon-button span {
  font-size: 1.55rem;
  line-height: 1;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.score-panel {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgb(22 35 55 / 10%);
}

.score-panel.current {
  border-color: var(--green);
}

.disc {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: block;
  border-radius: 50%;
  box-shadow: inset 0 -5px 0 rgb(0 0 0 / 16%);
}

.red {
  background: var(--red);
}

.yellow {
  background: var(--yellow);
}

.label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.score-panel strong {
  display: block;
  margin-top: 2px;
  font-size: 1.9rem;
  line-height: 1;
}

.status {
  min-height: 28px;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.board-wrap {
  width: 100%;
  padding: clamp(12px, 3vw, 22px);
  border-radius: 8px;
  background: linear-gradient(180deg, var(--board), var(--board-dark));
  box-shadow: var(--shadow);
}

.drop-row,
.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: clamp(6px, 1.5vw, 12px);
}

.drop-row {
  margin-bottom: clamp(8px, 2vw, 14px);
}

.drop-button {
  aspect-ratio: 1;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: rgb(255 255 255 / 16%);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition:
    background-color 130ms ease,
    transform 130ms ease;
}

.drop-button::before {
  content: "↓";
  font-size: clamp(1.1rem, 4vw, 1.8rem);
  font-weight: 900;
  line-height: 1;
}

.drop-button:hover,
.drop-button:focus-visible {
  background: rgb(255 255 255 / 28%);
  transform: translateY(2px);
}

.drop-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  transform: none;
}

.cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cell);
  box-shadow:
    inset 0 7px 10px rgb(17 39 67 / 28%),
    0 1px 0 rgb(255 255 255 / 35%);
}

.cell::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: inherit;
  background: rgb(255 255 255 / 28%);
  opacity: 0;
}

.cell.red,
.cell.yellow {
  box-shadow:
    inset 0 -8px 0 rgb(0 0 0 / 16%),
    inset 0 5px 0 rgb(255 255 255 / 25%);
}

.cell.red {
  background: radial-gradient(circle at 35% 28%, #ff8a91 0 16%, var(--red) 17% 100%);
}

.cell.yellow {
  background: radial-gradient(circle at 35% 28%, #ffe28a 0 16%, var(--yellow) 17% 100%);
}

.cell.win {
  outline: 4px solid #ffffff;
  outline-offset: -7px;
}

@media (max-width: 560px) {
  body {
    align-items: start;
    padding: 18px;
  }

  .game-shell {
    gap: 14px;
  }

  .score-panel {
    min-height: 68px;
    padding: 11px;
  }

  .disc {
    width: 28px;
    height: 28px;
  }

  .score-panel strong {
    font-size: 1.55rem;
  }

  .status {
    font-size: 0.98rem;
  }
}
