@font-face {
  font-family: "Manrope";
  src: url("./manrope-latin.e310b55a7fd9.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  src: url("./manrope-latin-ext.ce093b341d9c.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Syne";
  src: url("./syne-latin.cfff412005ee.woff2") format("woff2");
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Syne";
  src: url("./syne-latin-ext.79bc839264c4.woff2") format("woff2");
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #07184b;
  --blue: #3157ff;
  --blue-deep: #1834b8;
  --cyan: #82f3ff;
  --ice: #eafcff;
  --white: #fbfdff;
  --magenta: #ff3ba7;
  --acid: #dfff4f;
  --line: rgba(7, 24, 75, 0.22);
  --blue-line: rgba(255, 255, 255, 0.3);
  --max: 1240px;
  color-scheme: light;
  font-family: "Manrope", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--white);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(49, 87, 255, 0.08) 50%, transparent calc(50% + 1px)),
    var(--white);
  font-size: 17px;
  line-height: 1.58;
  overflow-x: hidden;
}

button, a { -webkit-tap-highlight-color: transparent; }

a {
  color: inherit;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover { text-decoration-thickness: 0.16em; }

button, a:focus-visible {
  outline: none;
}

button:focus-visible, a:focus-visible {
  box-shadow: 0 0 0 3px var(--white), 0 0 0 6px var(--magenta);
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--ink);
  transform: translateY(-180%);
}

.skip-link:focus { transform: translateY(0); }

.shell {
  width: min(var(--max), calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 2px solid var(--ink);
}

.wordmark {
  font-family: "Syne", sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.language-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 44px;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}

.hero {
  min-height: calc(100svh - 76px);
  display: grid;
  align-content: center;
  padding-block: clamp(64px, 10vw, 136px) 52px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
  gap: clamp(40px, 7vw, 100px);
  align-items: end;
}

.eyebrow {
  margin: 0 0 22px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

h1, h2, h3, p { text-wrap: pretty; }

h1, h2, h3 {
  font-family: "Syne", sans-serif;
  line-height: 0.98;
  letter-spacing: -0.045em;
  text-wrap: balance;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

h1 {
  max-width: 960px;
  margin: 0;
  font-size: clamp(3.4rem, 8.3vw, 8rem);
  font-weight: 800;
}

.hero-title-mark {
  display: block;
  width: 100%;
  color: var(--blue);
}

.hero-grid > *,
.tool-heading > *,
.section-heading > *,
.result-summary > * { min-width: 0; }

.hero-lead {
  max-width: 760px;
  margin: 34px 0 0;
  font-size: clamp(1.16rem, 2vw, 1.55rem);
  line-height: 1.4;
}

.hero-gauge {
  position: relative;
  min-height: 390px;
  display: grid;
  place-items: center;
}

.hero-drum {
  position: absolute;
  width: min(100%, 390px);
  aspect-ratio: 1;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,0.9) 0 5%, transparent 5.5%),
    repeating-radial-gradient(circle, transparent 0 15%, rgba(49,87,255,0.15) 15.4% 15.9%),
    var(--ice);
  box-shadow: 14px 18px 0 var(--cyan), inset 0 0 0 14px rgba(255,255,255,0.5);
  transform: rotate(-7deg);
}

.hero-drum::before,
.hero-drum::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--ink);
  box-shadow: inset -5px -6px 0 rgba(49,87,255,0.18);
}

.hero-drum::before {
  width: 21%;
  aspect-ratio: 1;
  left: 17%;
  top: 49%;
}

.hero-drum::after {
  width: 15%;
  aspect-ratio: 1;
  right: 18%;
  top: 31%;
  background: var(--acid);
}

.gauge-readout {
  position: relative;
  z-index: 1;
  width: min(100%, 330px);
  padding: 18px 20px;
  border: 3px solid var(--ink);
  background: var(--white);
  transform: rotate(2deg);
  box-shadow: 8px 8px 0 var(--magenta);
}

