:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #69748a;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --line: #d8dfec;
  --shadow: 0 24px 70px rgba(23, 32, 51, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(20, 184, 166, 0.10)),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.roller {
  width: min(100%, 420px);
}

.panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 36px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: -6px 0 4px;
  font-size: clamp(2rem, 7vw, 3rem);
  line-height: 1;
}

.die {
  position: relative;
  width: 132px;
  height: 132px;
  border: 2px solid #cbd5e1;
  border-radius: 18px;
  background: linear-gradient(145deg, #ffffff, #edf2f7);
  box-shadow:
    inset 0 -8px 18px rgba(23, 32, 51, 0.08),
    0 12px 28px rgba(23, 32, 51, 0.16);
}

.pip {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
}

.top-left {
  top: 27%;
  left: 27%;
}

.top-right {
  top: 27%;
  left: 73%;
}

.middle-left {
  top: 50%;
  left: 27%;
}

.center {
  top: 50%;
  left: 50%;
}

.middle-right {
  top: 50%;
  left: 73%;
}

.bottom-left {
  top: 73%;
  left: 27%;
}

.bottom-right {
  top: 73%;
  left: 73%;
}

.result {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 1.2rem;
  font-weight: 700;
}

#result {
  color: var(--ink);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

button {
  width: min(100%, 220px);
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  transition: background 140ms ease, transform 140ms ease;
}

button:hover {
  background: var(--accent-dark);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 3px;
}
