/* =====================================================================
   app.css — หน้าตาฝั่งลูกค้า (เขียนใหม่ทั้งไฟล์)
   =====================================================================

   โหลดต่อจาก  theme.css → base.css → utils.css
   ไฟล์นี้ "ไม่ทับ" คุณสมบัติของ base.css — มีแต่ของฝั่งลูกค้าโดยเฉพาะ
   (เดิมเคยแยกเป็น app + mobile + ui แล้วเขียนทับกันไปมา จนค่าจริงเดาไม่ได้
    ตอนนี้รวมเหลือไฟล์เดียว หนึ่งคลาสประกาศที่เดียว)

   ห้ามใส่ z-index / transform ให้ .page หรือ .container
   → จะสร้าง stacking context แล้วกด modal (400) / sheet (300) จนคลิกไม่ได้

   สารบัญ
     1) โครงหน้า            6) ตั๋วทอง + ตัวเลขรางวัล
     2) แถบเมนู             7) หน้าเฉพาะ (ทายผล/กงล้อ/อันดับ/โปรไฟล์/บทความ)
     3) หัวข้อ              8) แลนดิ้งย่อย (สไลด์/สมัคร)
     4) รายการ/เมนู         9) โมชัน
     5) สถิติ/แท็บ         10) จอเล็ก
   ===================================================================== */

/* พื้นหลังหน้าเว็บ — ไล่เฉดจาง ๆ จากสีธีม
   (นี่คือการทับ base.css จุดเดียวที่อนุญาต: base ตั้งพื้นทึบไว้ให้หลังบ้าน
    ส่วนฝั่งลูกค้าเติมไล่เฉดทับ — เป็น element เดียวกันจึงเลี่ยงไม่ได้) */
body {
  background:
    radial-gradient(62% 42% at 100% -6%, color-mix(in srgb, var(--c-accent) 12%, transparent), transparent 62%),
    radial-gradient(52% 40% at -8% 0%, color-mix(in srgb, var(--c-primary) 10%, transparent), transparent 60%),
    var(--c-bg);
  background-attachment: fixed;
}

/* =====================================================================
   0) ให้มือถือรู้สึกเหมือนแอป (ไม่ใช่เว็บที่เปิดในเบราว์เซอร์)
   ===================================================================== */
@media (max-width: 991px) {
  html, body {
    /* กันการลากทั้งหน้าแบบยางยืด (overscroll) ที่ทำให้ดูเป็นเว็บ */
    overscroll-behavior-y: none;
  }
  body {
    /* ปิด callout ตอนกดค้างบนลิงก์/ปุ่ม — พฤติกรรมแบบแอป */
    -webkit-touch-callout: none;
  }
  /* เลือกข้อความไม่ได้ ยกเว้นที่ต้องคัดลอกจริง ๆ */
  .dnav, .app-header, .bottom-nav, .btn, .seg, .type-card,
  .menu-row, .bet-chip, .keypad, .wiz-steps, .tab-bar {
    -webkit-user-select: none; user-select: none;
  }
  input, textarea, [contenteditable], .lux-code, .serial,
  .slip__num, .u-mono, .lotto-ball, .draw-num__d {
    -webkit-user-select: text; user-select: text;
  }
  /* แถบเลื่อนแนวนอนให้หยุดเป็นช่อง ๆ เหมือน carousel ในแอป */
  .seg--scroll, .dnav__menu { scroll-snap-type: x proximity; }
  .seg--scroll > * { scroll-snap-align: center; }
}

/* โหมดติดตั้งเป็นแอป (เปิดจาก home screen) — ไม่มีแถบเบราว์เซอร์แล้ว
   จึงต้องเผื่อพื้นที่ขอบจอเอง */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .app-header { padding-top: max(env(safe-area-inset-top), 8px); }
  .page { padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + var(--sp-6)); }
}

/* =====================================================================
   1) โครงหน้า
   ===================================================================== */
.page {
  padding-top: var(--sp-6);
  padding-bottom: calc(var(--bottomnav-h) + var(--sp-8));
}
.stack > * + * { margin-top: var(--sp-4); }

.layout-with-sidebar { display: grid; gap: var(--sp-6); align-items: start; }

.hide-mobile { display: none; }

@media (min-width: 992px) {
  .page { padding-bottom: var(--sp-8); }
  .layout-with-sidebar { grid-template-columns: 1fr 320px; }
  .hide-mobile { display: block; }
  .hide-desktop { display: none !important; }
}
@media (min-width: 1440px) {
  .layout-with-sidebar { grid-template-columns: 1fr 360px; gap: var(--sp-8); }
}

/* =====================================================================
   2) แถบเมนู
   ===================================================================== */

/* ---- เดสก์ท็อป ---- */
.dnav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--c-header-bg) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in srgb, var(--c-border) 70%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--gold) 30%, transparent);
  display: none;
}
.dnav__inner { display: flex; align-items: center; gap: var(--sp-4); height: var(--dnav-h); }
.dnav__brand { display: flex; align-items: center; flex: none; }
.dnav__brand:hover { text-decoration: none; }
.dnav__brand-text {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: var(--fs-lg); font-weight: 800; color: var(--c-text);
}
.dnav__mark {
  position: relative;
  width: 36px; height: 36px; flex: none;
  border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  font-size: .95rem; color: var(--gold-ink);
  background: var(--foil);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--gold) 38%, transparent),
              inset 0 -2px 4px rgba(0, 0, 0, .2);
}
.dnav__mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.dnav__menu {
  display: flex; align-items: center; gap: 2px;
  flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.dnav__menu::-webkit-scrollbar { display: none; }
.dnav__link {
  padding: 9px 14px; border-radius: var(--radius-full);
  color: var(--c-text-muted); font-size: .95rem; font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.dnav__link:hover {
  text-decoration: none; color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 8%, transparent);
}
.dnav__link.is-active {
  color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 12%, transparent);
}

.dnav__actions { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.dnav__credit {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 15px; border-radius: var(--radius-full);
  font-size: var(--fs-sm); font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--gold-ink); background: var(--foil);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--gold) 30%, transparent);
}
.dnav__credit:hover { text-decoration: none; filter: brightness(1.04); }
.dnav__user {
  display: inline-flex; align-items: center; gap: 9px;
  max-width: 220px; padding: 5px 14px 5px 6px;
  border: 1px solid var(--c-border); border-radius: var(--radius-full);
  background: var(--c-surface); color: var(--c-text);
  font-size: var(--fs-sm); font-weight: 700;
}
.dnav__user:hover { text-decoration: none; border-color: color-mix(in srgb, var(--c-primary) 35%, var(--c-border)); }
.dnav__user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (min-width: 992px) { .dnav { display: block; } }
@media (max-width: 1200px) {
  .dnav__inner { gap: var(--sp-3); }
  .dnav__link { padding: 9px 10px; font-size: .9rem; }
  .dnav__link i { display: none; }
}
@media (max-width: 1150px) {
  .dnav__user span { display: none; }
  .dnav__user { padding: 5px; }
}