.gauge-value {
  display: block;
  font-family: "Syne", sans-serif;
  font-size: clamp(2.35rem, 3vw, 2.9rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  white-space: nowrap;
}

.gauge-label {
  display: block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-foot {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
  margin-top: 52px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.hero-fact {
  max-width: 680px;
  margin: 0;
  font-weight: 650;
}

.jump-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.jump-link::after { content: "↓"; font-size: 1.3rem; }

.tool-section {
  color: var(--white);
  background: var(--blue);
  border-block: 3px solid var(--ink);
}

.tool-shell { padding-block: clamp(64px, 9vw, 116px); }

.tool-heading {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(24px, 5vw, 72px);
  align-items: end;
  margin-bottom: 54px;
}

.tool-heading h2,
.section-heading h2 {
  margin: 0;
  font-size: clamp(2.6rem, 5.4vw, 5.8rem);
  font-weight: 800;
}

.tool-intro {
  max-width: 590px;
  margin: 0 0 4px;
  font-size: 1.14rem;
}

.machine {
  display: grid;
  grid-template-columns: minmax(370px, 0.84fr) minmax(470px, 1.16fr);
  border: 3px solid var(--white);
  background: var(--blue-deep);
  box-shadow: 14px 14px 0 var(--cyan);
}

.controls-panel {
  padding: clamp(24px, 4vw, 48px);
  border-right: 3px solid var(--white);
}

.selection-fieldset {
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
}

.selection-fieldset legend {
  width: 100%;
  margin-bottom: 16px;
  font-weight: 800;
}

.selection-rack {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  margin-bottom: 12px;
}

.selection-slot {
  display: grid;
  place-items: center;
  min-width: 0;
  aspect-ratio: 1;
  border: 2px solid var(--blue-line);
  border-radius: 50%;
  color: transparent;
  background: rgba(255,255,255,0.06);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.selection-slot.filled {
  color: var(--ink);
  background: var(--acid);
  border-color: var(--ink);
  box-shadow: inset -3px -4px 0 rgba(7,24,75,0.18);
}

.selected-count {
  min-height: 1.5em;
  margin: 0 0 18px;
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.number-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.ball-button {
  min-width: 44px;
  min-height: 44px;
  aspect-ratio: 1;
  padding: 0;
  border: 2px solid var(--white);
  border-radius: 50%;
  color: var(--white);
  background: transparent;
  font: 750 0.82rem/1 "Manrope", sans-serif;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.ball-button:hover { background: rgba(255,255,255,0.12); }

.ball-button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--acid);
  border-color: var(--acid);
  box-shadow: inset -3px -3px 0 rgba(7,24,75,0.2);
  transform: translateY(-2px);
}

.machine-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 22px;
}

.action-button {
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid var(--white);
  color: var(--white);
  background: transparent;
  font: 800 0.76rem/1.2 "Manrope", sans-serif;
  cursor: pointer;
}

.action-button.primary {
  grid-column: 1 / -1;
  min-height: 58px;
  color: var(--ink);
  background: var(--cyan);
  border-color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  font-size: 0.86rem;
}

.action-button:hover:not(:disabled) { background: var(--magenta); color: var(--ink); }
.action-button:disabled {
  color: var(--white);
  background: var(--blue-deep);
  border-color: rgba(255,255,255,0.62);
  box-shadow: none;
  cursor: not-allowed;
}

.no-js-note {
  padding: 13px 15px;
  margin: 20px 0 0;
  color: var(--ink);
  background: var(--acid);
  font-size: 0.84rem;
}

.js .no-js-note { display: none; }
.js.load-failed .no-js-note { display: block; }

.drum-panel {
  position: relative;
  display: grid;
  min-width: 0;
  padding: clamp(20px, 3vw, 40px);
  overflow: hidden;
  background:
    linear-gradient(rgba(255,255,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.08) 1px, transparent 1px),
    var(--blue-deep);
  background-size: 28px 28px;
}

.drum-frame {
  position: relative;
  width: 100%;
  max-width: 660px;
  margin: auto;
  aspect-ratio: 1;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(130,243,255,0.18), transparent 64%);
  box-shadow: inset 0 0 0 12px rgba(255,255,255,0.07), 10px 12px 0 rgba(130,243,255,0.55);
}

.drum-svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ring-line { fill: none; stroke: rgba(255,255,255,0.38); stroke-width: 1.2; }
.ring-line.inner { stroke: var(--cyan); stroke-width: 1.8; }
.draw-mark { fill: var(--white); opacity: 0.8; }
.draw-mark.best { fill: var(--magenta); opacity: 1; stroke: var(--white); stroke-width: 0.8; }
.draw-mark.exact { fill: var(--acid); stroke: var(--ink); stroke-width: 1.2; }
.draw-layer { opacity: 0; transition: opacity 420ms ease; }
.drum-ready .draw-layer { opacity: 1; }

.drum-center {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 72px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 2px solid var(--white);
  border-radius: 50%;
  color: var(--ink);
  background: var(--cyan);
  font-family: "Syne", sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.drum-axis-label {
  position: absolute;
  left: 50%;
  padding: 2px 7px;
  color: var(--ink);
  background: var(--white);
  font-size: 0.64rem;
  font-weight: 800;
  transform: translateX(-50%);
  pointer-events: none;
}

.drum-axis-label[data-ring="0"] { top: 1.2%; }
.drum-axis-label[data-ring="1"] { top: 8.2%; }
.drum-axis-label[data-ring="2"] { top: 15.8%; }
.drum-axis-label[data-ring="3"] { top: 23.8%; }
.drum-axis-label[data-ring="4"] { top: 31.6%; }
.drum-axis-label[data-ring="5"] { top: 39%; }

.drum-caption {
  max-width: 540px;
  margin: 26px auto 0;
  color: var(--ice);
  font-size: 0.84rem;
  text-align: center;
}

.result-section {
  border-top: 3px solid var(--ink);
  background: var(--cyan);
}

.result-shell { padding-block: clamp(64px, 8vw, 104px); }

.result-summary {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(28px, 6vw, 90px);
  align-items: start;
}

.result-figure {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(5rem, 12vw, 11rem);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.08em;
}

.result-figure small {
  font-size: 0.26em;
  letter-spacing: -0.03em;
}

.result-copy h2 {
  margin: 0;
  font-size: clamp(2.2rem, 4vw, 4.4rem);
}

.best-list {
  padding: 0;
  margin: 34px 0 0;
  list-style: none;
  border-top: 2px solid var(--ink);
}

.best-draw {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) 1fr auto;
  gap: 16px;
  align-items: center;
  padding-block: 15px;
  border-bottom: 1px solid var(--line);
}

.best-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-ball {
  display: inline-grid;
  place-items: center;
  width: 34px;
  aspect-ratio: 1;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
}

.mini-ball.common { color: var(--white); background: var(--blue); }
.best-count { font-size: 0.72rem; font-weight: 800; text-align: right; }

.distribution {
  margin-top: 78px;
  padding-top: 32px;
  border-top: 3px solid var(--ink);
}

.distribution-head {
  display: grid;
  grid-template-columns: 1fr 0.8fr;
  gap: 40px;
  align-items: end;
  margin-bottom: 30px;
}

.distribution h3 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.distribution-intro { margin: 0; }

.histogram { display: grid; gap: 12px; }

.hist-header {
  margin-bottom: 9px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hist-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 110px 110px;
  gap: 14px;
  align-items: center;
}

.hist-row > * { min-width: 0; }

.hist-label { font-weight: 800; }

.hist-track {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  height: 28px;
  border-block: 1px solid var(--ink);
  background: rgba(255,255,255,0.38);
  overflow: visible;
}

.hist-observed {
  fill: var(--blue);
}

.hist-expected {
  stroke: var(--magenta);
  stroke-width: 7;
}

.hist-value { font-variant-numeric: tabular-nums; text-align: right; }
.hist-value.expected { font-size: 0.82rem; }

.static-section { padding-block: clamp(76px, 10vw, 140px); }

.section-heading {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(28px, 6vw, 90px);
  align-items: start;
}

.section-body {
  max-width: 780px;
  margin: 42px 0 0 auto;
  font-size: clamp(1.06rem, 1.8vw, 1.28rem);
}

.chance-section {
  color: var(--white);
  background: var(--ink);
}

.chance-fraction {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 28px;
  margin-top: 52px;
  padding-block: 18px;
  border-block: 2px solid var(--cyan);
}

.chance-one {
  color: var(--acid);
  font: 800 clamp(5rem, 15vw, 13rem)/0.8 "Syne", sans-serif;
  letter-spacing: -0.08em;
}

.chance-denominator {
  font: 800 clamp(2.2rem, 7vw, 6.6rem)/0.95 "Syne", sans-serif;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
}

.neighborhoods-section { background: var(--ice); }

.ring-ledger {
  margin-top: 62px;
  border-block: 3px solid var(--ink);
}

.ring-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 24px;
  align-items: baseline;
  padding-block: 17px;
  border-bottom: 1px solid var(--line);
}

.ring-row:last-child { border-bottom: 0; }
.ring-match { font: 800 1.5rem/1 "Syne", sans-serif; }
.ring-total { font: 800 clamp(1.65rem, 4vw, 4.1rem)/1 "Syne", sans-serif; letter-spacing: -0.05em; }
.ring-unit { margin-left: 10px; font-size: 0.82rem; font-weight: 700; }

.archive-section {
  color: var(--white);
  background: var(--blue);
}

.archive-equation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 60px;
  font: 800 clamp(1.9rem, 3.8vw, 4rem)/0.95 "Syne", sans-serif;
  letter-spacing: -0.055em;
}

