/* Self-hosted expressive Vietnamese typeface: no runtime font CDN needed. */
@font-face { font-family: 'Bricolage Grotesque'; src: url('/fonts/bricolage-vietnamese.woff2') format('woff2'); font-style: normal; font-weight: 400 900; font-display: swap; unicode-range: U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/fonts/bricolage-latin-ext.woff2') format('woff2'); font-style: normal; font-weight: 400 900; 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-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Bricolage Grotesque'; src: url('/fonts/bricolage-latin.woff2') format('woff2'); font-style: normal; font-weight: 400 900; 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; }

: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 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; transition: background .2s, color .2s; }
button, select, input { 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; }
}

/* V7 · Studio-style sculpted surfaces and consistent physical depth. */
:root {
  --bevel: rgba(255,255,255,.92);
  --lift: 0 3px 0 rgba(123,100,58,.13),0 12px 24px rgba(64,49,24,.09),0 27px 50px rgba(37,47,39,.045);
  --lift-hover: 0 5px 0 rgba(123,100,58,.16),0 17px 32px rgba(64,49,24,.12),0 32px 53px rgba(37,47,39,.08);
  --panel-glow: linear-gradient(145deg,rgba(255,255,255,.96),rgba(255,255,255,0) 45%);
}
:root[data-theme="dark"] {
  --bevel: rgba(255,255,255,.18);
  --lift: 0 3px 0 rgba(219,184,119,.07),0 15px 34px rgba(0,0,0,.56),inset 0 1px 0 rgba(255,255,255,.08);
  --lift-hover: 0 5px 0 rgba(219,184,119,.12),0 21px 38px rgba(0,0,0,.68),inset 0 1px 0 rgba(255,255,255,.12);
  --panel-glow: linear-gradient(145deg,rgba(255,255,255,.075),rgba(255,255,255,0) 49%);
}
body { background-image: radial-gradient(ellipse 700px 340px at 100% -20px,rgba(201,165,93,.10),transparent 68%),radial-gradient(ellipse 700px 480px at 0% 48%,rgba(75,154,144,.055),transparent 72%); }
.app-shell { position: relative; isolation: isolate; }
.site-header { position: relative; z-index: 22; }
.brand { text-shadow: 0 2px 3px rgba(115,99,54,.10); letter-spacing: -.055em; }
.brand-mark { transform: rotate(-11deg) perspective(110px) rotateY(-15deg); border: 1px solid rgba(255,255,255,.4); box-shadow: inset 1px 2px 2px rgba(255,255,255,.55),inset -3px -3px 4px rgba(67,44,11,.27),0 5px 0 #927341,0 11px 18px rgba(71,54,30,.18); }
.hero { border: 1px solid rgba(255,244,200,.32); background: radial-gradient(circle at 77% -10%,rgba(255,217,148,.72),transparent 51%),linear-gradient(120deg,#142e2b 0%,#23504d 46%,#ac834a 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,.24),inset 0 -5px 14px rgba(3,22,22,.24),0 6px 0 rgba(90,69,38,.20),0 26px 50px rgba(22,48,40,.16); }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg,rgba(255,255,255,.13),transparent 27%,transparent 75%,rgba(255,235,189,.12)); pointer-events: none; }
.hero h1 { font-size: clamp(37px,4.2vw,56px); font-weight: 870; letter-spacing: -.065em; text-shadow: 0 4px 13px rgba(6,32,28,.26); }
.hero h1 span { color: #ffe0a0; }
.hero-ball { border: 1px solid rgba(255,255,255,.56); box-shadow: inset 3px 4px 6px rgba(255,255,255,.4),inset -9px -12px 15px rgba(33,27,14,.24),0 9px 0 rgba(12,29,27,.18),0 29px 32px rgba(12,29,27,.25); }
.toolbar .game-picker { background: var(--panel-glow),var(--surface); border-color: var(--border); box-shadow: var(--lift); }
.game-tab { position: relative; transition: transform .18s,background .18s,box-shadow .18s; }
.game-tab:hover:not(.active) { background: var(--primary-bg); color: var(--text); transform: translateY(-2px); }
.game-tab.active { background: linear-gradient(155deg,#f9e7b8,#d9ad5d 60%,#bd8e3d); color: #302f26; box-shadow: inset 0 2px 1px rgba(255,255,255,.65),inset 0 -2px 0 rgba(88,61,17,.17),0 3px 0 #a57b36,0 9px 14px rgba(129,94,44,.22); }
.panel, .favorites-panel { background: var(--panel-glow),var(--surface); border: 1px solid var(--border); border-top-color: var(--bevel); box-shadow: var(--lift); transition: box-shadow .24s,transform .24s; }
.panel:hover { box-shadow: var(--lift-hover); }
.metric-card { overflow: hidden; border: 1px solid rgba(255,255,255,.44); box-shadow: inset 0 2px 0 rgba(255,255,255,.55),inset -3px -4px 8px rgba(64,65,37,.08),0 4px 0 rgba(98,94,68,.12),0 15px 26px rgba(42,46,26,.09); transition: transform .2s,box-shadow .2s; }
.metric-card:hover { transform: translateY(-3px) rotateX(1.3deg); box-shadow: inset 0 2px 0 rgba(255,255,255,.55),0 7px 0 rgba(98,94,68,.11),0 18px 28px rgba(42,46,26,.14); }
[data-theme="dark"] .metric-card { border-color: rgba(255,255,255,.09); box-shadow: inset 0 1px 0 rgba(255,255,255,.12),0 4px 0 rgba(169,139,89,.10),0 14px 30px rgba(0,0,0,.39); }
.metric-card::after { content: ''; position: absolute; width: 130px; height: 130px; border-radius: 50%; top: -76px; right: -35px; background: rgba(255,255,255,.23); box-shadow: 0 0 0 29px rgba(255,255,255,.065); pointer-events: none; }
.metric-card > strong, .metric-value > strong { font-weight: 870; text-shadow: 0 2px 0 rgba(255,255,255,.16); }
.select-wrap,.sort-tabs,.icon-setting,.theme-toggle,.refresh-button { border: 1px solid var(--border); background: var(--panel-glow),var(--surface); box-shadow: inset 0 1px 0 var(--bevel),0 3px 0 rgba(92,74,40,.09),0 8px 15px rgba(30,38,29,.06); }
.select-trigger { position: relative; z-index: 1; }.select-menu { box-shadow: 0 6px 0 rgba(154,121,66,.12),0 22px 38px rgba(22,29,20,.21); }
.refresh-button:hover,.theme-toggle:hover,.icon-setting:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 var(--bevel),0 4px 0 rgba(92,74,40,.12),0 10px 18px rgba(30,38,29,.12); }
.refresh-button,.theme-toggle,.icon-setting { transition: transform .16s,box-shadow .16s; }
.number-tile { border: 1px solid rgba(255,255,255,.19); box-shadow: inset 0 1px 1px rgba(255,255,255,.24),inset -2px -3px 4px rgba(30,30,20,.09),0 3px 0 rgba(74,68,49,.095),0 5px 9px rgba(30,30,20,.045); transition: transform .14s,box-shadow .14s; }
.number-tile:hover { transform: translateY(-3px) scale(1.03); box-shadow: inset 0 1px 1px rgba(255,255,255,.23),0 6px 0 rgba(74,68,49,.12),0 14px 18px rgba(30,30,20,.11); z-index: 1; }
.sort-tab.active { box-shadow: inset 0 2px 0 rgba(255,255,255,.36),0 2px 0 rgba(91,80,53,.10),0 4px 8px rgba(51,45,28,.07); }
.bar-track { box-shadow: inset 0 2px 4px rgba(16,33,28,.14); }.bar-fill { background: linear-gradient(180deg,#ffe8b0 0%,#c99b51 48%,#a97a34); box-shadow: inset 0 2px 0 rgba(255,255,255,.4),0 2px 5px rgba(183,132,47,.22); }
.history-row { border-top-color: var(--bevel); box-shadow: inset 0 1px 0 var(--bevel),inset 0 -2px 8px rgba(66,63,45,.045),0 3px 0 rgba(83,74,51,.10),0 9px 21px rgba(40,42,30,.07); transition: transform .17s,box-shadow .17s; }
.history-row:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 var(--bevel),0 6px 0 rgba(83,74,51,.10),0 14px 25px rgba(40,42,30,.12); }
.history-balls .draw-ball { box-shadow: inset 2px 3px 4px rgba(255,255,255,.66),inset -5px -7px 8px rgba(27,28,19,.25),0 4px 0 rgba(27,39,35,.23),0 11px 14px rgba(24,32,31,.19); }
.generator-panel { background: radial-gradient(circle at 90% 0%,rgba(243,198,110,.20),transparent 40%),linear-gradient(128deg,#15332f,#152e2d 51%,#314943); border: 1px solid #ad965d; border-top-color: #e7d0a3; box-shadow: inset 0 2px 0 rgba(255,255,255,.20),inset 0 -5px 0 rgba(4,19,18,.4),0 6px 0 rgba(97,76,45,.25),0 28px 52px rgba(11,33,28,.26); }
.generator-icon { transform: perspective(100px) rotateY(-9deg); box-shadow: inset 1px 2px 3px rgba(255,255,255,.7),inset -3px -4px 6px rgba(95,63,14,.23),0 5px 0 #9c7534,0 10px 20px rgba(0,0,0,.24); }
.mode-option { border-top-color: rgba(255,255,255,.37); box-shadow: inset 0 1px 0 rgba(255,255,255,.06),0 3px 0 rgba(0,0,0,.18),0 7px 15px rgba(0,0,0,.12); transition: transform .17s,box-shadow .17s,border-color .17s; }
.mode-option:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.12),0 5px 0 rgba(0,0,0,.17),0 11px 18px rgba(0,0,0,.17); }
.mode-option.selected { box-shadow: inset 0 1px 0 rgba(251,225,175,.2),0 3px 0 rgba(213,175,108,.27),0 10px 18px rgba(0,0,0,.17); }
.mode-icon { box-shadow: inset 0 1px 0 rgba(255,255,255,.22),0 2px 0 rgba(0,0,0,.16); }
.mode-tooltip { box-shadow: inset 0 1px 0 rgba(255,255,255,.16); }
.count-button,.count-custom { border: 1px solid #5a746f; border-top-color: #859c8c; color: #e7e5d9; background: linear-gradient(160deg,#415a55,#273c3a); border-radius: 11px; box-shadow: inset 0 1px 0 rgba(255,255,255,.13),0 4px 0 #182f2b,0 9px 14px rgba(0,0,0,.18); transition: transform .16s,box-shadow .16s,border-color .16s; }
.count-button:hover,.count-custom:focus-within { transform: translateY(-2px); border-color: #e6c887; box-shadow: inset 0 1px 0 rgba(255,255,255,.15),0 6px 0 #182f2b,0 11px 16px rgba(0,0,0,.2); }
.count-button.selected,.count-custom.selected { background: linear-gradient(160deg,#fff0bf,#d8b56e 70%,#ac823e); border-color: #f9df9f; color: #29382e; box-shadow: inset 0 2px 0 rgba(255,255,255,.6),0 4px 0 #987036,0 9px 15px rgba(0,0,0,.2); }
.count-custom { min-height: 52px; display: grid; place-items: center; overflow: hidden; }
.count-custom input { width: 100%; min-width: 0; height: 100%; min-height: 50px; border: 0; outline: 0; padding: 7px 5px; text-align: center; background: transparent; color: inherit; font-weight: 900; font-size: 14px; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.count-custom input::-webkit-inner-spin-button,.count-custom input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.count-custom input::placeholder { color: #e1e8da; opacity: .82; }.count-custom.selected input::placeholder { color: #514a36; }
.count-custom:has(input[aria-invalid="true"]) { border-color: #ff9090; box-shadow: 0 0 0 2px rgba(255,143,143,.26),0 4px 0 #693c36; }
.count-error { margin: 10px 2px 0; font-size: 12px; font-weight: 750; color: #ffb6a6; }.count-error[hidden] { display: none; }
.generate-button { border: 1px solid #ffe7ad; background: linear-gradient(160deg,#fff4ce 0%,#edca7f 44%,#bd9146 100%); box-shadow: inset 0 2px 0 rgba(255,255,255,.72),inset 0 -3px 5px rgba(116,75,20,.18),0 5px 0 #936b30,0 16px 26px rgba(0,0,0,.22); transition: transform .15s,box-shadow .15s; }
.generate-button:hover { transform: translateY(-2px); box-shadow: inset 0 2px 0 rgba(255,255,255,.72),0 7px 0 #936b30,0 22px 30px rgba(0,0,0,.28); }
.generate-button:active { transform: translateY(3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.5),0 2px 0 #936b30,0 9px 18px rgba(0,0,0,.21); }
.ticket-output { background: linear-gradient(160deg,rgba(4,17,16,.55),rgba(10,29,27,.17)); border-top-color: rgba(255,249,224,.28); box-shadow: inset 0 2px 8px rgba(0,0,0,.16),0 2px 0 rgba(219,185,117,.16); }
.ticket-row,.favorite-card { border: 1px solid #fff8dc; background: linear-gradient(145deg,#fffef7,#f0e9d9); box-shadow: inset 0 1px 0 #fff, inset 0 -2px 6px rgba(123,100,65,.10),0 4px 0 #baae94,0 13px 20px rgba(0,0,0,.14); }
.ticket-row { position: relative; transition: transform .18s,box-shadow .18s; }
.ticket-row:hover,.favorite-card:hover { transform: translateY(-2px); box-shadow: inset 0 1px 0 #fff,0 6px 0 #baae94,0 16px 24px rgba(0,0,0,.16); }
.ticket-top-actions { display: flex; align-items: center; gap: 7px; }.ticket-row-top { min-height: 29px; }
.favorite-button { display: grid; place-items: center; width: 31px; height: 31px; flex: none; padding: 6px; border: 1px solid #e8d9b9; border-radius: 9px; background: linear-gradient(145deg,#fff,#eadfca); color: #9b8f79; box-shadow: inset 0 1px 0 white,0 2px 0 #c6b99e; }
.favorite-button svg { width: 17px; height: 17px; }.favorite-button:hover { color: #c45c64; }.favorite-button.is-saved { color: #c74759; border-color: #ecc1c5; background: #fff0ed; }.favorite-button.is-saved svg { fill: #e9757c; stroke: #ab3041; }
.ticket-ball { box-shadow: inset 2px 3px 4px rgba(255,255,255,.76),inset -6px -9px 10px rgba(20,24,17,.25),0 5px 0 rgba(25,34,28,.25),0 13px 17px rgba(31,37,32,.2); }
.ticket-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
.ticket-tools .copy-button { display: inline-flex; align-items: center; white-space: nowrap; }
.favorites-panel { margin-top: 6px; }.favorites-panel .panel-header h3 { display: flex; width: fit-content; align-items: center; gap: 9px; }.favorites-panel .panel-header h3 svg { width: 20px; height: 20px; color: var(--accent-text); }
.favorites-empty { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 10px; min-height: 116px; text-align: center; color: var(--muted); font-size: 12px; }
.favorites-empty[hidden] { display: none; }.favorites-empty svg { width: 26px; height: 26px; color: var(--primary); opacity: .75; }
.favorites-list { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px 13px; }.favorites-list:empty { display: none; }
.favorite-card { min-width: 0; padding: 13px 12px 16px; color: #293b36; border-radius: 12px; transition: transform .18s,box-shadow .18s; }
.favorite-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; color: #746548; font-size: 12px; font-weight: 850; }
.favorite-card .ticket-balls { padding-block: 8px 5px; }.favorite-card .ticket-ball { font-size: 12px; }
.remove-favorite { border: 1px solid #e0d4bc; background: #fff8ea; color: #8c695d; width: 29px; height: 29px; padding: 5px; display: grid; place-items: center; border-radius: 8px; }
.remove-favorite svg { width: 16px; height: 16px; }.remove-favorite:hover { background: #ffe3df; color: #c6434e; }
.icon-setting { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--text); }.icon-setting svg { width: 19px; height: 19px; }
.settings-wrap { position: relative; }.settings-panel { position: absolute; z-index: 95; top: calc(100% + 12px); right: 0; width: min(310px,calc(100vw - 28px)); padding: 16px; background: var(--surface); border: 1px solid var(--border); border-top-color: var(--bevel); border-radius: 15px; box-shadow: 0 5px 0 rgba(126,101,62,.14),0 23px 47px rgba(12,22,18,.24); }
.settings-panel[hidden] { display: none; }.settings-heading { display: flex; align-items: center; gap: 9px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--border); }.settings-heading svg { width: 17px; height: 17px; color: var(--accent-text); }
.setting-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 16px; cursor: pointer; }.setting-row strong,.setting-row small { display: block; }.setting-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.setting-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }.switch-visual { position: relative; flex: 0 0 44px; width: 44px; height: 25px; border-radius: 25px; background: #aaaca6; border: 1px solid rgba(0,0,0,.1); box-shadow: inset 0 2px 4px rgba(0,0,0,.18); transition: background .2s; }
.switch-visual::after { content: ''; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: radial-gradient(circle at 30% 20%,#fff,#e8e7df 80%); box-shadow: 0 2px 3px rgba(0,0,0,.23); transition: transform .2s; }
.setting-row input:checked + .switch-visual { background: linear-gradient(120deg,#c5964a,#f4d38d); }.setting-row input:checked + .switch-visual::after { transform: translateX(19px); }.setting-row input:focus-visible + .switch-visual { outline: 3px solid var(--primary); outline-offset: 3px; }
.money-rain { position: fixed; z-index: 50; inset: 0; overflow: hidden; pointer-events: none; contain: strict; }.money-rain[hidden] { display: none; }
.money-note { --note-front:#c6eac4; --note-back:#6d9b76; display: block; position: absolute; left: var(--x); top: -92px; width: 82px; height: 40px; transform-origin: center; color: #28573d; background: linear-gradient(165deg,rgba(255,255,255,.7),transparent 34%),repeating-linear-gradient(120deg,transparent 0 7px,rgba(255,255,255,.14) 7px 8px),linear-gradient(140deg,var(--note-front),var(--note-back)); border: 1px solid rgba(255,255,255,.8); border-radius: 3px; box-shadow: inset 0 0 0 2px rgba(38,99,67,.12),0 3px 0 rgba(35,70,48,.26),0 12px 20px rgba(0,0,0,.25); opacity: .58; will-change: transform; animation: money-fall var(--speed) linear var(--delay) infinite; }
.bill-edge { position: absolute; inset: 4px; border: 1px double currentColor; opacity: .5; }.bill-content { display: flex; align-items: baseline; justify-content: center; gap: 4px; position: absolute; top: 6px; left: 9px; right: 9px; background: rgba(255,255,255,.17); border-radius: 30px; transform: rotate(-6deg); }.bill-content b { font-size: 18px; letter-spacing: -.08em; font-weight: 900; line-height: 26px; }.bill-content small { font-size: 9px; font-weight: 800; }
.money-amber { --note-front:#fff4bf; --note-back:#d6a953; color: #86632a; }.money-aqua { --note-front:#c5e9ea; --note-back:#78b7b7; color: #286a6b; }.money-rose { --note-front:#f5d9d3; --note-back:#cb9b93; color: #884f53; }
@keyframes money-fall { 0% { transform: translate3d(0,-35vh,0) rotate(var(--twist)) rotateY(0deg) scale(var(--scale)); } 100% { transform: translate3d(var(--drift),calc(100vh + 160px),0) rotate(calc(var(--twist) + 30deg)) rotateY(700deg) scale(var(--scale)); } }
@media (max-width: 1100px) { .favorites-list { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 660px) { .money-note { width: 67px; height: 34px; opacity: .50; }.bill-content { top: 4px; }.bill-content b { font-size: 15px; line-height: 24px; } .favorites-list { grid-template-columns: 1fr; } .ticket-tools { gap: 7px; } }
@media (max-width: 520px) { .header-actions { gap: 8px; }.icon-setting { width: 39px; height: 39px; }.count-custom,.count-button { min-height: 47px; }.count-custom input { min-height: 45px; }.ticket-title { align-items: flex-start; flex-wrap: wrap; }.ticket-tools { margin-left: auto; }.generator-panel { box-shadow: inset 0 2px 0 rgba(255,255,255,.16),0 5px 0 rgba(97,76,45,.22),0 20px 32px rgba(11,33,28,.20); } }
/* V8 · Banknote collecting, persistent wallet and pre-reveal lottery drum. */
.money-rain .money-note { pointer-events: auto; cursor: pointer; touch-action: manipulation; font: inherit; text-align: center; padding: 0; }
.money-rain .money-note:hover,.money-rain .money-note:focus-visible { animation-play-state: paused; opacity: .95; }
.money-note .bill-edge,.money-note .bill-content { pointer-events: none; }
.money-note .bill-content b { font-size: 16px; letter-spacing: -.07em; }
.money-note.collected { visibility: hidden; opacity: 0!important; animation: none!important; pointer-events: none; }
.money-note:focus-visible { outline: 3px solid #ffdb89; outline-offset: 2px; }
.money-pop { position: fixed; z-index: 100; pointer-events: none; transform: translate(-50%,-50%); font-size: 22px; font-weight: 900; color: #ffe6a4; text-shadow: 0 2px 7px #162f29,0 0 15px rgba(255,235,169,.8); animation: collect-pop .8s ease-out forwards; }
@keyframes collect-pop { 0% { transform: translate(-50%,-50%) scale(.8); opacity: 0; } 20% { opacity: 1; } 100% { transform: translate(-50%,-160%) scale(1.2); opacity: 0; } }
.money-collector { position: fixed; z-index: 70; right: 10px; top: 52%; transform: translateY(-50%); width: 122px; padding: 11px 9px 12px; border: 1px solid rgba(245,214,152,.7); border-radius: 18px; background: radial-gradient(circle at 100% 0%,rgba(255,218,132,.20),transparent 67%),linear-gradient(145deg,#193b34,#102522); color: #ffefcd; box-shadow: inset 0 2px 0 rgba(255,255,255,.23),inset 0 -4px 6px rgba(0,0,0,.26),0 5px 0 #80603c,0 15px 35px rgba(7,21,18,.35); }
.collector-top { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin-bottom: 12px; }.collector-top > div { min-width: 0; }.collector-icon { display: grid; place-items: center; width: 33px; height: 33px; border-radius: 10px; background: linear-gradient(150deg,#ffebb7,#b88c43); color: #263b31; box-shadow: inset 0 1px 0 white,0 3px 0 #836233,0 6px 10px rgba(0,0,0,.2); }.collector-icon svg { width: 19px; height: 19px; }
.collector-overline { display: block; color: #f0ca82; font-size: 8px; font-weight: 900; letter-spacing: .1em; }.collector-top strong { display: block; font-size: 14px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }.collector-top small { display: block; font-size: 9px; color: #d2d8ca; }
.collector-denominations { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px 7px; }.collector-denomination { position: relative; min-width: 0; padding: 1px; }.money-mini { display: grid; place-items: center; width: 100%; height: 29px; border: 1px solid rgba(255,255,255,.73); border-radius: 4px; font-size: 11px; font-weight: 900; font-variant-numeric: tabular-nums; color: #28573d; background: linear-gradient(165deg,rgba(255,255,255,.76),transparent 47%),linear-gradient(140deg,var(--note-front,#c6eac4),var(--note-back,#6d9b76)); box-shadow: inset 0 0 0 2px rgba(28,74,58,.16),0 3px 0 rgba(8,17,15,.32),0 6px 10px rgba(0,0,0,.16); }.money-mini.money-amber { color: #86632a; }.money-mini.money-aqua { color: #286a6b; }.money-mini.money-rose { color: #884f53; }
.collector-badge { display: grid; place-items: center; position: absolute; right: -5px; top: -7px; min-width: 17px; min-height: 17px; padding: 1px 3px; border-radius: 14px; border: 1px solid #fff9e8; background: linear-gradient(150deg,#ffe8a3,#c99545); color: #382b1a; box-shadow: 0 2px 4px rgba(0,0,0,.27); font-size: 10px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.1; }.collector-badge.collector-pulse { animation: badge-pop .4s ease-out; }
@keyframes badge-pop { 0% { transform: scale(1); } 35% { transform: scale(1.65) rotate(-10deg); } 100% { transform: scale(1); } }
.draw-stage { display: flex; justify-content: center; align-items: center; gap: 32px; min-height: 195px; padding: 17px 22px 30px; margin: 0 34px 27px; border-radius: 16px; border: 1px solid rgba(241,214,156,.39); background: radial-gradient(circle at 28% 20%,rgba(247,218,153,.14),transparent 65%),linear-gradient(140deg,rgba(6,22,20,.68),rgba(16,52,46,.51)); box-shadow: inset 0 2px 7px rgba(0,0,0,.31),0 3px 0 rgba(242,201,128,.16); }
.draw-stage[hidden] { display: none; }.draw-machine { position: relative; width: 142px; height: 142px; flex: none; border-radius: 50%; background: radial-gradient(circle at 32% 20%,rgba(255,255,255,.24),rgba(203,238,231,.09) 35%,rgba(14,44,42,.66) 78%); border: 4px solid #e6c47d; box-shadow: inset 2px 3px 6px rgba(255,255,255,.25),inset -9px -12px 15px rgba(0,0,0,.27),0 5px 0 #9e793a,0 15px 20px rgba(0,0,0,.28); perspective: 220px; }.draw-ring { position: absolute; inset: 10px; border: 1px dashed rgba(250,231,188,.42); border-radius: 50%; box-shadow: inset 0 0 16px rgba(237,213,164,.2); }.draw-orbit { position: absolute; inset: 8px; animation: draw-orbit 1.6s linear infinite; }
.draw-spin-ball { position: absolute; width: 38px; height: 38px; display: grid; place-items: center; color: #3e331e; font-size: 12px; font-weight: 900; font-variant-numeric: tabular-nums; border-radius: 50%; border: 1px solid rgba(255,255,255,.9); background: radial-gradient(circle at 28% 22%,#fff,#f6dfa7 45%,#b8863f 90%); box-shadow: inset 2px 3px 4px rgba(255,255,255,.72),inset -3px -5px 7px rgba(46,39,22,.23),0 4px 0 rgba(6,22,20,.31),0 10px 14px rgba(0,0,0,.17); animation: draw-ball-tumble 1s ease-in-out infinite alternate; }
.draw-spin-ball:nth-child(1) { left: 5%; top: 5%; animation-delay: -.1s; }.draw-spin-ball:nth-child(2) { left: 55%; top: 5%; animation-delay: -.65s; }.draw-spin-ball:nth-child(3) { left: 27%; top: 34%; animation-delay: -.28s; }.draw-spin-ball:nth-child(4) { left: 5%; bottom: 6%; animation-delay: -.8s; }.draw-spin-ball:nth-child(5) { right: 5%; bottom: 5%; animation-delay: -.42s; }.draw-spin-ball:nth-child(6) { right: 3%; top: 39%; animation-delay: -.94s; }
.draw-stage-copy span { display: block; color: #ebc583; font-size: 11px; font-weight: 900; letter-spacing: .17em; }.draw-stage-copy strong { display: block; margin-top: 5px; color: #fff1cd; font-size: clamp(18px,2.4vw,26px); font-weight: 900; }
@keyframes draw-orbit { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes draw-ball-tumble { 0% { transform: translate3d(0,-8px,0) rotateY(0deg) rotateZ(-15deg); } 100% { transform: translate3d(6px,12px,0) rotateY(540deg) rotateZ(21deg); } }
.ticket-output.ticket-reveal .ticket-row { animation: ticket-arrive .75s cubic-bezier(.21,.82,.26,1.06) both; animation-delay: var(--reveal-delay,0ms); }
.ticket-output.ticket-reveal .ticket-row .ticket-ball { animation: ticket-ball-land .83s cubic-bezier(.15,.7,.23,1.05) both; animation-delay: calc(var(--reveal-delay,0ms) + 110ms); backface-visibility: hidden; }
@keyframes ticket-arrive { 0% { opacity: 0; transform: perspective(460px) translateY(-45px) rotateX(-28deg) rotateY(-75deg) scale(.75); } 55% { opacity: 1; transform: perspective(460px) translateY(9px) rotateX(9deg) rotateY(18deg) scale(1.03); } 100% { opacity: 1; transform: perspective(460px) translateY(0) rotateX(0) rotateY(0) scale(1); } }
@keyframes ticket-ball-land { 0% { opacity: .1; transform: translateY(-22px) rotateY(-540deg) scale(.54); } 70% { opacity: 1; transform: translateY(5px) rotateY(30deg) scale(1.13); } 100% { opacity: 1; transform: translateY(0) rotateY(0) scale(1); } }
@media (max-width: 820px) { .money-collector { top: auto; left: 14px; right: 14px; bottom: max(12px,env(safe-area-inset-bottom)); transform: none; width: auto; min-height: 83px; display: flex; align-items: center; gap: 16px; padding: 10px 14px; }.collector-top { flex-direction: row; align-items: center; margin: 0; flex: 0 1 160px; min-width: 100px; text-align: left; }.collector-denominations { flex: 1; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }.collector-denomination { min-width: 0; }.money-mini { height: 32px; }.back-to-top { bottom: max(116px,calc(env(safe-area-inset-bottom) + 107px)); } }
@media (max-width: 520px) { .money-note .bill-content b { font-size: 13px; }.money-collector { gap: 9px; padding: 9px 10px; min-height: 77px; }.collector-icon,.collector-overline { display: none; }.collector-top { flex: 0 1 111px; min-width: 88px; }.collector-top strong { font-size: 13px; }.collector-top small { font-size: 9px; }.collector-denominations { gap: 5px; }.money-mini { height: 29px; font-size: 10px; }.collector-badge { top: -9px; right: -4px; }.draw-stage { gap: 12px; flex-direction: column; min-height: 240px; margin-inline: 15px; padding: 18px; }.draw-stage-copy { text-align: center; }.back-to-top { bottom: max(111px,calc(env(safe-area-inset-bottom) + 104px)); } }
/* Fit the wallet into desktop side gutters without covering form controls. */
@media (min-width: 1201px) {
  .money-collector { right: 6px; top: 52%; width: 78px; padding: 9px 6px 12px; border-radius: 14px; }
  .collector-top { gap: 5px; margin-bottom: 13px; }
  .collector-icon { width: 29px; height: 29px; }
  .collector-overline { font-size: 7px; letter-spacing: .03em; }
  .collector-top strong { font-size: 11px; }
  .collector-denominations { grid-template-columns: 1fr; gap: 11px; }
  .money-mini { height: 27px; }
}
@media (min-width: 821px) and (max-width: 1200px) {
  .money-collector { top: auto; left: 14px; right: 14px; bottom: max(12px,env(safe-area-inset-bottom)); transform: none; width: auto; min-height: 83px; display: flex; align-items: center; gap: 16px; padding: 10px 14px; }
  .collector-top { flex-direction: row; align-items: center; margin: 0; flex: 0 1 160px; min-width: 100px; text-align: left; }
  .collector-denominations { flex: 1; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
  .back-to-top { bottom: max(116px,calc(env(safe-area-inset-bottom) + 107px)); }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { animation-duration: .01ms!important; transition-duration: .01ms!important; scroll-behavior: auto!important; } }