/* ---- มือถือ: header บาง ---- */
.app-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: var(--sp-2);
  height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--sp-4) 0;
  background: color-mix(in srgb, var(--c-header-bg) 90%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--c-border);
}
.app-header__back {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-left: -8px; flex: none;
  border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--c-text);
  font-size: 1.3rem; cursor: pointer;
}
.app-header__title {
  flex: 1; min-width: 0; margin: 0;
  font-size: var(--fs-base); font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-header__actions { display: flex; align-items: center; gap: var(--sp-1); flex: none; }
.app-header .dnav__mark { width: 30px; height: 30px; font-size: .8rem; }
.app-header .dnav__credit { padding: 6px 11px; font-size: var(--fs-xs); }

@media (min-width: 992px) { .app-header { display: none; } }

/* ---- มือถือ: แถบล่าง ---- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--c-bottomnav-bg) 94%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .08);
}
.bottom-nav__item {
  position: relative;
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  color: var(--c-text-muted); font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition);
}
.bottom-nav__item:hover { text-decoration: none; }
.bottom-nav__item i { font-size: 1.22rem; transition: transform var(--transition); }
.bottom-nav__item span { font-size: .68rem; }
.bottom-nav__item.is-active { color: var(--c-primary); }
/* ขีดบอกตำแหน่งด้านบนแบบ tab bar ของแอป */
.bottom-nav__item.is-active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--c-primary);
}
.bottom-nav__item.is-active i { transform: translateY(-1px) scale(1.06); }
/* กดแล้วยุบเล็กน้อย = รู้สึกว่าแตะติด */
.bottom-nav__item:active i { transform: scale(.9); }

.bottom-nav__item--primary { position: relative; }
.bottom-nav__fab {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin-top: -24px;
  border-radius: 50%;
  border: 4px solid var(--c-bottomnav-bg);
  background: linear-gradient(140deg, var(--c-primary), var(--c-primary-dark));
  color: #fff; font-size: 1.4rem;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--c-primary) 45%, transparent);
}

/* ซ่อนแถบล่างตอนเลื่อนลง (app.js ใส่ .is-tucked ให้) */
.bottom-nav { transition: transform .25s cubic-bezier(.32, .72, 0, 1); }
.bottom-nav.is-tucked { transform: translateY(105%); }

@media (min-width: 992px) { .bottom-nav { display: none; } }

/* ---- กระเพื่อมตรงจุดที่แตะ (ripple) ---- */
.ripple {
  position: absolute; left: 0; top: 0;
  width: 12px; height: 12px; margin: -6px 0 0 -6px;
  border-radius: 50%; pointer-events: none;
  background: currentColor; opacity: .28;
  transform: scale(0);
  animation: rippleOut .5s ease-out forwards;
}
@keyframes rippleOut {
  to { transform: scale(16); opacity: 0; }
}

/* ---- ดึงลงเพื่อรีเฟรช ---- */
.ptr {
  position: fixed; top: 10px; left: 50%; z-index: 95;
  width: 38px; height: 38px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--c-surface); color: var(--c-primary);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translate(-50%, 0);
  pointer-events: none;
  transition: opacity .2s ease, transform .25s cubic-bezier(.32, .72, 0, 1);
}
.ptr.is-loading i { animation: ptrSpin .8s linear infinite; }
@keyframes ptrSpin { to { transform: rotate(360deg); } }
@media (min-width: 992px) { .ptr { display: none; } }

/* ---- Bottom sheet ---- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0, 0, 0, .5);
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
}
.sheet-backdrop.is-open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 301;
  max-height: 88dvh; overflow-y: auto;
  padding: var(--sp-6);
  padding-bottom: calc(var(--sp-6) + env(safe-area-inset-bottom));
  background: var(--c-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32, .72, 0, 1);
}
.sheet.is-open { transform: none; }
.sheet__handle {
  width: 40px; height: 4px; margin: 0 auto var(--sp-4);
  border-radius: var(--radius-full); background: var(--c-border);
}
.sheet__title {
  display: flex; align-items: center; gap: var(--sp-3);
  font-size: var(--fs-lg); font-weight: 800; margin: 0 0 var(--sp-4);
}
.sheet__title i { color: var(--c-primary); font-size: .95em; }

/* จอใหญ่: sheet กลายเป็นกล่องกลางจอ */
@media (min-width: 720px) {
  .sheet {
    left: 50%; right: auto; top: 50%; bottom: auto;
    width: min(430px, calc(100vw - 40px));
    max-height: 86dvh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none;
    transform: translate(-50%, calc(-50% + 14px)) scale(.98);
    transition: transform .25s cubic-bezier(.32, .72, 0, 1), opacity .2s ease;
  }
  .sheet.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
  .sheet__handle { display: none; }
}

/* =====================================================================
   3) หัวข้อ
   ===================================================================== */

