/* TheLabs.fyi Lottery: dark first, the game's own colour for the special ball */
:root {
  color-scheme: light;
  --bg: #f3f5f7; --surface: #fff; --surface-2: #e8edf1; --ink: #13202a; --ink-2: #44535e; --ink-3: #66757f; --line: #d6dee4;
  --accent: #d6223a; --on-accent: #fff; --ball: #fff; --ball-ink: #13202a; --good: #187a4a; --focus: #2a78d6;
}
:root[data-game="mega"] { --accent: #c9961a; --on-accent: #1d1400; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1418; --surface: #182027; --surface-2: #222c35; --ink: #edf3f6; --ink-2: #b4c1ca; --ink-3: #8795a0; --line: #2b3640;
  --accent: #ff4d63; --on-accent: #2a0007; --ball: #edf3f6; --ball-ink: #0f1418; --good: #5fd39a; --focus: #6aa8f0;
}
:root[data-theme="dark"][data-game="mega"] { --accent: #f2c14e; --on-accent: #2a1d00; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0f1418; --surface: #182027; --surface-2: #222c35; --ink: #edf3f6; --ink-2: #b4c1ca; --ink-3: #8795a0; --line: #2b3640;
    --accent: #ff4d63; --on-accent: #2a0007; --ball: #edf3f6; --ball-ink: #0f1418; --good: #5fd39a; --focus: #6aa8f0;
  }
  :root:not([data-theme])[data-game="mega"] { --accent: #f2c14e; --on-accent: #2a1d00; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 Inter, system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
main, .top, .foot { max-width: 620px; margin: 0 auto; padding: 0 16px; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; line-height: 1.2; }
h2 { font-size: 17px; margin: 18px 0 8px; }
.card h2:first-child { margin-top: 0; }
.muted { color: var(--ink-3); margin: 6px 0 0; }
.small { font-size: 14px; }

.top { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; padding-bottom: 6px; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand h1 { font-size: 24px; font-weight: 800; }
.home { font-size: 13px; font-weight: 700; color: var(--ink-3); text-decoration: none; }
.theme { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); font-size: 18px; cursor: pointer; }

.games, .tabs, .seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); margin: 10px 0; }
.games a, .tabs button, .seg span { display: grid; place-items: center; min-height: 42px; border-radius: 9px; font-weight: 700; color: var(--ink-2); text-decoration: none; border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; }
.games a[aria-current], .tabs [aria-selected=true], .seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .2); }
.games a[aria-current] { color: var(--accent); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }

.card { background: var(--surface); border-radius: 16px; padding: 16px; margin: 10px 0; }
.kicker { margin: 0 0 10px; font-weight: 700; color: var(--ink-2); font-size: 14px; }
.balls { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ball { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ball); color: var(--ball-ink); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; box-shadow: inset 0 -2px 0 rgb(0 0 0 / .15); }
:root:not([data-theme="dark"]) .ball:not(.sp) { box-shadow: inset 0 0 0 1.5px var(--line), inset 0 -2px 0 rgb(0 0 0 / .08); }
.ball.sp { background: var(--accent); color: var(--on-accent); }
.ball.hit { outline: 3px solid var(--good); outline-offset: 1px; }
.big .ball { width: 46px; height: 46px; font-size: 19px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.wide { width: 100%; }
.row-gap { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink-2); }
select, input[type=date] { min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }

.picks { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.picks li { display: flex; align-items: center; gap: 10px; }
.picks .lbl { font-weight: 800; color: var(--ink-3); width: 14px; }

.plays { display: grid; gap: 8px; margin-top: 12px; }
.play { display: flex; align-items: center; gap: 5px; }
.play b { width: 16px; color: var(--ink-3); }
.play input { width: 100%; min-width: 0; max-width: 52px; height: 44px; text-align: center; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; font-size: 16px; padding: 0; }
.play input.sp { border-color: var(--accent); }
.play input:focus { outline: none; border-color: var(--focus); }
.status { min-height: 1.2em; margin: 10px 0 0; font-weight: 600; color: var(--ink-2); }
.crop { margin-top: 12px; }
.crop-box { max-height: 60vh; overflow: hidden; border-radius: 12px; background: #000; }
.crop-box img { display: block; max-width: 100%; }

.result { margin-top: 14px; display: grid; gap: 10px; }
.result .r-draw { font-weight: 700; color: var(--ink-2); margin: 6px 0 0; }
.result .r-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.result .win { color: var(--good); font-weight: 800; }
.result .lose { color: var(--ink-3); font-size: 14px; }

.prizes { margin-top: 16px; }
.prizes summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.prizes table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 15px; }
.prizes td { padding: 6px 0; border-top: 1px solid var(--line); }
.r { text-align: right; font-weight: 700; }

.draws { list-style: none; margin: 0; padding: 0; }
.draws li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.draws li:first-child { border-top: 0; }
.draws .d { font-size: 14px; color: var(--ink-2); min-width: 120px; }
.draws .ball { width: 30px; height: 30px; font-size: 14px; }

.freq { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.freq > span { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.freq small { font-size: 12px; color: var(--ink-3); }
.pairs > span { flex-direction: row; flex-wrap: wrap; justify-content: center; width: 86px; gap: 3px; }
.pairs small { width: 100%; text-align: center; }
.note { margin: 18px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; }
.foot { padding-top: 10px; padding-bottom: 28px; font-size: 13px; color: var(--ink-3); text-align: center; }
@media (max-width: 380px) { .ball { width: 30px; height: 30px; font-size: 14px; } .big .ball { width: 40px; height: 40px; font-size: 17px; } }
.status:empty { display: none; }
.update { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.update.is-ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.update.is-warn { background: color-mix(in srgb, #f0a54a 16%, transparent); color: #f0a54a; }
:root:not([data-theme="dark"]) .update.is-warn { color: #9a5a00; }
.changes { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--ink-2); }
.card .kicker + h2 { margin-top: 0; }
.ocr-text { margin-top: 10px; }
.ocr-text summary { cursor: pointer; font-size: 14px; color: var(--ink-3); font-weight: 600; }
.ocr-text pre { white-space: pre-wrap; font-size: 12px; background: var(--surface-2); padding: 8px 10px; border-radius: 10px; max-height: 220px; overflow: auto; color: var(--ink-2); }
.play.unsure { outline: 2px solid #f0a54a; outline-offset: 3px; border-radius: 12px; }
