:root {
  color-scheme: dark;
  --felt: #0e3b2c;
  --felt-deep: #08261c;
  --cream: #f6f0e4;
  --ink: #1b1712;
  --gold: #f0d48a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(900px 420px at 50% 0, #1a5c44, transparent 55%),
    var(--felt-deep);
  color: var(--cream);
  font: 18px/1.4 ui-sans-serif, system-ui, sans-serif;
  padding: max(18px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

main { max-width: 28rem; margin: 0 auto; }

.kicker {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--gold);
}

h1 {
  margin: 0.1rem 0 0.3rem;
  font-size: 3rem;
  line-height: 0.95;
  font-weight: 650;
}

.lede, .plain { color: #d7e6dc; }
.lede { margin: 0 0 1.1rem; }

fieldset { border: 0; margin: 0 0 0.9rem; padding: 0; }
legend { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.4rem; }

.picks { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.picks button, .roll {
  font: 650 1.05rem/1 ui-sans-serif, system-ui, sans-serif;
  min-height: 48px;
  min-width: 48px;
  border: 0;
  border-radius: 999px;
  background: #14513c;
  color: var(--cream);
  cursor: pointer;
}

.picks button.on { background: var(--gold); color: var(--ink); }

button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.tray {
  min-height: 112px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
  margin: 1.1rem 0 0.4rem;
}

.die {
  width: 84px;
  height: 84px;
  background: var(--cream);
  color: var(--ink);
  border-radius: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px;
  box-shadow: 0 7px 0 #071910, 0 12px 18px rgba(0, 0, 0, 0.28);
}

.die.shake { animation: shake 0.35s ease; }

@keyframes shake {
  0% { transform: rotate(-8deg) translateY(0); }
  40% { transform: rotate(7deg) translateY(-6px); }
  100% { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .die.shake { animation: none; }
}

.die i {
  width: 14px;
  height: 14px;
  margin: auto;
  border-radius: 50%;
  background: transparent;
}

.die[data-pips="1"] i:nth-child(5),
.die[data-pips="2"] i:nth-child(1),
.die[data-pips="2"] i:nth-child(9),
.die[data-pips="3"] i:nth-child(1),
.die[data-pips="3"] i:nth-child(5),
.die[data-pips="3"] i:nth-child(9),
.die[data-pips="4"] i:nth-child(1),
.die[data-pips="4"] i:nth-child(3),
.die[data-pips="4"] i:nth-child(7),
.die[data-pips="4"] i:nth-child(9),
.die[data-pips="5"] i:nth-child(1),
.die[data-pips="5"] i:nth-child(3),
.die[data-pips="5"] i:nth-child(5),
.die[data-pips="5"] i:nth-child(7),
.die[data-pips="5"] i:nth-child(9),
.die[data-pips="6"] i:nth-child(1),
.die[data-pips="6"] i:nth-child(3),
.die[data-pips="6"] i:nth-child(4),
.die[data-pips="6"] i:nth-child(6),
.die[data-pips="6"] i:nth-child(7),
.die[data-pips="6"] i:nth-child(9) {
  background: var(--ink);
}

.num {
  display: grid;
  place-items: center;
  font: 650 2rem/1 ui-monospace, Menlo, Consolas, monospace;
}

.num small {
  display: block;
  font: 700 0.65rem/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6d6256;
}

.total {
  margin: 0.2rem 0 0;
  text-align: center;
  font: 650 3.2rem/1 ui-monospace, Menlo, Consolas, monospace;
  color: var(--gold);
}

.plain { text-align: center; margin: 0.3rem 0 1rem; }

.roll {
  display: block;
  width: 100%;
  min-height: 64px;
  border-radius: 16px;
  background: var(--gold);
  color: var(--ink);
  font-size: 1.35rem;
}