/* ---- หัวข้อ section ---- */
.u-head {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px dashed color-mix(in srgb, var(--gold) 30%, transparent);
}
.u-head__icon {
  width: 40px; height: 40px; flex: none;
  border-radius: 13px; display: grid; place-items: center;
  font-size: 1rem; color: #fff;
  background: linear-gradient(140deg, var(--c-primary), color-mix(in srgb, var(--c-primary) 55%, #000));
  box-shadow: 0 4px 12px color-mix(in srgb, var(--c-primary) 30%, transparent);
}
.u-head__icon--gold  { background: var(--foil); color: var(--gold-ink); box-shadow: 0 4px 12px color-mix(in srgb, var(--gold) 32%, transparent); }
.u-head__icon--alt   { background: linear-gradient(140deg, var(--c-secondary), var(--c-primary)); }
.u-head__icon--hot   { background: linear-gradient(140deg, color-mix(in srgb, var(--c-danger) 70%, #fb923c), var(--c-danger)); }
.u-head__icon--cold  { background: linear-gradient(140deg, color-mix(in srgb, var(--c-warning) 60%, #fff), var(--c-warning)); }
.u-head__icon--onhead{ background: rgba(255, 255, 255, .22); color: #fff; box-shadow: none; }
.u-head__icon--sm    { width: 34px; height: 34px; border-radius: 10px; font-size: .85rem; }

.u-head__text  { flex: 1; min-width: 0; }
.u-head__title { font-size: var(--fs-lg); font-weight: 800; line-height: 1.25; margin: 0; }
.u-head__sub   { font-size: var(--fs-sm); color: var(--c-text-muted); margin: 0; }
.u-head__link  { font-size: var(--fs-sm); font-weight: 700; white-space: nowrap; flex: none; }

/* ---- หัวข้อหน้า ---- */
.u-pagehead {
  position: relative; overflow: hidden;
  padding: var(--sp-6) var(--sp-6) calc(var(--sp-6) + 5px);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(120% 150% at 100% 0%, color-mix(in srgb, var(--c-accent) 52%, transparent), transparent 58%),
    linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, .2);
}
/* แถบทองคาดขอบล่าง */
.u-pagehead::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px;
  background: var(--foil);
}
.u-pagehead > * { position: relative; z-index: 1; }

.u-pagehead__title {
  font-size: var(--fs-2xl); font-weight: 800; line-height: 1.2; margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}
.u-pagehead__title small { font-size: .6em; font-weight: 700; opacity: .85; }
.u-pagehead__sub {
  margin: 6px 0 0; max-width: 46ch;
  font-size: var(--fs-sm); color: rgba(255, 255, 255, .84);
}
.u-pagehead__icon {
  position: absolute; right: 16px; bottom: -12px; z-index: 0;
  font-size: 5rem; color: rgba(255, 255, 255, .14);
  transform: rotate(-12deg);
}
.u-pagehead__row {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: var(--sp-3);
}
.u-pagehead__row .u-pagehead__title,
.u-pagehead__row .u-pagehead__sub { margin: 0; }
.u-pagehead__body { flex: 1; min-width: 0; }
.u-pagehead__body .u-pagehead__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-pagehead__actions {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4);
}
.u-pagehead__note {
  position: relative; z-index: 1; margin: var(--sp-3) 0 0;
  font-size: var(--fs-sm); color: rgba(255, 255, 255, .88);
}

/* ปุ่ม/ป้ายที่วางบนพื้นหัวข้อหน้า */
.btn-onhead { background: rgba(255, 255, 255, .2); color: #fff; box-shadow: none; }
.btn-onhead:hover:not(:disabled) { background: rgba(255, 255, 255, .3); }
.btn-onhead--solid { background: #fff; color: var(--c-primary); font-weight: 800; }
.btn-onhead--solid:hover:not(:disabled) { background: #fff; filter: brightness(.96); }
.badge-onhead { background: rgba(255, 255, 255, .22); color: #fff; padding: 6px 12px; }

/* =====================================================================
   4) รายการ / เมนู
   ===================================================================== */
.list { border-radius: var(--radius-lg); overflow: hidden; }
.list__row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid color-mix(in srgb, var(--c-border) 70%, transparent);
  transition: background var(--transition);
}
.list__row:last-child { border-bottom: 0; }
.list__row:hover { background: color-mix(in srgb, var(--c-primary) 4%, transparent); }
.list--flush .list__row { padding-left: 0; padding-right: 0; }
.list--flush a.list__row { color: inherit; }
.list--flush a.list__row:hover { text-decoration: none; }
.list__row--top { align-items: flex-start; }
.list__row--boxed {
  color: inherit; border-radius: 12px;
  border: 1px solid var(--c-border);
}
.list__row--boxed:hover { text-decoration: none; color: inherit; }
.list__row.is-unread { background: color-mix(in srgb, var(--c-primary) 5%, transparent); }

.list__main  { flex: 1; min-width: 0; }
.list__title { font-weight: 700; font-size: var(--fs-base); }
.list__sub   { font-size: var(--fs-xs); color: var(--c-text-muted); }
.list__value {
  flex: none; text-align: right;
  font-weight: 800; color: var(--c-primary); font-variant-numeric: tabular-nums;
}
.list__dot { width: 9px; height: 9px; flex: none; margin-top: 6px; border-radius: 50%; background: var(--c-danger); }
.list__icon {
  width: 40px; height: 40px; flex: none;
  border-radius: 13px; display: grid; place-items: center;
  font-size: 1.05rem;
  color: var(--ic, var(--c-primary));
  background: color-mix(in srgb, var(--ic, var(--c-primary)) 13%, transparent);
}

/* ---- เมนูแบบแถว (โปรไฟล์) ---- */
.menu-list { display: flex; flex-direction: column; }
.menu-row {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%;
  padding: var(--sp-3) var(--sp-2);
  border: 0; border-bottom: 1px solid color-mix(in srgb, var(--c-border) 60%, transparent);
  border-radius: 12px;
  background: transparent; color: var(--c-text);
  font-family: inherit; font-size: var(--fs-base); text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.menu-row:last-child { border-bottom: 0; }
.menu-row:hover { background: color-mix(in srgb, var(--c-primary) 5%, transparent); text-decoration: none; color: var(--c-text); }
.menu-row--static { cursor: default; }
.menu-row--static:hover { background: transparent; }
.menu-row__icon {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px; display: grid; place-items: center;
  font-size: .95rem; color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 10%, transparent);
}
.menu-row__icon--gold { color: var(--gold-dk); background: color-mix(in srgb, var(--gold) 15%, transparent); }
:root[data-theme="dark"] .menu-row__icon--gold { color: var(--gold-lt); }
.menu-row__body  { flex: 1; min-width: 0; line-height: 1.35; }
.menu-row__title { display: block; font-weight: 700; font-size: var(--fs-sm); }
.menu-row__sub   { display: block; font-size: var(--fs-xs); color: var(--c-text-muted); }
.menu-row__go    { flex: none; color: var(--c-text-muted); font-size: .78rem; }

/* ---- แถวรายการเดินบัญชี ---- */
.tx-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--c-border) 70%, transparent);
}
.tx-row:last-child { border-bottom: 0; }
.tx-row__main   { flex: 1; min-width: 0; }
.tx-row__title  { font-weight: 700; font-size: var(--fs-sm); }
.tx-row__sub    { font-size: var(--fs-xs); color: var(--c-text-muted); }
.tx-row__side   { flex: none; text-align: right; }
.tx-row__amount { font-weight: 800; font-variant-numeric: tabular-nums; }
.tx-row__amount--in  { color: var(--c-success); }
.tx-row__amount--out { color: var(--c-text); }

/* ---- กล่องพับเก็บได้ ---- */
.disclosure > summary {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  font-weight: 700; cursor: pointer; list-style: none;
}
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after {
  content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900;
  font-size: .75rem; color: var(--c-text-muted);
  transition: transform var(--transition);
}
.disclosure[open] > summary::after { transform: rotate(180deg); }
.disclosure__body { padding: 0 var(--sp-6) var(--sp-6); }

/* ---- รูปปก ---- */
.thumb {
  aspect-ratio: 16 / 9;
  margin-bottom: var(--sp-3);
  border-radius: var(--radius);
  background-color: color-mix(in srgb, var(--c-text) 8%, var(--c-surface));
  background-position: center; background-size: cover; background-repeat: no-repeat;
  display: grid; place-items: center;
  font-size: 2rem; color: var(--c-text-muted);
}
.thumb--wide { aspect-ratio: 16 / 10; }
.thumb--hero { margin-bottom: var(--sp-4); }

/* =====================================================================
   5) สถิติ / แท็บ
   ===================================================================== */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--sp-3); }
.stat-row--tight { gap: var(--sp-2); }
.stat-tile {
  position: relative; overflow: hidden;
  padding: var(--sp-4) var(--sp-3); text-align: center;
  background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.stat-tile::after {
  content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 44%; height: 2px; border-radius: 2px 2px 0 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 70%, transparent), transparent);
}
.stat-tile--sm { padding: var(--sp-3) var(--sp-2); }
.stat-tile__num {
  font-size: var(--fs-2xl); font-weight: 800; line-height: 1.1;
  color: var(--c-primary); font-variant-numeric: tabular-nums;
}
.stat-tile--sm .stat-tile__num { font-size: var(--fs-lg); }
.stat-tile__num--accent { color: var(--c-accent); }
.stat-tile__lbl  { font-size: var(--fs-xs); color: var(--c-text-muted); margin-top: 3px; }
.stat-tile__icon { font-size: 1.05rem; color: var(--c-accent); margin-bottom: 6px; }

/* คอลัมน์ข้างบนเดสก์ท็อป: บังคับ 3 ช่อง ไม่ให้ตกเป็น 2+1 */
@media (min-width: 992px) {
  .layout-with-sidebar > aside .stat-row { grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
  .layout-with-sidebar > aside .stat-tile { padding: var(--sp-3) var(--sp-2); }
  .layout-with-sidebar > aside .stat-tile__num { font-size: var(--fs-xl); }
}

/* ---- แท็บแบบ segmented ---- */
.seg {
  display: inline-flex; gap: 4px; padding: 4px;
  max-width: 100%;
  border: 1px solid var(--c-border); border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--c-text) 6%, var(--c-surface));
}
.seg--scroll {
  display: flex; overflow-x: auto;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.seg--scroll::-webkit-scrollbar { display: none; }
.seg__item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border: 0; border-radius: var(--radius-full);
  background: transparent; color: var(--c-text-muted);
  font-family: inherit; font-size: var(--fs-sm); font-weight: 700;
  white-space: nowrap; cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.seg__item:hover { color: var(--c-text); text-decoration: none; }
.seg__item.is-active {
  color: var(--gold-ink); background: var(--foil);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--gold) 32%, transparent);
}

/* ---- แถบเลื่อนเดือน ---- */
.month-nav {
  display: inline-flex; align-items: center; gap: var(--sp-2); padding: 4px;
  border: 1px solid var(--c-border); border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--c-text) 6%, var(--c-surface));
}
.month-nav__btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  color: var(--c-text-muted); font-size: .8rem;
  transition: background var(--transition), color var(--transition);
}
.month-nav__btn:hover { background: color-mix(in srgb, var(--c-primary) 10%, transparent); color: var(--c-primary); text-decoration: none; }
.month-nav__btn.is-disabled { opacity: .35; pointer-events: none; }
.month-nav__label { min-width: 120px; text-align: center; font-size: var(--fs-sm); font-weight: 700; }

