/* ============================================================
 *  template3.css — "แบบ 3" หน้าแรกก่อนล็อกอิน (โทนกรมท่า + ปุ่มเขียว)
 *  มีผลเฉพาะเมื่อ <body> มี class .tpl3-active (ตั้งโดย template3.js)
 * ========================================================== */

:root {
  --t3-bg: #070c1c;
  --t3-bg-glow: #14224a;
  --t3-surface: #0f1830;
  --t3-surface-2: var(--t3-surface-a);
  --t3-surface-a: #101a34;
  --t3-surface-b: #0d1730;
  --t3-surface-deep: #0a1023;
  --t3-bg-rgb: 7, 12, 28;
  --t3-border: #1d2b4d;
  --t3-border-strong: #2f3e62;
  --t3-ink: #e3ebf7;
  --t3-ink-2: #ccd5e5;
  --t3-muted: #93a4bd;
  --t3-primary: #2f6bff;
  --t3-primary-hi: #3b78ff;
  --t3-primary-soft: #4d8dff;
  --t3-primary-rgb: 47, 107, 255;
  --t3-primary-ink: #ffffff;
  --t3-nav-btn: var(--t3-ink-2);
  --t3-logout-btn: var(--t3-ink-2);
  --t3-rank: var(--t3-cta-from);
  --t3-cta-from: #19d08a;
  --t3-cta-to: #11b679;
  --t3-cta-ink: #0a1733;
  --t3-cta-soft: #3ae199;
  --t3-cta-text: var(--t3-cta-from);
  --t3-cta-rgb: 25, 208, 138;
  --t3-header-from: #050a24;
  --t3-header-to: #0a1545;
  --t3-radius: 14px;
  --t3-btn-radius: 10px;
  --t3-container: 1080px;
}

body.tpl3-active { overflow: hidden; }
body.tpl3-active .topbar,
body.tpl3-active .app-install,
body.tpl3-active .cat-tabs,
body.tpl3-active .bottom-nav,
body.tpl3-active .cs-float,
body.tpl3-active .pred-float,
body.tpl3-active .footer { display: none !important; }

.t3-root {
  position: fixed;
  inset: 0;
  z-index: 150;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: 'Anuphan', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--t3-ink);
  background: radial-gradient(1200px 600px at 50% -10%, var(--t3-bg-glow) 0%, var(--t3-bg) 55%), var(--t3-bg);
}
.t3-root *, .t3-root *::before, .t3-root *::after { box-sizing: border-box; }
.t3-root a { color: inherit; text-decoration: none; }
.t3-root img { max-width: 100%; display: block; }
.t3-root h2, .t3-root h3, .t3-root p { margin: 0; }
.t3-container { width: min(var(--t3-container), 100%); margin: 0 auto; padding: 0 20px; }
.t3-center { text-align: center; }

/* ---------- ปุ่ม ---------- */
.t3-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--t3-btn-radius);
  font-weight: 600; font-size: 15px; white-space: nowrap; cursor: pointer; border: 0;
  transition: background .2s, transform .15s, box-shadow .2s, color .2s;
}
.t3-btn--primary { background: linear-gradient(90deg, var(--t3-cta-from), var(--t3-cta-to)); color: var(--t3-cta-ink) !important; }
.t3-btn--primary:hover { background: linear-gradient(90deg, var(--t3-cta-to), var(--t3-cta-from)); box-shadow: 0 6px 20px rgba(var(--t3-cta-rgb), .3); }
.t3-btn--outline { border: 1px solid var(--t3-border-strong); color: var(--t3-ink) !important; background: transparent; }
.t3-btn--outline:hover { background: var(--t3-header-to); color: var(--t3-ink-2) !important; }
.t3-btn--lg { height: 48px; padding: 0 26px; font-size: 16px; }
.t3-btn--pill { height: 52px; padding: 0 30px 0 8px; gap: 12px; border-radius: 999px; background: linear-gradient(135deg, var(--t3-cta-soft) -20%, var(--t3-cta-from) 45%, var(--t3-cta-to) 100%); color: var(--t3-cta-ink) !important; font-size: 17px; font-weight: 700; letter-spacing: .01em; border: 1px solid rgba(255, 255, 255, .16); box-shadow: 0 10px 28px -8px rgba(var(--t3-cta-rgb), .65), inset 0 1px 0 rgba(255, 255, 255, .25); }
.t3-btn--pill i { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, .18); color: inherit !important; font-size: 15px; }
.t3-btn--pill:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 32px -8px rgba(var(--t3-cta-rgb), .75), inset 0 1px 0 rgba(255, 255, 255, .3); }

/* ---------- แถบประกาศ + header ---------- */
.t3-announce { background: linear-gradient(90deg, var(--t3-cta-to), var(--t3-cta-from)); color: var(--t3-cta-ink); font-size: 14px; }
.t3-announce-inner { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 30px; text-align: center; }
.t3-announce a { font-weight: 700; text-decoration: underline !important; }

