/* self-hosted fonts (SIL OFL): one origin, no render-blocking third-party CSS */
@font-face { font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/noto-thai.woff2) format('woff2'); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Noto Sans Thai'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(fonts/noto-latin.woff2) format('woff2'); 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; }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(fonts/grotesk-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
/* สถิติเลขทอง — themes: copper (default) / navy, each with dark (default) and light mode */
:root, [data-theme="copper"] {
  --bg: #1a0709; --bg2: #220a0d; --surface: #2c0d11; --surface2: #3b1318; --surface3: #4a1a20;
  --line: rgba(255, 206, 140, .14); --line2: rgba(255, 206, 140, .28);
  --text: #f8ecdc; --muted: #cfae95; --faint: #9c7d69;
  --gold: #f4c55a; --gold2: #d4932a; --gold-ink: #3a1a05;
  --accent: #e0483a; --accent-soft: rgba(224, 72, 58, .16);
  --ok: #3ddc84; --ok-soft: rgba(61, 220, 132, .16); --warn: #ffb547;
  --hero: radial-gradient(120% 140% at 100% 0%, #6a1d22 0%, #3b1117 45%, #2a0b0f 100%);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
[data-theme="navy"] {
  --bg: #070b18; --bg2: #0a1022; --surface: #0f1730; --surface2: #16213f; --surface3: #1d2b52;
  --line: rgba(160, 190, 255, .14); --line2: rgba(160, 190, 255, .28);
  --text: #eaf0ff; --muted: #a8b6d8; --faint: #7383a8;
  --accent: #4f7cff; --accent-soft: rgba(79, 124, 255, .16);
  --hero: radial-gradient(120% 140% at 100% 0%, #233a7a 0%, #142350 45%, #0d1733 100%);
}
[data-mode="light"] {
  --bg: #f7f1e8; --bg2: #efe6d8; --surface: #ffffff; --surface2: #faf4ea; --surface3: #f1e6d4;
  --line: rgba(80, 40, 10, .12); --line2: rgba(80, 40, 10, .24);
  --text: #2b170d; --muted: #6f5646; --faint: #9a8576;
  --gold: #e4ad3a; --gold2: #b97a16;
  --hero: linear-gradient(135deg, #fff7e8 0%, #fde9cf 100%);
  --shadow: 0 8px 24px rgba(80, 40, 10, .10);
}
[data-mode="light"][data-theme="navy"] {
  --bg: #eef2fb; --bg2: #e3e9f7; --surface2: #f4f7fd; --surface3: #e5ecfa;
  --line: rgba(20, 40, 90, .12); --line2: rgba(20, 40, 90, .24);
  --text: #111a33; --muted: #4c5a7c; --faint: #7d89a6;
  --hero: linear-gradient(135deg, #f3f6ff 0%, #dfe8ff 100%);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 'Noto Sans Thai', system-ui, sans-serif;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.num, .ball, .mono { font-family: 'Space Grotesk', 'Noto Sans Thai', sans-serif; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.hide { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: 60px;
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; white-space: nowrap; }
.brand img { width: 34px; height: 34px; }
.brand b { color: var(--gold); }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.on { color: var(--gold); background: var(--surface); }
.tools { display: flex; align-items: center; gap: 8px; }
.iconbtn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.iconbtn:hover { color: var(--gold); border-color: var(--line2); }
.iconbtn svg { width: 18px; height: 18px; }
.announce { background: linear-gradient(90deg, var(--gold2), var(--gold)); color: var(--gold-ink); text-align: center; font-weight: 600; padding: 6px 16px; font-size: 14px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 20px; max-width: 1320px; margin: 0 auto; padding: 18px 20px 40px; }
.layout.wide { grid-template-columns: minmax(0, 1fr); max-width: 1100px; }
.side {
  position: sticky; top: 78px; align-self: start; max-height: calc(100vh - 96px); overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 12px;
  scrollbar-width: thin;
}
.search { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg2); outline: none; }
.search:focus { border-color: var(--gold2); }
.seg { display: flex; gap: 6px; margin: 10px 0; }
.seg button { flex: 1; padding: 7px 0; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.grp { margin: 14px 4px 6px; font-size: 12px; color: var(--faint); font-weight: 600; letter-spacing: .02em; }
.mlink { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; color: var(--muted); font-size: 14px; }
.mlink:hover { background: var(--surface2); color: var(--text); }
.mlink.on { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.mlink .cnt { margin-left: auto; font-size: 12px; color: var(--faint); }
.flag { width: 22px; text-align: center; }

.crumbs { font-size: 13px; color: var(--faint); margin-bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--gold); }
.datehead { float: right; color: var(--faint); font-size: 13px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 18px; }
.card h2, .card h3 { margin: 0 0 4px; font-size: 19px; }
.card .sub { color: var(--muted); font-size: 14px; margin: 0 0 14px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.more { color: var(--gold); font-size: 14px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line2); color: var(--gold); font-weight: 600; font-size: 13px; background: color-mix(in srgb, var(--gold) 8%, transparent); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--surface3); color: var(--muted); }
.tag.live { background: var(--ok-soft); color: var(--ok); }
.tag.house { background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }

/* hero */
.hero { background: var(--hero); border: 1px solid var(--line2); border-radius: 22px; padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--gold) 22%, transparent), transparent 70%); pointer-events: none; }
.hero-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hero h1 { margin: 0; font-size: 30px; line-height: 1.2; }
.hero .code { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 28px; background: color-mix(in srgb, var(--gold) 14%, transparent); border: 1px solid var(--line2); }
.hero .meta { color: var(--muted); font-size: 14px; }
.hero .next { margin-left: auto; }
.summary { margin: 16px 0; padding: 12px 16px; border-left: 3px solid var(--gold); background: color-mix(in srgb, var(--bg) 35%, transparent); border-radius: 0 12px 12px 0; color: var(--text); font-size: 14.5px; }
.clock { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--bg) 45%, transparent); border: 1px solid var(--line); flex-wrap: wrap; }
.clock .when b { color: var(--gold); }
.cd { display: flex; gap: 8px; }
.cd div { min-width: 58px; text-align: center; padding: 6px 4px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); }
.cd b { display: block; font: 700 24px/1.1 'Space Grotesk', sans-serif; color: var(--gold); }
.cd span { font-size: 11px; color: var(--faint); }