/* ---- ชิปตัวเลข ---- */
.chip--num {
  display: inline-flex; align-items: center;
  padding: 8px 14px; border-radius: 12px;
  font-size: var(--fs-lg); font-weight: 800;
  font-variant-numeric: tabular-nums; letter-spacing: .06em;
  color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-primary) 22%, transparent);
}
.chip--num small { margin-left: 6px; font-size: .68rem; font-weight: 600; letter-spacing: 0; color: var(--c-text-muted); }
.chip--hot  { color: var(--c-danger);  background: color-mix(in srgb, var(--c-danger) 12%, transparent);  border-color: color-mix(in srgb, var(--c-danger) 25%, transparent); }
.chip--cold { color: var(--c-warning); background: color-mix(in srgb, var(--c-warning) 14%, transparent); border-color: color-mix(in srgb, var(--c-warning) 28%, transparent); }
.chip--gold { color: var(--gold-dk);   background: color-mix(in srgb, var(--gold) 14%, transparent);      border-color: color-mix(in srgb, var(--gold) 32%, transparent); }
:root[data-theme="dark"] .chip--gold { color: var(--gold-lt); }

/* =====================================================================
   6) ตั๋วทอง + ตัวเลขรางวัล
   ===================================================================== */

/* ---- การ์ดพรีเมียม (ผลรางวัล / นับถอยหลัง / โค้ดชวนเพื่อน) ---- */
.lux-hero {
  position: relative; overflow: hidden;
  padding: var(--sp-6); text-align: center;
  border-radius: var(--radius-lg);
  color: var(--lux-text);
  background:
    radial-gradient(85% 60% at 50% -10%, color-mix(in srgb, var(--gold) 22%, transparent), transparent 62%),
    linear-gradient(160deg, var(--lux-1), var(--lux-2) 58%, var(--lux-3));
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .14);
}
/* ลายนิรภัยจาง ๆ แบบสลาก */
.lux-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(122deg, transparent 0 11px,
    color-mix(in srgb, var(--gold) 5%, transparent) 11px 12px);
}
.lux-hero > * { position: relative; z-index: 1; }
.lux-hero__label { color: var(--lux-dim); font-size: var(--fs-sm); letter-spacing: .04em; }
.lux-dim { color: var(--lux-dim); }
.lux-hero__stub {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3); flex-wrap: wrap;
  padding-bottom: var(--sp-3); margin-bottom: var(--sp-3);
  border-bottom: 2px dashed color-mix(in srgb, var(--gold) 30%, transparent);
  text-align: left;
}
.lux-hero__stub .serial { color: var(--lux-dim); }
.lux-ribbon {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 16px; border-radius: var(--radius-full);
  font-size: var(--fs-sm); font-weight: 700;
  color: var(--gold-ink); background: var(--foil);
  box-shadow: 0 3px 12px color-mix(in srgb, var(--gold) 32%, transparent);
}
.lux-code {
  margin: var(--sp-2) 0;
  font-size: 2rem; font-weight: 800; letter-spacing: .16em;
  color: var(--gold-lt); font-variant-numeric: tabular-nums;
}
.lux-copy { display: flex; gap: var(--sp-2); max-width: 440px; margin: 0 auto; }
.lux-rays { display: none; }              /* เลิกใช้ลำแสงหมุน — กินแรงเครื่องและรบกวนสายตา */
.glow-gold { filter: drop-shadow(0 4px 12px color-mix(in srgb, var(--gold) 45%, transparent)); }

.form-control--onlux {
  background: rgba(255, 255, 255, .1);
  border-color: color-mix(in srgb, var(--gold) 40%, transparent);
  color: #fff; font-size: var(--fs-sm);
}
.form-control--onlux::placeholder { color: rgba(255, 255, 255, .55); }
.btn-onlux {
  background: rgba(255, 255, 255, .1); color: var(--gold-lt);
  border-color: color-mix(in srgb, var(--gold) 42%, transparent);
  font-weight: 800; box-shadow: none;
}
.btn-onlux:hover:not(:disabled) { background: rgba(255, 255, 255, .16); }

/* การ์ดผลรางวัลแบบตั๋ว — รอยปรุซ้าย-ขวา */
.card--ticket::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-radial-gradient(circle at 0 50%,
      transparent 0 5px, var(--c-bg) 5px 6px, transparent 6px) left center / 6px 21px repeat-y,
    repeating-radial-gradient(circle at 100% 50%,
      transparent 0 5px, var(--c-bg) 5px 6px, transparent 6px) right center / 6px 21px repeat-y;
}

/* ---- เส้นประฉีก + เลขซีเรียล ---- */
.tear {
  height: 0; margin: var(--sp-4) 0; border: 0;
  border-top: 2px dashed color-mix(in srgb, var(--gold) 40%, transparent);
}
.serial {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: .68rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; opacity: .75;
}
.serial::before { content: "No."; letter-spacing: 0; opacity: .7; }

/* ---- ลูกบอลเลขหวย ---- */
.lotto-balls { display: inline-flex; gap: 7px; flex-wrap: wrap; justify-content: center; }
.lotto-ball {
  position: relative; isolation: isolate;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 1.45rem; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: #fff;
  --ball: var(--c-primary);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .8), rgba(255, 255, 255, 0) 32%),
    radial-gradient(circle at 34% 30%, color-mix(in srgb, var(--ball) 45%, #fff), var(--ball) 62%);
  box-shadow:
    inset 0 -6px 10px rgba(0, 0, 0, .3),
    inset 0 3px 4px rgba(255, 255, 255, .4),
    0 4px 10px rgba(0, 0, 0, .26);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
/* แผ่นวงกลมใต้ตัวเลข (z-index -1 = จมใต้ตัวเลข แต่ลอยเหนือพื้นลูกบอล) */
.lotto-ball::before {
  content: ""; position: absolute; inset: 19%; z-index: -1;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .18);
}
.lotto-ball--sm { width: 34px; height: 34px; font-size: 1.05rem; }
.lotto-ball--lg { width: 60px; height: 60px; font-size: 1.9rem; }
.lotto-ball--gold {
  --ball: var(--gold);
  color: var(--gold-ink); text-shadow: 0 1px 1px rgba(255, 255, 255, .4);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 32%),
    var(--foil);
  box-shadow:
    inset 0 -6px 10px rgba(0, 0, 0, .24),
    inset 0 3px 4px rgba(255, 255, 255, .6),
    0 4px 12px color-mix(in srgb, var(--gold) 40%, transparent);
}
.lotto-ball--accent { --ball: var(--c-accent); color: var(--gold-ink); }

/* ---- ป้ายตัวเลขแบบเครื่องจับรางวัล ---- */
.draw-num { display: inline-flex; gap: 4px; }
.draw-num__d {
  position: relative; overflow: hidden;
  min-width: 32px; padding: 7px 4px;
  display: grid; place-items: center; border-radius: 8px;
  font-size: 1.5rem; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--gold-lt);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--lux-1) 70%, #000),
    color-mix(in srgb, var(--lux-3) 80%, #000));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 2px 6px rgba(0, 0, 0, .35);
}
.draw-num__d::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px;
  background: rgba(0, 0, 0, .5);
}
.draw-num--sm .draw-num__d { min-width: 22px; padding: 5px 3px; font-size: 1rem; border-radius: 6px; }