.t3-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(90deg, var(--t3-header-from), var(--t3-header-to));
  border-bottom: 1px solid var(--t3-border);
}
.t3-header-inner { display: flex; align-items: center; gap: 24px; height: 65px; }
.t3-brand { flex: 0 0 auto; display: flex; align-items: center; }
.t3-brand-logo { height: 34px; width: auto; max-width: 180px; object-fit: contain; }
.t3-brand-text { font-weight: 700; font-size: 22px; color: #fff; }
.t3-nav { display: flex; gap: 20px; flex: 1; justify-content: center; }
.t3-nav a { font-size: 15px; font-weight: 500; color: #cfd8ea; padding: 6px 2px; white-space: nowrap; position: relative; transition: color .15s; }
.t3-nav a:hover, .t3-nav a[aria-current] { color: #fff; }
.t3-nav a[aria-current]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px; background: var(--t3-cta-from); }
.t3-ctas { display: flex; gap: 10px; flex: 0 0 auto; }
.t3-nav-toggle { display: none; align-items: center; gap: 6px; background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; font: inherit; font-size: 13px; }
.t3-bars { display: grid; gap: 4px; }
.t3-bars span { display: block; width: 20px; height: 2px; border-radius: 2px; background: currentColor; }

.t3-mnav {
  position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 64px 24px 24px; background: linear-gradient(90deg, var(--t3-header-to), var(--t3-header-from));
  transform: translateY(-100%); transition: transform .2s ease; overflow-y: auto;
}
.t3-mnav.open { transform: none; }
.t3-mnav-close { position: absolute; top: 14px; right: 16px; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; }
.t3-mnav-logo { height: 46px; width: auto; max-width: 220px; object-fit: contain; }
.t3-mnav-links { display: grid; gap: 4px; width: 100%; max-width: 360px; text-align: center; }
.t3-mnav-links a { padding: 12px; font-size: 18px; font-weight: 600; color: #fff; border-radius: 10px; transition: color .15s, background .15s; }
.t3-mnav-links a:hover { color: #e5b752; background: rgba(255, 255, 255, .06); }
.t3-mnav-ctas { display: grid; gap: 10px; width: 100%; max-width: 360px; }
.t3-mnav-ctas .t3-btn { height: 46px; }
.t3-mnav-note { margin-top: auto; font-size: 12px; color: rgba(255, 255, 255, .6); }

/* ---------- hero slider ---------- */
.t3-hero { padding: 0; }
.t3-hero-viewport { position: relative; overflow: hidden; width: 100%; }
.t3-hero-track { display: flex; align-items: center; transition: transform .5s ease; }
.t3-slide { flex: 0 0 100%; }
.t3-slide img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.t3-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(var(--t3-bg-rgb), .6); color: #fff; font-size: 24px; line-height: 1; transition: background .15s;
}
.t3-arrow:hover { background: rgba(var(--t3-bg-rgb), .85); }
.t3-arrow--prev { left: 12px; }
.t3-arrow--next { right: 12px; }
.t3-dots { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 6px; }
.t3-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .45); transition: width .2s, background .2s; }
.t3-dot.active { width: 22px; background: var(--t3-primary); }

/* ---------- ข้อความวิ่ง ---------- */
.t3-marquee { overflow: hidden; background: rgba(var(--t3-bg-rgb), .9); border-block: 1px solid var(--t3-border); }
.t3-marquee-track { display: flex; width: max-content; animation: t3-marquee 40s linear infinite; }
.t3-marquee-item { display: inline-flex; align-items: center; gap: 8px; padding: 10px 28px; font-size: 14px; color: #cfd8ea; white-space: nowrap; }
.t3-marquee-item i { color: var(--t3-cta-text); }
@keyframes t3-marquee { to { transform: translateX(-50%); } }

/* ---------- block ทั่วไป ---------- */
.t3-block { padding: 28px 0; }
.t3-h2 { font-size: 24px; font-weight: 700; margin-bottom: 16px !important; color: #fff; }

.t3-split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.t3-split-media { border-radius: var(--t3-radius); overflow: hidden; display: grid; place-items: center; }
.t3-split-media img { width: auto; max-width: 100%; height: auto; max-height: 480px; object-fit: contain; border-radius: var(--t3-radius); }
.t3-intro-ph { display: grid; place-items: center; aspect-ratio: 16 / 9; width: 100%; background: var(--t3-surface); }
.t3-intro-logo { max-width: 60%; max-height: 50%; object-fit: contain; }
.t3-split-body h2 { font-size: 26px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.t3-split-body p { color: #b8c4d8; font-size: 15px; margin-bottom: 20px; }

/* ---------- 10 อันดับ ---------- */
.t3-rank-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 18px;
  border-radius: 999px; background: linear-gradient(90deg, var(--t3-header-to), var(--t3-surface-a) 60%, transparent);
}
.t3-rank-badge { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 999px; background: var(--t3-header-to); color: #fff; font-weight: 800; }
.t3-rank-title { font-size: 18px; font-weight: 700; color: #fff; }
.t3-rank-nav { margin-left: auto; display: flex; gap: 6px; }
.t3-rank-nav button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--t3-border); background: var(--t3-surface); color: #fff; cursor: pointer; font-size: 18px; transition: background .15s; }
.t3-rank-nav button:hover { background: var(--t3-primary); }
.t3-rank-viewport { overflow: hidden; }
.t3-rank-track { display: flex; transition: transform .4s ease; }
.t3-rank-item { flex: 0 0 calc(100% / 6); padding: 0 6px; }
.t3-rank-figure { position: relative; display: flex; align-items: flex-end; justify-content: center; }
.t3-rank-num {
  position: relative; z-index: 0; flex: none; margin: 0 -0.12em -0.06em 0; text-align: right;
  font-size: clamp(48px, 6vw, 92px); font-weight: 800; line-height: .8; color: transparent;
  -webkit-text-stroke: 2px var(--t3-rank); user-select: none;
}
.t3-rank-card {
  position: relative; z-index: 1; flex: none; width: 66%; display: grid; place-items: center; aspect-ratio: 1 / 1; padding: 4px; overflow: hidden;
  border-radius: var(--t3-radius); border: 3px solid rgba(var(--t3-primary-rgb), .85); border-radius: 18px;
  background: radial-gradient(circle at 50% 30%, var(--t3-bg-glow), var(--t3-surface-deep) 70%);
  box-shadow: 0 0 18px rgba(var(--t3-primary-rgb), .35); transition: transform .2s, box-shadow .2s;
}
.t3-rank-card:hover { transform: translateY(-4px); box-shadow: 0 0 26px rgba(var(--t3-primary-rgb), .55); }
.t3-rank-card img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }
.t3-rank-name { display: block; margin-top: 10px; text-align: center; font-size: 14px; color: var(--t3-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- การ์ดจุดเด่น ---------- */
.t3-features { background: linear-gradient(180deg, rgba(var(--t3-bg-rgb), .5), rgba(var(--t3-bg-rgb), 0)); }
.t3-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.t3-card {
  display: grid; gap: 10px; padding: 22px; border-radius: var(--t3-radius); text-align: center;
  background: var(--t3-surface); border: 1px solid var(--t3-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: transform .2s, border-color .2s;
}
.t3-card:hover { transform: translateY(-4px); border-color: var(--t3-cta-from); }
.t3-card-icon { font-size: 30px; color: var(--t3-cta-text); }
.t3-card h3 { font-size: 17px; font-weight: 700; color: var(--t3-cta-text); margin-bottom: 6px; }
.t3-card p { font-size: 14px; color: #b8c4d8; }

/* ---------- 4 ขั้นตอน ---------- */
.t3-steps-wrap { text-align: center; }
.t3-steps-heading { font-size: 30px; font-weight: 700; color: #fff; }
.t3-steps-sub { color: var(--t3-muted); margin: 6px 0 24px !important; }
.t3-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.t3-step {
  padding: 22px 16px; border-radius: var(--t3-radius); background: var(--t3-surface-2);
  border: 1px solid var(--t3-border); animation: t3-step-glow 6s infinite; animation-delay: calc(var(--i) * 1.5s);
}
.t3-step-num {
  width: 36px; height: 36px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%;
  background: var(--t3-border); color: var(--t3-ink); font-weight: 700;
}
.t3-step-title { font-weight: 700; color: var(--t3-ink); margin-bottom: 4px; }
.t3-step-text { font-size: 13px; color: var(--t3-muted); }
@keyframes t3-step-glow {
  0%, 20% { border-color: var(--t3-cta-from); box-shadow: 0 0 22px rgba(var(--t3-cta-rgb), .25); }
  25%, 100% { border-color: var(--t3-border); box-shadow: none; }
}
.t3-step.active .t3-step-num, .t3-step:hover .t3-step-num { background: var(--t3-cta-from); color: var(--t3-cta-ink); }

/* ---------- โปรโมชั่น ---------- */
.t3-promo-row { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 3); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: thin; }
.t3-promo { scroll-snap-align: start; border-radius: var(--t3-radius); overflow: hidden; border: 1px solid var(--t3-border); transition: transform .2s; }
.t3-promo:hover { transform: translateY(-3px); }
.t3-promo img { width: 100%; height: auto; }

/* ---------- รายการถอนล่าสุด ---------- */
.t3-tx-updated { text-align: center; font-size: 13px; color: var(--t3-muted); margin: -8px 0 16px; }
.t3-tx-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.t3-tx-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--t3-radius);
  background: var(--t3-surface); border: 1px solid var(--t3-border);
}
.t3-tx-ic { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: #fff; color: #1d2b4d; }
.t3-tx-ic img { width: 100%; height: 100%; object-fit: cover; }
.t3-tx-info { display: grid; flex: 1; min-width: 0; font-size: 13px; color: #cfd8ea; }
.t3-tx-info b { color: #fff; }
.t3-tx-date { color: var(--t3-muted); font-size: 12px; }
.t3-tx-status { flex: 0 0 auto; padding: 6px 14px; border-radius: 999px; background: var(--t3-cta-from); color: var(--t3-cta-ink); font-size: 13px; font-weight: 700; }

/* ---------- CTA ---------- */
.t3-cta {
  padding: 40px 24px; text-align: center; border-radius: 18px;
  background: linear-gradient(135deg, var(--t3-surface-a), var(--t3-surface-deep)); border: 1px solid var(--t3-border);
}
.t3-cta h2 { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 8px; }
.t3-cta p { color: #b8c4d8; margin-bottom: 22px; }

/* ---------- โลโก้ค่าย ---------- */
.t3-logos { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.t3-logos-track { display: flex; width: max-content; animation: t3-marquee 30s linear infinite; }
.t3-logos:hover .t3-logos-track { animation-play-state: paused; }
.t3-logo-set { display: flex; gap: 32px; padding-right: 32px; align-items: center; }
.t3-logo-set img { height: 46px; width: auto; max-width: 120px; object-fit: contain; opacity: .85; transition: opacity .15s; }
.t3-logo-set img:hover { opacity: 1; }

/* ---------- footer ---------- */
.t3-footer { margin-top: 20px; padding: 40px 0 90px; border-top: 1px solid var(--t3-border); color: var(--t3-muted); font-size: 14px; }
.t3-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.t3-footer-logo { height: 40px; width: auto; max-width: 200px; object-fit: contain; margin-bottom: 12px; }
.t3-footer-brand p { margin-bottom: 12px !important; }
.t3-socials { display: flex; gap: 10px; }
.t3-social { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: #06c755; color: #fff !important; font-size: 20px; }
.t3-fcol-title { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: 0; padding: 0 0 10px; font: inherit; font-weight: 700; color: #ced3de; cursor: default; }
.t3-fcol-title i { display: none; }
.t3-fcol-links { display: grid; gap: 8px; }
.t3-fcol-links a { transition: color .15s; }
.t3-fcol-links a:hover { color: #fff; }
.t3-footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--t3-border); text-align: center; font-size: 13px; }

/* ---------- ปุ่มลอย ---------- */
.t3-float { position: fixed; right: 16px; bottom: 20px; z-index: 160; display: grid; gap: 10px; }
.t3-float-btn { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer; color: #fff !important; font-size: 22px; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); transition: transform .15s; }
.t3-float-btn:hover { transform: scale(1.06); }
.t3-float-btn--up { background: var(--t3-border); font-size: 18px; }
.t3-float-btn--line { background: #06c755; }
body:not(.tpl3-active) .t3-float { display: none; }

/* ============================================================
 *  สมัคร / ล็อกอิน (แต่ง #authModal เดิม)
 * ========================================================== */
body.tpl3-active #authModal {
  z-index: 300 !important; padding: 0 !important; align-items: flex-start !important; overflow-y: auto !important;
  background: radial-gradient(1200px 600px at 50% -10%, var(--t3-bg-glow) 0%, var(--t3-bg) 55%), var(--t3-bg) !important;
  font-family: 'Anuphan', 'Noto Sans Thai', system-ui, sans-serif !important;
}
body.tpl3-active #bankPicker { z-index: 310; }
body.tpl3-active #authModal .modal-card {
  width: min(520px, 100%) !important; max-height: none !important; margin: 40px auto !important; overflow: visible !important;
  background: transparent !important; border: 0 !important; box-shadow: none !important; display: block !important;
}
body.tpl3-active #authModal .modal-card-inner {
  position: relative !important; display: block !important; padding: 0 !important; overflow: visible !important;
  background: transparent !important; border: 0 !important; box-shadow: none !important;
}
body.tpl3-active #authModal .modal-head {
  position: absolute !important; top: 14px !important; right: 14px !important; z-index: 2 !important; padding: 0 !important; border: 0 !important; background: none !important;
}
body.tpl3-active #authModal .modal-head .close-btn {
  width: 36px !important; height: 36px !important; border-radius: 50% !important; background: rgba(255, 255, 255, .06) !important; border: 1px solid var(--t3-border) !important;
}
body.tpl3-active #authModal .auth-side,
body.tpl3-active #authModal .auth-tabs,
body.tpl3-active #authModal #authTitle,
body.tpl3-active #authModal .step-line,
body.tpl3-active #authModal .step-section,
body.tpl3-active #authModal .step-divider,
body.tpl3-active #authModal .auth-switch-note { display: none !important; }
body.tpl3-active #authModal .step-collapse { display: block !important; max-height: none !important; }
body.tpl3-active #authModal .step-collapse[style*="max-height:0"] { display: none !important; }
body.tpl3-active #authModal #authBody {
  padding: 26px 24px !important; border-radius: 18px !important; color: var(--t3-ink) !important;
  background: linear-gradient(180deg, var(--t3-surface-a), var(--t3-surface-b)) !important; border: 1px solid var(--t3-border) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45) !important;
}
body.tpl3-active #authModal label { color: var(--t3-ink) !important; font-weight: 600 !important; font-size: 14px !important; }
body.tpl3-active #authModal .input {
  height: 50px !important; border-radius: 10px !important; background: var(--t3-surface-deep) !important; border: 1px solid var(--t3-border) !important; color: #fff !important;
  transition: border-color .15s, box-shadow .15s !important;
}
body.tpl3-active #authModal .input:focus { border-color: var(--t3-primary) !important; box-shadow: 0 0 0 3px rgba(var(--t3-primary-rgb), .2) !important; outline: 0 !important; }
body.tpl3-active #authModal .btn-submit {
  height: 50px !important; border-radius: 10px !important; border: 0 !important; width: 100% !important; margin-top: 14px !important;
  background: linear-gradient(90deg, var(--t3-cta-from), var(--t3-cta-to)) !important; color: var(--t3-cta-ink) !important; font-weight: 700 !important;
}
body.tpl3-active #authModal .btn-submit:hover { background: linear-gradient(90deg, var(--t3-cta-to), var(--t3-cta-from)) !important; }
body.tpl3-active #authModal .reg-age-box { border-color: var(--t3-border) !important; background: rgba(255, 255, 255, .03) !important; }
body.tpl3-active #authModal a { color: var(--t3-cta-text) !important; }
body.tpl3-active #authModal .modal-close,
body.tpl3-active #authModal .close-btn { color: #fff !important; }

.t3-auth-head { text-align: center; margin-bottom: 18px; }
.t3-auth-head h2 { font-size: 24px; font-weight: 700; color: #fff; margin: 0 0 4px; }
.t3-auth-head p { color: var(--t3-muted); font-size: 14px; margin: 0; }
.t3-auth-steps { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 20px; border-bottom: 1px solid var(--t3-border); }
.t3-auth-step { display: grid; justify-items: center; gap: 6px; padding-bottom: 12px; font-size: 13px; color: var(--t3-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.t3-auth-step span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--t3-border); color: var(--t3-ink); font-weight: 700; font-size: 14px; }
.t3-auth-step.active { color: #fff; border-bottom-color: var(--t3-cta-from); }
.t3-auth-step.active span, .t3-auth-step.done span { background: var(--t3-cta-from); color: var(--t3-cta-ink); }
.t3-auth-switch {
  display: block; width: 100%; height: 60px; margin-top: 16px; border-radius: 14px; cursor: pointer;
  background: linear-gradient(180deg, var(--t3-surface-a), var(--t3-surface-b)); border: 1px solid var(--t3-border); color: #cfd8ea; font: inherit; font-size: 15px;
  transition: border-color .15s;
}
.t3-auth-switch b { color: var(--t3-cta-text); }
.t3-auth-switch:hover { border-color: var(--t3-cta-from); }
.t3-reg-hint { font-size: 13px; color: var(--t3-muted); margin: 8px 0 0; }
.t3-reg-back { background: none; border: 0; color: var(--t3-muted); font: inherit; font-size: 13px; cursor: pointer; padding: 0 0 12px; }
.t3-reg-back:hover { color: #fff; }

/* ---------- จอเล็ก ---------- */
@media (max-width: 1099px) {
  .t3-nav { display: none; }
  .t3-header-inner { gap: 12px; height: 58px; }
  .t3-ctas { margin-left: auto; }
  .t3-nav-toggle { display: inline-flex; }
  .t3-rank-item { flex-basis: calc(100% / 4); }
  .t3-footer-grid { grid-template-columns: 1fr 1fr; }
  .t3-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .t3-cards { grid-template-columns: repeat(2, 1fr); }
  .t3-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .t3-container { padding: 0 14px; }
  .t3-brand-logo { height: 28px; max-width: 120px; }
  .t3-ctas .t3-btn { height: 36px; padding: 0 10px; font-size: 13px; }
  .t3-ctas .t3-btn i { display: none; }
  .t3-nav-toggle-label { display: none; }
  .t3-announce { font-size: 12px; }
  .t3-split { grid-template-columns: 1fr; gap: 18px; }
  .t3-split-body { text-align: center; }
  .t3-split-body p { font-size: 14px; }
  .t3-rank-item { flex-basis: calc(100% / 2.4); }
  .t3-rank-num { font-size: 52px; }
  .t3-cards { grid-template-columns: 1fr; }
  .t3-steps-heading { font-size: 24px; }
  .t3-promo-row { grid-auto-columns: 82%; }
  .t3-tx-grid { grid-template-columns: 1fr; }
  .t3-cta h2 { font-size: 22px; }
  .t3-footer-grid { grid-template-columns: 1fr; gap: 0; }
  .t3-footer-brand { margin-bottom: 16px; }
  .t3-fcol { border-top: 1px solid var(--t3-border); }
  .t3-fcol-title { padding: 14px 0; cursor: pointer; }
  .t3-fcol-title i { display: inline; transition: transform .2s; }
  .t3-fcol-links { display: none; padding-bottom: 12px; }
  .t3-fcol.open .t3-fcol-links { display: grid; }
  .t3-fcol.open .t3-fcol-title i { transform: rotate(180deg); }
  body.tpl3-active #authModal .modal-card { margin: 16px auto; padding: 0 12px; }
  body.tpl3-active #authModal #authBody { padding: 20px 16px; }
}
/* ============================================================
 *  หน้าข้างในหลังล็อกอิน (template3-member.js)
 *  ขนาดหลัก: จอใหญ่ = คอนเทนเนอร์ 800px / มือถือ (<=575px) = แผงเต็มจอขอบ 12px
 * ========================================================== */
.t3-root--member { background: radial-gradient(1200px 600px at 50% -10%, var(--t3-bg-glow) 0%, var(--t3-bg) 55%), var(--t3-bg); }
.t3-root--member a { cursor: pointer; }
.t3-root--member i { color: inherit !important; }
.t3-root--member button { font: inherit; color: inherit; }

/* หัวเว็บ */
.t3-mhead { position: sticky; top: 0; z-index: 300; background: linear-gradient(180deg, var(--t3-header-from), var(--t3-header-to)); backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); }
.t3-mhead-inner { display: flex; align-items: center; justify-content: space-between; width: min(800px, 100%); margin: 0 auto; padding: 10px 15px 0; height: 75px; }
.t3-mhead-side { flex: 1 1 0; display: flex; }
.t3-mhead-side--end { justify-content: flex-end; }
.t3-mhead-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 16px 0 14px; border-radius: 999px; border: 1px solid var(--t3-border); background: rgba(255, 255, 255, .035); color: var(--t3-nav-btn); font-size: 15px; font-weight: 500; transition: background .15s, border-color .15s; }
.t3-mhead-btn:hover { background: rgba(255, 255, 255, .08); border-color: var(--t3-border-strong); }
.t3-mhead-btn i { font-size: 16px; }
.t3-mhead-brand { flex: none; display: grid; place-items: center; }
.t3-mhead-logo { height: 65px; width: auto; max-width: 250px; object-fit: contain; }
.t3-mhead-logo.t3-brand-text { height: auto; font-size: 28px; font-weight: 700; }

/* แบนเนอร์ */
.t3-mbanner { background: var(--t3-bg); }
.t3-mbanner .t3-slide img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
.t3-mbanner .t3-arrow, .t3-mbanner .t3-dots { display: none; }

/* แผงเนื้อหา (ซ้อนขึ้นไปบนแบนเนอร์) */
.t3-mmain { position: relative; z-index: 2; padding: 40px 40px 20px; }
.t3-mpanel { display: flex; flex-direction: column; gap: 14px; width: min(800px, 100%); margin: -80px auto 0; padding: 15px; border-radius: 14px; border: 1px solid var(--t3-border); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); }
.t3-ptitle { display: flex; padding-top: 2px; margin-bottom: -4px; }
.t3-ptitle h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 22px; font-weight: 700; line-height: 1.35; }
.t3-ptitle h3::before { content: ""; width: 5px; height: 1em; border-radius: 999px; background: linear-gradient(var(--t3-primary-hi), var(--t3-primary)); }
.t3-mheading { display: flex; align-items: center; gap: 8px; margin: 6px 0 -2px; font-size: 16px; font-weight: 700; line-height: 1.2; }
.t3-mheading::before { content: ""; width: 4px; height: 16px; border-radius: 999px; background: var(--t3-cta-from); flex: none; }

/* โปรไฟล์ */
.t3-profile { display: flex; align-items: center; gap: 12px; }
.t3-profile-avatar { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: linear-gradient(var(--t3-primary-hi), var(--t3-primary)); color: var(--t3-primary-ink); font-size: 18px; }
.t3-profile-id { display: grid; min-width: 0; }
.t3-profile-id small { font-size: 13px; line-height: 1.25; color: var(--t3-muted); }
.t3-profile-id strong { font-size: 18px; font-weight: 700; line-height: 1.25; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t3-profile-actions { display: flex; gap: 8px; margin-left: auto; }
.t3-chip { display: flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--t3-border); background: rgba(255, 255, 255, .035); color: var(--t3-ink-2); font-size: 13px; font-weight: 500; white-space: nowrap; transition: background .15s; }
.t3-chip:hover { background: rgba(255, 255, 255, .08); }

/* การ์ดยอดเงิน */
.t3-wallet { position: relative; display: grid; grid-template-columns: 1.1fr 1fr; gap: 0 20px; align-items: center; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--t3-border-strong); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 14px 32px -14px rgba(0, 0, 0, .55); }
.t3-wallet::before { content: ""; position: absolute; top: -1px; left: 28px; width: 80px; height: 4px; border-radius: 0 0 4px 4px; background: var(--t3-cta-from); }
.t3-wallet-head { display: flex; align-items: center; gap: 10px; }
.t3-wallet-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--t3-muted); }
.t3-wallet-label-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(var(--t3-cta-rgb), .3); background: rgba(var(--t3-cta-rgb), .12); color: var(--t3-cta-soft); font-size: 13px; }
.t3-wallet-refresh { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--t3-border); background: rgba(255, 255, 255, .06); color: var(--t3-ink-2) !important; font-size: 13px; cursor: pointer; transition: background .15s; }
.t3-wallet-refresh:hover { background: rgba(255, 255, 255, .12); }
.t3-wallet-amount { margin: 8px 0 0 !important; font-size: 40px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; color: var(--t3-cta-text); font-variant-numeric: tabular-nums; }
.t3-wallet-bonus { display: block; margin-top: 4px; font-size: 12px; color: #f4d787; }
.t3-wallet-actions { display: grid; gap: 10px; }
.t3-wbtn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 10px; font-size: 16px; font-weight: 700; transition: filter .15s, background .15s; }
.t3-wbtn--deposit { border: 1px solid transparent; background: linear-gradient(90deg, var(--t3-cta-from), var(--t3-cta-to)); color: var(--t3-cta-ink) !important; }
.t3-wbtn--deposit:hover { filter: brightness(1.06); }
.t3-wbtn--withdraw { border: 1px solid var(--t3-border-strong); color: var(--t3-ink) !important; }
.t3-wbtn--withdraw:hover { background: rgba(255, 255, 255, .06); }

