:root {
  color-scheme: light dark;
  --bg: #11161c;
  --panel: #1b2430;
  --board: #22324a;
  --slot: #0e141b;
  --red: #e0453f;
  --yellow: #e8b839;
  --text: #e8edf2;
  --muted: #8a96a3;
  --accent: #3d7bf5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap {
  width: 100%;
  max-width: 560px;
  padding: 2rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

h1 {
  margin: 0 0 0.25rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mode {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.9rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.mode label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.mode input {
  accent-color: var(--accent);
}

.status {
  margin: 0 0 1.25rem;
  font-size: 1rem;
  color: var(--muted);
  min-height: 1.4em;
}

.status.win { color: var(--text); font-weight: 600; }
.status.thinking { font-style: italic; }

.board {
  --cols: 7;
  --rows: 6;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
  gap: 6px;
  background: var(--board);
  border-radius: 14px;
  padding: 10px;
  width: 100%;
  aspect-ratio: 7 / 6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.board.locked {
  pointer-events: none;
  opacity: 0.85;
}

.col {
  grid-row: 1 / -1;
  display: grid;
  grid-template-rows: repeat(var(--rows), 1fr);
  gap: 6px;
  cursor: pointer;
  border-radius: 8px;
}

.col:hover .slot.empty {
  background: #15202c;
}

.col.full {
  cursor: not-allowed;
}

.slot {
  background: var(--slot);
  border-radius: 50%;
  position: relative;
}

.slot .disc {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  transform: scale(0);
  transition: transform 0.18s ease-out;
}

.slot.r .disc { background: var(--red); transform: scale(1); }
.slot.y .disc { background: var(--yellow); transform: scale(1); }

.slot.win .disc {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.controls {
  margin-top: 1.25rem;
}

button {
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1.3rem;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }
button:active { filter: brightness(0.95); }

.ir-foot { text-align: center; font-size: .7rem; opacity: .45; margin: 2rem 0 1rem; }
.ir-foot a { color: inherit; }
