:root {
  color-scheme: dark;
  --bg: #07131f;
  --bg-2: #0d2233;
  --panel: rgba(11, 28, 43, 0.9);
  --border: rgba(144, 212, 255, 0.2);
  --ink: #ecf8ff;
  --muted: #a3c3d9;
  --accent: #ffc857;
  --accent-2: #ff9f43;
  --water: #14344f;
  --water-2: #0d2439;
  --stone: #dce8f5;
  --stone-edge: #8ca8c1;
  --sunken: #12304c;
  --dock: #7f5a3a;
  --hero: #ffe08c;
  --glow: 0 0 0 4px rgba(255, 200, 87, 0.18);
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top, rgba(78, 130, 186, 0.18), transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, #081824 45%, #040b12 100%);
}
.shell {
  width: min(920px, 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;
  backdrop-filter: blur(8px);
}
.hero h1 { margin: 0 0 10px; font-size: clamp(2.2rem, 5vw, 3.5rem); }
.eyebrow, .subtitle, .label, .round-copy, .message { color: var(--muted); }
.subtitle { margin: 0; line-height: 1.55; }
.hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.hud div {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}
.label {
  display: block;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}
.hud strong { font-size: 1.16rem; }
.board-head, .button-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.board {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 12px;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--water), var(--water-2));
  border: 1px solid rgba(159, 220, 255, 0.18);
}
.tile {
  position: relative;
  min-height: 72px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  padding: 0;
}
.tile:disabled { cursor: default; }
.tile.stone {
  background: linear-gradient(180deg, var(--stone), #c2d4e5);
  color: #12314b;
  border-color: rgba(255,255,255,0.35);
  box-shadow: inset 0 -5px 0 rgba(100, 125, 150, 0.2);
}
.tile.stone.reachable {
  outline: none;
  box-shadow: inset 0 -5px 0 rgba(100, 125, 150, 0.2), var(--glow);
}
.tile.sunken {
  background: radial-gradient(circle at 50% 30%, rgba(109, 184, 255, 0.12), rgba(12, 34, 52, 0.92));
  border-color: rgba(109, 184, 255, 0.08);
}
.tile.start, .tile.finish {
  background: linear-gradient(180deg, #9c7751, var(--dock));
  color: #fff5db;
  border-color: rgba(255, 230, 194, 0.22);
}
.tile.player::after {
  content: '🏮';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
}
.tile.firefly::before {
  content: '✨';
  position: absolute;
  top: 8px;
  right: 9px;
  font-size: 1rem;
}
.tile.finish.ready {
  box-shadow: 0 0 0 4px rgba(255, 200, 87, 0.2);
}
.tile .mini {
  position: absolute;
  left: 10px;
  bottom: 8px;
  font-size: 0.76rem;
  opacity: 0.85;
}
.controls-card { text-align: center; }
.message { margin: 0; min-height: 1.5em; }
.notes p { margin: 0 0 10px; line-height: 1.5; }
.notes p:last-child { margin-bottom: 0; }
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: #3a2200; }
button.secondary { background: rgba(255,255,255,0.1); color: var(--ink); }
button.hidden { display: none; }
@media (max-width: 720px) {
  .shell { width: min(100vw - 14px, 920px); }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-head, .button-group { flex-direction: column; align-items: stretch; }
  .tile { min-height: 62px; }
}