/* ปุ่มเข้าเล่นเกม / แนะนำเพื่อน / กิจกรรม */
.t3-dnav { display: flex; flex-direction: column; gap: 14px; }
.t3-play { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; min-height: 116px; padding: 20px 24px; border-radius: 14px; background: linear-gradient(var(--t3-primary-hi), var(--t3-primary)); color: var(--t3-primary-ink) !important; box-shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 14px 32px -14px rgba(0, 0, 0, .6); transition: filter .15s, transform .15s; }
.t3-play:hover { filter: brightness(1.05); transform: translateY(-1px); }
.t3-play-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 60px; height: 60px; flex: none; border-radius: 50%; background: var(--t3-primary-ink); color: var(--t3-primary); font-size: 22px; }
.t3-play-text { position: relative; z-index: 1; display: grid; gap: 4px; min-width: 0; }
.t3-play-label { font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--t3-primary-ink); }
.t3-play-desc { font-size: 14px; line-height: 1.5; color: var(--t3-primary-ink); opacity: .9; }
.t3-play-go { position: relative; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; flex: none; margin-left: auto; border-radius: 50%; border: 1px solid var(--t3-primary-ink); }
.t3-play-art { position: absolute; top: 0; bottom: 0; right: 40px; width: 200px; display: flex; align-items: center; justify-content: space-around; font-size: 48px; opacity: .12; transform: rotate(-12deg); pointer-events: none; }
.t3-offer { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; border: 1px solid rgba(var(--t3-primary-rgb), .4); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); transition: border-color .15s; }
.t3-offer:hover { border-color: rgba(var(--t3-primary-rgb), .7); }
.t3-offer-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; background: var(--t3-primary); color: var(--t3-primary-ink); font-size: 20px; }
.t3-offer-text { display: grid; min-width: 0; }
.t3-offer-text strong { font-size: 16px; font-weight: 700; line-height: 1.55; }
.t3-offer-text small { font-size: 13px; line-height: 1.55; color: var(--t3-muted); }
.t3-offer-go { margin-left: auto; color: var(--t3-muted); }
.t3-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.t3-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; min-height: 108px; padding: 18px 10px 14px; border-radius: 14px; border: 1px solid var(--t3-border); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); text-align: center; transition: border-color .15s, transform .15s; }
.t3-tile:hover { border-color: var(--t3-border-strong); transform: translateY(-1px); }
.t3-tile-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; font-size: 16px; }
.t3-tile--green .t3-tile-icon { background: var(--t3-cta-from); color: var(--t3-cta-ink); }
.t3-tile--blue .t3-tile-icon { background: var(--t3-primary); color: var(--t3-primary-ink); }
.t3-tile-label { font-size: 14px; font-weight: 600; line-height: 1.3; }
.t3-linerow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--t3-border); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); transition: border-color .15s; }
.t3-linerow:hover { border-color: var(--t3-border-strong); }
.t3-linerow-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: #25d366; color: #fff; font-size: 22px; }
.t3-linerow-label { font-size: 15px; font-weight: 600; }
.t3-linerow-go { margin-left: auto; color: var(--t3-muted); }

