.game {
  width: min(720px, 100% - 32px);
  margin: 0 auto;
  padding: 40px 0 64px;
  text-align: center;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.95rem;
}
.target {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0;
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: clamp(1.9rem, 7vw, 3.2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.target::before {
  content: "rgb(";
  color: var(--muted);
}
.target::after {
  content: ")";
  color: var(--muted);
}
.target span + span::before {
  content: ", ";
  color: var(--muted);
}
.target .r {
  color: #e5484d;
}
.target .g {
  color: #30a46c;
}
.target .b {
  color: #3e63dd;
}
[data-theme="light"] .target .r {
  color: #c2262b;
}
[data-theme="light"] .target .g {
  color: #1f7a4d;
}
[data-theme="light"] .target .b {
  color: #2f4cc0;
}
.status {
  min-height: 1.6em;
  margin: 0 0 22px;
  font-weight: 500;
  color: var(--muted);
}
.status.ok {
  color: var(--ok);
}
.status.bad {
  color: var(--bad);
}
.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 26px;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.tile {
  aspect-ratio: 1.25;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 10px 24px -14px rgba(0, 0, 0, 0.7);
  transition: transform 0.2s, opacity 0.35s, background-color 0.5s, box-shadow 0.2s;
  animation: pop 0.35s ease backwards;
}
.tile:hover:not(:disabled) {
  transform: translateY(-3px);
}
.tile:active:not(:disabled) {
  transform: scale(0.97);
}
.tile.miss {
  opacity: 0.08;
  transform: scale(0.9);
  cursor: default;
}
.tile.won {
  cursor: default;
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent);
}
.tile[hidden] {
  display: none;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 30px 0 14px;
}
.scoreboard div {
  padding: 14px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.scoreboard dt {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scoreboard dd {
  margin: 2px 0 0;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hint {
  color: var(--muted);
  font-size: 0.85rem;
}
kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
  font-family: var(--mono);
  font-size: 0.78rem;
}
@media (max-width: 460px) {
  .board {
    gap: 10px;
  }
  .hint {
    display: none;
  }
}

/* ---------- RGB game: playful, warm, colour-first ---------- */
:root {
  --bg: #120d24;
  --bg-2: #1a1432;
  --card: #1c1636;
  --card-hi: #241c44;
  --line: #34295c;
  --text: #f7f4ff;
  --muted: #bab2d8;
  --accent: #ff8a66;
  --on-accent: #1a0e0a;
  --ok: #5eead4;
  --bad: #ff9aa2;
}
[data-theme="light"] {
  --bg: #fff6ec;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-hi: #fff0e0;
  --line: #f0d9c0;
  --text: #2b1a12;
  --muted: #6a5242;
  --accent: #c2410c;
  --on-accent: #ffffff;
  --ok: #0f766e;
  --bad: #b91c1c;
}
body {
  background:
    radial-gradient(700px 360px at 50% -80px, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--bg);
  background-color: var(--bg);
  transition: background-color 0.7s ease, color 0.4s ease;
}
.eyebrow {
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}
.target {
  font-size: clamp(1.5rem, 6.4vw, 3.3rem);
  font-weight: 700;
  white-space: nowrap;
}
.status {
  font-size: 1.05rem;
}
.board {
  gap: 16px;
}
.tile {
  aspect-ratio: 1.1;
  border-radius: 22px;
}
.tile.won {
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--text);
}
.scoreboard div {
  border-radius: 18px;
}
.scoreboard dd {
  font-size: 2rem;
}
.btn.primary {
  border-radius: 999px;
  padding-inline: 24px;
}
.segmented,
.segmented button {
  border-radius: 999px;
}
.board.solved .tile {
  box-shadow: inset 0 0 0 3px var(--text);
}
.board.solved .tile.won {
  box-shadow: inset 0 0 0 3px var(--text), 0 0 0 4px var(--bg), 0 0 0 7px var(--text);
}
.flooded .target .r,
.flooded .target .g,
.flooded .target .b {
  color: var(--text);
}
body.flooded {
  background-image: none;
}
