/* Source Serif 4, self-hosted (SIL Open Font License, see /fonts/OFL.txt) so visitors' browsers never contact Google. */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-ext.woff2") format("woff2");
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin.woff2") format("woff2");
  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;
}

:root {
  color-scheme: light;
  --bg: #fafaf7;
  --surface: #ffffff;
  --surface-2: #f2f1ec;
  --border: #e4e2da;
  --ink: #111111;
  --ink-2: #52514e;
  --ink-3: #85847e;
  --loss: #b42318;
  --accent: #111111;
  --lucky: #1baf7a;
  --avg: #2a78d6;
  --unlucky: #eb6834;
  --path: #85847e;
  --band: rgba(42, 120, 214, 0.10);
  --grid: #ecebe5;
  --radius: 14px;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2385847e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* Light is the default for everyone; dark only when the visitor picks it. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238d8c84' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --bg: #121211;
  --surface: #1a1a19;
  --surface-2: #232321;
  --border: #2e2e2b;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --ink-3: #8d8c84;
  --loss: #ff6b61;
  --accent: #f0efec;
  --lucky: #199e70;
  --avg: #3987e5;
  --unlucky: #d95926;
  --path: #8d8c84;
  --band: rgba(57, 135, 229, 0.14);
  --grid: #2a2a27;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2 { font-family: "Source Serif 4", Georgia, "Times New Roman", serif; font-weight: 700; letter-spacing: -0.015em; line-height: 1.12; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.hint { color: var(--ink-3); font-weight: 400; font-size: 0.8em; }

/* header */
.site-header { border-bottom: 1px solid var(--border); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.logo { font-weight: 800; font-size: 1.35rem; text-decoration: none; letter-spacing: -0.03em; }
.logo.small { font-size: 1rem; }
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo-not { color: var(--loss); }
.logo-mark { width: 26px; height: 26px; flex: none; }
.logo.small .logo-mark { width: 18px; height: 18px; }
.logo.small { gap: 6px; vertical-align: -3px; }
.logo-mark rect { fill: var(--ink); }
.logo-mark path { fill: none; stroke: #e5484d; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.nav { display: flex; gap: 20px; font-size: 0.95rem; }
.nav a { text-decoration: none; color: var(--ink-2); }
.nav a:hover { color: var(--ink); }
.nav-help { color: var(--loss) !important; font-weight: 600; }
@media (max-width: 640px) { .nav a:not(.nav-help) { display: none; } }

/* hero */
.hero { padding-top: 48px; padding-bottom: 24px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 0 0 12px; max-width: 18ch; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 60ch; margin: 0; }

/* layout */
.calc { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; padding-top: 16px; padding-bottom: 48px; }
@media (max-width: 900px) { .calc { grid-template-columns: minmax(0, 1fr); } }
.calc > * { min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }

/* inputs */
.inputs { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 76px; }
@media (max-width: 900px) { .inputs { position: static; } }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
input, select {
  font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; width: 100%; min-width: 0;
  font-variant-numeric: tabular-nums;
}
select {
  appearance: none; -webkit-appearance: none;
  background-image: var(--chevron); background-repeat: no-repeat;
  background-position: right 12px center; background-size: 12px 8px;
  padding-right: 34px; text-overflow: ellipsis; cursor: pointer;
}
input:focus, select:focus { outline: 2px solid var(--avg); outline-offset: 1px; }
.suffix-input, .prefix-input { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.suffix-input:focus-within, .prefix-input:focus-within { outline: 2px solid var(--avg); outline-offset: 1px; }
.suffix-input input, .prefix-input input { border: 0; background: transparent; outline: none; }
.suffix-input span { padding-right: 11px; color: var(--ink-3); }
.prefix-input span { padding-left: 11px; color: var(--ink-3); }
.edge-line { margin: -4px 0 0; font-size: 0.85rem; color: var(--ink-2); }
.edge-line strong { color: var(--loss); }

/* results */
.results { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hero-result { padding: 24px; }
.eyebrow { margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.06em; }
.big-number { margin: 4px 0; font-family: "Source Serif 4", Georgia, serif; font-size: clamp(2.8rem, 7.5vw, 4.4rem); font-weight: 700; letter-spacing: -0.02em; color: var(--loss); font-variant-numeric: tabular-nums; line-height: 1.1; }
.sub { margin: 0; color: var(--ink-2); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.tile-label { margin: 0; font-size: 0.8rem; color: var(--ink-2); font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tile-value { margin: auto 0 0; padding-top: 4px; font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-lucky { background: var(--lucky); }
.sw-avg { background: var(--avg); }
.sw-unlucky { background: var(--unlucky); }

/* chart */
.chart-card { position: relative; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.chart-head h2 { font-size: 1.25rem; margin: 0; }
.chart-actions, .chart-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.chart-foot { margin-top: 12px; }
.btn-ghost {
  font: inherit; font-size: 0.85rem; color: var(--ink-2); background: transparent;
  border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; cursor: pointer;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0 4px; font-size: 0.8rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { width: 16px; height: 2px; border-radius: 2px; display: inline-block; }
.lg-path { background: var(--path); opacity: 0.6; height: 1px; }
.chart { width: 100%; height: 340px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart text { font-size: 11px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
.chart .direct { font-size: 11px; font-weight: 600; fill: var(--ink-2); }
.tooltip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 10px; font-size: 0.8rem; box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  font-variant-numeric: tabular-nums; min-width: 170px; z-index: 5;
}
.tooltip .tt-title { font-weight: 700; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.tooltip .tt-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.table-wrap { overflow-x: auto; margin-top: 8px; max-height: 340px; overflow-y: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--ink-2); font-weight: 600; position: sticky; top: 0; background: var(--surface); }

.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.facts li { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; color: var(--ink-2); }
.facts strong { color: var(--ink); }

/* prose */
.prose { max-width: 760px; padding-top: 24px; padding-bottom: 24px; }
.prose h2 { font-size: 1.6rem; }
.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); }
.formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border-radius: 10px; padding: 14px 16px; font-size: 0.95rem; margin: 16px 0; overflow-x: auto; }
details { border-bottom: 1px solid var(--border); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; }

.help { margin-top: 24px; margin-bottom: 48px; max-width: 728px; width: calc(100% - 32px); }
.help h2 { margin-top: 0; }
.help ul { padding-left: 18px; color: var(--ink-2); }

#volLine strong { color: var(--ink); }

.game-links { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.game-links a { display: block; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; text-decoration: none; font-weight: 600; color: var(--ink); }
.game-links a:hover { border-color: var(--ink-3); }
.game-links a strong { display: block; }
.game-links a span { display: block; margin-top: 2px; font-weight: 400; font-size: 0.875rem; color: var(--ink-2); line-height: 1.4; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 12px 0; font-size: 0.875rem; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }
.facts-table { width: 100%; margin: 8px 0 16px; }
.facts-table th, .facts-table td { text-align: left; white-space: normal; }
.facts-table td:last-child, .facts-table th:last-child { text-align: right; }
.breadcrumb { font-size: 0.875rem; color: var(--ink-3); margin: 0 0 12px; }
.breadcrumb a { color: var(--ink-2); text-decoration: none; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { padding: 20px 0; border-bottom: 1px solid var(--border); }
.post-list a { text-decoration: none; }
.post-list a:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
.post-list h2 { font-size: 1.4rem; margin: 0 0 6px; color: var(--ink); }
.post-list p { margin: 0 0 6px; }
.post-list time, .post-meta { font-size: 0.875rem; color: var(--ink-3); }
.post-meta { margin: 0; }
.article { font-size: 1.075rem; }
.article h2 { font-size: 1.45rem; margin-top: 2em; }
.article a, .prose p a { color: var(--ink); text-underline-offset: 3px; }
.table-scroll { overflow-x: auto; margin: 16px 0; }
.post-links { padding-left: 18px; color: var(--ink-2); }
.post-links li { margin: 6px 0; }
.hero-narrow { max-width: 760px; }
.hero-narrow h1 { max-width: none; }
.prose h3 { font-size: 1rem; margin: 24px 0 8px; }
.sources { padding-left: 20px; font-size: 0.875rem; color: var(--ink-2); }
.sources li { margin: 4px 0; }
.sources a { color: var(--ink-2); }
.rtp-slider { margin-top: -4px; }
.rtp-slider input[type="range"] { width: 100%; padding: 0; background: none; border: 0; accent-color: var(--loss); }
.rtp-slider input[type="range"]:focus { outline-offset: 2px; }
.range-scale { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--ink-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.row-rtp { grid-template-columns: 2fr 3fr; }
.edge-line .odds { color: var(--ink); font-weight: 600; }
.odds-box { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.odds-title { margin: 0 0 8px; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.odds-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.odds-row input { background: var(--surface); }
.odds-box .edge-line { margin: 8px 0 0; }
.theme-toggle { font: inherit; background: none; border: 1px solid var(--border); border-radius: 999px; width: 32px; height: 32px; display: inline-grid; place-items: center; color: var(--ink-2); cursor: pointer; padding: 0; }
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.theme-toggle svg { width: 16px; height: 16px; }
.nav { align-items: center; }
.odds-intro { margin: 0 0 12px; }
.odds-row label { display: flex; flex-direction: column; gap: 4px; font-size: 0.75rem; font-weight: 600; color: var(--ink-2); min-width: 0; }
.link-btn { font: inherit; color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 32px; color: var(--ink-2); font-size: 0.9rem; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.footer-brand p { margin: 10px 0 0; max-width: 34ch; }
.footer-brand a:not(.footer-logo) { color: var(--ink); text-underline-offset: 3px; }
.footer-logo { text-decoration: none; color: var(--ink); }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col h2 { font-family: inherit; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); margin: 0 0 4px; }
.footer-col a { color: var(--ink-2); text-decoration: none; }
.footer-col a:hover { color: var(--ink); }
.footer-bottom { position: relative; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; margin-top: 32px; padding-top: 20px; font-size: 0.8rem; color: var(--ink-3); }
.footer-bottom::before { content: ""; position: absolute; top: 0; left: 16px; right: 16px; border-top: 1px solid var(--border); }
.footer-bottom p { margin: 0; }
.estimate-note { margin: -4px 0 0; font-size: 0.8rem; color: var(--ink-3); }
.estimate-note a { color: var(--ink-2); text-underline-offset: 3px; }
.nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
/* Side-rail ads: in the empty space beside the 1100px content column, only on wide screens */
.ad-rail { position: fixed; top: 84px; width: 160px; z-index: 5; }
.ad-rail-left { left: calc(50% - 534px - 24px - 160px); }
.ad-rail-right { right: calc(50% - 534px - 24px - 160px); }
@media not all and (min-width: 1480px) and (min-height: 720px) { .ad-rail { display: none; } }
.ad-label { display: none; margin: 0 0 4px; font-size: 0.65rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); text-align: center; }
.ad-rail:has(ins[data-ad-status="filled"]) .ad-label, .ad-slot:has(ins[data-ad-status="filled"]) .ad-label { display: block; }
.ad-rail:has(ins[data-ad-status="unfilled"]), .ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
/* An ad slot takes no space until Google reports a filled ad. It keeps its width (Google needs it
   to choose an ad) but has no height or margin, so empty or blocked slots leave no gap. */
.ad-slot { height: 0; overflow: hidden; margin: 0 auto; }
.ad-slot:has(ins[data-ad-status="filled"]) { height: auto; overflow: visible; margin: 24px auto; }
.article .ad-slot:has(ins[data-ad-status="filled"]), .prose .ad-slot:has(ins[data-ad-status="filled"]) { margin: 28px 0; }
.article ul { padding-left: 20px; color: var(--ink-2); }
.article li { margin: 6px 0; }
.article code { font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.text-table th, .text-table td { text-align: left; white-space: normal; vertical-align: top; }
.text-table td:first-child { white-space: nowrap; }
.not-found-actions { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; margin-top: 24px; }
.not-found-actions a { color: var(--ink); text-underline-offset: 3px; }
.btn-primary { background: var(--ink); color: var(--bg) !important; padding: 10px 18px; border-radius: 999px; text-decoration: none; font-weight: 600; }