/* ฝาก / ถอน */
.t3-acct { padding: 14px; border-radius: 14px; border: 1px solid var(--t3-border); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); }
.t3-acct .t3-mheading { margin: 0 0 14px; font-size: 15px; }
.t3-acct-body { display: flex; align-items: center; gap: 16px; }
.t3-acct-logo { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%; overflow: hidden; background: var(--t3-surface-deep); color: var(--t3-muted); font-size: 20px; }
.t3-acct-logo img { width: 100%; height: 100%; object-fit: cover; }
.t3-acct-rows { display: grid; gap: 4px; margin: 0; min-width: 0; }
.t3-acct-rows > div { display: flex; align-items: baseline; gap: 10px; }
.t3-acct-rows dt { flex: none; width: 72px; font-size: 13px; color: var(--t3-muted); }
.t3-acct-rows dd { margin: 0; min-width: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.t3-acct-number { font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.t3-acct-note { margin: 12px 0 0 !important; font-size: 13px; color: var(--t3-muted); }
.t3-acct-line { color: var(--t3-cta-soft) !important; font-weight: 600; }
.t3-alert { padding: 12px 20px; border-radius: 10px; border: 1px solid rgba(var(--t3-cta-rgb), .4); border-left: 3px solid var(--t3-cta-from); background: rgba(var(--t3-cta-rgb), .12); color: var(--t3-cta-soft); font-size: 15px; line-height: 1.55; }
.t3-methods { display: flex; flex-direction: column; gap: 10px; }
.t3-method { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 62px; border-radius: 14px; border: 1px solid var(--t3-border); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); transition: filter .15s; }
.t3-method--primary { border-color: transparent; background: linear-gradient(var(--t3-primary-hi), var(--t3-primary)); color: var(--t3-primary-ink) !important; }
.t3-method:hover { filter: brightness(1.06); }
.t3-method-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--t3-primary-ink); color: var(--t3-primary); font-size: 17px; }
.t3-method-label { flex: 1; font-size: 15px; font-weight: 600; }
.t3-method-go { font-size: 13px; }
.t3-rowlink { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--t3-border); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); transition: border-color .15s; }
.t3-rowlink:hover { border-color: var(--t3-border-strong); }
.t3-rowlink-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; background: rgba(var(--t3-primary-rgb), .16); color: var(--t3-primary-soft); font-size: 14px; }
.t3-rowlink-label { flex: 1; font-size: 14px; font-weight: 500; }
.t3-rowlink-go { color: var(--t3-muted); font-size: 13px; }

