/* =====================================================================
   บ้านเลขชะตา.com — app.css (ไฟล์เดียวทั้งเว็บ, mobile-first)
   แนว "งานวัด/อาเขต": พื้นครีม · เส้นขอบหมึกหนา · เงาทึบเยื้อง · สีสด
   หมึก #2A1A12 · แดง #E63E2D · เหลือง #FFC53D · หยก #12A587 · ชมพู #FF7EA6 · ฟ้า #4FB3E8
   ===================================================================== */
:root {
  --paper: #FFF4E0;
  --paper-2: #FFE7C2;
  --card: #FFFFFF;
  --ink: #2A1A12;
  --text: #3b2a20;
  --muted: #7a6656;
  --red: #E63E2D;
  --red-d: #B92A1C;
  --yellow: #FFC53D;
  --yellow-l: #FFE39A;
  --jade: #12A587;
  --jade-l: #C9F0E4;
  --pink: #FF7EA6;
  --pink-l: #FFD6E3;
  --sky: #4FB3E8;
  --sky-l: #D3EEFB;
  --purple: #7A5CFA;
  --purple-l: #E2DAFF;

  --bw: 2.5px;
  --r-lg: 22px;
  --r: 16px;
  --r-sm: 12px;
  --sh: 4px 4px 0 var(--ink);
  --sh-sm: 2px 2px 0 var(--ink);
  --sh-lg: 6px 6px 0 var(--ink);
  --head: "Mitr", "Anuphan", system-ui, sans-serif;
  --sans: "Anuphan", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", sans-serif;
  --top-h: 60px;
  --tabbar-h: 66px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --boing: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 400 16px/1.65 var(--sans); overflow-x: hidden;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(42, 26, 18, .09) 1.2px, transparent 1.3px);
  background-size: 22px 22px;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  -webkit-tap-highlight-color: transparent;
}
img, svg { max-width: 100%; }
a { color: var(--red-d); text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--head); color: var(--ink); line-height: 1.3; margin: 0 0 .4em; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 7.5vw, 3.1rem); line-height: 1.2; }
h2 { font-size: clamp(1.35rem, 5vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.center { text-align: center; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }
.num { font-family: var(--head); font-variant-numeric: tabular-nums; }
.hl { background: linear-gradient(transparent 58%, var(--yellow) 58%, var(--yellow) 92%, transparent 92%); padding: 0 .1em; }
.red { color: var(--red); }

/* ---------- ส่วนหัว ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: var(--bw) solid var(--ink); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: var(--top-h); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); min-width: 0; }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--head); font-weight: 600; font-size: 1.2rem; line-height: 1.1; display: block; white-space: nowrap; }
.brand-name small { font-size: .7em; color: var(--red); }
.brand-sub { font-size: .72rem; color: var(--muted); display: block; white-space: nowrap; }
.mainnav { display: none; margin-left: auto; gap: 4px; }
.mainnav a { color: var(--ink); font-family: var(--head); font-weight: 500; padding: 6px 14px; border-radius: 999px; border: 2px solid transparent; }
.mainnav a:hover { border-color: var(--ink); }
.mainnav a.active { background: var(--yellow); border-color: var(--ink); box-shadow: var(--sh-sm); }
.draw-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--ink); background: var(--card);
  border: 2px solid var(--ink); border-radius: 999px; padding: 4px 11px; box-shadow: var(--sh-sm); white-space: nowrap; }
.draw-chip b { font-family: var(--head); font-weight: 600; color: var(--red); }
@media (min-width: 900px) { .mainnav { display: flex; } .draw-chip { margin-left: 8px; } }

/* แถบล่าง (มือถือ) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--card); border-top: var(--bw) solid var(--ink); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tabbar-h);
  color: var(--muted); font-size: .74rem; font-family: var(--head); }
.tabbar a svg { width: 24px; height: 24px; }
.tabbar a.active { color: var(--ink); }
.tabbar a.active svg { background: var(--yellow); border: 2px solid var(--ink); border-radius: 10px; padding: 2px; width: 32px; height: 28px; }
.tabbar .play-tab svg { color: var(--red); }
@media (min-width: 900px) { .tabbar { display: none; } body { padding-bottom: 0; } }

/* ---------- ปุ่ม ---------- */
.btn { --bg: var(--card); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 9px 20px;
  font-family: var(--head); font-weight: 500; font-size: 1rem; color: var(--ink); background: var(--bg);
  border: var(--bw) solid var(--ink); border-radius: 14px; box-shadow: var(--sh); transition: transform .12s var(--ease), box-shadow .12s var(--ease);
  text-align: center; line-height: 1.2; user-select: none; }
.btn:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: .55; cursor: default; transform: none; box-shadow: var(--sh-sm); }
.btn svg { width: 18px; height: 18px; }
.btn-red, .btn-gold { --bg: var(--red); color: #fff; }
.btn-red:hover, .btn-gold:hover { color: #fff; }
.btn-yellow { --bg: var(--yellow); }
.btn-jade, .btn-navy { --bg: var(--jade); color: #fff; }
.btn-jade:hover, .btn-navy:hover { color: #fff; }
.btn-ghost, .btn-light { --bg: var(--card); }
.btn-sm { min-height: 38px; padding: 6px 14px; font-size: .9rem; border-radius: 12px; box-shadow: var(--sh-sm); }
.btn-sm:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-lg { min-height: 58px; font-size: 1.15rem; padding: 12px 28px; border-radius: 18px; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-row.center { justify-content: center; }

/* ---------- การ์ด / กล่อง ---------- */
.card { background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--sh); padding: 20px; position: relative; }
.card + .card { margin-top: 18px; }
.card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title h2, .card-title h3 { margin: 0; }
.eyebrow { display: inline-block; font-family: var(--head); font-size: .8rem; font-weight: 500; color: var(--red-d); letter-spacing: .02em; }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.sec-head h2 { margin: 0; }
.sec-head p { flex-basis: 100%; margin: 0; color: var(--muted); }
.section { padding: 26px 0; }
.grid { display: grid; gap: 18px; }
@media (min-width: 800px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-32 { grid-template-columns: 3fr 2fr; } }

.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-family: var(--head); font-weight: 500; line-height: 1;
  padding: 5px 9px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); white-space: nowrap; }
.tag-predict { background: var(--pink-l); }
.tag-real { background: var(--jade-l); }
.tag-game { background: var(--yellow-l); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 2px dashed var(--ink); background: var(--card); font-size: .9rem; }
.notice svg { width: 22px; height: 22px; flex: none; margin-top: 2px; }

/* ---------- ลูกเลข ---------- */
.balls { display: flex; flex-wrap: wrap; gap: 8px; }
.balls.center { justify-content: center; }
.ball { display: inline-grid; place-items: center; min-width: 46px; height: 46px; padding: 0 8px; border-radius: 999px;
  font-family: var(--head); font-weight: 600; font-size: 1.2rem; color: var(--ink); background: var(--card);
  border: var(--bw) solid var(--ink); box-shadow: var(--sh-sm); font-variant-numeric: tabular-nums; }
.ball.gold { background: var(--yellow); }
.ball.navy { background: var(--red); color: #fff; }
.ball.jade { background: var(--jade); color: #fff; }
.ball.sm { min-width: 36px; height: 36px; font-size: 1rem; padding: 0 6px; }
.ball.lg { min-width: 62px; height: 62px; font-size: 1.7rem; }
.ball.xl { min-width: 84px; height: 84px; font-size: 2.4rem; box-shadow: var(--sh); }
.balls.pop .ball { animation: pop .5s var(--boing) both; }
.balls.pop .ball:nth-child(2) { animation-delay: .07s; } .balls.pop .ball:nth-child(3) { animation-delay: .14s; }
.balls.pop .ball:nth-child(4) { animation-delay: .21s; } .balls.pop .ball:nth-child(5) { animation-delay: .28s; }
.balls.pop .ball:nth-child(6) { animation-delay: .35s; } .balls.pop .ball:nth-child(7) { animation-delay: .42s; }
@keyframes pop { from { transform: scale(.2) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Hero ---------- */
.hero { padding: 26px 0 18px; position: relative; overflow: hidden; }
.hero .wrap { display: grid; gap: 18px; align-items: center; }
@media (min-width: 800px) { .hero .wrap { grid-template-columns: 1.15fr .85fr; } }
.hero h1 .pop-word { display: inline-block; background: var(--red); color: #fff; padding: 0 .25em; border: var(--bw) solid var(--ink); border-radius: 14px;
  box-shadow: var(--sh); transform: rotate(-2deg); margin-top: 4px; }
.hero .lead { font-size: 1.05rem; max-width: 36em; }
.kicker { display: inline-flex; align-items: center; gap: 6px; font-family: var(--head); font-size: .85rem; background: var(--card); border: 2px solid var(--ink);
  border-radius: 999px; padding: 4px 12px; margin-bottom: 12px; box-shadow: var(--sh-sm); }
.kicker i { width: 8px; height: 8px; border-radius: 50%; background: var(--jade); animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.house-art { position: relative; max-width: 360px; width: 100%; margin: 0 auto; }
.house-art svg { width: 100%; height: auto; display: block; overflow: visible; }
.house-art .door-num { font-family: var(--head); font-weight: 600; }
.house-art .win { animation: winGlow 3s infinite; }
.house-art .win:nth-of-type(2) { animation-delay: 1.5s; }
@keyframes winGlow { 0%, 100% { fill: var(--yellow-l); } 50% { fill: var(--yellow); } }
.page-hero { padding: 22px 0 6px; }
.page-hero .wrap { display: block; }
.page-hero h1 { font-size: clamp(1.7rem, 6vw, 2.5rem); }

/* นับถอยหลัง */
.countdown { display: flex; gap: 8px; }
.cd-box { flex: 1; min-width: 0; text-align: center; background: var(--ink); color: var(--yellow); border-radius: 12px; padding: 6px 4px 4px; }
.cd-box b { display: block; font-family: var(--head); font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-box small { font-size: .7rem; color: #f3dcc4; }
.draw-strip { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.draw-strip .countdown { flex: 1 1 260px; max-width: 340px; }

/* ---------- ห้องเกม (การ์ดเกม) ---------- */
.rooms { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 640px) { .rooms { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.room { --c: var(--yellow); position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 14px 12px; color: var(--ink);
  background: var(--c); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--sh);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease); min-height: 150px; overflow: hidden; }
.room:hover { color: var(--ink); transform: translate(-2px, -2px) rotate(-.6deg); box-shadow: var(--sh-lg); }
.room:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.room .emo { font-size: 2.6rem; line-height: 1; margin-bottom: 6px; filter: drop-shadow(2px 2px 0 rgba(42, 26, 18, .35)); transition: transform .3s var(--boing); }
.room:hover .emo { transform: scale(1.15) rotate(-8deg); }
.room b { font-family: var(--head); font-weight: 600; font-size: 1.08rem; line-height: 1.25; }
.room small { font-size: .8rem; line-height: 1.4; opacity: .85; }
.room .no { position: absolute; top: 10px; right: 10px; font-family: var(--head); font-size: .72rem; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 8px; }
.room.done .no { background: var(--ink); color: var(--yellow); }
.room .got { margin-top: auto; padding-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.room .got .ball { min-width: 28px; height: 28px; font-size: .8rem; padding: 0 5px; border-width: 2px; box-shadow: none; }

/* ---------- กระเป๋าเลข ---------- */
.pocket-card { background: var(--ink); color: #fff; border-radius: var(--r-lg); border: var(--bw) solid var(--ink); box-shadow: var(--sh); padding: 20px; position: relative; overflow: hidden; }
.pocket-card h2, .pocket-card h3 { color: #fff; }
.pocket-card .eyebrow { color: var(--yellow); }
.pocket-card .muted { color: #d9c5b4; }
.pocket-card .ball { box-shadow: none; }
.power { height: 16px; border-radius: 999px; background: rgba(255, 255, 255, .15); border: 2px solid #fff; overflow: hidden; margin: 6px 0 4px; }
.power i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--yellow) 0 10px, #ffd76e 10px 20px); transition: width 1s var(--ease); }
.power-row { display: flex; justify-content: space-between; font-size: .8rem; color: #e9d6c5; }
.pocket-empty { text-align: center; padding: 6px 0; }
.pocket-empty .emo { font-size: 2.6rem; }
.lek-set { display: grid; gap: 12px; }
.lek-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lek-row .lbl { flex: 0 0 74px; font-family: var(--head); font-size: .88rem; }
.why { font-size: .82rem; color: var(--muted); margin: 6px 0 0; }
.pocket-card .why { color: #d9c5b4; }
.lek-inline { display: grid; gap: 6px; }
.lek-inline .lbl { display: inline-flex; align-items: center; gap: 5px; font-family: var(--head); font-size: .85rem; }
.lek-inline .lbl svg { width: 16px; height: 16px; }

.history { display: grid; gap: 10px; }
.hist { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); }
.hist .emo { font-size: 1.7rem; flex: none; }
.hist .t { flex: 1; min-width: 0; }
.hist b { font-family: var(--head); font-weight: 500; display: block; line-height: 1.3; }
.hist small { color: var(--muted); font-size: .76rem; }
.hist .balls { gap: 4px; justify-content: flex-end; }
.freq { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 120px; }
.freq div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.freq i { display: block; width: 100%; border: 2px solid var(--ink); border-radius: 8px 8px 3px 3px; background: var(--sky-l); height: 0; transition: height .8s var(--ease); min-height: 4px; }
.freq div.top i { background: var(--yellow); }
.freq b { font-family: var(--head); font-size: .95rem; line-height: 1; }
.freq small { font-size: .68rem; color: var(--muted); line-height: 1; }

/* ---------- เวทีเกม ---------- */
.stage { --c: var(--yellow-l); background: var(--c); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--sh); padding: 18px; position: relative; overflow: hidden; }
.stage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stage-head h2 { margin: 0; font-size: 1.2rem; }
.hud { display: flex; gap: 8px; flex-wrap: wrap; }
.hud span { font-family: var(--head); font-size: .85rem; background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 11px; }
.hud b { color: var(--red); }
.howto { font-size: .92rem; margin: 0 0 12px; }
.game-meta { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.game-meta .emo { font-size: 3.2rem; line-height: 1; flex: none; filter: drop-shadow(3px 3px 0 rgba(42, 26, 18, .3)); }
.game-meta h1 { margin: 0; }
.next-games { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.next-games .room { min-height: 0; padding: 10px; }
.next-games .room .emo { font-size: 1.8rem; margin: 0; }
.next-games .room b { font-size: .88rem; }
.next-games .room small, .next-games .room .no { display: none; }

/* ตั๋วผลลัพธ์ */
.ticket { position: relative; background: var(--card); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); box-shadow: var(--sh-lg); margin-top: 18px;
  animation: ticketIn .6s var(--boing) both; }
@keyframes ticketIn { from { transform: translateY(30px) scale(.9) rotate(2deg); opacity: 0; } to { transform: none; opacity: 1; } }
.ticket-top { background: var(--red); color: #fff; padding: 12px 18px; border-radius: 19px 19px 0 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ticket-top b { font-family: var(--head); font-weight: 600; font-size: 1.05rem; }
.ticket-top small { font-size: .78rem; opacity: .9; }
.ticket-cut { position: relative; height: 0; border-top: 2.5px dashed var(--ink); margin: 0 14px; }
.ticket-cut::before, .ticket-cut::after { content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--paper);
  border: var(--bw) solid var(--ink); }
.ticket-cut::before { left: -28px; clip-path: inset(0 0 0 50%); }
.ticket-cut::after { right: -28px; clip-path: inset(0 50% 0 0); }
.ticket-body { padding: 16px 18px 18px; }
.ticket-main { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ticket-main .t { flex: 1; min-width: 0; }
.ticket-main h3 { margin: 0 0 2px; }
.ticket-main p { margin: 0; font-size: .9rem; color: var(--muted); }
.ticket .note { font-size: .92rem; background: var(--paper); border-radius: var(--r-sm); padding: 10px 12px; margin: 12px 0 0; border: 2px solid var(--ink); }
.ticket .btn-row { margin-top: 14px; }
.stamp { position: absolute; right: 14px; top: 54px; transform: rotate(12deg); font-family: var(--head); font-weight: 600; color: var(--jade); border: 3px solid var(--jade);
  border-radius: 10px; padding: 2px 10px; font-size: .9rem; opacity: .85; animation: stamp .45s .35s var(--boing) both; background: rgba(255, 255, 255, .8); }
@keyframes stamp { from { transform: rotate(12deg) scale(2.4); opacity: 0; } to { transform: rotate(12deg) scale(1); opacity: .85; } }

/* confetti */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border: 1.5px solid var(--ink); border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--rot)); } }

/* ---------- เกม: สอยดาว ---------- */
.starboard { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; background: var(--ink); padding: 12px; border-radius: var(--r); border: var(--bw) solid var(--ink);
  background-image: radial-gradient(rgba(255, 255, 255, .25) 1px, transparent 1.2px); background-size: 16px 16px; }
.starbtn { aspect-ratio: 1; border: 0; background: none; padding: 0; position: relative; display: grid; place-items: center; transition: transform .2s var(--boing); }
.starbtn svg { width: 100%; height: 100%; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .45)); }
.starbtn:not(:disabled):hover { transform: scale(1.12) rotate(8deg); }
.starbtn .sv { position: absolute; font-family: var(--head); font-weight: 600; color: var(--ink); font-size: clamp(.9rem, 4vw, 1.2rem); opacity: 0; }
.starbtn.open { animation: starOpen .55s var(--boing) both; }
.starbtn.open .sv { opacity: 1; transition: opacity .2s .2s; }
.starbtn.open path { fill: var(--yellow); }
.starbtn.dim { opacity: .35; }
.starbtn:disabled { cursor: default; }
@keyframes starOpen { 0% { transform: scale(1); } 40% { transform: scale(.6) rotate(-90deg); } 100% { transform: scale(1.1) rotate(0); } }

/* ---------- เกม: วงล้อ ---------- */
.wheel-wrap { position: relative; width: min(320px, 82vw); aspect-ratio: 1; margin: 6px auto 14px; }
.wheel-wrap .wheel { width: 100%; height: 100%; transition: transform 3.6s cubic-bezier(.12, .7, .1, 1); }
.wheel-wrap .pin { position: absolute; left: 50%; top: -8px; width: 34px; height: 40px; transform: translateX(-50%); z-index: 2; }
.wheel-wrap .hub { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; transform: translate(-50%, -50%); border-radius: 50%; background: var(--yellow); border: var(--bw) solid var(--ink);
  display: grid; place-items: center; font-family: var(--head); font-weight: 600; font-size: 1.6rem; box-shadow: var(--sh-sm); }
.slots { display: flex; justify-content: center; gap: 10px; margin-bottom: 14px; }
.slots span { width: 60px; height: 72px; display: grid; place-items: center; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 14px; box-shadow: var(--sh-sm);
  font-family: var(--head); font-weight: 600; font-size: 2.2rem; color: var(--muted); }
.slots span.on { color: var(--ink); background: var(--yellow); animation: pop .45s var(--boing); }

/* ---------- เกม: เซียมซี ---------- */
.tube-zone { display: grid; place-items: center; padding: 70px 0 4px; min-height: 330px; position: relative; overflow: hidden; }
.tube { width: 150px; height: 230px; position: relative; cursor: pointer; border: 0; background: none; padding: 0; transform-origin: 50% 90%; }
.tube svg { width: 100%; height: 100%; overflow: visible; }
.tube.shake { animation: shake .16s infinite alternate ease-in-out; }
@keyframes shake { from { transform: rotate(-11deg) translateY(-2px); } to { transform: rotate(11deg) translateY(2px); } }
.stick-out { position: absolute; left: 50%; top: 70px; width: 26px; height: 170px; margin-left: -13px; background: #e9c27f; border: var(--bw) solid var(--ink); border-radius: 8px 8px 4px 4px;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 8px; font-family: var(--head); font-weight: 600; color: var(--red-d); writing-mode: vertical-rl;
  animation: stickUp .9s var(--boing) both; z-index: 3; box-shadow: var(--sh-sm); }
.stick-out::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 22px; background: var(--red); border-radius: 5px 5px 0 0; }
.stick-out span { position: relative; margin-top: 18px; writing-mode: horizontal-tb; font-size: 1.15rem; }
@keyframes stickUp { from { transform: translateY(120px) rotate(0); } to { transform: translateY(-62px) rotate(14deg); } }
.paper { background: #fffaf0; border: var(--bw) solid var(--ink); border-radius: var(--r); padding: 16px; margin-top: 14px; box-shadow: var(--sh-sm);
  background-image: repeating-linear-gradient(transparent 0 30px, rgba(230, 62, 45, .14) 30px 31px); }
.paper-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.paper-head .no { width: 54px; height: 54px; flex: none; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-family: var(--head); font-size: 1.5rem;
  font-weight: 600; border: var(--bw) solid var(--ink); }
.paper-head h3 { margin: 0; }
.lv { font-family: var(--head); font-size: .8rem; padding: 2px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--yellow-l); }
.lv-great { background: var(--yellow); } .lv-care { background: var(--pink-l); }
.poem { font-family: var(--head); font-weight: 400; text-align: center; line-height: 1.95; margin: 6px 0 10px; }

/* ---------- เกม: ขูดบัตร ---------- */
.scard { background: linear-gradient(135deg, var(--pink) 0%, var(--yellow) 100%); border: var(--bw) solid var(--ink); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh); max-width: 460px; margin: 0 auto; }
.scard-title { text-align: center; font-family: var(--head); font-weight: 600; font-size: 1.25rem; color: var(--ink); margin-bottom: 10px; letter-spacing: .02em; }
.spots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.spot { position: relative; aspect-ratio: 1; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 50%; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.spot .v { font-family: var(--head); font-weight: 600; font-size: clamp(1.4rem, 7vw, 2.1rem); color: var(--red); }
.spot .lb { position: absolute; bottom: 12%; font-size: .66rem; color: var(--muted); }
.spot canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
.spot.clear canvas { opacity: 0; transition: opacity .4s; pointer-events: none; }
.scard-foot { text-align: center; font-size: .78rem; margin-top: 10px; color: var(--ink); }

/* ---------- เกม: ช้อนปลา ---------- */
.pond { position: relative; height: 340px; border-radius: 50% / 40%; border: var(--bw) solid var(--ink); overflow: hidden; touch-action: manipulation;
  background: radial-gradient(ellipse at 50% 40%, #8fd7f5 0%, var(--sky) 60%, #2f8fc4 100%); box-shadow: inset 0 -12px 0 rgba(0, 0, 0, .1), var(--sh); cursor: crosshair; }
.pond::before { content: ""; position: absolute; inset: 0; background: repeating-radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .12) 0 2px, transparent 2px 26px); }
.fish { position: absolute; left: 0; top: 0; width: 64px; height: 40px; border: 0; background: none; padding: 0; will-change: transform; }
.fish svg { width: 100%; height: 100%; overflow: visible; }
.fish .fd { font-family: var(--head); font-weight: 600; }
.fish.caught { transition: transform .5s var(--ease), opacity .5s; opacity: 0; pointer-events: none; }
.splash { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 3px solid #fff; border-radius: 50%; animation: splash .5s ease-out forwards; pointer-events: none; }
@keyframes splash { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }
.bucket { display: flex; justify-content: center; gap: 8px; margin-top: 14px; min-height: 52px; }
.bucket .slot { width: 52px; height: 52px; border-radius: 50%; border: 2.5px dashed var(--ink); display: grid; place-items: center; font-family: var(--head); font-weight: 600; font-size: 1.4rem; background: rgba(255, 255, 255, .6); }
.bucket .slot.on { border-style: solid; background: var(--yellow); animation: pop .4s var(--boing); }
.paper-life { letter-spacing: 2px; }

/* ---------- เกม: ถ้วย ---------- */
.cups { position: relative; height: 210px; max-width: 420px; margin: 0 auto; }
.cup { position: absolute; bottom: 20px; width: 30%; left: 0; border: 0; background: none; padding: 0; transition: transform .35s ease-in-out; z-index: 2; }
.cup svg { width: 100%; height: auto; display: block; overflow: visible; transition: transform .35s var(--ease); }
.cup.lift svg { transform: translateY(-70px); }
.cup:disabled { cursor: default; }
.cup.pickable:hover svg { transform: translateY(-8px); }
.cup-ball { position: absolute; bottom: 20px; width: 30%; display: grid; place-items: center; z-index: 1; transition: transform .35s ease-in-out; }
.cup-ball .ball { box-shadow: none; }
.cups-floor { position: absolute; left: 0; right: 0; bottom: 8px; height: 14px; background: rgba(42, 26, 18, .12); border-radius: 50%; }

/* ---------- เกม: กาชา ---------- */
.gacha { position: relative; width: 230px; margin: 0 auto; }
.gacha svg { width: 100%; display: block; overflow: visible; }
.gacha .crank { transform-origin: 115px 262px; transition: transform .9s var(--ease); }
.gacha .capsules { transform-origin: 115px 110px; }
.gacha.turning .capsules { animation: jiggle .3s 3; }
@keyframes jiggle { 50% { transform: rotate(6deg) translateY(3px); } }
.capsule-out { display: block; margin: 10px auto 0; border: 0; background: none; padding: 0; width: 86px; height: 86px; animation: drop .7s var(--boing) both; }
.capsule-out svg { width: 100%; height: 100%; overflow: visible; }
.capsule-out .top { transition: transform .5s var(--ease); transform-origin: 20px 43px; }
.capsule-out.open .top { transform: rotate(-70deg) translate(-6px, -14px); }
@keyframes drop { from { transform: translateY(-120px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.capsule-out:not(.open) { animation: drop .7s var(--boing) both, wobble 1s .8s infinite; }
@keyframes wobble { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }

/* ---------- เกม: ฟองฝัน ---------- */
.dream-sky { position: relative; height: 230px; border-radius: var(--r); border: var(--bw) solid var(--ink); overflow: hidden;
  background: linear-gradient(#2c2463, #6a4fc9 70%, #b48cf0); }
.dream-sky .moon { position: absolute; right: 22px; top: 18px; width: 54px; height: 54px; border-radius: 50%; box-shadow: -12px 6px 0 0 var(--yellow); }
.dream-sky .zz { position: absolute; left: 24px; bottom: 18px; font-size: 2.6rem; }
.dream-sky .tw { position: absolute; width: 3px; height: 3px; background: #fff; border-radius: 50%; animation: blink 2s infinite; }
.bubble { position: absolute; bottom: -80px; width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font-family: var(--head); font-weight: 600; font-size: 1.5rem; color: var(--ink);
  background: radial-gradient(circle at 32% 28%, #fff 0 12%, rgba(255, 255, 255, .85) 13%, rgba(211, 238, 251, .9) 70%); border: 2.5px solid var(--ink); animation: rise 2.6s var(--ease) forwards; }
@keyframes rise { 0% { transform: translateY(0) scale(.5); } 70% { transform: translateY(var(--h)) scale(1.05); } 100% { transform: translateY(var(--h)) scale(1); } }
.dream-sky .hint { position: absolute; inset: 0; display: grid; place-items: center; color: #e9e2ff; font-family: var(--head); text-align: center; padding: 20px; }
.picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- เกม: บ้านเลขที่ ---------- */
.doorway { position: relative; width: 220px; height: 270px; margin: 4px auto 14px; perspective: 700px; }
.doorway .frame { position: absolute; inset: 0; border: var(--bw) solid var(--ink); border-radius: 110px 110px 8px 8px; background: #3a2418; overflow: hidden; }
.doorway .inside { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 4px; background: radial-gradient(circle at 50% 60%, var(--yellow) 0%, #ffb02e 60%, #e98a1a); text-align: center; padding: 20px; }
.doorway .inside b { font-family: var(--head); font-size: 3rem; color: var(--ink); line-height: 1; }
.doorway .inside small { font-family: var(--head); color: var(--ink); }
.doorway .door { position: absolute; inset: 0; border-radius: 108px 108px 6px 6px; background: var(--red); border: var(--bw) solid var(--ink); transform-origin: 0 50%;
  transition: transform 1s var(--ease); display: grid; place-items: center; z-index: 2; backface-visibility: hidden; }
.doorway .door::before { content: ""; position: absolute; inset: 22px 22px 120px; border: 2.5px solid var(--ink); border-radius: 80px 80px 6px 6px; }
.doorway .door::after { content: ""; position: absolute; inset: 160px 22px 22px; border: 2.5px solid var(--ink); border-radius: 6px; }
.doorway .knob { position: absolute; right: 24px; top: 140px; width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); border: 2.5px solid var(--ink); z-index: 3; }
.doorway .plate { position: absolute; top: 72px; left: 50%; transform: translateX(-50%); background: var(--card); border: 2.5px solid var(--ink); border-radius: 8px; padding: 2px 10px; font-family: var(--head); font-weight: 600; font-size: 1.1rem; z-index: 3; white-space: nowrap; max-width: 170px; overflow: hidden; text-overflow: ellipsis; }
.doorway.knock .door { animation: knock .18s 3; }
@keyframes knock { 50% { transform: translateX(3px) rotate(.6deg); } }
.doorway.open .door { transform: rotateY(-105deg); }
.pairs-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pr { font-family: var(--head); font-size: .9rem; padding: 2px 9px; border-radius: 999px; border: 2px solid var(--ink); }
.pr.good { background: var(--jade-l); } .pr.bad { background: var(--pink-l); text-decoration: line-through; text-decoration-thickness: 2px; }

/* ---------- ฟอร์ม ---------- */
.field { display: grid; gap: 4px; flex: 1; min-width: 0; }
.field > span { font-family: var(--head); font-size: .84rem; }
.input, .select { width: 100%; min-height: 48px; padding: 10px 14px; border: var(--bw) solid var(--ink); border-radius: 14px; background: var(--card); font-size: 1rem; }
.input:focus, .select:focus { outline: none; box-shadow: 0 0 0 4px var(--sky-l); }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232A1A12' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }
.form-row { display: flex; gap: 8px; }
.input-big { font-family: var(--head); font-size: 1.5rem; text-align: center; letter-spacing: .12em; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-left: 44px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-family: var(--head); font-size: .86rem; padding: 5px 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--card); }
.chip:hover { background: var(--yellow-l); }
.chip.on, .chip[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
.seg { display: flex; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 14px; padding: 4px; gap: 4px; }
.seg button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 10px; font-family: var(--head); font-size: .9rem; }
.seg button[aria-selected="true"] { background: var(--yellow); box-shadow: inset 0 0 0 2px var(--ink); }

/* ---------- กระดานเลข (หลังบ้านแก้ได้) ---------- */
.board { background: var(--jade); color: #fff; }
.board::before { content: ""; position: absolute; left: 50%; top: -14px; transform: translateX(-50%); width: 70px; height: 22px; background: var(--yellow-l); border: 2px solid var(--ink); border-radius: 4px; opacity: .95; }
.board-title { color: #fff; margin: 4px 0 0; text-align: center; }
.board-date { text-align: center; font-size: .9rem; margin-bottom: 10px; color: #e7fff7; }
.board-meta { text-align: center; }
.board-group { background: rgba(255, 255, 255, .14); border: 2px solid rgba(255, 255, 255, .5); border-radius: var(--r); padding: 10px; margin-bottom: 10px; }
.board-group .lbl { text-align: center; font-family: var(--head); font-size: .85rem; margin-bottom: 6px; }
.board-note { text-align: center; font-size: .82rem; margin: 6px 0 0; color: #e7fff7; }
.board .ball { box-shadow: none; }

/* ---------- ทำนายฝัน (รายการ) ---------- */
.dream-list { display: grid; gap: 10px; margin-top: 12px; }
@media (min-width: 720px) { .dream-list { grid-template-columns: 1fr 1fr; } }
.dream { background: var(--card); border: 2px solid var(--ink); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 6px; }
.dream h4 { margin: 0; font-size: 1.02rem; }
.dream .cat { font-size: .72rem; font-family: var(--head); background: var(--purple-l); border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 8px; }
.dream p { margin: 0; font-size: .88rem; color: var(--muted); }
.more-row { grid-column: 1 / -1; text-align: center; }

/* ---------- ผลสลาก (ข้อมูลจริง) ---------- */
.digits { display: flex; gap: 5px; justify-content: center; }
.digits span { width: 42px; height: 54px; display: grid; place-items: center; background: var(--card); border: var(--bw) solid var(--ink); border-radius: 10px;
  font-family: var(--head); font-weight: 600; font-size: 1.8rem; color: var(--ink); }
.digits.flip span { background: var(--ink); color: var(--yellow); }
.digits.flip span { animation: flipIn .5s var(--ease) both; }
.digits.flip span:nth-child(2) { animation-delay: .06s; } .digits.flip span:nth-child(3) { animation-delay: .12s; } .digits.flip span:nth-child(4) { animation-delay: .18s; }
.digits.flip span:nth-child(5) { animation-delay: .24s; } .digits.flip span:nth-child(6) { animation-delay: .3s; }
@keyframes flipIn { from { transform: rotateX(90deg); } to { transform: none; } }
.prize-first { text-align: center; margin-bottom: 12px; }
.prize-first .lbl { font-family: var(--head); font-size: .9rem; margin-bottom: 6px; }
.prize-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.prize-grid > div { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 8px 6px; text-align: center; }
.prize-grid .lbl { font-size: .74rem; color: var(--muted); }
.prize-grid .v { font-family: var(--head); font-weight: 600; font-size: 1.05rem; color: var(--ink); line-height: 1.35; }
.prize-grid .v.l2 { font-size: 1.7rem; color: var(--red); }
.prize-all { display: grid; gap: 12px; margin-top: 12px; }
.prize-all h4 { margin: 0 0 4px; font-size: .95rem; }
.prize-all .nums { display: flex; flex-wrap: wrap; gap: 4px 10px; font-family: var(--head); font-size: .95rem; font-variant-numeric: tabular-nums; }
details.more summary { cursor: pointer; font-family: var(--head); margin-top: 12px; }
.check-box { display: grid; gap: 10px; }
.result-box { border: var(--bw) solid var(--ink); border-radius: var(--r); padding: 14px; margin-top: 12px; background: var(--card); }
.result-box.win { background: var(--yellow); }
.result-box.lose { background: var(--paper); }
.ck-win { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 10px; }
.ck-ico { font-size: 2rem; }
.hot2 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.hot2 div { text-align: center; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-sm); padding: 6px 2px; }
.hot2 b { display: block; font-family: var(--head); font-size: 1.35rem; line-height: 1.2; }
.hot2 small { font-size: .7rem; color: var(--muted); }
.hot2.cold div { background: var(--sky-l); }
.hot2.hot div { background: var(--pink-l); }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: 8px 6px; border-bottom: 1.5px solid rgba(42, 26, 18, .15); text-align: center; white-space: nowrap; }
.tbl th { font-family: var(--head); font-weight: 500; font-size: .8rem; }
.tbl td.f { font-family: var(--head); font-weight: 600; letter-spacing: .06em; }
.tbl td.l2 { font-family: var(--head); font-weight: 600; color: var(--red); font-size: 1.05rem; }

/* ---------- ส่วนท้าย ---------- */
.footer { margin-top: 30px; border-top: var(--bw) solid var(--ink); background: var(--ink); color: #e9d6c5; padding: 28px 0 22px; font-size: .9rem; }
.footer .brand { color: #fff; }
.footer .brand-sub { color: #cdb7a4; }
.footer-grid { display: grid; gap: 20px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer h4 { color: var(--yellow); font-size: .95rem; margin-bottom: 8px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer a { color: #e9d6c5; }
.footer a:hover { color: var(--yellow); }
.footer p { margin: 10px 0 0; }
.footer .fine { margin-top: 20px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .15); font-size: .76rem; color: #bda592; }

/* ---------- อื่น ๆ ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 30px); opacity: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: .92rem; transition: .25s var(--ease); pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (min-width: 900px) { .toast { bottom: 24px; } }
.skeleton { display: inline-block; width: 46px; height: 46px; border-radius: 999px; background: linear-gradient(90deg, #eee 0%, #f8f8f8 50%, #eee 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.prize-first .skeleton { width: 260px; height: 54px; border-radius: 10px; }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.fade-in { animation: fadeIn .45s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.marquee { overflow: hidden; border-block: var(--bw) solid var(--ink); background: var(--yellow); white-space: nowrap; }
.marquee div { display: inline-block; padding: 7px 0; font-family: var(--head); font-weight: 500; animation: marq 28s linear infinite; }
.marquee span { margin: 0 18px; }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
.pocket-card:has(.pocket-empty) { display: grid; place-items: center; }
.starbtn.dim .sv { opacity: .9; color: #fff; }
.dream-sky .hint[hidden] { display: none; }
@media (min-width: 800px) { .grid-32 { align-items: start; } }
