:root {
  color-scheme: light dark;
  --bg: #fff7e8;
  --surface: #fffdf8;
  --surface-2: #f5e4c8;
  --text: #2b1a0f;
  --muted: #6b4a2d;
  --line: #d8b98a;
  --accent: #c94b1a;
  --accent-2: #f2a900;
  --good: #2e7d32;
  --bad: #b3261e;
  --grill: #3a2a22;
  --grill-line: #5a4336;
  --raw: #d98b6a;
  --gold: #b86a1d;
  --burnt: #3f2b20;
  --smoke: rgba(90, 67, 54, 0.18);
  --shadow: 0 10px 30px rgba(43, 26, 15, 0.12);
  --radius: 18px;
  --font: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17110d;
    --surface: #211712;
    --surface-2: #2d2018;
    --text: #f7ead7;
    --muted: #d2b08a;
    --line: #5a4332;
    --accent: #ff7043;
    --accent-2: #ffcc4d;
    --good: #7bd389;
    --bad: #ff8a80;
    --grill: #120d0a;
    --grill-line: #2b211b;
    --smoke: rgba(255, 244, 220, 0.08);
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  }
}
html[data-theme="light"] { color-scheme: light; }
html[data-theme="light"] :root, html[data-theme="light"] {
  --bg: #fff7e8; --surface:#fffdf8; --surface-2:#f5e4c8; --text:#2b1a0f; --muted:#6b4a2d; --line:#d8b98a;
  --accent:#c94b1a; --accent-2:#f2a900; --good:#2e7d32; --bad:#b3261e; --grill:#3a2a22; --grill-line:#5a4336; --smoke:rgba(90,67,54,.18); --shadow:0 10px 30px rgba(43,26,15,.12);
}
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] {
  --bg:#17110d; --surface:#211712; --surface-2:#2d2018; --text:#f7ead7; --muted:#d2b08a; --line:#5a4332;
  --accent:#ff7043; --accent-2:#ffcc4d; --good:#7bd389; --bad:#ff8a80; --grill:#120d0a; --grill-line:#2b211b; --smoke:rgba(255,244,220,.08); --shadow:0 14px 40px rgba(0,0,0,.35);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(circle at top, var(--surface-2), var(--bg) 45%);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent); }
.wrap { max-width: 980px; margin: 0 auto; padding: 1rem 1rem 4rem; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem 0 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem;
}
.brand { font-weight: 800; font-size: 1rem; text-decoration: none; color: var(--text); }
.controls { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: flex-end; }
.chip, button.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: .45rem .8rem; font: inherit; cursor: pointer; text-decoration: none;
}
.chip:hover, .chip:focus-visible { border-color: var(--accent); outline: none; }
.hero { display: grid; gap: 1rem; grid-template-columns: 1.1fr .9fr; align-items: start; margin: 1.2rem 0; }
h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.05; margin: 0 0 .5rem; }
.lede { font-size: 1.1rem; color: var(--muted); margin: 0; max-width: 42rem; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1rem;
}
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin: 1rem 0; }
.stat { background: var(--surface-2); border-radius: 14px; padding: .7rem; text-align: center; }
.stat b { display: block; font-size: 1.45rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .9rem; }
.game-shell { position: relative; }
canvas {
  width: 100%; aspect-ratio: 16 / 10; display: block; border-radius: 20px;
  background: linear-gradient(#5bb3ff22, transparent 35%), var(--grill);
  border: 2px solid var(--line); touch-action: manipulation;
}
.overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  padding: 1rem; border-radius: 20px; background: rgba(23,17,13,.55); backdrop-filter: blur(2px);
}
.overlay[hidden] { display: none !important; }
.panel { max-width: 34rem; text-align: center; }
.panel h2 { margin: 0 0 .4rem; font-size: 2rem; }
.panel p { margin: .4rem 0; }
.actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: .8rem; }
.btn {
  background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: .8rem 1.2rem;
  font: inherit; font-weight: 700; cursor: pointer;
}
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.btn:hover, .btn:focus-visible { filter: brightness(1.05); outline: 2px solid var(--accent-2); outline-offset: 2px; }
.hint { color: var(--muted); font-size: .95rem; margin-top: .6rem; }
.toast {
  min-height: 2.2rem; margin: .6rem 0 0; font-weight: 700; color: var(--accent-2); text-align: center;
}
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); margin-top: 1rem; }
.grid h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.grid p, .grid li { color: var(--muted); margin: 0; }
.grid ul { margin: 0; padding-left: 1.1rem; }
footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