/* หน้าเกม */
.t3-lobby { display: flex; flex-direction: column; gap: 12px; }
.t3-lcats { display: flex; gap: 8px; margin: 0 -2px; padding: 2px; overflow-x: auto; scrollbar-width: none; }
.t3-lcats::-webkit-scrollbar { display: none; }
.t3-lcat { flex: 1 0 68px; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--t3-border); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); color: var(--t3-ink-2); cursor: pointer; transition: border-color .15s; }
.t3-lcat.is-active { border-color: rgba(var(--t3-cta-rgb), .4); color: var(--t3-ink); }
.t3-lcat-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: rgba(var(--t3-cta-rgb), .12); color: var(--t3-cta-soft); font-size: 15px; }
.t3-lcat.is-active .t3-lcat-icon { background: var(--t3-cta-from); color: var(--t3-cta-ink); }
.t3-lcat-label { font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap; }
.t3-lhead { display: flex; align-items: center; gap: 12px; }
.t3-lhead .t3-mheading { margin: 0; }
.t3-lhead-count { margin-left: auto; font-size: 13px; color: var(--t3-muted); }
.t3-lback { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--t3-border); background: rgba(255, 255, 255, .035); font-size: 13px; cursor: pointer; }
.t3-lgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.t3-lcard { display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; border: 1px solid var(--t3-border); background: linear-gradient(var(--t3-surface-a), var(--t3-surface-b)); }
.t3-lcard-media { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; padding: 0; border: 0; background: var(--t3-surface-deep); cursor: pointer; overflow: hidden; }
.t3-lcard--game .t3-lcard-media { aspect-ratio: 16 / 9; }
.t3-lcard-media img { width: 100%; height: 100%; object-fit: contain; object-position: center; transition: transform .2s; }
.t3-lcard-media > i { font-size: 34px; color: var(--t3-muted) !important; }
.t3-lcard-play { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; }
.t3-lcard-play i { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(90deg, var(--t3-cta-from), var(--t3-cta-to)); color: var(--t3-cta-ink) !important; font-size: 16px; }
.t3-lcard-media:hover .t3-lcard-play { opacity: 1; }
.t3-lcard-media:hover img { transform: scale(1.04); }
.t3-lcard-body { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; min-width: 0; }
.t3-lcard-title { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t3-lcard-btn { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: linear-gradient(90deg, var(--t3-cta-from), var(--t3-cta-to)); color: var(--t3-cta-ink) !important; font-size: 14px; font-weight: 700; cursor: pointer; transition: filter .15s; }
.t3-lcard-btn:hover { filter: brightness(1.06); }
.t3-lempty { padding: 32px 16px; text-align: center; color: var(--t3-muted); border: 1px dashed var(--t3-border); border-radius: 14px; }

/* ส่วนท้าย */
.t3-mfoot { margin: 36px 0 120px; padding-top: 30px; background: var(--t3-surface-deep); border-top: 1px solid var(--t3-border); color: var(--t3-muted); }
.t3-mfoot-inner { width: min(800px, 100%); margin: 0 auto; padding: 0 15px 24px; text-align: center; }
.t3-mfoot-brand { display: grid; justify-items: center; gap: 10px; }
.t3-mfoot-logo { height: 39px; width: auto; max-width: 150px; object-fit: contain; }
.t3-mfoot-logo.t3-brand-text { height: auto; font-size: 22px; font-weight: 700; color: var(--t3-ink); }
.t3-mfoot-tagline { margin: 0 !important; font-size: 17px; }
.t3-mfoot-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0; }
.t3-mfoot-badge { display: flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--t3-border); background: rgba(255, 255, 255, .035); color: var(--t3-ink-2); font-size: 14px; }
.t3-mfoot-badge i { color: var(--t3-cta-soft) !important; }
.t3-mfoot-copy { margin: 0 !important; font-size: 13px; }

