@font-face { font-family: Geist; src: url('/body.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/heading.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --paper: #f4f6ee;
  --white: #fcfdf8;
  --ink: #16291f;
  --muted: #54665a;
  --line: #d9e3d4;
  --jade: #21563e;
  --lime: #d4ed94;
  --serif: 'Instrument Serif', Georgia, serif;
  font: 15px/1.55 Geist, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  color-scheme: light;
  scroll-behavior: smooth;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: .98; }
section { scroll-margin-top: 24px; }
:focus-visible { outline: 2px solid #2b7657; outline-offset: 4px; }

.shell { width: min(1160px, calc(100% - 72px)); margin-inline: auto; }
.skip { position: fixed; z-index: 3; left: 10px; top: -100px; padding: 10px; background: var(--white); }
.skip:focus { top: 10px; }
.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 77px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-family: var(--serif); font-size: 31px; line-height: 1; white-space: nowrap; }
.brand-mark { width: 31px; height: 31px; display: grid; place-content: center; gap: 3px; border-radius: 8px; background: #21563e; }
.brand-mark i { width: 15px; height: 1px; position: relative; background: #b8d2a3; }
.brand-mark i::after { content: ''; position: absolute; top: -2px; left: 2px; width: 5px; height: 5px; border-radius: 50%; background: #d5eaac; }
.brand-mark i:nth-child(2)::after { left: 8px; }
.brand-mark i:nth-child(3)::after { left: 5px; }
.header-inner nav { display: flex; gap: 30px; font-size: 13px; font-weight: 550; }
.header-inner nav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.header-inner nav a:hover, .footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.game-label { color: var(--jade); font-size: 12px; font-weight: 600; white-space: nowrap; padding: 6px 12px; border: 1px solid #d6e1cf; border-radius: 100px; }
.game-label i, .live-dot { display: inline-block; background: #518b60; border-radius: 50%; width: 7px; height: 7px; margin-right: 7px; vertical-align: 1px; }

.intro { padding: 56px 0 39px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .16em; line-height: 1.45; color: var(--jade); }
.eyebrow span { margin-inline: 7px; color: #698674; }
.intro h1 { font-size: clamp(65px, 7.8vw, 112px); letter-spacing: -.044em; margin: 11px 0 10px; }
.lede { max-width: 480px; font-size: 16px; color: var(--muted); }
.abacus { flex: 0 1 320px; margin: 10px 25px 0 0; border-inline: 1px solid #a9c2ac; opacity: .96; padding-block: 11px; }
.rod { display: flex; align-items: center; gap: 5px; position: relative; height: 43px; padding-inline: 12px; }
.rod::before { content: ''; position: absolute; inset: 50% 0 auto; height: 1px; background: #a9c2ac; }
.rod i { z-index: 1; width: 24px; height: 31px; border-radius: 50%; border: 1px solid #6b9c7b; background: radial-gradient(ellipse at 31% 23%, #d8e8c8, #81af84 69%, #6c9879); box-shadow: inset -2px -3px 5px #456f5030, 2px 2px 3px #193f2318; }
.rod-top i:first-child { margin-left: 17%; }
.rod-top i:nth-child(2) { margin-right: auto; }
.rod-middle { justify-content: flex-end; }
.rod-middle i { background: radial-gradient(ellipse at 30% 25%, #bddbb0, #569071 70%, #357458); }
.rod-bottom i:nth-child(2) { margin-right: auto; }
.rod-bottom i { background: radial-gradient(ellipse at 30% 25%, #ecf5d4, #b8cf9e 70%, #8dad7c); }

.workbench { display: grid; grid-template-columns: 1.24fr 1fr; gap: 18px; }
.panel { border-radius: 20px; border: 1px solid var(--line); background: var(--white); }
.ticket { padding: 32px clamp(22px, 3.1vw, 43px) 24px; color: #fbfff0; border-color: #1c4a37; background: radial-gradient(ellipse at 90% 0%, #397657, transparent 67%), linear-gradient(135deg, #153f30, #215340); box-shadow: 0 8px 16px #1b3c2410; }
.ticket .eyebrow { color: #c0dfa6; }
.ticket h2 { margin-top: 7px; font-size: clamp(38px, 4.2vw, 55px); }
.ticket-subtitle { margin-top: 8px; color: #d4e3d4; font-size: 13px; }
.ticket-balls { display: flex; justify-content: space-between; gap: 7px; max-width: 435px; margin-block: 24px; }
.ticket-balls span { width: clamp(42px, 5.25vw, 71px); aspect-ratio: 1; display: grid; place-content: center; border-radius: 50%; border: 1px solid #739582; color: #d7e8d4; background: #ecfff214; font-size: clamp(20px, 2.45vw, 33px); font-variant-numeric: tabular-nums; font-weight: 500; }
.ticket-balls.generated span { background: radial-gradient(circle at 34% 28%, #f4fbe4, #c0dcb0 80%); border-color: #d4e7b7; color: #153f30; box-shadow: inset 0 -4px 6px #2c5e3523, 0 4px 8px #0f302b4a; }
.ticket-actions { display: flex; gap: 10px; }
.ticket-actions button { border-radius: 10px; min-height: 48px; font-weight: 700; }
.generate { flex: 1; border: 1px solid var(--lime); background: var(--lime); color: #193624; padding: 8px 14px; }
.generate:hover { background: #e3f7b5; }
.sparkle { font-size: 17px; margin-right: 6px; }
.copy { border: 1px solid #8aaa93; color: #f0f8ed; background: #e2f8eb0b; padding-inline: 18px; }
.copy:enabled:hover { background: #e2f8eb24; }
.copy:disabled { opacity: .62; }
.ticket :focus-visible { outline-color: #e3f7b5; }
.ticket-status { color: #d4e3d4; font-size: 12px; min-height: 1.6em; margin-top: 12px; }

.filters { padding: 29px clamp(19px, 2.75vw, 34px) 21px; }
.filter-header h2 { font-size: 43px; }
.filter-header p { margin-top: 7px; color: var(--muted); font-size: 13px; }
#rule-list { margin-top: 19px; }
.rule-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 14px; border-top: 1px solid var(--line); padding-block: 15px; }
.rule-label { cursor: pointer; }
.rule-label strong { display: block; line-height: 1.35; font-size: 15px; }
.rule-label span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 4px; }
.rule-rate { color: var(--jade); font-size: 18px; font-variant-numeric: tabular-nums; }
.switch { width: 42px; height: 24px; position: relative; display: inline-grid; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.switch span { background: #b0bcb3; border-radius: 20px; pointer-events: none; }
.switch span::after { content: ''; position: absolute; inset: 3px auto 3px 3px; aspect-ratio: 1; background: white; border-radius: 50%; transition: transform .18s ease; }
.switch input:checked + span { background: #276747; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid #2b7657; outline-offset: 3px; }
.filter-summary { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 9px 11px; border-radius: 8px; color: #214e38; background: #e9f1e2; font-size: 12px; font-weight: 600; }
.filter-summary strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.filter-sample { color: var(--muted); margin-top: 6px; font-size: 11px; }

.latest { margin-top: 18px; display: flex; gap: 18px; align-items: center; padding: 16px 24px; border-radius: 14px; }
.latest-caption { display: flex; align-items: center; gap: 7px; flex: 1; }
.latest-caption .eyebrow { font-size: 9px; }
.latest-caption strong { font-size: 15px; }
.live-dot { width: 8px; height: 8px; box-shadow: 0 0 0 4px #e0edda; }
.mini-balls { display: flex; gap: 6px; }
.mini-balls span { width: 32px; aspect-ratio: 1; display: grid; place-content: center; flex-shrink: 0; background: #e7f1df; border: 1px solid #d3e4c8; color: #254c36; border-radius: 50%; font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 650; }
.arrow-link { margin-left: auto; flex: 1; text-align: right; text-decoration: none; font-size: 12px; font-weight: 650; color: var(--jade); }
.arrow-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.arrow-link span { margin-left: 4px; }

.section { margin-top: 56px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.section-heading h2 { font-size: clamp(43px, 5vw, 61px); letter-spacing: -.026em; margin-top: 5px; }
.section-heading > p { color: var(--muted); font-size: 12px; }
.pattern-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.pattern-card { padding: 23px; }
.pattern-card h3 { font-size: 35px; }
.pattern-meter { margin-block: 16px 9px; display: flex; height: 8px; overflow: hidden; border-radius: 20px; }
.pattern-meter span { flex-basis: 0; }
.balanced { background: #3b7957; }
.near { background: #91b989; }
.extreme { background: #d0dfb5; }
.pattern-card dl > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #e6ebe2; }
.pattern-card dl > div:last-child { border-bottom: 0; padding-bottom: 0; }
.pattern-card dt { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pattern-card dt i { display: block; width: 8px; height: 8px; border-radius: 50%; }
.pattern-card dd { display: flex; align-items: baseline; gap: 12px; }
.pattern-card dd span { min-width: 67px; color: var(--muted); font-size: 11px; text-align: right; }
.pattern-card dd strong { font-size: 14px; font-variant-numeric: tabular-nums; }
.method { color: var(--muted); font-size: 12px; margin-top: 13px; }

.archive-panel { overflow: hidden; }
.archive-filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 20px 24px 11px; }
.archive-filters label { display: grid; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 600; }
.archive-filters input, .archive-filters select, .archive-filters button, .pagination button { border-radius: 7px; min-height: 39px; border: 1px solid #cbd9c8; background: var(--white); color: var(--ink); padding-inline: 10px; }
.archive-filters input, .archive-filters select { min-width: 144px; }
.archive-filters .filter-button { background: var(--jade); color: #f5fff5; border-color: var(--jade); font-weight: 650; }
.archive-filters .filter-button:hover { background: #2c6c4f; }
.archive-filters .clear-button:hover, .pagination button:enabled:hover { background: #e9f1e2; }
.archive-status { padding: 3px 24px 12px; font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background: #eaf0e4; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; }
th, td { padding: 10px 24px; }
td { font-size: 13px; border-bottom: 1px solid #e3eadf; }
td:first-child { width: 32%; white-space: nowrap; font-weight: 550; }
.format-cell { width: 20%; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 15px 24px; color: var(--muted); font-size: 12px; }
.pagination button:disabled { opacity: .52; }
.footer { padding-block: 34px; color: var(--muted); font-size: 11px; display: flex; justify-content: space-between; gap: 12px; }
.footer a { text-decoration: none; }

@media (max-width: 850px) {
  .shell { width: calc(100% - 48px); }
  .workbench { gap: 13px; }
  .rule-row { gap: 8px; }
  .ticket-balls span { width: clamp(41px, 7vw, 56px); }
  .abacus { margin-right: 6px; }
}

@media (max-width: 670px) {
  .shell { width: calc(100% - 30px); }
  .header-inner { min-height: 82px; flex-wrap: wrap; gap: 9px; padding-block: 11px; }
  .brand { font-size: 26px; }
  .brand-mark { width: 27px; height: 27px; }
  .header-inner nav { order: 3; width: 100%; gap: 18px; font-size: 12px; }
  .game-label { font-size: 10px; padding-inline: 8px; }
  .intro { padding: 31px 0 26px; }
  .intro h1 { font-size: clamp(58px, 14vw, 83px); }
  .lede { font-size: 14px; }
  .abacus { display: none; }
  .workbench, .pattern-grid { grid-template-columns: 1fr; }
  .ticket { padding-top: 23px; }
  .ticket-balls { max-width: 390px; }
  .ticket-balls span { width: clamp(39px, 12.8vw, 65px); font-size: 25px; }
  .filters { padding-top: 23px; }
  .latest { flex-wrap: wrap; gap: 10px 15px; padding: 14px; }
  .latest-caption { flex: 1 0 150px; }
  .latest .mini-balls { gap: 4px; }
  .latest .mini-balls span { width: 26px; }
  .arrow-link { flex: auto; text-align: left; }
  .section { margin-top: 38px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .pattern-card { padding: 17px; }
  .archive-filters { padding: 14px 12px 9px; gap: 8px; }
  .archive-filters input, .archive-filters select { min-width: 115px; max-width: 100%; }
  .archive-status, .pagination { padding-inline: 12px; }
  th, td { padding: 9px 9px; }
  .format-cell { width: auto; }
  td:first-child { width: auto; }
  td { font-size: 11px; }
  th { letter-spacing: .025em; }
  td .mini-balls { gap: 3px; }
  td .mini-balls span { width: clamp(19px, 6.5vw, 28px); font-size: 10px; }
  .footer { flex-wrap: wrap; padding-block: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