.archive-equation strong:last-child { color: var(--acid); }
.archive-equation strong { min-width: 0; overflow-wrap: anywhere; }

.method-section { background: var(--white); }

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 58px;
  border: 2px solid var(--ink);
}

.method-grid p {
  margin: 0;
  padding: 28px;
  border-right: 2px solid var(--ink);
}

.method-grid p:last-child { border-right: 0; }

.sources {
  padding: 54px 0 104px;
  border-top: 3px solid var(--ink);
}

.sources h2 {
  margin: 0 0 24px;
  font-size: 1.6rem;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.source-list a { font-weight: 750; }
.source-meta { display: block; margin-top: 6px; font-size: 0.75rem; }

.site-footer {
  color: var(--white);
  background: var(--ink);
  border-top: 12px solid var(--magenta);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  min-height: 150px;
}

.footer-inner p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 20px; }

.top-target:focus { outline: none; }

.back-to-top {
  position: fixed;
  z-index: 20;
  right: 18px;
  bottom: calc(var(--back-top-lift, 18px) + env(safe-area-inset-bottom));
  min-width: 48px;
  min-height: 48px;
  padding: 9px 12px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--acid);
  font: 800 0.72rem/1.1 "Manrope", sans-serif;
  cursor: pointer;
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(12px);
  transition: transform 160ms ease;
}

