:root {
  --bg: #fff4e6;
  --card: #ffffff;
  --ink: #2b2118;
  --muted: #7a6a5c;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --ok: #2b8a3e;
  --bad: #c92a2a;
  --line: #f1d9c0;
  --tile: #fff9f2;
  --shadow: 0 10px 30px rgba(120, 60, 0, .15);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1410;
    --card: #271e18;
    --ink: #fbeee0;
    --muted: #b9a592;
    --accent: #ff922b;
    --accent-ink: #1b1410;
    --ok: #69db7c;
    --bad: #ff8787;
    --line: #3b2d23;
    --tile: #2f241c;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.card {
  width: min(560px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 20px 20px 14px;
}
.top { display: flex; gap: 14px; align-items: center; }
.logo { width: 56px; height: 56px; flex: none; }
h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.02em; }
h1 span { color: var(--accent); }
.tag { margin: 2px 0 0; color: var(--muted); font-size: .9rem; }
.dots { display: flex; gap: 8px; list-style: none; padding: 0; margin: 16px 0 6px; }
.dots li { height: 8px; flex: 1; border-radius: 99px; background: var(--line); transition: background .3s; }
.dots li.done { background: var(--ok); }
.dots li.now { background: var(--accent); }
.stage { padding: 8px 0 4px; outline: none; }
.stage h2 { font-size: 1.15rem; margin: 10px 0 4px; }
.stage .hint { color: var(--muted); font-size: .92rem; margin: 0 0 12px; }
.msg { min-height: 1.5em; margin: 10px 0 0; font-weight: 600; }
.msg.bad { color: var(--bad); }
.msg.ok { color: var(--ok); }
.btn {
  appearance: none; border: 0; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 700;
  padding: 12px 18px; border-radius: 12px; min-height: 48px;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 1: checkbox */
.robobox {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px; border: 2px solid var(--line); border-radius: 14px;
  background: var(--tile); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; text-align: left;
}
.robobox .box { width: 30px; height: 30px; border: 3px solid var(--muted); border-radius: 6px; display: grid; place-items: center; flex: none; }
.robobox.spin .box { border-color: var(--accent); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 2: grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tile {
  appearance: none; aspect-ratio: 1; border-radius: 12px; border: 3px solid transparent;
  background: var(--tile); padding: 8px; cursor: pointer; display: grid; place-items: center;
}
.tile svg { width: 100%; height: 100%; }
.tile[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--tile)); }

/* 3: preheat */
.dial { text-align: center; font-size: 3rem; font-weight: 800; letter-spacing: -.03em; margin: 6px 0; }
.dial small { font-size: 1.1rem; color: var(--muted); font-weight: 600; }
input[type="range"] { width: 100%; height: 40px; accent-color: var(--accent); }

/* 4: wobble text */
.wobble { background: var(--tile); border: 2px dashed var(--line); border-radius: 12px; padding: 6px; text-align: center; }
.wobble svg { width: 100%; height: 90px; }
.field {
  width: 100%; font: inherit; font-size: 1.15rem; padding: 12px 14px; margin-top: 10px;
  border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--ink); min-height: 48px;
  text-transform: uppercase; letter-spacing: .12em;
}

/* 5: hold */
.cook { position: relative; width: 100%; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: none; }
.cook .fill { position: absolute; inset: 0 auto 0 0; width: 0%; background: rgba(0, 0, 0, .22); pointer-events: none; }
.cook span { position: relative; }

/* 6: choices */
.choices { display: grid; gap: 8px; }
.choices .btn { text-align: left; background: var(--tile); color: var(--ink); border: 2px solid var(--line); font-weight: 600; }

/* done */
.cert { border: 3px double var(--accent); border-radius: 16px; padding: 18px; text-align: center; background: var(--tile); }
.cert h2 { margin: 0 0 4px; }
.cert .id { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: .15em; font-size: 1.2rem; color: var(--accent); }
.cert svg { width: 72px; height: 72px; }

.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: .8rem; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.noscript { position: fixed; inset: auto 12px 12px 12px; background: var(--card); border: 2px solid var(--bad); padding: 12px; border-radius: 12px; }
.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.row.center { justify-content: center; }

[hidden] { display: none !important; }