/* ---- นับถอยหลัง ---- */
.countdown { display: flex; gap: var(--sp-2); justify-content: center; }
.countdown__unit {
  flex: 1; min-width: 0; max-width: 78px;
  padding: var(--sp-2); text-align: center;
  background: var(--c-bg);
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
}
.countdown__num { font-size: var(--fs-xl); font-weight: 800; color: var(--c-text); font-variant-numeric: tabular-nums; }
.countdown__lbl { font-size: var(--fs-xs); color: var(--c-text-muted); }

/* บนตั๋วพื้นเข้ม: ป้ายกลไกสีทอง */
.lux-hero .countdown__unit {
  position: relative; overflow: hidden;
  padding: var(--sp-3) var(--sp-2);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--lux-1) 70%, #000),
    color-mix(in srgb, var(--lux-3) 80%, #000));
  border-color: color-mix(in srgb, var(--gold) 32%, transparent);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1);
}
.lux-hero .countdown__unit::after {
  content: ""; position: absolute; left: 0; right: 0; top: 52%; height: 1px;
  background: rgba(0, 0, 0, .5);
}
.lux-hero .countdown__num { color: var(--gold-lt); font-size: var(--fs-2xl); }
.lux-hero .countdown__lbl { color: var(--lux-dim); font-weight: 600; }

/* ---- กระเป๋าเงิน ---- */
.wallet {
  position: relative; overflow: hidden;
  padding: var(--sp-6) var(--sp-4);
  border-radius: var(--radius-lg);
  color: var(--lux-text);
  background:
    radial-gradient(90% 70% at 50% -20%, color-mix(in srgb, var(--gold) 26%, transparent), transparent 62%),
    linear-gradient(150deg, var(--lux-1), var(--lux-2) 62%, var(--lux-3));
  border: 1px solid color-mix(in srgb, var(--gold) 36%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.wallet__label { font-size: var(--fs-sm); color: var(--lux-dim); }
.wallet__amount {
  font-size: clamp(2rem, 8vw, 2.7rem); font-weight: 800; line-height: 1.15;
  font-variant-numeric: tabular-nums;
  color: var(--gold-lt);
}
.wallet__amount small { font-size: 1rem; font-weight: 700; }
.wallet__badge {
  width: 52px; height: 52px; flex: none;
  border-radius: 16px; display: grid; place-items: center;
  font-size: 1.3rem; color: var(--gold-ink); background: var(--foil);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--gold) 38%, transparent);
}
.wallet__actions { display: grid; gap: var(--sp-2); margin-top: var(--sp-4); }
.wallet__actions--2 { grid-template-columns: 1fr 1fr; }
.wallet__note { margin-top: var(--sp-3); font-size: var(--fs-xs); color: var(--lux-dim); }
.wallet__note--warn { color: var(--gold-lt); }

/* =====================================================================
   7) หน้าเฉพาะ
   ===================================================================== */

/* ---- การ์ดเลือกประเภทหวย ---- */
.type-card {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  color: var(--c-text); text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.type-card:hover {
  text-decoration: none; transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--gold) 50%, var(--c-border));
  box-shadow: var(--shadow-md);
}
.type-card__icon   { font-size: 2rem; line-height: 1; }
.type-card__name   { font-size: var(--fs-sm); font-weight: 600; text-align: center; }
.type-card__status { font-size: var(--fs-xs); }

/* ---- หน้าทายผล ---- */
.step-head { display: flex; align-items: center; gap: 8px; margin-bottom: var(--sp-2); }
.step-no {
  width: 22px; height: 22px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--c-primary); color: #fff;
  font-size: var(--fs-xs); font-weight: 800;
}
.pf-field {
  padding: var(--sp-3);
  background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.pf-field:focus-within {
  border-color: color-mix(in srgb, var(--c-primary) 55%, var(--c-border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-primary) 10%, transparent);
}
.pf-field.is-filled { border-color: color-mix(in srgb, var(--c-success) 45%, var(--c-border)); }
.pf-field__head    { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.pf-field__label   { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 700; }
.pf-field__hint    { font-size: var(--fs-xs); font-weight: 500; color: var(--c-text-muted); }
.pf-field__actions { margin-left: auto; display: inline-flex; gap: 4px; }
.pf-mini {
  width: 30px; height: 30px;
  display: grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--c-border); background: var(--c-bg);
  color: var(--c-text-muted); font-size: .8rem; cursor: pointer;
}
.pf-mini:hover { color: var(--c-primary); border-color: color-mix(in srgb, var(--c-primary) 40%, var(--c-border)); }

.digit-row { display: flex; gap: var(--sp-2); justify-content: center; }
.digit-cell {
  width: 100%; max-width: 60px; aspect-ratio: 3 / 3.6; padding: 0;
  text-align: center;
  font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--c-text);
  background: color-mix(in srgb, var(--c-primary) 4%, var(--c-surface));
  border: 1.5px solid var(--c-border); border-radius: 12px;
  outline: none; -moz-appearance: textfield;
}
.digit-cell::-webkit-outer-spin-button,
.digit-cell::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.digit-cell::placeholder { color: color-mix(in srgb, var(--c-text-muted) 55%, transparent); font-weight: 400; }
.digit-cell:focus {
  border-color: var(--c-primary); background: var(--c-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 16%, transparent);
}
.digit-cell.is-set { border-color: color-mix(in srgb, var(--c-primary) 45%, var(--c-border)); }

.bet-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.bet-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--radius-full);
  background: var(--c-surface); color: var(--c-text);
  border: 1.5px solid var(--c-border);
  font-size: var(--fs-sm); font-weight: 700;
  cursor: pointer; user-select: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.bet-chip:hover { border-color: color-mix(in srgb, var(--c-primary) 45%, var(--c-border)); }
.bet-chip__pts { font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-muted); }
.bet-chip.is-on {
  background: var(--c-primary); border-color: var(--c-primary); color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--c-primary) 28%, transparent);
}
.bet-chip.is-on .bet-chip__pts { color: rgba(255, 255, 255, .85); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); max-width: 320px; margin: 0 auto; }
.keypad__btn {
  padding: var(--sp-3) 0; border-radius: 14px;
  background: var(--c-surface); color: var(--c-text);
  border: 1px solid var(--c-border);
  font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background var(--transition), transform .06s ease;
}
.keypad__btn:hover  { background: color-mix(in srgb, var(--c-primary) 8%, var(--c-surface)); }
.keypad__btn:active { transform: scale(.94); }
.keypad__btn--fn     { font-size: 1rem; font-weight: 700; color: var(--c-text-muted); }
.keypad__btn--danger { color: var(--c-danger); }

/* โมดอลใส่ราคา */
.price-modal { position: fixed; inset: 0; z-index: 400; display: none; }
.price-modal.is-open { display: block; }
.price-modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.price-modal__box {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(94vw, 620px); max-height: 88dvh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--c-surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.price-modal__head {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: var(--sp-4); border-bottom: 1px solid var(--c-border);
}
.price-modal__head > div:first-child { flex: 1; }
.price-modal__tools {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-bg); border-bottom: 1px solid var(--c-border);
}
.price-modal__body { flex: 1; overflow-y: auto; padding: 0 var(--sp-4); }
.price-modal__foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--c-bg); border-top: 1px solid var(--c-border);
}
.price-modal__foot > .u-sm { flex: 1; min-width: 200px; }
.price-input {
  width: 100px; min-height: 40px; padding: 6px 10px;
  text-align: right; font-weight: 700; font-variant-numeric: tabular-nums;
}

