:root {
  color-scheme: light;
  --bg: #f4efe4;
  --panel: rgba(255, 255, 255, 0.88);
  --ink: #20312a;
  --muted: #617067;
  --line: #d7c8ad;
  --accent: #d07c2d;
  --accent-2: #3f8f6b;
  --shadow: 0 18px 42px rgba(46, 40, 26, 0.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 top left, rgba(208, 124, 45, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(63, 143, 107, 0.18), transparent 24%),
    var(--bg);
}
button { font: inherit; }
.shell {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 18px 0 32px;
}
.topnav {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
  font-weight: 700;
}
.topnav a { color: var(--ink); text-decoration: none; }
.hero, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.hero { padding: 18px; margin-bottom: 16px; }
.eyebrow, .mini { margin: 0; color: var(--accent); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
h1 { margin: 4px 0 0; font-size: clamp(1.9rem, 3vw, 3rem); }
.subtitle { margin: 10px 0 0; color: var(--muted); line-height: 1.5; max-width: 720px; }
.hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.hud .panel { padding: 12px 14px; }
.hud span, .panel h2 { display: block; margin: 0 0 4px; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.hud strong { font-size: 1.25rem; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.board-panel { padding: 16px; }
.board-head { display: flex; justify-content: space-between; gap: 10px; align-items: start; margin-bottom: 12px; }
.board-head h2 { margin: 3px 0 0; font-size: 1.2rem; }
.ghost, .primary, .button-stack button {
  min-height: 44px; border-radius: 12px; border: 1px solid var(--line); cursor: pointer; padding: 10px 14px; font-weight: 800;
}
.ghost { background: #f8f4ea; color: var(--ink); }
.primary { background: var(--accent-2); border-color: var(--accent-2); color: white; }
.primary:disabled { opacity: .45; cursor: not-allowed; }
.board-wrap { position: relative; width: min(100%, 520px); margin: 0 auto; aspect-ratio: 1; }
.board, .rope-layer { position: absolute; inset: 0; }
.board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  z-index: 2;
}
.rope-layer { z-index: 1; overflow: visible; pointer-events: none; }
.cell {
  display: grid; place-items: center; position: relative; padding: 0; border: 1px solid #dcccb0; border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(239,230,214,.88));
  min-width: 0;
}
.cell:disabled { cursor: default; }
.cell.tent { background: linear-gradient(180deg, rgba(255,248,236,.95), rgba(255,236,206,.92)); }
.cell.stake { background: linear-gradient(180deg, rgba(236,246,240,.95), rgba(213,233,223,.94)); }
.cell.selected { outline: 3px solid rgba(208,124,45,.3); }
.cell.done.tent { box-shadow: inset 0 0 0 2px rgba(63,143,107,.35); }
.symbol { font-size: clamp(1.2rem, 3vw, 1.6rem); line-height: 1; }
.note {
  position: absolute; right: 8px; bottom: 6px; min-width: 22px; height: 22px; display: grid; place-items: center;
  border-radius: 999px; background: #20312a; color: white; font-size: .75rem; font-weight: 900;
}
.cell.stake .note { background: var(--accent-2); }
.rope { stroke-width: 8; stroke-linecap: round; opacity: .86; }
.rope-0 { stroke: #d07c2d; }
.rope-1 { stroke: #3f8f6b; }
.rope-2 { stroke: #7d5cb8; }
.rope-3 { stroke: #c04f63; }
.side { display: grid; gap: 16px; }
.rules, .controls, .progress { padding: 16px; }
.rules ul { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 8px; line-height: 1.45; }
.button-stack { display: grid; gap: 10px; }
.hint { margin: 10px 0 0; color: var(--muted); line-height: 1.4; }
.level-dots { list-style: none; display: flex; gap: 8px; padding: 0; margin: 0; }
.dot { width: 12px; height: 12px; border-radius: 999px; background: #d7c8ad; }
.dot.active { background: var(--accent); }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr 1fr; }
  .progress { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .shell { width: min(100% - 14px, 1120px); padding-top: 12px; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .board-panel, .rules, .controls, .progress, .hero { padding: 12px; }
  .board-wrap { width: 100%; }
  .board { gap: 4px; }
  .board-head { flex-direction: column; }
  .side { grid-template-columns: 1fr; }
}
