@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

:root {
  color-scheme: dark;
  --bg: #101829;
  --bg-deep: #0b1220;
  --panel: #151f31;
  --panel-light: #1a263a;
  --line: rgba(211, 224, 246, .1);
  --text: #f2f4f7;
  --muted: #a1acbd;
  --subtle: #77849a;
  --gold: #f4c970;
  --gold-light: #ffe2a1;
  --mint: #a9e7ca;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(ellipse at 80% 0%, rgba(40, 65, 101, .28), transparent 36%), var(--bg);
  color: var(--text);
  font-family: 'DM Sans', 'Noto Sans KR', sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
.site-shell { max-width: 1200px; margin: 0 auto; padding: 0 40px; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 10px; align-items: center; font-size: 16px; font-weight: 700; letter-spacing: -.035em; }
.brand-mark { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 10px; background: rgba(244, 201, 112, .14); color: var(--gold); font-size: 17px; }
.main-nav { display: flex; gap: 8px; align-items: center; }
.nav-link { padding: 10px 15px; color: var(--muted); font-size: 13px; font-weight: 600; border-radius: 9px; transition: color .2s, background .2s; }
.nav-link:hover, .nav-link.is-active { color: var(--text); background: rgba(255, 255, 255, .06); }
.nav-link.is-active { color: var(--gold-light); }
.nav-link span { margin-left: 4px; font-size: 11px; }

.hero { min-height: 490px; display: grid; grid-template-columns: 1fr .92fr; align-items: center; padding: 44px 0 30px; position: relative; }
.hero-copy { position: relative; z-index: 2; padding-bottom: 4px; }
.eyebrow { margin: 0 0 18px; color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.eyebrow-dot { display: inline-block; width: 6px; height: 6px; margin: 0 6px 1px 0; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px rgba(244, 201, 112, .65); }
h1, h2, p { margin-top: 0; }
.hero h1, .history-intro h1 { margin-bottom: 19px; font-size: clamp(36px, 4.3vw, 56px); line-height: 1.22; letter-spacing: -.055em; font-weight: 700; }
.hero h1 span, .history-intro h1 span { color: var(--gold); }
.hero-description { margin-bottom: 27px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.primary-button { min-height: 51px; padding: 0 22px; display: inline-flex; align-items: center; gap: 10px; border: 1px solid rgba(255, 226, 161, .55); border-radius: 11px; color: #2b2519; background: linear-gradient(135deg, #ffe3a5, #edbd5e); font-weight: 700; font-size: 14px; box-shadow: 0 7px 23px rgba(227, 174, 80, .19); cursor: pointer; transition: transform .18s, box-shadow .18s, opacity .18s; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(227, 174, 80, .26); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: .78; }
.button-icon { font-size: 18px; line-height: 1; }
.small-note { margin: 12px 0 0; color: var(--subtle); font-size: 11px; }

.machine-area { min-height: 400px; position: relative; display: grid; place-items: center; isolation: isolate; }
.machine-glow { position: absolute; width: 310px; height: 260px; top: 43px; left: 50%; transform: translateX(-50%); background: radial-gradient(ellipse, rgba(93, 133, 173, .2), transparent 69%); filter: blur(13px); z-index: -1; }
.machine { position: relative; width: 284px; height: 336px; margin-top: 12px; display: flex; flex-direction: column; align-items: center; filter: drop-shadow(0 23px 28px rgba(0, 0, 0, .26)); }
.machine-glass { position: relative; overflow: hidden; width: 244px; height: 238px; border: 2px solid rgba(202, 225, 246, .46); border-radius: 50%; background: radial-gradient(circle at 35% 25%, rgba(195, 224, 255, .24), rgba(69, 107, 148, .13) 39%, rgba(23, 39, 59, .6) 70%); box-shadow: inset 0 0 32px rgba(177, 217, 249, .13), inset -11px -13px 22px rgba(0, 0, 0, .18), 0 0 0 8px rgba(112, 148, 184, .08); }
.machine-glass::before { content: ''; position: absolute; width: 57px; height: 152px; left: 31px; top: 13px; transform: rotate(31deg); border-radius: 50%; background: linear-gradient(90deg, rgba(255,255,255,.16), transparent); filter: blur(5px); }
.machine-rim { position: absolute; top: 0; left: 50%; z-index: -1; width: 250px; height: 244px; border: 4px solid rgba(175, 205, 233, .28); border-radius: 50%; transform: translateX(-50%); }
.machine-ball { position: absolute; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 50%; color: #172134; font-size: 12px; font-weight: 800; box-shadow: inset -4px -5px 7px rgba(33, 35, 41, .2), inset 3px 3px 6px rgba(255,255,255,.7), 0 3px 8px rgba(0,0,0,.26); background: #f4ca65; }
.ball-a { left: 42px; top: 40px; background: #f5c95f; }.ball-b { left: 102px; top: 48px; background: #9ab5dc; }.ball-c { right: 35px; top: 79px; background: #e99091; }.ball-d { left: 62px; top: 111px; background: #b6c6da; }.ball-e { left: 133px; top: 108px; background: #9ab5dc; }.ball-f { right: 34px; top: 154px; background: #f4ca65; }.ball-g { left: 29px; top: 166px; background: #f4ca65; }.ball-h { left: 102px; top: 172px; background: #75c897; }.ball-i { right: 67px; top: 26px; background: #e99091; }
.machine-neck { width: 73px; height: 31px; margin-top: -8px; border: 2px solid rgba(186, 207, 226, .22); border-top: 0; background: linear-gradient(90deg, #465a70, #8298ab 48%, #34475c); clip-path: polygon(0 0, 100% 0, 82% 100%, 18% 100%); }
.machine-base { width: 164px; height: 47px; margin-top: -1px; display: grid; place-items: center; border: 1px solid rgba(211, 224, 246, .24); border-radius: 9px 9px 13px 13px; color: #e9c879; background: linear-gradient(110deg, #32465d, #667c8c 47%, #28384b); box-shadow: inset 0 2px 3px rgba(255,255,255,.2), 0 7px 14px rgba(0,0,0,.25); font-size: 9px; letter-spacing: .19em; font-weight: 700; }
.machine-foot { width: 126px; height: 11px; border-radius: 0 0 10px 10px; background: linear-gradient(90deg, #27384b, #66798a, #26374a); }
.machine-caption { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; text-align: center; color: var(--subtle); font-size: 11px; letter-spacing: .05em; }
.spark { position: absolute; color: rgba(246, 211, 138, .72); animation: twinkle 2.8s ease-in-out infinite; }.spark-one { right: 13%; top: 70px; font-size: 18px; }.spark-two { left: 13%; top: 135px; font-size: 23px; animation-delay: .6s; }.spark-three { right: 20%; bottom: 58px; font-size: 12px; animation-delay: 1.3s; }
.machine.is-spinning { animation: machine-rumble .17s ease-in-out infinite; }
.machine.is-spinning .machine-glass { animation: tumble .42s ease-in-out infinite; box-shadow: inset 0 0 42px rgba(190, 225, 255, .2), inset -11px -13px 22px rgba(0,0,0,.18), 0 0 27px rgba(122, 180, 229, .22); }
.machine.is-spinning .machine-glass::after { content: ''; position: absolute; inset: 12%; border: 1px solid rgba(227, 239, 255, .22); border-radius: 50%; background: conic-gradient(from 0deg, transparent, rgba(255,255,255,.07), transparent 34%, rgba(150,209,255,.08), transparent 68%); animation: chamber-current .9s linear infinite; }
.machine.is-spinning .machine-ball { animation: ball-flight .62s cubic-bezier(.42,0,.58,1) infinite alternate; }
.machine.is-spinning .ball-a { --flight-x: 32px; --flight-y: 22px; animation-delay: -.13s; }
.machine.is-spinning .ball-b { --flight-x: -24px; --flight-y: 34px; animation-delay: -.41s; }
.machine.is-spinning .ball-c { --flight-x: -37px; --flight-y: 20px; animation-delay: -.27s; }
.machine.is-spinning .ball-d { --flight-x: 26px; --flight-y: -29px; animation-delay: -.55s; }
.machine.is-spinning .ball-e { --flight-x: -32px; --flight-y: -22px; animation-delay: -.08s; }
.machine.is-spinning .ball-f { --flight-x: -18px; --flight-y: -34px; animation-delay: -.36s; }
.machine.is-spinning .ball-g { --flight-x: 35px; --flight-y: -25px; animation-delay: -.21s; }
.machine.is-spinning .ball-h { --flight-x: 22px; --flight-y: 26px; animation-delay: -.48s; }
.machine.is-spinning .ball-i { --flight-x: -27px; --flight-y: 33px; animation-delay: -.31s; }
.machine-area.is-drawing .machine-glow { animation: glow-pulse .7s ease-in-out infinite alternate; }
@keyframes machine-rumble { 0%,100% { transform: translateX(0) rotate(0); } 25% { transform: translateX(-2px) rotate(-.35deg); } 75% { transform: translateX(2px) rotate(.35deg); } }
@keyframes tumble { 0%,100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.035); } }
@keyframes ball-flight { from { transform: translate3d(0,0,0) rotate(0) scale(.94); } to { transform: translate3d(var(--flight-x),var(--flight-y),0) rotate(170deg) scale(1.08); } }
@keyframes chamber-current { to { transform: rotate(360deg); } }
@keyframes glow-pulse { from { opacity: .55; transform: translateX(-50%) scale(.92); } to { opacity: 1; transform: translateX(-50%) scale(1.1); } }
@keyframes twinkle { 0%,100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.12); } }

.results-section, .log-section { padding: 31px 0 38px; border-top: 1px solid var(--line); }
.section-heading, .archive-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 19px; }
.section-heading .eyebrow, .archive-heading .eyebrow { margin-bottom: 8px; }
.section-heading h2, .archive-heading h2 { margin-bottom: 0; font-size: 21px; letter-spacing: -.04em; }
.heading-count { margin-left: 7px; color: var(--subtle); font-size: 11px; font-weight: 500; letter-spacing: 0; vertical-align: middle; }
.section-hint { margin: 0 0 3px; color: var(--subtle); font-size: 11px; }
.results-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; }
.empty-result, .empty-log { min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed rgba(211, 224, 246, .14); border-radius: 13px; color: var(--subtle); font-size: 12px; text-align: center; }
.empty-result { grid-column: 1 / -1; min-height: 132px; }
.empty-result p, .empty-log p { margin: 0; line-height: 1.75; }
.empty-icon { color: rgba(244, 201, 112, .63); font-size: 20px; }
.result-card { min-height: 113px; padding: 14px 13px; border: 1px solid var(--line); border-radius: 13px; background: linear-gradient(145deg, rgba(28, 42, 63, .89), rgba(20, 31, 48, .85)); animation: card-in .38s both; animation-delay: var(--card-delay, 0ms); }
.result-card-label { margin: 0 0 12px; color: var(--subtle); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.number-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; }
.lotto-ball { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 50%; color: #182030; font-size: 11px; font-weight: 800; box-shadow: inset -2px -3px 4px rgba(0,0,0,.13), inset 2px 2px 4px rgba(255,255,255,.43); }
.lotto-ball.is-revealing { opacity: 0; animation: ball-release .5s cubic-bezier(.18,.85,.35,1.35) both; animation-delay: var(--ball-delay, 0ms); }
.ball-range-1 { background: #f6cc64; }.ball-range-2 { background: #8db7e4; }.ball-range-3 { background: #ef9295; }.ball-range-4 { background: #d6dbe0; }.ball-range-5 { background: #84cf9e; }
@keyframes card-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ball-release { 0% { opacity: 0; transform: translateY(-20px) scale(.45) rotate(-40deg); } 65% { opacity: 1; transform: translateY(3px) scale(1.12) rotate(8deg); } 100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); } }
.log-section { padding-bottom: 25px; }
.log-heading { margin-bottom: 15px; }
.text-button { padding: 7px 0; border: 0; color: var(--subtle); background: transparent; font-size: 11px; cursor: pointer; }.text-button:hover { color: #f0a0a0; }
.log-list { display: grid; gap: 10px; }
.empty-log { min-height: 108px; }
.log-entry { padding: 14px 16px 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(21, 31, 49, .62); }
.log-entry-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.log-entry-title { margin: 0; color: #e8ecf2; font-size: 12px; font-weight: 600; }.log-entry-date { margin-left: 8px; color: var(--subtle); font-size: 10px; font-weight: 400; }
.log-games { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }.log-game { min-width: 0; }.log-game-label { display: block; margin-bottom: 7px; color: var(--subtle); font-size: 9px; }.log-game .number-row { gap: 3px; }.log-game .lotto-ball { width: 24px; height: 24px; flex-basis: 24px; font-size: 9px; }
.privacy-note { margin: 13px 0 0; color: var(--subtle); font-size: 10px; }.privacy-note span { margin-right: 5px; color: var(--mint); }
.site-footer { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 10px; }
.footer-brand { color: #cbd3df; font-size: 11px; font-weight: 600; }.site-footer > a:last-child { color: var(--gold); }.site-footer > a:last-child span { margin-left: 4px; }

/* Archive page */
.history-main { display: grid; grid-template-columns: 255px 1fr; gap: 50px; padding: 52px 0 60px; align-items: start; min-height: calc(100vh - 154px); }
.history-intro { position: sticky; top: 30px; padding-top: 10px; }.history-intro h1 { font-size: 43px; }.history-intro > p:not(.eyebrow) { color: var(--muted); font-size: 13px; line-height: 1.85; }
.official-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 20px; color: var(--gold); font-size: 11px; line-height: 1.6; }.official-link:hover { color: var(--gold-light); }
.archive-panel { min-width: 0; padding: 23px 22px 18px; border: 1px solid var(--line); border-radius: 16px; background: rgba(18, 28, 44, .65); }
.archive-heading { align-items: center; margin-bottom: 11px; }.archive-heading h2 { font-size: 19px; }.search-box { height: 37px; width: 168px; padding: 0 10px; display: flex; align-items: center; gap: 7px; border: 1px solid rgba(211, 224, 246, .12); border-radius: 8px; color: var(--subtle); background: rgba(6, 13, 24, .33); }.search-icon { font-size: 18px; transform: rotate(-20deg); }.search-box input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 11px; }.search-box input::placeholder { color: #7f8a9b; }
.archive-help { margin-bottom: 17px; color: var(--subtle); font-size: 10px; }.archive-list { display: grid; gap: 8px; }.archive-item { padding: 12px 13px; display: grid; grid-template-columns: 77px 1fr; align-items: center; gap: 13px; border: 1px solid rgba(211, 224, 246, .075); border-radius: 10px; background: rgba(255, 255, 255, .025); }.archive-round { color: #ecf0f6; font-size: 12px; font-weight: 700; }.archive-date { display: block; margin-top: 4px; color: var(--subtle); font-size: 9px; font-weight: 400; }.archive-item .number-row { gap: 5px; }.archive-item .lotto-ball { width: 27px; height: 27px; flex-basis: 27px; font-size: 10px; }.bonus-divider { width: 1px; height: 20px; margin: 0 3px; background: rgba(211, 224, 246, .16); }.bonus-label { color: var(--subtle); font-size: 9px; }
.no-matches { padding: 35px 12px; color: var(--muted); text-align: center; font-size: 12px; }.data-note { margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 9px; line-height: 1.8; }.data-note a { color: #c5d5e9; text-decoration: underline; text-underline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* Frequency model summary */
.stats-section { padding: 30px 0 34px; border-top: 1px solid var(--line); }
.frequency-recommendation { min-height: 78px; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px; border: 1px solid var(--line); border-radius: 11px; background: rgba(21, 31, 49, .62); }
.frequency-recommendation .number-row { gap: 9px; }
.frequency-recommendation .lotto-ball { width: 38px; height: 38px; flex-basis: 38px; font-size: 13px; }
.frequency-pick-caption { color: var(--subtle); font-size: 10px; }
.model-note { margin: 13px 0 0; color: var(--subtle); font-size: 10px; line-height: 1.8; }

/* QR scanner page */
.qr-main { min-height: calc(100vh - 154px); padding: 48px 0 58px; }
.qr-intro { margin-bottom: 27px; }
.qr-intro h1 { margin-bottom: 12px; font-size: clamp(35px, 4.2vw, 49px); line-height: 1.2; letter-spacing: -.055em; }
.qr-intro h1 span { color: var(--gold); }
.qr-intro > p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.8; }
.qr-layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr); gap: 17px; align-items: stretch; }
.qr-card { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: rgba(21, 31, 49, .72); }
.scanner-card { display: flex; flex-direction: column; align-items: stretch; }
.scanner-placeholder, .video-frame { width: min(100%, 500px); aspect-ratio: 4 / 3; margin: 0 auto 18px; border: 1px solid rgba(211, 224, 246, .13); border-radius: 12px; background: radial-gradient(ellipse at 50% 42%, rgba(53, 80, 113, .4), rgba(9, 16, 28, .78) 72%); }
.scanner-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 11px; color: var(--subtle); font-size: 11px; text-align: center; }
.qr-placeholder-icon { color: rgba(244, 201, 112, .8); font-size: 52px; line-height: 1; text-shadow: 0 0 28px rgba(244, 201, 112, .25); }
.video-frame { position: relative; overflow: hidden; background: #060a12; }
.video-frame video { width: 100%; height: 100%; object-fit: cover; }
.scan-overlay { position: absolute; inset: 15%; border: 1px solid rgba(244, 201, 112, .75); border-radius: 8px; box-shadow: 0 0 0 1000px rgba(3, 8, 16, .28), 0 0 28px rgba(244, 201, 112, .17); pointer-events: none; }
.scan-overlay i { position: absolute; width: 17px; height: 17px; border-color: #ffe2a1; border-style: solid; }
.scan-overlay i:nth-of-type(1) { top: -2px; left: -2px; border-width: 2px 0 0 2px; border-radius: 5px 0 0; }
.scan-overlay i:nth-of-type(2) { top: -2px; right: -2px; border-width: 2px 2px 0 0; border-radius: 0 5px 0 0; }
.scan-overlay i:nth-of-type(3) { bottom: -2px; left: -2px; border-width: 0 0 2px 2px; border-radius: 0 0 0 5px; }
.scan-overlay i:nth-of-type(4) { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; border-radius: 0 0 5px; }
.scan-line { position: absolute; left: 2%; right: 2%; top: 4%; height: 2px; background: linear-gradient(90deg, transparent, #b8f5d2, #fff, #b8f5d2, transparent); box-shadow: 0 0 12px rgba(169, 231, 202, .8); animation: scan-sweep 1.65s ease-in-out infinite alternate; }
@keyframes scan-sweep { to { top: calc(96% - 2px); } }
.scanner-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.scanner-actions .primary-button { min-height: 44px; padding: 0 16px; font-size: 12px; }
.secondary-button { min-height: 39px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(211, 224, 246, .16); border-radius: 9px; color: #dce4ef; background: rgba(255, 255, 255, .045); font-size: 11px; font-weight: 600; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.secondary-button:hover { transform: translateY(-1px); border-color: rgba(244, 201, 112, .5); background: rgba(244, 201, 112, .08); }
.secondary-button:disabled { cursor: wait; opacity: .65; }
.file-button { user-select: none; }
.scanner-status { min-height: 31px; margin: 11px 0 5px; color: var(--muted); font-size: 10px; line-height: 1.7; }
.scanner-status.is-success { color: var(--mint); }
.scanner-status.is-error { color: #f1a4a6; }
.paste-details { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.paste-details summary { color: var(--muted); font-size: 10px; cursor: pointer; }
.paste-form { margin-top: 11px; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.paste-form input { min-width: 0; height: 39px; padding: 0 10px; border: 1px solid rgba(211, 224, 246, .13); border-radius: 8px; outline: none; color: var(--text); background: rgba(6, 13, 24, .4); font-size: 10px; }
.paste-form input:focus { border-color: rgba(244, 201, 112, .58); }
.privacy-card .eyebrow { margin-bottom: 15px; color: var(--gold); }
.qr-steps { margin: 0; padding: 0; display: grid; gap: 19px; list-style: none; }
.qr-steps li { display: flex; gap: 11px; align-items: flex-start; }
.qr-steps li > span { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border: 1px solid rgba(244, 201, 112, .25); border-radius: 8px; color: var(--gold); background: rgba(244, 201, 112, .08); font-size: 10px; font-weight: 700; }
.qr-steps p { margin: 1px 0 0; color: var(--muted); font-size: 10px; line-height: 1.75; }
.qr-steps strong { color: #e9edf4; font-size: 11px; }
.privacy-callout { margin: 23px 0 0; padding: 12px; border: 1px solid rgba(169, 231, 202, .1); border-radius: 9px; color: var(--subtle); background: rgba(169, 231, 202, .035); font-size: 9px; line-height: 1.8; }
.privacy-callout span { margin-right: 5px; color: var(--mint); }
.privacy-card .official-link { margin-top: 16px; }
.ticket-result { padding: 27px 0 40px; scroll-margin-top: 18px; }
.ticket-result .section-heading { align-items: center; }
.official-check-button { white-space: nowrap; }
.ticket-result-note { margin: 0 0 14px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.ticket-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.ticket-game { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(21, 31, 49, .62); }
.ticket-game-heading { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--subtle); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.rank-badge { padding: 5px 8px; border-radius: 999px; color: #dce4ef; background: rgba(255,255,255,.08); font-size: 9px; letter-spacing: 0; }
.rank-badge.is-rank-1, .rank-badge.is-rank-2 { color: #382713; background: linear-gradient(135deg, #ffe3a5, #edbd5e); }
.rank-badge.is-rank-3 { color: #14271d; background: #a9e7ca; }
.rank-badge.is-rank-4 { color: #182030; background: #d6dbe0; }
.rank-badge.is-rank-5 { color: #17263a; background: #8db7e4; }
.rank-badge.is-no-win { color: #c3ccda; background: rgba(255,255,255,.08); }
.rank-badge.is-unknown { color: #ffe2a1; background: rgba(244,201,112,.12); }
.ticket-game .number-row { gap: 5px; }
.ticket-game-detail { margin: 9px 0 0; color: var(--subtle); font-size: 9px; }
.ticket-disclaimer { margin: 13px 0 0; color: var(--subtle); font-size: 9px; line-height: 1.8; }

@media (max-width: 850px) {
  .site-shell { padding: 0 25px; }
  .hero { grid-template-columns: 1fr .8fr; min-height: 430px; }
  .machine { transform: scale(.87); }.machine-area { margin-left: -20px; }
  .results-grid { grid-template-columns: repeat(3, 1fr); }
  .history-main { grid-template-columns: 205px 1fr; gap: 25px; }
  .history-intro h1 { font-size: 36px; }
}
@media (max-width: 620px) {
  .site-shell { padding: 0 18px; }
  .topbar { height: 68px; }.brand { font-size: 14px; }.brand-mark { width: 26px; height: 26px; }.main-nav { gap: 0; }.nav-link { padding: 9px 9px; font-size: 11px; }
  .hero { grid-template-columns: 1fr; padding-top: 39px; padding-bottom: 21px; }.hero-copy { text-align: center; }.hero h1 { font-size: 39px; }.hero-description { font-size: 13px; }.desktop-break { display: none; }.small-note { font-size: 10px; }
  .machine-area { min-height: 335px; margin: -1px 0 0; transform: scale(.87); transform-origin: top center; }.machine { margin-top: 0; }.machine-caption { bottom: 6px; }.spark-one { right: 12%; top: 51px; }.spark-two { left: 10%; top: 118px; }
  .results-section, .log-section { padding-top: 25px; }.section-heading h2 { font-size: 19px; }.section-hint { font-size: 10px; }
  .results-grid { grid-template-columns: 1fr 1fr; gap: 8px; }.result-card { padding: 12px 10px; min-height: 100px; }.lotto-ball { width: 28px; height: 28px; flex-basis: 28px; font-size: 10px; }.number-row { gap: 4px; }
  .log-games { grid-template-columns: 1fr; gap: 10px; }.log-game { display: flex; align-items: center; justify-content: space-between; gap: 9px; }.log-game-label { width: 38px; flex: 0 0 38px; margin: 0; }.log-game .number-row { gap: 4px; }.log-game .lotto-ball { width: 25px; height: 25px; flex-basis: 25px; }
  .site-footer { padding: 14px 0; flex-wrap: wrap; row-gap: 8px; }.site-footer > span { order: 3; width: 100%; }.site-footer > a:last-child { font-size: 9px; }
  .history-main { display: block; padding: 35px 0 40px; }.history-intro { position: static; padding: 0 0 25px; }.history-intro h1 { margin-bottom: 12px; font-size: 36px; }.history-intro > p:not(.eyebrow) { margin-bottom: 7px; }.official-link { margin-top: 7px; }.archive-panel { padding: 17px 12px 14px; }.archive-heading { align-items: flex-start; flex-direction: column; gap: 14px; }.archive-heading h2 { font-size: 18px; }.search-box { width: 100%; }.archive-help { line-height: 1.6; }.archive-item { grid-template-columns: 62px 1fr; gap: 8px; padding: 10px 8px; }.archive-item .number-row { gap: 3px; }.archive-item .lotto-ball { width: 24px; height: 24px; flex-basis: 24px; font-size: 9px; }.bonus-label { display: none; }.bonus-divider { margin: 0 1px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (max-width: 850px) {
  .qr-layout { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { gap: 4px; }
  .brand { flex: 0 0 auto; gap: 6px; font-size: 12px; }
  .brand-mark { width: 24px; height: 24px; }
  .main-nav { flex: 1 1 auto; justify-content: flex-end; }
  .nav-link { padding: 7px 4px; font-size: 9px; white-space: nowrap; }
  .frequency-recommendation { padding: 12px 10px; gap: 8px; }
  .frequency-recommendation .number-row { gap: 5px; }
  .frequency-recommendation .lotto-ball { width: 30px; height: 30px; flex-basis: 30px; font-size: 10px; }
  .frequency-pick-caption { width: 100%; }
  .qr-main { padding: 34px 0 42px; }
  .qr-intro h1 { font-size: 35px; }
  .qr-card { padding: 16px; }
  .scanner-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .scanner-actions .primary-button { grid-column: 1 / -1; justify-content: center; }
  .scanner-actions .secondary-button, .file-button { min-height: 42px; }
  .ticket-result .section-heading { align-items: flex-start; flex-direction: column; }
  .ticket-games { grid-template-columns: 1fr; }
  .ticket-game .lotto-ball { width: 29px; height: 29px; flex-basis: 29px; }
  .site-footer > a:nth-last-child(2) { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .scan-line { animation: none; }
}