.slip { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.slip th, .slip td { padding: 10px var(--sp-2); text-align: left; border-bottom: 1px solid var(--c-border); }
.slip th { font-size: var(--fs-xs); font-weight: 700; color: var(--c-text-muted); }
.slip td.slip__num { font-family: var(--font-mono); font-size: 1.05rem; font-weight: 800; letter-spacing: .08em; }
.slip tfoot td { border-bottom: 0; font-weight: 800; }

/* ---- กงล้อ ---- */
.draw-stage {
  width: fit-content; margin: 0 auto;
  padding: var(--sp-4) var(--sp-6);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(70% 60% at 50% 0%, color-mix(in srgb, var(--gold) 12%, transparent), transparent 62%),
    linear-gradient(160deg, var(--lux-1), var(--lux-3));
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 12px 28px rgba(0, 0, 0, .3);
}
.wheel-wrap { position: relative; width: min(78vw, 300px); margin: 0 auto; aspect-ratio: 1; }
.wheel-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 3;
  width: 0; height: 0;
  border-left: 14px solid transparent; border-right: 14px solid transparent;
  border-top: 26px solid var(--c-accent);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .4));
}
.wheel {
  position: absolute; inset: 0; overflow: hidden;
  border-radius: 50%; border: 6px solid var(--c-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(255, 255, 255, .15);
  transition: transform 5s cubic-bezier(.17, .67, .16, 1);
}
.wheel__seg { position: absolute; inset: 0; display: flex; justify-content: center; pointer-events: none; }
.wheel__label {
  width: 22%; margin-top: 14%; text-align: center;
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
  font-size: .62rem; font-weight: 700; line-height: 1.15; word-break: break-word;
}
.wheel__label img {
  width: 100%; max-width: 38px; aspect-ratio: 1; object-fit: contain;
  display: block; margin: 0 auto 2px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
}
.wheel-hub {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 22%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-surface); border: 4px solid var(--c-accent);
  color: var(--c-accent); font-size: 1.4rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.wheel-spinning { pointer-events: none; opacity: .85; }
.wheel-stats { grid-template-columns: 1fr 1fr; max-width: 380px; margin-inline: auto; }
.bulbs { position: relative; }        /* ไฟวิ่งถูกถอดออก — เหลือคลาสไว้กัน markup พัง */

/* ---- อันดับเซียน ---- */
.lb-page { padding-bottom: 104px; }
.lb-stage { padding: var(--sp-6) var(--sp-4) var(--sp-4); }
.lb-stage__glow { display: none; }

.lb-podium {
  display: grid; grid-template-columns: 1fr 1.12fr 1fr;
  gap: var(--sp-2); align-items: end; margin-top: var(--sp-6);
}
.lb-podium--1 { grid-template-columns: minmax(0, 260px); justify-content: center; }
.lb-podium--2 { grid-template-columns: 1fr 1fr; max-width: 460px; margin-inline: auto; }
.lb-slot { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.lb-slot__crown { margin-bottom: 6px; font-size: 1.35rem; color: var(--gold-lt); }

.lb-ava {
  position: relative;
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.4rem; font-weight: 800; color: #fff;
  background: linear-gradient(140deg,
    color-mix(in srgb, var(--c-primary) 78%, #fff),
    color-mix(in srgb, var(--c-primary) 82%, #000));
  box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
}
.lb-ava img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.lb-ava::before {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%; border: 2px solid rgba(255, 255, 255, .28); pointer-events: none;
}
.lb-ava--1 { width: 84px; height: 84px; font-size: 1.9rem; }
.lb-ava--1::before { border-color: var(--gold-lt); box-shadow: 0 0 18px color-mix(in srgb, var(--gold) 50%, transparent); }
.lb-ava--2::before { border-color: #dde3ea; }
.lb-ava--3::before { border-color: #d9a06a; }
.lb-ava__medal {
  position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  min-width: 24px; height: 24px; padding: 0 6px;
  display: grid; place-items: center; border-radius: var(--radius-full);
  font-size: .78rem; font-weight: 800; color: var(--gold-ink);
  background: var(--foil); border: 2px solid var(--lux-2);
}
.lb-ava--2 .lb-ava__medal { background: linear-gradient(135deg, #f4f7fb, #c3ccd8); color: #37414f; }
.lb-ava--3 .lb-ava__medal { background: linear-gradient(135deg, #f3c795, #c78038); color: #4a2a06; }

.lb-slot__name {
  margin-top: var(--sp-4); max-width: 100%;
  font-size: var(--fs-sm); font-weight: 700; color: var(--lux-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lb-slot--1 .lb-slot__name { font-size: var(--fs-base); }
.lb-slot__pts { font-size: var(--fs-lg); font-weight: 800; line-height: 1.2; color: var(--gold-lt); font-variant-numeric: tabular-nums; }
.lb-slot--1 .lb-slot__pts { font-size: var(--fs-xl); }
.lb-slot__pts span { margin-left: 4px; font-size: .68rem; font-weight: 600; color: var(--lux-dim); }
.lb-slot.is-me .lb-slot__name { color: var(--gold-lt); }

.lb-stand {
  width: 100%; margin-top: var(--sp-3);
  display: grid; place-items: center;
  border-radius: 14px 14px 0 0;
  border: 1px solid rgba(255, 255, 255, .1); border-bottom: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .02));
}
.lb-stand__no { font-size: 1.5rem; font-weight: 800; color: rgba(255, 255, 255, .45); }
.lb-slot--1 .lb-stand {
  height: 92px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold) 50%, transparent), transparent);
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
}
.lb-slot--1 .lb-stand__no { color: var(--gold-lt); font-size: 1.9rem; }
.lb-slot--2 .lb-stand { height: 66px; background: linear-gradient(180deg, rgba(222, 229, 238, .3), transparent); }
.lb-slot--3 .lb-stand { height: 50px; background: linear-gradient(180deg, rgba(199, 128, 56, .34), transparent); }

.lb-you {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border-radius: var(--radius-full); vertical-align: middle;
  font-size: .66rem; font-weight: 800;
  color: var(--gold-ink); background: var(--foil);
}

.lb-summary {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2);
  margin-top: var(--sp-4); padding-top: var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.lb-summary > div { font-size: .72rem; line-height: 1.5; color: var(--lux-dim); }
.lb-summary span { display: block; font-size: var(--fs-lg); font-weight: 800; color: var(--gold-lt); font-variant-numeric: tabular-nums; }

.lb-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2); border-radius: 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--c-border) 65%, transparent);
  transition: background var(--transition);
}
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover { background: color-mix(in srgb, var(--c-primary) 5%, transparent); }
.lb-row.is-me {
  background: color-mix(in srgb, var(--c-accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c-accent) 40%, transparent);
}
.lb-rank { width: 34px; flex: none; text-align: center; font-weight: 800; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.lb-row__name { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-row__pts  { font-weight: 800; color: var(--c-primary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-row__pts small { font-size: .7rem; font-weight: 600; color: var(--c-text-muted); }

/* แถบอันดับของฉัน (ลอยเหนือแถบเมนูล่าง) */
.lb-me {
  position: fixed; left: 0; right: 0; z-index: 90;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom));
  padding: var(--sp-2) var(--sp-4);
  pointer-events: none;
}
.lb-me__wrap { padding: 0; }
.lb-me__card {
  pointer-events: auto;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: 16px;
  color: var(--lux-text);
  background: linear-gradient(135deg, var(--lux-1), var(--lux-3));
  border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .45);
}
.lb-me__rank {
  min-width: 46px; height: 38px; padding: 0 10px; flex: none;
  display: grid; place-items: center; border-radius: 12px;
  font-weight: 800; color: var(--gold-ink); background: var(--foil);
}
.lb-me__rank.is-empty {
  background: color-mix(in srgb, var(--gold) 22%, transparent);
  color: var(--gold-lt); font-size: var(--fs-lg);
}
.lb-me__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.lb-me__text b { font-size: var(--fs-sm); }
.lb-me__text small { font-size: .72rem; color: var(--lux-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-me__pts { font-weight: 800; color: var(--gold-lt); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-me__pts small { font-size: .7rem; font-weight: 600; color: var(--lux-dim); }

@media (min-width: 992px) {
  .lb-me { bottom: var(--sp-4); }
  .lb-me__card { max-width: 560px; margin-left: auto; }
  .lb-page { padding-bottom: 96px; }
}

/* ---- โปรไฟล์ ---- */
@media (max-width: 991px) {
  /* align-items: start มาจาก .layout-with-sidebar (ตั้งไว้ให้คอลัมน์ของ grid ไม่ยืดเท่ากัน)
     พอสลับเป็น flex column ค่าเดิมกลายเป็นการจัดแนวแกนขวาง = การ์ดหดเหลือเท่าเนื้อหา
     ต้อง stretch กลับ ไม่งั้นบนมือถือการ์ดจะกว้างครึ่งจอ */
  .profile-layout { display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-4); }
  .profile-layout > aside { order: -1; }
  .profile-layout > aside > section + section { margin-top: var(--sp-4); }
}

/* ---- บทความ ---- */
.article__title { font-size: var(--fs-2xl); font-weight: 800; line-height: 1.3; }
.article__lead {
  padding-left: var(--sp-3);
  border-left: 3px solid var(--c-primary);
  font-size: var(--fs-sm); color: var(--c-text-muted);
}
.article__body { line-height: 1.85; white-space: pre-wrap; }

/* ---- หน้า Login / Register ---- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-4); }
.auth-card { width: 100%; max-width: 430px; }
.auth-card .card { box-shadow: var(--shadow-lg); }
.auth-brand { text-align: center; margin-bottom: var(--sp-6); }
.auth-brand__logo {
  width: 62px; height: 62px; margin: 0 auto var(--sp-3);
  border-radius: 20px; overflow: hidden;
  display: grid; place-items: center;
  font-size: 1.7rem; color: #fff;
  background: linear-gradient(140deg, var(--c-primary), var(--c-accent));
  box-shadow: 0 10px 24px color-mix(in srgb, var(--c-primary) 32%, transparent);
}
.auth-brand__logo img { width: 100%; height: 100%; object-fit: cover; }
.auth-brand__name { font-size: var(--fs-2xl); font-weight: 800; }
.auth-title { text-align: center; font-size: var(--fs-xl); font-weight: 800; margin-bottom: var(--sp-2); }
.auth-lead  { text-align: center; font-size: var(--fs-sm); color: var(--c-text-muted); margin-bottom: var(--sp-4); }
.auth-foot  { text-align: center; font-size: var(--fs-sm); color: var(--c-text-muted); margin: var(--sp-4) 0 0; }
.auth-foot--tight { margin-top: var(--sp-2); }

/* =====================================================================
   8) แลนดิ้งย่อย — สไลด์แบนเนอร์ / ตัวเลือกธนาคาร / สมัคร 3 สเต็ป
   ===================================================================== */
.slider { position: relative; overflow: hidden; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }
.slider__track { display: flex; transition: transform .45s cubic-bezier(.4, 0, .2, 1); }
.slide {
  position: relative; overflow: hidden;
  min-width: 100%; aspect-ratio: 16 / 6.4;
  display: flex; align-items: flex-end; padding: var(--sp-4);
  background-size: cover; background-position: center;
  color: #fff; text-decoration: none;
}
.slide--fallback {
  background:
    radial-gradient(70% 80% at 100% 0%, color-mix(in srgb, var(--gold) 46%, transparent), transparent 60%),
    linear-gradient(135deg, var(--c-primary), var(--lux-1) 70%, var(--lux-3));
}
.slide::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .45), transparent 60%); }
.slide:hover { text-decoration: none; }
.slide__deco { position: absolute; top: -10px; right: 8px; font-size: 5rem; color: rgba(255, 255, 255, .12); transform: rotate(-12deg); }
.slide__body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.slide__caption {
  max-width: 80%;
  font-size: var(--fs-xl); font-weight: 800; line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .45);
}
.slide__cta {
  align-self: flex-start; padding: 3px 14px; border-radius: var(--radius-full);
  font-size: var(--fs-sm); font-weight: 700;
  color: var(--gold-ink); background: var(--foil);
}
.slider__dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; gap: 6px; justify-content: center; }
.slider__dot {
  width: 8px; height: 8px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .5); cursor: pointer;
}
.slider__dot.is-active { background: #fff; }

/* ตัวเลือกธนาคาร */
.bank-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-2); }
.bank-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 2px; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition), border-color var(--transition);
}
.bank-tile:hover { background: color-mix(in srgb, var(--c-primary) 6%, transparent); }
.bank-tile.is-selected { border-color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 10%, transparent); }
.bank-tile__logo {
  position: relative; width: 42px; height: 42px;
  border-radius: 10px; overflow: hidden;
  display: grid; place-items: center;
  background: var(--bc, var(--c-secondary));
  box-shadow: var(--shadow-sm);
}
.bank-tile__logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; }
.bank-tile__abbr { color: #fff; font-size: .62rem; font-weight: 800; line-height: 1; text-align: center; padding: 2px; }
.bank-tile__name { font-size: .62rem; line-height: 1.1; text-align: center; color: var(--c-text-muted); }
.bank-tile.is-selected .bank-tile__name { color: var(--c-primary); font-weight: 600; }

/* สมัคร 3 สเต็ป */
.wiz-steps { display: flex; align-items: center; justify-content: center; gap: 4px; margin-bottom: var(--sp-4); }
.wiz-dot {
  width: 30px; height: 30px; flex: none;
  display: grid; place-items: center; border-radius: 50%;
  font-size: var(--fs-sm); font-weight: 800;
  color: var(--c-text-muted); background: var(--c-bg);
  border: 2px solid var(--c-border);
}
.wiz-dot.is-active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.wiz-dot.is-done   { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.wiz-line { width: 34px; height: 2px; background: var(--c-border); }

/* ช่องทางที่รู้จัก */
.choice-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.choice {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: var(--sp-3) 4px; border-radius: var(--radius);
  background: var(--c-surface); border: 2px solid var(--c-border);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color var(--transition), background var(--transition);
}
.choice:hover { border-color: color-mix(in srgb, var(--c-primary) 40%, var(--c-border)); }
.choice.is-selected { border-color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 8%, transparent); }
.choice i { font-size: 1.5rem; }
.choice span { font-size: var(--fs-xs); font-weight: 600; line-height: 1.1; text-align: center; }

/* =====================================================================
   9) โมชัน — เบา ๆ พอให้รู้สึกมีชีวิต ไม่รบกวนการใช้งาน
   ===================================================================== */
@media (prefers-reduced-motion: no-preference) {
  .u-in { animation: uIn .4s cubic-bezier(.22, .8, .3, 1) both; }
  @keyframes uIn { from { opacity: 0; } to { opacity: 1; } }

  /* ลูกบอลหล่นลงมาทีละลูก */
  .lotto-balls .lotto-ball { animation: ballDrop .45s cubic-bezier(.24, .9, .32, 1.3) both; }
  @keyframes ballDrop {
    from { opacity: 0; scale: .7; }
    60%  { opacity: 1; scale: 1.05; }
    to   { opacity: 1; scale: 1; }
  }
  .lotto-balls .lotto-ball:nth-child(1) { animation-delay: .02s; }
  .lotto-balls .lotto-ball:nth-child(2) { animation-delay: .09s; }
  .lotto-balls .lotto-ball:nth-child(3) { animation-delay: .16s; }
  .lotto-balls .lotto-ball:nth-child(4) { animation-delay: .23s; }
  .lotto-balls .lotto-ball:nth-child(5) { animation-delay: .30s; }
  .lotto-balls .lotto-ball:nth-child(6) { animation-delay: .37s; }

  /* ปุ่มสำคัญเรืองแสงเป็นจังหวะ */
  .pulse-gold { animation: pulseGold 2.6s ease-out infinite; }
  @keyframes pulseGold {
    0%, 100% { box-shadow: 0 6px 18px color-mix(in srgb, var(--gold) 34%, transparent); }
    55%      { box-shadow: 0 8px 24px color-mix(in srgb, var(--gold) 50%, transparent); }
  }

  /* ** ห้ามใส่ transform ใน .page-enter **
     animation-fill-mode: both ทำให้ค่าค้างถาวร → .page กลายเป็น stacking context
     แล้ว modal/sheet ที่อยู่ข้างในจะถูกกดจนคลิกไม่ได้ */
  .page-enter { animation: pageIn .25s ease both; }
  @keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
}
/* ระหว่างหมุนดรัมเลข */
.lotto-ball.is-rolling { animation: none !important; }
.lotto-ball.is-landed  { animation: ballDrop .4s cubic-bezier(.2, .9, .3, 1.5) both !important; }

@media (hover: none) {
  .btn:active, .bottom-nav__item:active, .card--hover:active { opacity: .85; }
}

/* =====================================================================
   10) จอเล็ก
   ===================================================================== */
@media (max-width: 640px) {
  .u-pagehead { padding: var(--sp-4); border-radius: var(--radius); }
  .u-pagehead__title { font-size: var(--fs-xl); }
  .u-pagehead__sub { font-size: var(--fs-xs); }
  .u-pagehead__icon { font-size: 3.4rem; right: 8px; bottom: -8px; }
  .disclosure > summary { padding: var(--sp-4); }
  .disclosure__body { padding: 0 var(--sp-4) var(--sp-4); }
}

@media (max-width: 560px) {
  /* หัวข้อ */
  .u-head { gap: var(--sp-2); margin-bottom: var(--sp-3); }
  .u-head__icon { width: 34px; height: 34px; border-radius: 11px; font-size: .9rem; }
  .u-head__title { font-size: var(--fs-base); }
  .u-head__sub, .u-head__link { font-size: var(--fs-xs); }
  .u-pagehead__actions .btn { flex: 1 1 auto; }

  /* สถิติ — ลด min ให้ครบ 3 ช่อง ไม่ตกเป็น 2+1 */
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: var(--sp-2); }
  .stat-tile { padding: var(--sp-3) 4px; }
  .stat-tile__num { font-size: var(--fs-lg); }
  .stat-tile__lbl { font-size: .66rem; }

  /* ตั๋วทอง */
  .lux-hero { padding: var(--sp-4) var(--sp-3); }
  .lux-code { font-size: 1.5rem; letter-spacing: .12em; }
  .lux-copy { flex-direction: column; }
  .wallet { padding: var(--sp-4) var(--sp-3); }
  .wallet__badge { width: 44px; height: 44px; font-size: 1.1rem; }

  /* ลูกบอล — 6 หลักต้องพอดีจอ */
  .lotto-balls { gap: 5px; }
  .lotto-ball    { width: clamp(34px, 11.5vw, 46px); height: clamp(34px, 11.5vw, 46px); font-size: clamp(1rem, 5vw, 1.45rem); }
  .lotto-ball--lg { width: clamp(42px, 14vw, 60px); height: clamp(42px, 14vw, 60px); font-size: clamp(1.3rem, 6.5vw, 1.9rem); }
  .lotto-ball--sm { width: clamp(22px, 6.6vw, 34px); height: clamp(22px, 6.6vw, 34px); font-size: clamp(.72rem, 3vw, 1.05rem); }
  .grid--tight .lotto-balls { gap: 3px; }

  .draw-num { gap: 3px; }
  .draw-num__d { min-width: 26px; padding: 6px 3px; font-size: 1.2rem; }
  .draw-num--sm .draw-num__d { min-width: 18px; padding: 4px 2px; font-size: .85rem; }

  /* นับถอยหลัง */
  .countdown { gap: 6px; }
  .countdown__unit { padding: var(--sp-2) 2px; max-width: none; }
  .lux-hero .countdown__unit { padding: var(--sp-2) 2px; }
  .lux-hero .countdown__num { font-size: var(--fs-xl); }
  .countdown__lbl { font-size: .66rem; }

  /* รายการ */
  .list__row { gap: var(--sp-2); padding: var(--sp-3) 0; }
  .list__title { font-size: var(--fs-sm); }
  .list__value { font-size: var(--fs-sm); white-space: nowrap; }
  .tx-row { gap: var(--sp-2); }

  .seg__item { padding: 8px 14px; }
  .slip { font-size: var(--fs-xs); }
  .slip th, .slip td { padding: 8px 4px; }
  .price-input { width: 84px; min-height: 36px; }
  .price-modal__head, .price-modal__tools, .price-modal__foot { padding: var(--sp-3); }
  .price-modal__body { padding: 0 var(--sp-3); overflow-x: auto; }
  .price-modal__foot { flex-direction: column; align-items: stretch; }
  .price-modal__foot > .u-sm { min-width: 0; }
  .price-modal__foot .btn { width: 100%; }
}