.sets { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.set { padding: 14px; border-radius: 16px; border: 1px solid var(--line2); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.set.main { border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.set-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.row > .lbl { width: 42px; color: var(--muted); font-size: 13px; }
.ball {
  min-width: 54px; height: 54px; padding: 0 10px; border-radius: 14px; display: inline-grid; place-items: center;
  font-size: 24px; font-weight: 700; color: var(--gold-ink);
  background: linear-gradient(160deg, #ffe7a3 0%, var(--gold) 45%, var(--gold2) 100%);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .18), 0 4px 12px rgba(0, 0, 0, .25);
}
.ball.sm { min-width: 40px; height: 40px; font-size: 18px; border-radius: 11px; }
.ball.xs { min-width: 34px; height: 30px; font-size: 15px; border-radius: 8px; padding: 0 7px; }
.ball.ghost { background: var(--surface2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.ball.hit { background: linear-gradient(160deg, #b8ffd6, var(--ok)); color: #053019; }
.ball.dim { opacity: .55; }
.recline { font-size: 13px; color: var(--muted); margin-top: 6px; }
.recline b { color: var(--text); }
.share { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 11px; border: 1px solid var(--line2); background: var(--surface2); font-weight: 600; font-size: 14px; }
.btn:hover { border-color: var(--gold2); color: var(--gold); }
.btn.gold { background: linear-gradient(160deg, var(--gold), var(--gold2)); color: var(--gold-ink); border: 0; }
.btn:disabled { opacity: .5; cursor: default; }

/* tabs */
.tabs { position: sticky; top: 60px; z-index: 20; display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; margin-bottom: 8px; background: var(--bg); scrollbar-width: none; }
.tabs a { white-space: nowrap; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: 14px; }
.tabs a.on, .tabs a:hover { color: var(--gold-ink); background: var(--gold); border-color: var(--gold); }

/* formula grid */
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.fcard { border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--surface2); display: flex; flex-direction: column; gap: 6px; }
.fcard h4 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.fcard .style { color: var(--muted); font-size: 13px; min-height: 40px; }
.acc { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; color: var(--muted); }
.acc b { font: 700 20px 'Space Grotesk', sans-serif; color: var(--gold); }
.bar { height: 6px; border-radius: 6px; background: var(--surface3); position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--gold2), var(--gold)); border-radius: 6px; }
.bar u { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: .6; }
.beat { color: var(--ok); font-weight: 700; }
.below { color: var(--faint); }

/* consensus */
.cons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); font-size: 13px; }
.chip b { font: 700 17px 'Space Grotesk', sans-serif; color: var(--gold); }
.bands { display: flex; height: 30px; border-radius: 10px; overflow: hidden; margin: 8px 0 4px; }
.bands div { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--gold-ink); }
.bands div:nth-child(1) { background: #ffe39a; } .bands div:nth-child(2) { background: var(--gold); } .bands div:nth-child(3) { background: var(--gold2); }
.legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; color: var(--faint); font-size: 12.5px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: var(--surface2); }
.tbl .r { text-align: right; }
.rank { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; background: var(--surface3); font-weight: 700; }
.rank.r1 { background: linear-gradient(160deg, #ffe7a3, var(--gold)); color: var(--gold-ink); }
.rank.r2 { background: #d9dde6; color: #222; } .rank.r3 { background: #e0a46b; color: #2a1405; }
.tblwrap { overflow-x: auto; }
.expand td { background: var(--bg2); }
.picklist { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; padding: 6px 0; }
.pickrow { padding: 8px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; }
.pickrow .nm { display: flex; justify-content: space-between; margin-bottom: 4px; }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; font-size: 13px; }
.board div { padding: 6px 8px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.board b { display: block; color: var(--gold); font: 700 16px 'Space Grotesk', sans-serif; }
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.toggle button { padding: 6px 14px; border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 13px; }
.toggle button.on { background: var(--gold); color: var(--gold-ink); }

/* stats */
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.stat-list div { text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); }
.stat-list b { display: block; font: 700 20px 'Space Grotesk', sans-serif; color: var(--gold); }
.stat-list span { font-size: 11.5px; color: var(--faint); }
.heat { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.heat div { aspect-ratio: 1.3; border-radius: 6px; display: grid; place-items: center; font: 600 12px 'Space Grotesk', sans-serif; border: 1px solid var(--line); }
.digits { display: grid; grid-template-columns: 70px repeat(10, 1fr); gap: 4px; font-size: 12px; align-items: center; }
.digits div { text-align: center; padding: 4px 0; border-radius: 6px; }
.digits .h { color: var(--faint); }
.meter { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--surface3); margin: 6px 0 2px; }
.meter i { background: var(--gold); } .meter i + i { background: var(--accent); }

/* lucky */
.lucky { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.why { font-size: 12.5px; color: var(--muted); }
.signs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sign { padding: 14px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); }
.sign h4 { margin: 0 0 4px; display: flex; justify-content: space-between; }
.stars { color: var(--gold); letter-spacing: 2px; }

/* results page */
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.rcard { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: block; }
.rcard:hover { border-color: var(--gold2); }
.rcard h4 { margin: 0; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.rcard .d { font-size: 12.5px; color: var(--faint); margin: 2px 0 10px; }
.rnums { display: flex; gap: 14px; }
.rnums small { display: block; font-size: 11.5px; color: var(--faint); }
.rnums b { font: 700 24px 'Space Grotesk', sans-serif; color: var(--gold); letter-spacing: 1px; }
.rprev { margin-top: 8px; font-size: 12.5px; color: var(--faint); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 600; }
.input, textarea.input, select.input { padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--bg2); outline: none; width: 100%; }
.input:focus { border-color: var(--gold2); }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); font-size: 14px; }
.notice.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: var(--ok-soft); }
.notice.err { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.win { color: var(--ok); font-weight: 700; }

.prose { max-width: 760px; }
.prose h2 { font-size: 20px; margin: 22px 0 6px; color: var(--gold); }
.prose p, .prose li { color: var(--text); }
.disclaimer { font-size: 13px; color: var(--faint); text-align: center; margin: 20px auto 0; max-width: 760px; }
.foot { border-top: 1px solid var(--line); padding: 24px 20px 90px; text-align: center; font-size: 13px; color: var(--faint); }
.foot a { color: var(--muted); } .foot a:hover { color: var(--gold); }
.foot .mk { max-width: 1100px; margin: 10px auto; line-height: 2; }
.skeleton { height: 120px; border-radius: 16px; background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.empty { padding: 30px; text-align: center; color: var(--faint); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; z-index: 99; box-shadow: var(--shadow); }

/* mobile */
.bottom { display: none; }
.pickbtn { display: none; }
.drawer-bg { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 50; }
@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 12px 12px 30px; }
  .side { display: none; }
  .side.open { display: block; position: fixed; z-index: 60; inset: auto 0 0 0; top: 12vh; max-height: none; border-radius: 20px 20px 0 0; padding-bottom: 30px; }
  .nav { display: none; }
  .tools { margin-left: auto; }
  .pickbtn { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 12px 14px; margin-bottom: 12px; border-radius: 14px; border: 1px solid var(--line2); background: var(--surface); font-weight: 600; }
  .bottom {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--muted); padding: 4px 0; }
  .bottom a.on { color: var(--gold); }
  .bottom svg { width: 22px; height: 22px; }
  .hero { padding: 18px; border-radius: 18px; }
  .hero h1 { font-size: 24px; }
  .hero .next { margin-left: 0; }
  .sets, .cons, .sgrid, .lucky { grid-template-columns: 1fr; }
  .ball { min-width: 48px; height: 48px; font-size: 21px; }
  .cd div { min-width: 48px; }
  .cd b { font-size: 20px; }
  .card { padding: 16px; border-radius: 16px; }
  .top { padding: 0 12px; }
  .tabs { top: 60px; }
  .datehead { display: none; }
  .hide-sm { display: none; }
}
@media (max-width: 420px) {
  .brand span { font-size: 16px; }
  .ball { min-width: 44px; height: 44px; font-size: 19px; padding: 0 7px; }
  .row > .lbl { width: 34px; }
}
.ssr { max-width: 900px; margin: 0 auto; padding: 20px; }
.fl { display: inline-block; vertical-align: -2px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); }
.fl.big { width: 36px; height: 24px; border-radius: 4px; }
/* light mode: gold used as text needs the darker shade for contrast */
[data-mode="light"] .cd b, [data-mode="light"] .pill, [data-mode="light"] .more, [data-mode="light"] .acc b,
[data-mode="light"] .stat-list b, [data-mode="light"] .rnums b, [data-mode="light"] .brand b, [data-mode="light"] .prose h2,
[data-mode="light"] .board b, [data-mode="light"] .chip b, [data-mode="light"] .clock .when b, [data-mode="light"] .stars,
[data-mode="light"] .nav a.on, [data-mode="light"] .bottom a.on, [data-mode="light"] .tag.house { color: #9a640c; }
[data-mode="light"] .tabs a.on, [data-mode="light"] .tabs a:hover { color: #2a1405; }

/* ---------- round 2: engagement + SEO blocks ---------- */
a.ball { text-decoration: none; transition: transform .12s; }
a.ball:hover { transform: translateY(-2px); }
.ball.fav { outline: 2px solid var(--gold); outline-offset: 1px; }
.ticker { display: flex; align-items: center; height: 34px; background: var(--bg2); border-bottom: 1px solid var(--line); font-size: 13px; overflow: hidden; }
.tk-h { flex: none; padding: 0 12px; height: 100%; display: flex; align-items: center; background: var(--accent); color: #fff; font-weight: 700; }
.tk { flex: 1; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.tk-in { display: inline-flex; gap: 28px; white-space: nowrap; padding-left: 20px; animation: tk 70s linear infinite; }
.tk-in a { color: var(--muted); } .tk-in a b { color: var(--gold); font-family: 'Space Grotesk', sans-serif; }
.ticker:hover .tk-in { animation-play-state: paused; }
@keyframes tk { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tk-in { animation: none; } }
.online { font-size: 12.5px; color: var(--ok); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.online::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.linkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.linkgrid > a { padding: 10px 12px; border-radius: 12px; background: var(--surface2); border: 1px solid var(--line); font-size: 14px; }
.linkgrid > a:hover { border-color: var(--gold2); color: var(--gold); }
.numgrid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.numgrid .ball { min-width: 0; width: 100%; }
details.faq { border-bottom: 1px solid var(--line); padding: 10px 0; }
details.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
details.faq summary::after { content: '+'; color: var(--gold); font-weight: 700; }
details.faq[open] summary::after { content: '−'; }
details.faq p { margin: 8px 0 0; color: var(--muted); }
.dgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.dcard { padding: 12px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); scroll-margin-top: 130px; }
.dcard h4 { margin: 0 0 4px; } .dcard p { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.dcard.flash { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent); }
button.chip { cursor: pointer; color: var(--muted); }
button.chip.on { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
dl.dreams dt { font-weight: 700; margin-top: 8px; } dl.dreams dd { margin: 0 0 4px; color: var(--muted); }
.rnums.big b { font-size: 40px; } .rnums.big small { font-size: 13px; }
.prizes { line-height: 1.9; color: var(--muted); word-spacing: 6px; }
.dlink:hover b { color: var(--gold); }
.cdmini { color: var(--warn); font-size: 13px; }
.freshhit { border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.toolbar-row { display: flex; gap: 8px; align-items: center; }
.foot .kw { max-width: 1100px; margin: 14px auto; }
.foot .kw div { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 8px; }
.foot .kw a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 12.5px; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 20px 20px 0 0; padding: 18px 14px calc(24px + env(safe-area-inset-bottom)); }
.sheet-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sheet-grid a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 12px; background: var(--surface2); font-size: 12px; text-align: center; }
.sheet-grid span { font-size: 22px; }
/* เซียมซี */
.tube { position: relative; width: 130px; height: 190px; margin: 10px auto 18px; }
.cup { position: absolute; bottom: 0; left: 10px; right: 10px; height: 120px; border-radius: 10px 10px 18px 18px; background: linear-gradient(90deg, #8e2229, #c0392b 50%, #8e2229); border: 3px solid var(--gold); display: grid; place-items: center; color: var(--gold); font-weight: 800; font-size: 18px; z-index: 1; }
.sticks { position: absolute; left: 22px; right: 22px; bottom: 60px; height: 130px; }
.sticks i { position: absolute; bottom: 0; left: calc(var(--i) * 6.5px); width: 5px; height: calc(92px + var(--i) * 3px); border-radius: 3px; background: linear-gradient(#f6d27c, #b97a16); transform: rotate(calc((var(--i) - 6) * 2deg)); transform-origin: bottom; }
.tube.shaking { animation: shake .16s ease-in-out infinite alternate; }
@keyframes shake { from { transform: rotate(-12deg) translateY(2px); } to { transform: rotate(12deg) translateY(-4px); } }
.slip { margin: 18px auto 0; max-width: 420px; text-align: center; padding: 18px; border-radius: 16px; background: linear-gradient(160deg, #fff4d6, #f4d28a); color: #3a1a05; animation: pop .35s ease-out; }
.slip p { color: #3a1a05; }
.slip-no { font-weight: 800; font-size: 20px; } .slip-lv { display: inline-block; margin: 4px 0; padding: 2px 12px; border-radius: 999px; background: #8e2229; color: #fff; font-weight: 700; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 960px) {
  .bottom { grid-template-columns: repeat(5, 1fr); }
  .online { display: none; }
  .numgrid { gap: 4px; } .numgrid .ball.xs { font-size: 13px; height: 28px; }
  .rnums.big b { font-size: 30px; }
}
/* WordPress menus inside the frame */
.navwp { display: contents; }
.navwp a { padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 600; }
.navwp a:hover { color: var(--text); background: var(--surface); }
.footlinks a { color: var(--muted); }
