:root {
  --bg: #1b3a2c;
  --board: #2a5a42;
  --grid: #0c1d14;
  --panel: #14281d;
  --panel-2: #1b3a2c;
  --ink: #eef3ef;
  --ink-2: #a8b9ad;
  --ink-3: #6d7f73;
  --accent: #e7c66a;
  --accent-ink: #1b1608;
  --hint: rgba(231, 198, 106, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica,
    Arial, sans-serif;
  font-size: 14px;
  min-height: 100vh;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 100vh;
}

header {
  text-align: center;
}
header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
header .subtitle {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--ink-2);
  letter-spacing: 0.12em;
}

.status {
  background: var(--panel);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.score {
  display: flex;
  gap: 16px;
  align-items: center;
}
.score .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.disc-mini {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.disc-mini.black {
  background: #1a1a1a;
}
.disc-mini.white {
  background: #fafafa;
}
.turn-label {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1 / 1;
  background: var(--grid);
  border-radius: 10px;
  padding: 6px;
  gap: 2px;
  user-select: none;
}
.cell {
  background: var(--board);
  border-radius: 3px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.1s;
}
.cell.legal {
  cursor: pointer;
}
.cell.legal::after {
  content: '';
  position: absolute;
  width: 30%;
  height: 30%;
  border-radius: 50%;
  background: var(--hint);
}
.cell:not(.legal) {
  cursor: default;
}
.cell.corner-hint {
  background: #356950;
}

.disc {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.35),
    inset 0 2px 3px rgba(255, 255, 255, 0.2),
    inset 0 -3px 4px rgba(0, 0, 0, 0.3);
  animation: flip 0.3s ease;
}
.disc.black {
  background: radial-gradient(circle at 35% 30%, #3a3a3a, #0a0a0a 70%);
}
.disc.white {
  background: radial-gradient(circle at 35% 30%, #ffffff, #d0d0d0 70%);
}
@keyframes flip {
  from {
    transform: scale(0.2);
    opacity: 0.3;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.controls button {
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-2);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.12s;
}
.controls button:hover:not(:disabled) {
  border-color: var(--accent);
}
.controls button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.controls button.primary:hover:not(:disabled) {
  filter: brightness(1.05);
}
.controls button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  color: var(--ink-2);
}
.mode-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.mode-row select {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--panel-2);
  border-radius: 4px;
  padding: 4px 8px;
  font: inherit;
}

.message {
  text-align: center;
  color: var(--accent);
  font-weight: 600;
  min-height: 1.5em;
}

footer {
  margin-top: auto;
  padding-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}
footer a {
  color: var(--ink-2);
}
footer a:hover {
  color: var(--ink);
}