@media (max-width: 480px) {
  .price-modal__box {
    width: 100vw; height: 100dvh; max-height: none;
    top: 0; left: 0; transform: none; border-radius: 0;
  }
  .choice-grid { grid-template-columns: repeat(3, 1fr); }
  .digit-cell { max-width: 52px; font-size: 1.35rem; }
}

@media (max-width: 420px) {
  .lb-ava { width: 54px; height: 54px; font-size: 1.2rem; }
  .lb-ava--1 { width: 70px; height: 70px; font-size: 1.6rem; }
  .lb-slot__pts { font-size: var(--fs-base); }
  .lb-slot--1 .lb-slot__pts { font-size: var(--fs-lg); }
  .lb-summary span { font-size: var(--fs-base); }
  .lb-stage { padding-inline: var(--sp-3); }
}

@media (max-width: 400px) {
  .digit-row { gap: 5px; }
  .digit-cell { max-width: none; font-size: 1.15rem; border-radius: 10px; }
  .pf-field { padding: var(--sp-2); border-radius: 13px; }
  .bet-chip { padding: 8px 12px; font-size: var(--fs-xs); }
}

@media (max-width: 380px) {
  /* 320px: การ์ดเหลือ 256px — min 78 + gap 5 ถึงจะได้ครบ 3 ช่อง */
  .stat-row { grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); gap: 5px; }
  .stat-tile { padding: var(--sp-2) 2px; }
  .stat-tile__num { font-size: var(--fs-base); }
  .u-pagehead__title { font-size: var(--fs-lg); }
  .grid--tight .lotto-ball--sm { width: 20px; height: 20px; font-size: .66rem; }
}
