:root {
  --bg: #12131c;
  --panel: #1b1d2a;
  --fg: #f5efe2;
  --muted: #a8a3b8;
  --line: #2c2f42;
  --tile: #20233a;
  --tile-2: #262a44;
  --gold: #ffd36b;
  --red: #ff6b6b;
  --teal: #4fd1c5;
  --violet: #a78bfa;
  --sky: #60a5fa;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 20% -10%, #2a2340, transparent), var(--bg);
  color: var(--fg);
  font: 16px/1.6 Inter, system-ui, sans-serif;
  min-height: 100vh;
}
.top {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding: 20px clamp(16px, 4vw, 48px);
}
.brand { font: 800 24px Fraunces, serif; display: flex; align-items: center; gap: 10px; }
.flame {
  width: 14px; height: 20px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: var(--gold); box-shadow: 0 0 18px var(--gold);
  animation: flicker 1.8s ease-in-out infinite;
}
@keyframes flicker { 50% { transform: scale(.88) rotate(-4deg); opacity: .8; } }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta span { font-size: 13px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; }

.guide {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px);
  max-width: 1200px; margin: 0 auto; padding: 16px clamp(16px, 4vw, 48px) 48px; align-items: center;
}
.stage { position: relative; }
#board { width: 100%; display: block; filter: drop-shadow(0 30px 60px rgba(0,0,0,.45)); }
#board .tile { transition: fill .4s; }
#board .tile.hl { fill: #39406b; }
#board .token { transition: transform .45s cubic-bezier(.3,1.5,.5,1); }
#board .pop { transform-box: fill-box; transform-origin: center; animation: pop .5s cubic-bezier(.3,1.6,.5,1) both; }
#board .fade { animation: fade .5s both; }
#board .pulse { transform-box: fill-box; transform-origin: center; animation: pulse 1.6s ease-in-out infinite; }
#board .trail { stroke-dasharray: 6 8; animation: march 1s linear infinite; }
@keyframes pop { from { transform: scale(0); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse { 50% { transform: scale(1.18); } }
@keyframes march { to { stroke-dashoffset: -28; } }

.die {
  position: absolute; right: 4%; top: 4%; width: 64px; height: 64px; border-radius: 14px;
  background: var(--fg); color: #12131c; display: grid; place-items: center;
  font: 800 30px Fraunces, serif; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  opacity: 0; transform: scale(.6); transition: opacity .3s, transform .3s;
}
.die.show { opacity: 1; transform: none; }
.die.roll { animation: roll .7s cubic-bezier(.3,1.4,.5,1); }
@keyframes roll { 0% { transform: rotate(-540deg) scale(.5); } }

.panel { display: grid; gap: 24px; }
.dots { list-style: none; display: flex; gap: 8px; }
.dots button {
  width: 34px; height: 6px; border-radius: 6px; border: 0; cursor: pointer;
  background: var(--line); transition: background .3s, width .3s;
}
.dots button[aria-current="step"] { background: var(--gold); width: 54px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: clamp(24px, 3vw, 36px); min-height: 300px; }
.card.enter > * { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.card.enter > *:nth-child(2) { animation-delay: .05s; }
.card.enter > *:nth-child(3) { animation-delay: .1s; }
.card.enter > *:nth-child(4) { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.kicker { color: var(--gold); font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.card h1 { font: 800 clamp(30px, 4vw, 44px)/1.1 Fraunces, serif; margin: 8px 0 14px; }
.card p { color: var(--muted); }
.tip { list-style: none; margin-top: 18px; display: grid; gap: 8px; }
.tip li { padding-left: 26px; position: relative; font-size: 15px; }
.tip li::before { content: "✦"; position: absolute; left: 0; color: var(--gold); }

.controls { display: flex; gap: 10px; }
.btn {
  padding: 13px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--gold); color: #1a1408; font: 600 15px Inter, sans-serif;
  transition: transform .2s cubic-bezier(.3,1.6,.5,1);
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.btn:disabled { opacity: .35; cursor: default; transform: none; }
.hint { color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .guide { grid-template-columns: 1fr; }
  .card { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
