:root {
  color-scheme: light;
  --bg: #f5fbff;
  --panel: rgba(255,255,255,0.92);
  --border: #b9d8ea;
  --ink: #153047;
  --muted: #5d7690;
  --accent: #3489ff;
  --accent-2: #7c5cff;
  --danger: #f15b6c;
  --safe: #73c7ff;
  --goal: #4b74ff;
  --tile-a: #dff2ff;
  --tile-b: #c7e7ff;
  --shadow: 0 18px 40px rgba(52, 101, 151, 0.15);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: radial-gradient(circle at top, #ffffff 0%, #e8f6ff 45%, #d8efff 100%);
  color: var(--ink);
}
.shell {
  width: min(960px, calc(100vw - 24px));
  margin: 0 auto;
  padding: 18px 0 32px;
}
.topnav {
  text-align: center;
  margin-bottom: 16px;
  color: var(--muted);
  font-weight: 700;
}
.topnav a { color: inherit; }
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(2rem, 5vw, 3.4rem); }
.eyebrow, .subtitle, .label, .round-copy, .message { color: var(--muted); }
.subtitle { margin: 0; font-size: 1.05rem; line-height: 1.5; }
.hud {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.hud div {
  background: rgba(223, 242, 255, 0.7);
  border-radius: 16px;
  padding: 12px;
  text-align: center;
}
.label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.hud strong { font-size: 1.15rem; }
.board-head, .action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bucket-row, .board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.bucket-row { margin: 16px 0 8px; }
.board { grid-template-rows: repeat(6, minmax(58px, 1fr)); }
.bucket, .tile {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.bucket {
  min-height: 72px;
  background: linear-gradient(180deg, #edf9ff, #d7eefc);
  flex-direction: column;
  font-weight: 800;
}
.bucket.goal { background: linear-gradient(180deg, #dfe9ff, #bfd0ff); }
.bucket.drain { background: linear-gradient(180deg, #ffe5e7, #ffc1c9); }
.bucket .mini { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.tile {
  min-height: 62px;
  background: linear-gradient(180deg, var(--tile-a), var(--tile-b));
  font-size: 2rem;
  font-weight: 900;
  color: #2b5c8e;
  cursor: pointer;
  overflow: hidden;
}
.tile:hover, .tile:focus-visible { outline: 3px solid rgba(52, 137, 255, 0.35); }
.tile .drop {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0 24%, #8fe0ff 25%, #3489ff 70%, #2268d3 100%);
  box-shadow: 0 0 0 3px rgba(255,255,255,0.45);
}
.controls-card { text-align: center; }
button {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; }
button.secondary { background: #ddeefe; color: var(--ink); }
button.alt { background: #ffe4e8; color: #8d2340; }
button.hidden { display: none; }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
}
.swatch {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
  margin-right: 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.swatch.goal { background: var(--goal); }
.swatch.safe { background: var(--safe); }
.swatch.drain { background: var(--danger); }
.swatch.drop { background: #3489ff; border-radius: 50%; }
.swatch.tile { background: linear-gradient(180deg, var(--tile-a), var(--tile-b)); }
.notes p { margin: 0 0 10px; line-height: 1.5; }
.notes p:last-child { margin-bottom: 0; }
@media (max-width: 700px) {
  .shell { width: min(100vw - 14px, 960px); }
  .hud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .board-head, .action-row { flex-direction: column; align-items: stretch; }
  .board { grid-template-rows: repeat(6, 56px); }
  .tile { min-height: 56px; font-size: 1.7rem; }
  .bucket { min-height: 66px; }
}
