:root {
  color-scheme: light;
  --bg: #f6f5f0;
  --surface: #fffefa;
  --surface-2: #f1f0e9;
  --text: #202a2b;
  --muted: #737b7a;
  --border: #e5e3d9;
  --primary: #c6a15b;
  --primary-2: #e5c98e;
  --primary-bg: #f6eddb;
  --accent-text: #87621b;
  --coral: #d28e54;
  --blue: #709aa5;
  --yellow: #d9b35d;
  --shadow: 0 14px 38px rgba(32, 38, 30, .06);
  --focus: 0 0 0 3px rgba(198, 161, 91, .34);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #111716;
  --surface-2: #1b2322;
  --text: #f6f4ec;
  --muted: #a3acaa;
  --border: #313a37;
  --primary: #e5bc6b;
  --primary-2: #f2dba4;
  --primary-bg: #382e1c;
  --accent-text: #f0c876;
  --coral: #edaf76;
  --blue: #91c0ca;
  --yellow: #f2d186;
  --shadow: 0 14px 38px rgba(0, 0, 0, .18);
  --focus: 0 0 0 3px rgba(235, 188, 104, .36);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; transition: background .2s, color .2s; }
button, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }
button:focus-visible, select:focus-visible, a:focus-visible, .mode-option:focus-within { outline: none; box-shadow: var(--focus); }
a { text-decoration: none; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; flex: none; }
.sr-only { position: absolute; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; height: 1px; width: 1px; }
.container { width: min(1200px, calc(100% - 64px)); margin: 0 auto; }

