:root {
  color-scheme: light;
  --ink: #131b2c; --muted: #647086; --line: #e3e8f0; --blue: #246cf0; --green: #087b5f; --red: #b42318;
  font-family: "Anuphan", "Noto Sans Thai", "Leelawadee UI", system-ui, sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: #f7f9fd; color: var(--ink); line-height: 1.65; }
button, input, select { font: inherit; }
a { color: inherit; }
.site-header { width: min(1160px, calc(100% - 64px)); margin: auto; min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 700; font-size: 19px; white-space: nowrap; }
.brand-mark { display: block; flex: 0 0 44px; width: 44px; height: 44px; }
.main-nav { display: flex; gap: 8px; }
.main-nav a { padding: 10px 18px; font-size: 14px; font-weight: 600; color: var(--muted); border-radius: 6px; text-decoration: none; white-space: nowrap; }
.main-nav a:hover { color: var(--blue); }
.main-nav a.active { color: var(--blue); background: #eaf1ff; }
main { width: min(1160px, calc(100% - 64px)); margin: auto; padding: 48px 0 80px; }
main:focus { outline: none; }
.hero { display: grid; grid-template-columns: 1fr; gap: 32px; }
.intro { max-width: 740px; }
.hero .intro {
  display: block;
  max-width: none;
  min-height: 340px;
  padding: 24px 46% 24px 0;
  background: url("/assets/lottery-modern.webp") right center / auto 100% no-repeat;
}
.hero .intro h1 { font-size: 38px; }
.hero .intro .hero-actions { margin-top: 22px; }
@media (max-width: 800px) {
  .hero .intro { min-height: 320px; padding-right: 40%; background-size: auto 85%; background-position: right bottom; }
  .hero .intro h1 { font-size: 32px; }
}
@media (max-width: 540px) {
  .hero .intro { min-height: 0; padding: 0 0 195px; background-size: auto 220px; background-position: right bottom; }
}
.eyebrow { margin: 0 0 12px; color: var(--blue); font-size: 14px; font-weight: 600; letter-spacing: 0; }
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: 44px; font-weight: 700; line-height: 1.35; }
h1 em { color: var(--blue); font-style: normal; }
h2 { font-size: 24px; line-height: 1.5; font-weight: 600; }
h3 { font-size: 16px; line-height: 1.6; font-weight: 600; }
.lead { margin: 12px 0 0; max-width: 640px; color: var(--muted); font-size: 17px; line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.button, .ghost-button, .icon-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 11px 20px; border: 1px solid transparent; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none; transition: background 160ms, box-shadow 160ms; }
.button { background: var(--blue); color: white; box-shadow: 0 4px 10px #246cf018; }
.button:hover { background: #1756c7; box-shadow: 0 6px 16px #246cf025; }
.ghost-button, .icon-button { background: white; color: var(--ink); border-color: var(--line); }
.ghost-button:hover, .icon-button:hover { background: #edf3ff; border-color: #bdd2f8; }
.icon-button { width: 44px; height: 44px; padding: 0; font-size: 24px; }
button:disabled { cursor: default; opacity: .45; }
:is(input, select, button, a):focus-visible { outline: 3px solid #246cf060; outline-offset: 3px; }
.latest-card { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px; padding: 28px 32px; border: 1px solid #dce5f4; border-radius: 8px; background: white; box-shadow: 0 16px 48px #314b7910; }
.latest-card > div:first-child { display: contents; }
.card-top { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.card-top .eyebrow { margin-bottom: 2px; }
.card-top h2 { font-size: 21px; }
.ticket-visual { padding: 16px 0; border-right: 1px solid var(--line); }
.ticket-visual > span { font-size: 14px; color: var(--muted); }
.first-number { display: block; color: var(--blue); font-size: 64px; font-weight: 700; line-height: 1.25; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-content: center; }
.mini-stat:last-child { grid-column: 1 / -1; }
.mini-stat span, .stat span { display: block; font-size: 14px; color: var(--muted); }
.mini-stat strong { display: block; font-size: 23px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-stat:last-child strong { color: var(--green); }
.section { margin-top: 48px; }
.latest-results { padding: 28px 32px; background: white; border: 1px solid #dce5f4; border-radius: 8px; box-shadow: 0 16px 48px #314b7910; }
.latest-heading .eyebrow { margin-bottom: 4px; }
.latest-heading h2 { font-size: 28px; font-weight: 700; }
.latest-date { margin: 4px 0 0; color: var(--blue); font-size: 18px; font-weight: 600; }
.latest-prizes { display: grid; grid-template-columns: 1.15fr 1fr 1fr .85fr; margin: 28px 0; }
.latest-prize { min-width: 0; padding: 8px 16px; text-align: center; border-left: 1px solid var(--line); }
.latest-prize:first-child { border-left: 0; }
.latest-numbers { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 16px; min-height: 54px; font-variant-numeric: tabular-nums; }
.latest-numbers strong { font-size: 30px; line-height: 1.6; font-weight: 700; }
.latest-prize-first strong { color: var(--blue); font-size: 38px; }
.latest-prize h3 { margin-top: 10px; font-size: 14px; font-weight: 500; }
.latest-prize p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.latest-all { width: 100%; }
.latest-all span { font-size: 23px; line-height: 1; }
@media (max-width: 1000px) {
  .latest-prizes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 0; }
  .latest-prize:nth-child(3) { border-left: 0; }
}
@media (max-width: 540px) {
  .latest-results { padding: 20px 16px; }
  .latest-heading h2 { font-size: 22px; }
  .latest-date { font-size: 16px; }
  .latest-prize { padding: 4px 8px; }
  .latest-numbers { gap: 0 8px; min-height: 44px; }
  .latest-numbers strong { font-size: 23px; }
  .latest-prize-first strong { font-size: 30px; }
}
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 20px; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.prize-catalog { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.catalog-item { padding: 24px 24px 24px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.catalog-item .amount { color: var(--muted); font-size: 14px; margin: 5px 0 14px; }
.catalog-item .reward { color: var(--ink); font-size: 21px; font-weight: 600; }
.catalog-item:first-child .reward { color: var(--blue); }
.source-line { margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.intro .source-line { font-size: 13px; }
.tool-shell { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 48px; align-items: start; }
.panel h1, .toolbar h1, .state-panel h1 { font-size: 32px; }
.tool-shell .panel { padding: 0; }
.result-panel { min-width: 0; padding-left: 32px; border-left: 1px solid var(--line); }
.field { display: grid; gap: 8px; margin-top: 24px; }
.scan-section { margin-top: 24px; padding-block: 20px; border-block: 1px solid var(--line); }
.scan-section h2 { font-size: 18px; margin-bottom: 12px; }
.scan-drop { position: relative; display: grid; gap: 6px; padding: 24px 16px; text-align: center; border: 1px dashed #94afe0; border-radius: 6px; background: #eef4ff; color: var(--blue); cursor: pointer; }
.scan-drop small { color: var(--muted); font-weight: 400; font-size: 13px; }
.scan-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.scan-drop:focus-within, .scan-drop.dragging { outline: 3px solid #246cf050; background: #ddeaff; }
.scan-preview { display: block; width: 100%; height: 200px; object-fit: contain; margin-top: 12px; background: #edf1f7; border-radius: 6px; }
.scan-preview[hidden] { display: none; }
#scan-button { margin-top: 12px; }
#scan-status { margin-top: 12px; font-size: 14px; overflow-wrap: anywhere; }
.scan-numbers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.scan-numbers button { font-variant-numeric: tabular-nums; font-size: 18px; }
label { font-size: 14px; font-weight: 600; }
input, select { min-width: 0; width: 100%; min-height: 50px; padding: 10px 14px; border: 1px solid #cfd8e6; border-radius: 6px; color: var(--ink); background: white; }
#ticket-number { font-size: 24px; font-variant-numeric: tabular-nums; }
input::placeholder { color: #9aa5b6; }
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.hint, .small-note, .meta { color: var(--muted); font-size: 14px; margin: 8px 0 0; line-height: 1.7; }
.result-empty { display: grid; place-items: center; min-height: 270px; padding: 24px; border-block: 1px dashed #d6deeb; color: var(--muted); text-align: center; font-size: 14px; }
.alert { padding: 16px; margin-top: 16px; border-left: 3px solid var(--red); background: #fff0ee; color: var(--red); border-radius: 4px; }
.success { border-color: var(--green); background: #eaf8f2; color: var(--green); }
.match-list { display: grid; margin-top: 16px; }
.match-item { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.match-item strong, .match-item span { display: block; }
.match-item span { color: var(--muted); font-size: 14px; }
.money { color: var(--green); font-weight: 600; }
.stats-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat { min-width: 0; }
.stat strong { display: block; margin-top: 4px; font-size: 21px; overflow-wrap: anywhere; }
.toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 20px; margin-bottom: 28px; }
.pager { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.draw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.draw-card { min-width: 0; padding: 22px; background: white; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.draw-card > div { min-width: 0; }
.draw-card .ghost-button { margin: 0; flex-shrink: 0; padding-inline: 12px; }
.draw-detail-page { margin-top: 24px; }
.draw-detail-page h1 { font-size: 32px; }
.draw-detail { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--line); }
.prize-group { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.number-cloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.number-pill { padding: 7px 12px; border-radius: 4px; background: #edf1f7; font-variant-numeric: tabular-nums; font-weight: 500; }
.state-panel { display: grid; place-items: center; min-height: 320px; padding: 24px; text-align: center; color: var(--muted); }
.loader { width: 32px; height: 32px; border: 3px solid #dde8fc; border-top-color: var(--blue); border-radius: 50%; animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1100px) {
  .intro { max-width: none; display: grid; grid-template-columns: 1fr auto; column-gap: 40px; }
  .intro .eyebrow, .intro h1, .intro .lead, .intro .source-line { grid-column: 1; }
  .intro .hero-actions { grid-column: 2; grid-row: 2 / 4; align-self: center; margin: 0; }
}
@media (max-width: 800px) {
  .site-header, main { width: calc(100% - 40px); }
  .site-header { min-height: 82px; }
  .main-nav { gap: 2px; }
  .main-nav a { padding: 10px; }
  main { padding-top: 32px; }
  h1 { font-size: 36px; }
  .tool-shell { grid-template-columns: 1fr; gap: 32px; }
  .result-panel { padding: 24px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .draw-grid, .prize-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .latest-card { gap: 20px; padding: 24px; }
  .first-number { font-size: 52px; }
}
@media (max-width: 540px) {
  .site-header { flex-wrap: wrap; gap: 16px; padding: 20px 0 12px; }
  .brand { font-size: 18px; }
  .main-nav { width: 100%; justify-content: space-between; }
  .main-nav a { flex: 1; text-align: center; }
  h1 { font-size: 32px; }
  h2 { font-size: 21px; }
  .lead { font-size: 16px; }
  .latest-card { grid-template-columns: 1fr; padding: 20px; }
  .card-top { flex-wrap: wrap; }
  .card-top h2 { font-size: 19px; }
  .card-top .ghost-button { min-height: 38px; padding: 6px 12px; }
  .ticket-visual { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px 0 20px; }
  .first-number { font-size: 56px; }
  .mini-grid { gap: 14px; }
  .mini-stat:last-child { grid-column: auto; }
  .mini-stat strong { font-size: 21px; }
  .section { margin-top: 36px; }
  .catalog-item { padding: 20px 12px 20px 0; }
  .catalog-item .reward { font-size: 18px; }
  .draw-grid { grid-template-columns: 1fr; }
  .draw-card { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px; }
  .draw-card .ghost-button { margin-top: 0; flex-shrink: 0; padding-inline: 12px; }
  .stats-row { grid-template-columns: 1fr; }
  .section-head { align-items: start; flex-wrap: wrap; }
}
.site-footer { width: min(1160px, calc(100% - 64px)); margin: 0 auto; border-top: 1px solid var(--line); padding: 26px 0; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-identity { display: flex; align-items: center; gap: 24px; }
.footer-identity span { color: var(--muted); font-size: 13px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; color: var(--muted); }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
@media (max-width: 900px) { .site-footer { flex-wrap: wrap; } }
@media (max-width: 480px) { .footer-identity { flex-wrap: wrap; gap: 8px 20px; } .site-footer nav { gap: 12px 20px; } }
.site-footer a:hover { color: #246cf0; }
.site-footer .footer-note { flex-basis: 100%; margin: 0; }
.contact-page { max-width: 840px; min-height: 55vh; padding: 20px 0; }
.contact-email { display: inline-block; font-size: 28px; font-weight: 600; color: #246cf0; margin: 20px 0 36px; overflow-wrap: anywhere; }
.contact-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; border-top: 1px solid var(--line); padding-top: 28px; }
.contact-topics h2 { font-size: 20px; }
.contact-topics p { color: var(--muted); line-height: 1.9; }
@media (max-width: 640px) { .site-footer { width: calc(100% - 40px); } .contact-topics { grid-template-columns: 1fr; gap: 12px; } .contact-email { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