.back-to-top.visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }

.no-js .back-to-top {
  position: static;
  display: inline-flex;
  justify-self: end;
  align-items: center;
  width: max-content;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

[hidden] { display: none !important; }

@media (max-width: 980px) {
  .hero-grid, .tool-heading, .section-heading, .result-summary { grid-template-columns: 1fr; }
  .hero-gauge { min-height: 330px; }
  .machine { grid-template-columns: 1fr; }
  .controls-panel { border-right: 0; border-bottom: 3px solid var(--white); }
  .drum-panel { min-height: 560px; }
  .distribution-head { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
  .method-grid p { border-right: 0; border-bottom: 2px solid var(--ink); }
  .method-grid p:last-child { border-bottom: 0; }
}

@media (max-width: 700px) {
  body { font-size: 16px; }
  .shell { width: min(100% - 32px, var(--max)); }
  .tool-section .shell { width: min(100% - 12px, var(--max)); }
  .site-header { min-height: 66px; }
  .hero { min-height: auto; padding-top: 68px; }
  .hero-grid { gap: 26px; }
  h1 { font-size: clamp(2.35rem, 10vw, 3rem); }
  .tool-heading h2,
  .section-heading h2 { font-size: clamp(2rem, 8.5vw, 3rem); }
  .hero-gauge { min-height: 300px; }
  .hero-drum { max-width: 275px; }
  .gauge-readout { max-width: 270px; padding: 15px; }
  .hero-foot { grid-template-columns: 1fr; margin-top: 38px; }
  .machine { box-shadow: 7px 8px 0 var(--cyan); }
  .controls-panel { padding: 20px 14px 26px; }
  .number-grid { gap: 4px; }
  .ball-button { min-width: 0; min-height: 44px; }
  .machine-actions { grid-template-columns: 1fr; }
  .action-button.primary { grid-column: auto; }
  .drum-panel { min-height: auto; padding: 26px 16px 36px; }
  .drum-frame { max-width: 430px; }
  .drum-center { width: 54px; font-size: 0.67rem; }
  .drum-axis-label { font-size: 0.55rem; }
  .best-draw { grid-template-columns: 1fr; }
  .best-count { text-align: left; }
  .hist-row { grid-template-columns: 45px minmax(0,1fr) 72px; gap: 8px; }
  .hist-header span:nth-child(2) { display: none; }
  .hist-header span:nth-child(4) { grid-column: 2 / -1; }
  .hist-value.expected { grid-column: 2 / -1; text-align: left; margin-top: -8px; }
  .chance-fraction { grid-template-columns: 1fr; gap: 12px; }
  .ring-row { grid-template-columns: 82px 1fr; gap: 12px; }
  .ring-unit { display: block; margin: 6px 0 0; }
  .archive-equation { grid-template-columns: 1fr; }
  .archive-equation span { transform: none; justify-self: start; }
  .source-list { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; padding-block: 38px; }
  .footer-links { justify-content: flex-start; }
}

@media (max-width: 350px) {
  .tool-section .shell { width: calc(100% - 8px); }
  .controls-panel { padding-inline: 10px; }
  .number-grid { grid-template-columns: repeat(6, 1fr); }
  .selection-rack { gap: 4px; }
  h1 { font-size: 1.9rem; }
  .tool-heading h2,
  .section-heading h2 { font-size: 1.8rem; }
  .gauge-value { font-size: 2.2rem; }
  .ring-row { grid-template-columns: 56px minmax(0, 1fr); gap: 7px; }
  .ring-match { font-size: 1.25rem; }
  .ring-total { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(7, 24, 75, 0.55); --blue-line: rgba(255,255,255,0.72); }
  .draw-mark { opacity: 1; }
}

@media print {
  .back-to-top { display: none !important; }
}
