:root {
  color-scheme: dark;
  --bg: #120f24;
  --panel: rgba(31, 26, 59, 0.84);
  --panel-strong: rgba(45, 38, 82, 0.95);
  --ink: #fff8d9;
  --muted: #c7bfe5;
  --gold: #ffd96a;
  --moon: #bde8ff;
  --danger: #ff7d9a;
  --good: #9ff2b2;
  --cell: #252044;
  --cell2: #2f2855;
  --line: rgba(255,255,255,.12);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(255,217,106,.18), transparent 26rem),
    radial-gradient(circle at 82% 0%, rgba(111,181,255,.17), transparent 24rem),
    linear-gradient(160deg, #090713 0%, var(--bg) 52%, #21173c 100%);
}
a { color: var(--moon); font-weight: 700; }
.shell { width: min(960px, 100%); margin: 0 auto; padding: 18px; }
.top-links { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }
.top-links a, button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255,255,255,.08);
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.hero { text-align: center; margin: 4px auto 18px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800; }
h1 { font-size: clamp(2.4rem, 12vw, 5rem); line-height: .92; margin: 0; text-shadow: 0 0 28px rgba(255,217,106,.35); }
.lede { max-width: 640px; margin: 14px auto 0; color: var(--muted); font-size: 1.05rem; }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 14px;
  box-shadow: 0 24px 80px rgba(0,0,0,.24);
  backdrop-filter: blur(10px);
}
.status-panel { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.status-panel div { background: rgba(255,255,255,.06); border-radius: 16px; padding: 10px; text-align: center; }
.label { display:block; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.board-wrap { display: grid; place-items: center; gap: 14px; }
.board {
  width: min(92vw, 560px);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  touch-action: manipulation;
}
.cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(150deg, var(--cell), var(--cell2));
  color: var(--ink);
  font-size: clamp(1.35rem, 6vw, 2.25rem);
  display: grid;
  place-items: center;
  position: relative;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 8px 16px rgba(0,0,0,.18);
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.cell:focus-visible { outline: 3px solid var(--moon); outline-offset: 2px; }
.cell:hover { transform: translateY(-1px); }
.cell.lamp { background: radial-gradient(circle, rgba(255,236,142,.9) 0 18%, #6f5522 38%, var(--cell2) 74%); box-shadow: 0 0 22px rgba(255,217,106,.38); }
.cell.path::after {
  content: "";
  width: 32%; height: 32%; border-radius: 999px;
  background: rgba(255,255,255,.38);
  position: absolute;
  bottom: 8%; right: 8%;
}
.cell.current { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(255,217,106,.55), 0 0 28px rgba(255,217,106,.45); }
.cell.web { background: linear-gradient(150deg, #38233a, #4b2440); }
.cell.jar { background: radial-gradient(circle, rgba(189,232,255,.9), #335b78 45%, var(--cell) 80%); }
.cell.flower { background: linear-gradient(150deg, #264935, #342857); }
.message { margin: 0; min-height: 1.5em; text-align: center; color: var(--muted); font-weight: 700; }
.message.win { color: var(--good); }
.message.lose { color: var(--danger); }
.controls { display: flex; gap: 10px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
button { color: var(--ink); background: linear-gradient(180deg, #8061ff, #5637c8); font: inherit; font-weight: 850; cursor: pointer; }
button.secondary { background: rgba(255,255,255,.08); }
button:disabled { opacity: .45; cursor: not-allowed; }
.how { color: var(--muted); }
.how h2 { color: var(--ink); margin: 0 0 8px; }
.how ul { margin: 0; padding-left: 1.2rem; }
@media (max-width: 620px) {
  .shell { padding: 12px; }
  .status-panel { grid-template-columns: repeat(2, 1fr); }
  .cell { border-radius: 13px; }
}