/* ปุ่มติดต่อลอย */
.t3-cfloat { position: fixed; right: 18px; bottom: 104px; z-index: 9990; display: flex; flex-direction: column; gap: 10px; }
.t3-cfloat-btn { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; color: #fff !important; font-size: 24px; box-shadow: 0 2px 4px rgba(0, 0, 0, .2), 0 8px 20px -6px rgba(0, 0, 0, .5); transition: transform .15s; }
.t3-cfloat-btn:hover { transform: scale(1.06); }
.t3-cfloat-btn--line { background: #06c755; }
.t3-cfloat-btn--tg { background: #29a9eb; }

/* แถบเมนูล่าง */
.t3-bnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9995; padding: 0 4px env(safe-area-inset-bottom, 0px); background: linear-gradient(180deg, var(--t3-header-to), var(--t3-header-from)); border-top: 1px solid var(--t3-border); box-shadow: 0 -8px 24px -16px rgba(0, 0, 0, .6); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.t3-bnav ul { display: flex; width: min(770px, 100%); margin: 0 auto; padding: 0; list-style: none; }
.t3-bnav li { flex: 1 1 0; display: flex; }
.t3-bnav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding: 8px 2px 6px; color: var(--t3-ink-2); font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: color .15s; }
.t3-bnav a i { font-size: 18px; }
.t3-bnav a:hover, .t3-bnav a.active { color: var(--t3-cta-soft); }
.t3-bnav-disc { display: grid; place-items: center; width: 56px; height: 56px; margin-top: -26px; border-radius: 50%; border: 4px solid var(--t3-bg); background: linear-gradient(90deg, var(--t3-cta-from), var(--t3-cta-to)); color: var(--t3-cta-ink); box-shadow: 0 6px 18px rgba(var(--t3-cta-rgb), .35); }
.t3-bnav-disc i { font-size: 22px !important; }

/* หน้าต่างฝาก/ถอน/ประวัติเดิม ให้สีเข้ากับธีม */
body.tpl3-active .wallet-modal-section { z-index: 10000; }
body.tpl3-active .wallet-modal-section > .section-head { border-color: var(--t3-border); background: linear-gradient(90deg, rgba(var(--t3-primary-rgb), .22), rgba(var(--t3-bg-rgb), .96)); }
body.tpl3-active .wallet-modal-section > .deposit-wrap,
body.tpl3-active .wallet-modal-section > .panel { border-color: var(--t3-border); background: linear-gradient(180deg, var(--t3-surface-a), var(--t3-surface-deep)); }

@media (max-width: 991px) {
  .t3-mmain { padding: 30px 30px 20px; }
}

@media (max-width: 575px) {
  .t3-mhead-inner { height: 70px; padding: 6px 15px; }
  .t3-mhead-btn { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 50%; }
  .t3-mhead-btn span { display: none; }
  .t3-mhead-btn i { font-size: 18px; }
  .t3-mhead-logo { height: 49px; max-width: 190px; }
  .t3-mbanner .t3-slide img { aspect-ratio: auto; }
  .t3-mmain { padding: 12px 12px 20px; }
  .t3-mpanel { margin-top: -40px; padding: 10px; gap: 12px; }
  .t3-ptitle h3 { font-size: 18px; }
  .t3-profile { flex-wrap: wrap; }
  .t3-profile-actions { flex-basis: 100%; margin-left: 0; }
  .t3-profile-actions .t3-chip { flex: 1 1 0; }
  .t3-wallet { grid-template-columns: 1fr auto; gap: 0 10px; padding: 12px 12px 12px 14px; }
  .t3-wallet::before { left: 18px; width: 54px; }
  .t3-wallet-label { font-size: 12px; }
  .t3-wallet-label-icon { display: none; }
  .t3-wallet-refresh { width: 24px; height: 24px; font-size: 10px; }
  .t3-wallet-amount { margin-top: 2px !important; font-size: 24px; }
  .t3-wallet-actions--2 { grid-template-columns: 1fr 1fr; gap: 6px; }
  .t3-wbtn { height: 36px; padding: 0 14px; font-size: 15px; }
  .t3-wbtn i { display: none; }
  .t3-dnav { gap: 12px; }
  .t3-play { gap: 14px; min-height: 98px; padding: 16px; }
  .t3-play-icon { width: 52px; height: 52px; font-size: 20px; }
  .t3-play-label { font-size: 22px; }
  .t3-play-desc { font-size: 12px; }
  .t3-play-go { width: 34px; height: 34px; }
  .t3-play-art { right: 30px; width: 160px; font-size: 40px; }
  .t3-offer { padding: 12px 14px; }
  .t3-tiles { gap: 8px; }
  .t3-tile { min-height: 96px; padding: 16px 6px 12px; }
  .t3-tile-icon { width: 36px; height: 36px; font-size: 15px; }
  .t3-tile-label { font-size: 13px; }
  .t3-lcat { padding: 8px 10px; }
  .t3-lcat-icon { width: 32px; height: 32px; font-size: 14px; }
  .t3-lcat-label { font-size: 13px; }
  .t3-lgrid { gap: 8px; }
  .t3-lcard-body { gap: 6px; padding: 6px 6px 8px; }
  .t3-lcard-title { font-size: 12px; }
  .t3-lcard-btn { height: 32px; padding: 0 4px; font-size: 12px; }
  .t3-lcard-play i { width: 29px; height: 29px; font-size: 12px; }
  .t3-mfoot { margin-bottom: 100px; }
  .t3-cfloat { right: 12px; bottom: 88px; }
  .t3-cfloat-btn { width: 48px; height: 48px; font-size: 22px; }
}

/* สีปุ่มออกจากระบบ + รูปพื้นหลังจากหลังบ้าน */
.t3-mhead-side--end .t3-mhead-btn { color: var(--t3-logout-btn); }
.t3-root.t3-has-bgimg { background-image: linear-gradient(rgba(var(--t3-bg-rgb), .82), rgba(var(--t3-bg-rgb), .94)), var(--runtime-bg-image); background-size: cover; background-position: center; background-attachment: fixed; }
/* ปุ่มอัปเดตยอด: ระบบเดิมใส่คำ "อัพเดทยอด" ลงปุ่มหลังโหลด แบบ 3 แสดงแค่ไอคอน */
.t3-wallet-refresh span { display: none !important; }
/* ไอคอนเมนูล่างที่อัปโหลดจากหลังบ้าน */
.t3-bnav-img { width: 24px; height: 24px; object-fit: contain; }
.t3-bnav-disc .t3-bnav-img { width: 30px; height: 30px; }
/* พื้นหลังเมนูล่างจากหลังบ้าน (สีหรือรูป) ใช้ร่วมกับแบบ 1 */
html.runtime-bottom-nav-custom .t3-bnav { background: var(--runtime-bottom-nav-bg) center / cover no-repeat; }