.site-header { height: 82px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 850; font-size: 25px; letter-spacing: -.07em; }
.brand-dot { color: var(--primary); }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; transform: rotate(-7deg); padding: 8px; display: grid; grid-template-columns: repeat(2,1fr); gap: 3px; background: linear-gradient(135deg,#d6b573,#7f683b); box-shadow: 0 6px 15px rgba(117, 87, 28, .18); }
.brand-mark i { display: block; border-radius: 50%; background: white; }
.brand-mark i:nth-child(2) { background: #f6e6b7; }.brand-mark i:nth-child(3) { background: #ced9d8; }
.header-actions { display: flex; align-items: center; gap: 23px; }
.header-tag { font-weight: 850; font-size: 10px; color: var(--muted); letter-spacing: .17em; }
.theme-toggle { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid var(--border); color: var(--text); background: var(--surface); border-radius: 12px; font-size: 12px; font-weight: 750; }
.theme-toggle:hover { border-color: var(--primary); }.theme-toggle svg { width: 16px; height: 16px; }.theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

.hero { min-height: 214px; position: relative; border-radius: 24px; overflow: hidden; display: flex; align-items: center; padding: 29px 48px; color: #fff; isolation: isolate; background: radial-gradient(circle at 77% 9%, #ceaa6a 0%, transparent 43%), linear-gradient(118deg,#1a3131 0%,#2e4240 47%,#917043 100%); }
.hero::before { content: ''; width: 460px; height: 460px; border-radius: 50%; border: 1px solid rgba(255,255,255,.2); position: absolute; right: -80px; top: -180px; z-index: -1; }
.hero-content { position: relative; z-index: 2; }
.hero-kicker { display: inline-flex; align-items: center; gap: 7px; color: #e7dcc2; letter-spacing: .14em; font-size: 10px; font-weight: 850; }
.hero-kicker svg { width: 16px; height: 16px; }
.hero h1 { margin: 11px 0 15px; letter-spacing: -.065em; line-height: 1.08; font-size: clamp(36px, 4.15vw, 52px); font-weight: 850; }
.hero h1 span { color: #f9db96; }
.hero-art { position: absolute; right: 84px; top: -23px; width: 370px; height: 310px; transform: scale(.88); transform-origin: center right; }
.art-disc { width: 290px; height: 290px; position: absolute; left: 45px; top: 10px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; }
.disc-two { width: 192px; height: 192px; top: 57px; left: 93px; border-style: dashed; border-color: rgba(255,255,255,.23); }
.hero-ball { display: grid; place-items: center; position: absolute; border-radius: 50%; font-weight: 850; font-variant-numeric: tabular-nums; box-shadow: inset -8px -9px 16px rgba(42, 38, 27, .2), 0 16px 32px rgba(15,25,23,.23); }
.hero-ball-one { width: 103px; height: 103px; top: 90px; left: 130px; font-size: 30px; color: #4c381b; background: radial-gradient(circle at 30% 20%, #fff4cb, #e7ba64 58%, #8e6528); transform: rotate(-13deg); }
.hero-ball-two { width: 77px; height: 77px; top: 39px; left: 271px; font-size: 20px; color: #334240; background: radial-gradient(circle at 30% 20%, #fff, #d4dedb 58%, #778d8a); transform: rotate(10deg); }
.hero-ball-three { width: 76px; height: 76px; top: 206px; left: 50px; font-size: 21px; color: #234449; background: radial-gradient(circle at 30% 20%, #f2fbfa, #8fbfc1 58%, #3b7077); }
.hero-ball-four { width: 49px; height: 49px; top: 220px; left: 282px; font-size: 14px; color: #47351d; background: radial-gradient(circle at 30% 20%, #fff2d8, #d8a46f 65%, #8f603a); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin: 25px 0 0; }
.game-picker { display: flex; gap: 7px; padding: 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.game-tab { border: 0; border-radius: 10px; min-width: 163px; padding: 11px 15px; display: flex; justify-content: center; align-items: center; gap: 9px; font-size: 13px; font-weight: 650; color: var(--muted); background: transparent; }
.game-tab svg { width: 18px; height: 18px; }.game-tab b { font-weight: 850; }
.game-tab.active { background: var(--primary); color: #292e2b; box-shadow: 0 6px 12px rgba(133,105,48,.2); }
.toolbar-right { display: flex; align-items: center; gap: 9px; }
.sync-indicator { border-radius: 50%; width: 7px; height: 7px; background: #e1aa42; }.sync-indicator.ready { background: #3ac995; }.sync-indicator.error { background: #ff637c; }
.sync-text { color: var(--muted); font-size: 12px; white-space: nowrap; }
.refresh-button { display: flex; align-items: center; gap: 8px; margin-left: 7px; border: 1px solid var(--border); color: var(--text); background: var(--surface); padding: 10px 13px; border-radius: 11px; font-size: 12px; font-weight: 750; }
.refresh-button:hover { border-color: var(--primary); }.refresh-button svg { width: 15px; height: 15px; }.refresh-button.loading svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.notice { display: flex; justify-content: space-between; gap: 10px; align-items: center; border-radius: 11px; padding: 12px 15px; margin-top: 16px; font-size: 12px; }
.notice[hidden] { display: none; }.notice-error { background: #ffe8eb; color: #b13f59; }.notice-warning { background: #fff1c8; color: #9e6d11; }[data-theme="dark"] .notice-error { background: #431c27; color: #ff9fb2; }[data-theme="dark"] .notice-warning { background: #382b12; color: #f5d47c; }
.notice button { background: transparent; border: 1px solid currentColor; border-radius: 7px; padding: 5px 10px; color: inherit; flex: none; }

.section-header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 30px 0 17px; }
.overline { color: var(--accent-text); letter-spacing: .15em; font-size: 10px; font-weight: 850; }
.section-header h2 { margin: 5px 0 0; font-weight: 820; letter-spacing: -.045em; font-size: 24px; }.muted-title { color: var(--muted); font-weight: 470; }
.period-control { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 12px; font-weight: 650; }
.select-wrap { min-width: 137px; position: relative; display: flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); box-shadow: 0 3px 9px rgba(44, 27, 98, .035); transition: border-color .18s, box-shadow .18s; }
.select-wrap:hover { border-color: var(--primary); }
.select-wrap:focus-within { border-color: var(--primary); box-shadow: var(--focus); }
.select-wrap select { appearance: none; -webkit-appearance: none; width: 100%; min-height: 44px; padding: 10px 39px 10px 14px; border: 0; outline: 0; border-radius: 11px; color: var(--text); background: transparent; font-size: 14px; font-weight: 760; cursor: pointer; }
.select-wrap select:focus-visible { box-shadow: none; }
.select-wrap select option { color: var(--text); background-color: var(--surface); }
.select-wrap svg { width: 17px; height: 17px; position: absolute; right: 12px; pointer-events: none; color: var(--accent-text); stroke-width: 2.2; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; }
.metric-card { min-width: 0; min-height: 133px; border: 1px solid transparent; border-radius: 17px; padding: 19px 21px; position: relative; }
.metric-gold { background: #f3e7ce; color: #76541b; }.metric-blue { background: #dfeaec; color: #2c5f67; }.metric-coral { background: #e9ede2; color: #4c6749; }.metric-yellow { background: #f4e7d4; color: #865c28; }
[data-theme="dark"] .metric-gold { background: #312819; color: #f0cc82; }[data-theme="dark"] .metric-blue { background: #172a2d; color: #acdade; }[data-theme="dark"] .metric-coral { background: #213122; color: #bed7a8; }[data-theme="dark"] .metric-yellow { background: #32281a; color: #f4ce8a; }
.metric-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; }
.metric-top svg { width: 21px; height: 21px; opacity: .85; }.metric-card > strong, .metric-value > strong { display: block; font-size: 31px; line-height: 1.2; letter-spacing: -.05em; font-weight: 850; margin-top: 13px; }
.metric-extra { display: block; font-size: 11px; font-weight: 700; margin-top: 3px; opacity: .8; }
.metric-value { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }.metric-pill { display: inline-flex; padding: 4px 8px; border-radius: 7px; background: rgba(255,255,255,.52); font-size: 10px; font-weight: 850; margin-bottom: 4px; white-space: nowrap; }[data-theme="dark"] .metric-pill { background: rgba(255,255,255,.09); }

.content-grid { display: flex; flex-direction: column; gap: 23px; margin: 0; }
.analysis-column, .generator-column { display: flex; flex-direction: column; width: 100%; min-width: 0; gap: 19px; }
.generator-column { order: 0; }.analysis-column { order: 1; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 25px 27px; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 23px; }
.panel-header h3 { margin: 4px 0 0; font-size: 19px; font-weight: 820; letter-spacing: -.045em; }
.panel-count { color: var(--accent-text); background: var(--primary-bg); border-radius: 8px; padding: 7px 10px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.bar-chart { display: flex; flex-direction: column; gap: 15px; min-height: 310px; }
.bar-row { display: grid; grid-template-columns: 23px 31px minmax(0,1fr) 58px; gap: 11px; align-items: center; font-size: 12px; }
.bar-rank { color: var(--muted); font-weight: 650; font-size: 10px; }.bar-num { font-weight: 850; font-size: 13px; }
.bar-track { width: 100%; height: 12px; border-radius: 5px; overflow: hidden; background: var(--surface-2); }
.bar-fill { height: 100%; min-width: 2px; background: linear-gradient(90deg,#aa8751,#e0bf82); border-radius: inherit; }
.bar-row:nth-child(1) .bar-fill { background: linear-gradient(90deg,#d9a24e,#f0d38e); }.bar-row:nth-child(2) .bar-fill { background: linear-gradient(90deg,#568e90,#a3c7c4); }.bar-row:nth-child(3) .bar-fill { background: linear-gradient(90deg,#899997,#c2d0c9); }
.bar-count { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }.bar-count small { font-weight: 500; color: var(--muted); }
.loading-placeholder { color: var(--muted); display: grid; place-items: center; min-height: 160px; font-size: 12px; }
.sort-tabs { display: inline-flex; background: var(--surface-2); gap: 3px; padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.sort-tab { padding: 7px 13px; border-radius: 7px; border: 0; background: transparent; color: var(--muted); font-size: 11px; font-weight: 780; }
.sort-tab.active { background: var(--surface); color: var(--accent-text); box-shadow: 0 2px 8px rgba(39,45,42,.09); }
.number-grid { display: grid; grid-template-columns: repeat(9,minmax(0,1fr)); gap: 8px; }
.number-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 1 / 1.06; border-radius: 9px; transition: transform .14s; }
.number-tile:hover { transform: translateY(-2px); }.number-tile strong { font-size: 13px; font-weight: 850; }.number-tile span { font-size: 9px; font-variant-numeric: tabular-nums; opacity: .8; }
.heat-0 { background: #f2efe5; color: #7f806e; }.heat-1 { background: #e5d8b9; color: #775d2f; }.heat-2 { background: #d7bb80; color: #654719; }.heat-3 { background: #bb9450; color: #272619; }.heat-4 { background: #886127; color: #fff; }
[data-theme="dark"] .heat-0 { background: #29302b; color: #b3b8ac; }[data-theme="dark"] .heat-1 { background: #433d2b; color: #e7d6a9; }[data-theme="dark"] .heat-2 { background: #796039; color: #fff0ca; }[data-theme="dark"] .heat-3 { background: #c09c5b; color: #1c211c; }[data-theme="dark"] .heat-4 { background: #efd099; color: #292316; }
.heatmap-legend { display: flex; justify-content: end; align-items: center; gap: 5px; margin-top: 17px; font-weight: 800; font-size: 9px; color: var(--muted); letter-spacing: .05em; }.heatmap-legend span { margin-inline: 4px; }.heatmap-legend i { width: 14px; height: 8px; border-radius: 2px; background: #f2efe5; }.heatmap-legend i:nth-of-type(2) { background: #e5d8b9; }.heatmap-legend i:nth-of-type(3) { background: #d7bb80; }.heatmap-legend i:nth-of-type(4) { background: #bb9450; }.heatmap-legend i:nth-of-type(5) { background: #886127; }
.official-link { display: flex; align-items: center; gap: 5px; color: var(--accent-text); font-size: 11px; font-weight: 850; }.official-link svg { width: 14px; height: 14px; }
.history-row { border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 13px 0; }.history-row:first-child { border-top: 0; }
.history-meta { width: 96px; flex: none; }.history-meta strong { display: block; font-weight: 800; font-size: 11px; }.history-meta span { display: block; margin-top: 3px; font-size: 10px; color: var(--muted); }
.history-balls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }.draw-ball { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; font-weight: 830; font-size: 11px; font-variant-numeric: tabular-nums; background: var(--surface-2); color: var(--text); }
.draw-ball.bonus { background: #c6a15b; color: #243130; margin-left: 8px; position: relative; }.draw-ball.bonus::before { content: '+'; position: absolute; left: -12px; color: var(--muted); font-size: 13px; }

.generator-panel { background: linear-gradient(125deg,#172c2e 0%,#142528 53%,#35423a 100%); border-radius: 22px; color: #fffef9; box-shadow: 0 17px 37px rgba(26,42,39,.14); border: 1px solid #63705f; overflow: hidden; }
.generator-title { display: flex; justify-content: center; align-items: center; gap: 15px; padding: 29px 30px 18px; }
.generator-icon { display: grid; place-items: center; width: 48px; height: 48px; background: linear-gradient(145deg,#f6dc9f,#c6a15b); color: #26312d; border-radius: 13px; }.generator-icon svg { width: 24px; height: 24px; }
.generator-kicker { color: #dfca9f; font-size: 9px; font-weight: 850; letter-spacing: .18em; }
.generator-title h3 { font-size: 28px; margin: 1px 0 0; font-weight: 850; letter-spacing: -.05em; }
.generator-form { display: grid; grid-template-columns: minmax(0,1.38fr) minmax(285px,.82fr); gap: 26px; padding: 0 34px 31px; }
.generator-methods,.generator-actions { min-width: 0; }
.form-label { margin: 11px 0 12px; color: #e3d3af; font-size: 10px; font-weight: 850; letter-spacing: .11em; }.count-label { margin-top: 11px; }
.mode-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; align-items: start; }
.mode-option { display: flex; flex-wrap: wrap; align-content: center; align-items: center; gap: 6px; position: relative; border: 1px solid #506866; border-radius: 12px; background: rgba(255,255,255,.045); min-height: 65px; padding: 8px 10px; }
.mode-option:hover { border-color: #e5c98e; }.mode-option.selected { background: rgba(198,161,91,.15); border-color: #e5bc6b; box-shadow: inset 0 0 0 1px rgba(225,185,106,.13); }
.mode-choice { display: flex; flex: 1; min-width: 0; align-items: center; gap: 9px; min-height: 46px; cursor: pointer; }
.mode-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }.mode-choice strong { flex: 1; min-width: 0; font-size: 12px; font-weight: 780; }
.mode-icon { display: grid; place-items: center; border-radius: 8px; width: 34px; height: 34px; background: rgba(255,255,255,.12); color: #f1dda9; }.mode-icon svg { width: 18px; height: 18px; }
.radio-dot { display: block; width: 16px; height: 16px; flex: none; border: 1.5px solid #9eada8; border-radius: 50%; position: relative; }.mode-option.selected .radio-dot { border-color: #f0cc82; }.mode-option.selected .radio-dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: #f0cc82; }
.mode-combo { border-color: #827657; background: rgba(198,161,91,.075); }.mode-combo .mode-icon { background: #eac77c; color: #263733; }.new-badge { color: #223430; background: #f1d99c; border-radius: 4px; padding: 3px 5px; font-size: 8px; font-weight: 900; letter-spacing: .05em; }
.mode-help { border: 0; flex: none; width: 34px; height: 40px; display: grid; place-items: center; background: transparent; color: #d5c5a5; border-radius: 9px; }
.mode-help svg { width: 18px; height: 18px; }.mode-help:hover,.mode-help:focus-visible { color: #fff0bc; background: rgba(255,255,255,.08); }
.mode-tooltip { display: none; position: static; order: 3; flex: 0 0 100%; margin: 3px 0 2px; padding: 10px 12px; border-left: 3px solid #d5b46a; border-radius: 7px; background: rgba(255,255,255,.09); color: #f2f0e5; box-shadow: none; font-size: 12px; font-weight: 520; line-height: 1.6; text-align: left; }
.mode-option.tooltip-preview .mode-tooltip,.mode-option.tooltip-open .mode-tooltip { display: block; }
.mode-option.tooltip-open .mode-help { color: #f0cc82; }
.count-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }.count-button { min-height: 52px; padding: 10px 0; color: #e7e5d9; background: #324644; border: 1px solid #5a746f; border-radius: 10px; font-size: 14px; font-weight: 850; }.count-button:hover { border-color: #e6c887; }.count-button.selected { background: #e8c984; border-color: #e8c984; color: #263633; }
.generate-button { display: flex; align-items: center; justify-content: space-between; gap: 9px; width: 100%; min-height: 55px; padding: 14px 16px; border-radius: 11px; background: linear-gradient(95deg,#f1d89f,#c9a55d); color: #243431; border: 0; margin-top: 18px; font-weight: 880; font-size: 14px; transition: transform .15s; }.generate-button:hover { transform: translateY(-1px); }.generate-button svg { width: 18px; height: 18px; }
.ticket-output { padding: 18px 22px 24px; margin: 0 34px 29px; background: rgba(0,0,0,.16); border: 1px solid #63776e; border-radius: 13px; }.ticket-output[hidden] { display: none; }
.ticket-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 3px 14px; }.ticket-title strong { font-size: 14px; }.copy-button { display: flex; align-items: center; gap: 6px; background: transparent; border: 0; color: #f3d696; font-weight: 750; font-size: 12px; }.copy-button svg { width: 16px; height: 16px; }
.tickets { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }.ticket-row { min-width: 0; background: #f9f8f2; color: #263b38; border-radius: 11px; padding: 13px 14px 16px; }.ticket-row-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; min-height: 19px; margin-bottom: 7px; }.ticket-index { color: #6f766f; font-size: 10px; font-weight: 900; letter-spacing: .08em; }.ticket-score { background: #eee0bf; color: #75551f; font-size: 10px; font-weight: 850; padding: 3px 6px; border-radius: 5px; }
.ticket-balls { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px; padding: 5px 1px 9px; }
.ticket-ball { --ball-light: #fff1c5; --ball-mid: #d7ad5c; --ball-dark: #8e632c; --ball-ink: #392c19; aspect-ratio: 1; width: 100%; max-width: 58px; justify-self: center; position: relative; display: grid; place-items: center; border-radius: 50%; isolation: isolate; color: var(--ball-ink); font-weight: 890; font-size: clamp(12px,1.35vw,16px); font-variant-numeric: tabular-nums; letter-spacing: -.03em; text-shadow: 0 1px 1px rgba(255,255,255,.45); background: radial-gradient(circle at 31% 20%,rgba(255,255,255,.95) 0 3%,rgba(255,255,255,.62) 9%,transparent 30%), radial-gradient(circle at 30% 25%,var(--ball-light),var(--ball-mid) 51%,var(--ball-dark) 91%); box-shadow: inset 1px 2px 3px rgba(255,255,255,.56), inset -4px -7px 8px rgba(18,25,23,.21), 0 4px 0 rgba(31,37,32,.17), 0 10px 13px rgba(25,35,33,.16); }
.ticket-ball:nth-child(6n+2) { --ball-light: #fff; --ball-mid: #c8d2d0; --ball-dark: #82928f; --ball-ink: #2e3b3b; }
.ticket-ball:nth-child(6n+3) { --ball-light: #daf6f4; --ball-mid: #78b5b3; --ball-dark: #33716e; --ball-ink: #173b3c; }
.ticket-ball:nth-child(6n+4) { --ball-light: #fff0db; --ball-mid: #d9a46c; --ball-dark: #946336; --ball-ink: #3b271a; }
.ticket-ball:nth-child(6n+5) { --ball-light: #eff7e5; --ball-mid: #abc4a2; --ball-dark: #667e5b; --ball-ink: #273b25; }
.ticket-ball:nth-child(6n+6) { --ball-light: #f9f4e7; --ball-mid: #e2d0a5; --ball-dark: #a59264; --ball-ink: #48402d; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 29px 0 35px; color: var(--muted); font-size: 11px; }.footer > div { display: flex; gap: 20px; }.footer a { display: inline-flex; align-items: center; gap: 4px; }.footer a:hover { color: var(--accent-text); }.footer svg { width: 13px; height: 13px; }
.toast { position: fixed; bottom: 23px; left: 50%; transform: translate(-50%,18px); max-width: calc(100% - 30px); pointer-events: none; opacity: 0; transition: .2s; z-index: 20; text-align: center; background: #243531; color: white; border: 1px solid #b69a62; padding: 11px 16px; border-radius: 10px; font-size: 12px; font-weight: 750; }.toast.show { opacity: 1; transform: translate(-50%,0); }
.back-to-top { position: fixed; right: max(20px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); z-index: 15; width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 14px; background: linear-gradient(145deg,#edd298,#b98f45); color: #263531; box-shadow: 0 7px 20px rgba(140,103,39,.27); opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(15px); transition: opacity .2s, transform .2s, visibility .2s, box-shadow .2s; }
.back-to-top svg { width: 22px; height: 22px; }.back-to-top.is-visible { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }.back-to-top:hover { box-shadow: 0 10px 24px rgba(140,103,39,.43); transform: translateY(-2px); }

/* Fixed toolbar columns prevent the status message changing length from
   making the tabs wrap or jump when switching between products. */
.toolbar { display: grid; grid-template-columns: minmax(0,1fr) 211px; align-items: center; }
.game-picker { min-width: 0; display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); }
.game-tab { min-width: 0; padding: 12px 7px; gap: 7px; white-space: nowrap; }
.toolbar-right { margin-left: 0; min-width: 0; width: 211px; min-height: 53px; }
.sync-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.refresh-button { flex: none; }
.section-header { position: relative; z-index: 8; }

/* Native selects can pop upward. This keyboard-accessible menu is always
   anchored immediately below its own trigger, including on mobile. */
.select-wrap { min-width: 150px; }
.select-trigger { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 13px; background: transparent; border: 0; color: var(--text); border-radius: 11px; font-size: 13px; font-weight: 800; text-align: left; cursor: pointer; }
.select-trigger svg { position: static; width: 16px; height: 16px; transition: transform .15s; }
.select-trigger[aria-expanded="true"] svg { transform: rotate(180deg); }
.select-menu { position: absolute; top: calc(100% + 7px); left: 0; right: 0; z-index: 80; display: flex; flex-direction: column; gap: 3px; padding: 5px; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 14px 36px rgba(0,0,0,.16); background: var(--surface); min-width: 150px; }
.select-menu[hidden] { display: none; }
.select-menu button { border: 0; text-align: left; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; padding: 11px 12px; font-weight: 650; }
.select-menu button:hover,.select-menu button:focus-visible,.select-menu button.active { background: var(--primary-bg); color: var(--accent-text); outline: 0; }

/* Each recent draw owns a full-width cell: the right side is used by the
   evenly spaced number chips instead of remaining empty. */
.history-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.history-row { min-width: 0; display: flex; flex-direction: column; gap: 15px; align-items: stretch; justify-content: space-between; padding: 17px; border: 1px solid var(--border); border-radius: 13px; background: linear-gradient(145deg,var(--surface),var(--surface-2)); }
.history-row:first-child { border-top: 1px solid var(--border); }
.history-meta { display: flex; width: auto; align-items: baseline; justify-content: space-between; gap: 6px; }
.history-meta strong { font-size: 12px; }
.history-meta span { margin: 0; font-size: 10px; flex: none; }
.history-balls { display: grid; grid-template-columns: repeat(var(--ball-columns,6),minmax(0,1fr)); gap: 6px; width: 100%; }
.history-balls .draw-ball { --orb-light:#fff2c8; --orb-mid:#d8ae60; --orb-dark:#8c642f; --orb-ink:#453317; width: min(100%,38px); aspect-ratio: 1; height: auto; min-width: 0; justify-self: center; position: relative; isolation: isolate; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.4); border-radius: 50%; color: var(--orb-ink); background: radial-gradient(circle at 29% 19%,rgba(255,255,255,.96) 0 3%,rgba(255,255,255,.52) 10%,transparent 31%),radial-gradient(circle at 32% 24%,var(--orb-light),var(--orb-mid) 53%,var(--orb-dark) 94%); text-shadow: 0 1px 1px rgba(255,255,255,.52); box-shadow: inset 1px 2px 3px rgba(255,255,255,.55),inset -3px -5px 7px rgba(28,25,16,.24),0 3px 0 rgba(22,29,27,.18),0 7px 10px rgba(24,32,31,.17); font-size: 11px; font-weight: 900; }
.history-balls .draw-ball:nth-child(6n+2) { --orb-light:#ffffff; --orb-mid:#c7d2d3; --orb-dark:#819597; --orb-ink:#243739; }
.history-balls .draw-ball:nth-child(6n+3) { --orb-light:#e8ffff; --orb-mid:#86bfc1; --orb-dark:#427c84; --orb-ink:#163c41; }
.history-balls .draw-ball:nth-child(6n+4) { --orb-light:#fef0d6; --orb-mid:#d9a275; --orb-dark:#985e35; --orb-ink:#432719; }
.history-balls .draw-ball:nth-child(6n+5) { --orb-light:#f6ffe8; --orb-mid:#adc79f; --orb-dark:#6b875a; --orb-ink:#294023; }
.history-balls .draw-ball:nth-child(6n+6) { --orb-light:#fffcef; --orb-mid:#e4d3a4; --orb-dark:#a39770; --orb-ink:#4e4124; }
.history-balls .draw-ball.bonus { margin-left: 0; }
.history-balls .draw-ball.bonus::before { display: none; }
.history-balls .draw-ball.bonus { --orb-light:#fff4c9; --orb-mid:#e7b85e; --orb-dark:#936020; --orb-ink:#45300e; }
.history-detail { color: var(--muted); font-size: 11px; line-height: 1.4; }
.history-detail strong { color: var(--accent-text); }
.history-balls.codes { grid-template-columns: repeat(var(--ball-columns,2), minmax(0,1fr)); }
.history-balls.codes .draw-ball { width: 100%; max-width: 120px; height: 42px; aspect-ratio: auto; border-radius: 13px; font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: .08em; box-shadow: inset 1px 2px 2px rgba(255,255,255,.65),inset -4px -6px 8px rgba(30,29,20,.22),0 4px 0 rgba(28,38,35,.19),0 9px 13px rgba(20,30,25,.16); }
.number-grid.small-range { grid-template-columns: repeat(10,minmax(0,1fr)); }
.ticket-balls.compact { display: flex; align-items: center; justify-content: center; gap: 15px; }
.ticket-balls.compact .ticket-ball { width: 64px; max-width: 64px; font-size: 17px; }
.ticket-balls .ticket-ball.bonus { --ball-light: #fff7db; --ball-mid: #d69f41; --ball-dark: #765225; --ball-ink: #3a2b17; }
.ticket-details { color: #69736e; font-size: 11px; font-weight: 700; text-align: center; margin-top: 5px; }
.ticket-separator { font-size: 16px; color: #ac8a4e; font-weight: 900; }
.lottery-context { text-align: center; color: #ead9b4; font-size: 11px; padding: 0 22px 18px; }

@media (max-width:1100px) {
 .toolbar { grid-template-columns: minmax(0,1fr); }
 .toolbar-right { justify-self: end; }
 .history-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width:660px) {
 .game-picker { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 4px; }
 .game-tab { min-height: 42px; font-size: 11px; padding: 9px 4px; gap: 5px; }
 .game-tab svg { width: 15px; height: 15px; }
 .history-list { grid-template-columns: 1fr; }
 .history-row { flex-direction: column; align-items: stretch; gap: 12px; padding: 15px; }
 .history-meta { display: flex; justify-content: space-between; width: auto; }
 .history-balls { gap: 8px; }
 .history-balls .draw-ball { width: min(100%,42px); }
 .number-grid.small-range { grid-template-columns: repeat(5,minmax(0,1fr)); }
 .period-control { position: relative; }
}

@media (max-width: 1100px) { .hero-art { right: -6px; } .number-grid { grid-template-columns: repeat(9,minmax(0,1fr)); }.metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.metric-card { padding: 17px; }.metric-top { font-size: 11px; }.tickets { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 820px) { .container { width: min(680px,calc(100% - 38px)); }.hero { padding: 35px; }.hero-art { right: -205px; opacity: .45; }.metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 11px; }.generator-form { grid-template-columns: 1fr; gap: 16px; padding-inline: 25px; }.generator-title { padding-inline: 25px; }.mode-options { grid-template-columns: repeat(2,minmax(0,1fr)); }.mode-option { min-height: 66px; }.number-grid { grid-template-columns: repeat(9,minmax(0,1fr)); }.ticket-output { margin-inline: 25px; } }
@media (max-width: 520px) {
 .container { width: calc(100% - 28px); }.site-header { height: 68px; }.brand { font-size: 23px; }.brand-mark { width: 31px; height: 31px; }.header-tag,.theme-toggle span { display: none; }.theme-toggle { padding: 9px; }
 .hero { min-height: 186px; border-radius: 17px; padding: 23px; }.hero h1 { font-size: 34px; margin: 10px 0 14px; }.hero-art { right: -275px; top: -40px; opacity: .34; }
 .toolbar { flex-direction: column; align-items: stretch; gap: 11px; margin-top: 16px; }.game-picker { width: 100%; }.game-tab { flex: 1; min-width: 0; padding: 11px 7px; }.toolbar-right { width: 100%; }.sync-text { margin-right: auto; font-size: 11px; }.refresh-button { margin-left: 3px; padding: 8px 10px; }
 .section-header { flex-direction: column; align-items: start; gap: 12px; margin-top: 22px; }.section-header h2 { font-size: 22px; }.muted-title { display: none; }.period-control { width: 100%; justify-content: space-between; }.select-wrap { min-width: 170px; }
 .metric-grid { gap: 9px; }.metric-card { min-height: 124px; padding: 15px; border-radius: 13px; }.metric-card > strong,.metric-value > strong { font-size: 28px; margin-top: 15px; }.metric-top { font-size: 10px; }.metric-top svg { width: 18px; height: 18px; }.metric-pill { font-size: 9px; }
 .content-grid,.analysis-column { gap: 13px; }.content-grid { margin-top: 14px; }.panel { border-radius: 14px; padding: 21px 17px; }.panel-header h3 { font-size: 17px; }.panel-count { font-size: 10px; padding: 6px 8px; }.bar-row { grid-template-columns: 16px 25px minmax(0,1fr) 40px; gap: 8px; }.bar-count small { display: none; }
 .number-grid { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 6px; }.number-tile { border-radius: 7px; }.number-tile strong { font-size: 12px; }.number-tile span { font-size: 8px; }
 .history-row { flex-direction: column; align-items: start; gap: 9px; }.history-meta { width: auto; display: flex; align-items: center; gap: 9px; }.history-meta span { margin: 0; }.draw-ball { width: 31px; height: 31px; }.history-balls { gap: 6px; }
 .generator-title { padding: 24px 21px 14px; }.generator-form { padding: 6px 21px 22px; }.mode-options { grid-template-columns: 1fr; gap: 8px; }.mode-option { min-height: 58px; }.count-grid { gap: 8px; }.count-button { min-height: 46px; }.generator-title h3 { font-size: 24px; }.ticket-output { margin: 0 15px 17px; padding: 14px; }.tickets { grid-template-columns: 1fr; gap: 10px; }.footer { flex-direction: column; align-items: start; gap: 8px; padding-top: 23px; }.footer > div { gap: 15px; }
 .back-to-top { width: 44px; height: 44px; right: 14px; bottom: max(80px, env(safe-area-inset-bottom)); }.ticket-ball { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms!important; transition-duration: .01ms!important; scroll-behavior: auto!important; } }
