:root {
  --felt: #14231d;
  --panel: #1e3229;
  --line: #36503f;
  --ink: #f2ead8;
  --muted: #a9b5a4;
  --bone: #efe4cc;
  --pip: #2a211a;
  --gold: #e3b04b;
  --red: #e0705c;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--felt);
  color: var(--ink);
  font: 17px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px calc(32px + env(safe-area-inset-bottom));
}
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 700; margin: 0; }
h1 { font-size: 40px; }
h2 { font-size: 26px; }
p { margin: 8px 0; }
.muted { color: var(--muted); font-size: 15px; }
.stack { display: grid; gap: 12px; margin-top: 16px; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

button, input, select {
  font: inherit;
  color: inherit;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 0 14px;
  width: 100%;
}
button { font-weight: 600; cursor: pointer; }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { background: var(--gold); border-color: var(--gold); color: #231a08; }
button.quiet { background: none; border-color: transparent; color: var(--muted); font-weight: 500; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
label { display: grid; gap: 4px; font-size: 15px; color: var(--muted); }

.scores { display: grid; gap: 6px; margin-top: 12px; }
.score {
  display: flex; justify-content: space-between;
  padding: 8px 12px; border-radius: 8px; background: var(--panel);
}
.score.active { outline: 2px solid var(--gold); }
.score b { font-variant-numeric: tabular-nums; }

.turn-points { font-size: 44px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.banner { padding: 10px 12px; border-radius: 8px; background: var(--panel); margin-top: 12px; }
.banner.bust { color: var(--red); }
.banner.good { color: var(--gold); }

.tray { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.tray button { padding: 0; border: 0; background: none; min-height: 0; }
.die {
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  aspect-ratio: 1; padding: 14%; border-radius: 16%;
  background: var(--bone); border: 3px solid transparent;
}
.die i { border-radius: 50%; margin: 8%; }
.die i.on { background: var(--pip); }
.die.empty { background: var(--panel); border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.active-slot .die { border-color: var(--gold); border-style: solid; }
.unsure .die { box-shadow: 0 0 0 2px var(--red); }
.kept .die { background: var(--gold); }
.dim .die { opacity: 0.55; }

.pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 12px; }
.pad button { padding: 0; font-size: 22px; }
canvas.preview { display: block; width: 100%; height: auto; border-radius: 10px; margin-top: 12px; }
