:root {
  --bg: #0a0a0c;
  --header: #090b0d;
  --gold-a: #ffd703;
  --gold-b: #ffb800;
  --menu: #262a36;
  --red: #e10600;
  --text: #fff;
  --muted: #c8c8c8;
  --col: 480px;
  --header-h: 55px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: #000;
  color: var(--text);
  font-family: "Sarabun", sans-serif;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.app {
  width: min(100%, var(--col));
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: clip;
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--header-h);
  background: var(--header);
  display: flex;
  align-items: center;
  padding: 0 4px 0 8px;
  gap: 6px;
}
.logo {
  width: 100px;
  height: 40px;
  object-fit: contain;
  margin-top: 4px;
  flex: 0 0 auto;
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-login, .btn-register, .btn-user {
  height: 32px;
  min-width: 85px;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 500;
  line-height: 32px;
  text-align: center;
}
.btn-login {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
}
.btn-register {
  border: 0;
  color: #000;
  background: linear-gradient(180deg, var(--gold-a), var(--gold-b));
}
.btn-user {
  border: 1px solid #ffd703;
  color: #ffd703;
  background: transparent;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
}
.icon-btn svg { width: 30px; height: 30px; fill: currentColor; }

.banner {
  position: relative;
  height: 167px;
  overflow: hidden;
  background: #111;
}
.banner-track {
  display: flex;
  height: 100%;
  transition: transform 0.45s ease;
}
.banner-track img {
  width: 100%;
  height: 167px;
  object-fit: cover;
  flex: 0 0 100%;
}
.dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: #6d6d6d;
}
.dots button.on { background: #fff; }
.banner .dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  justify-content: center;
}

.announce {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  background: #2c3038;
  overflow: hidden;
}
.announce img { width: 22px; height: 22px; flex: 0 0 auto; }
.marquee {
  overflow: hidden;
  white-space: nowrap;
  mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent);
}
.marquee span {
  display: inline-block;
  animation: tick 22s linear infinite;
  font-size: 13px;
}
@keyframes tick {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.stage {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 8px 0 6px;
}
.sidemenu {
  width: 77px;
  flex: 0 0 77px;
  height: 430px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: none;
}
.sidemenu::-webkit-scrollbar { display: none; }
.sidemenu button {
  width: 75px;
  height: 69px;
  border: 0;
  border-radius: 6px;
  padding: 6px 4px 0;
  background: var(--menu);
  color: #fff;
}
.sidemenu button.on {
  background: linear-gradient(180deg, rgba(63, 47, 255, 0.99), #390081);
}
.sidemenu img {
  width: 59px;
  height: 54px;
  margin: 0 auto;
  object-fit: contain;
}

.stage-main { flex: 1; min-width: 0; }
.block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin: 0 2px 6px;
}
.block-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}
.more {
  border: 0;
  background: transparent;
  color: #ff0000;
  font-size: 15px;
  font-weight: 600;
  padding: 0;
}
.section { margin-top: 14px; }
.section .block-head { padding: 0 10px; }

.hscroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: 0 0 auto; }

.slide-card {
  width: 78%;
  border-radius: 8px;
  overflow: hidden;
}
.slide-card img { width: 100%; height: 140px; object-fit: cover; }
.event-card img { height: 176px; }

.game-card {
  position: relative;
  width: 120px;
}
.game-card .thumb {
  width: 120px;
  height: 156px;
  object-fit: cover;
  border-radius: 8px;
  background: #1b1b1b;
}

/* กริดค่ายแบบเว็บตัวอย่าง — รูปจาก m.aummlaff168.com */
.hscroll.camp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  overflow: visible;
  scroll-snap-type: none;
  padding: 0 2px 14px;
}
.camp-card {
  position: relative;
  width: auto;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 10px;
  overflow: hidden;
}
.camp-card .thumb {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  background: #161820;
}
.camp-card .camp-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 6px 6px;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.85));
  pointer-events: none;
}
.camp-card.is-off { opacity: 0.55; }
.stage-main.is-camps #eventRow,
.stage-main.is-camps #eventRow + .block-head,
.stage-main.is-camps .block-head:has(+ #eventRow) {
  display: none;
}
.ribbon {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 2;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}
.ribbon.buy { background: linear-gradient(90deg, #0066ff, #030096); }
.ribbon.new { background: linear-gradient(90deg, #04ce00, #038d00); }
.ribbon.hot { background: linear-gradient(90deg, #ff7a00, #ff0000); }
.ribbon.off { background: #5c6370; }
.heart {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 24px;
  height: 22px;
  z-index: 2;
}
.rank {
  position: absolute;
  left: -2px;
  bottom: -18px;
  z-index: 3;
  font-family: Roboto, sans-serif;
  font-size: 68px;
  font-weight: 700;
  line-height: 0.75;
  color: #fff;
  -webkit-text-stroke: 5px #111;
  paint-order: stroke fill;
  pointer-events: none;
}
.top-row { padding: 0 8px 22px 10px; }

.live-card { width: 120px; position: relative; }
.live-card img {
  width: 120px;
  height: 156px;
  object-fit: cover;
  border-radius: 12px;
  background: #151515;
}
button.live-card {
  border: 0;
  padding: 0;
  background: transparent;
  flex: 0 0 auto;
}
button.live-card .camp-name {
  border-radius: 0 0 12px 12px;
}

/* แผงเกมย่อย — จัดแบบเว็บตัวอย่าง */
.games-panel {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: min(100%, var(--col));
  margin: 0 auto;
  background: #0a0a0c;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.games-panel[hidden] { display: none !important; }
.games-panel-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 10px;
  background: #090b0d;
  border-bottom: 1px solid #22262f;
}
.games-back {
  border: 0;
  background: transparent;
  color: #ffd703;
  font-size: 16px;
  font-weight: 600;
  padding: 8px 4px;
}
.games-panel-bar h2 {
  margin: 0;
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.games-count {
  color: #9aa3b2;
  font-size: 12px;
}
.games-hint {
  margin: 0;
  padding: 8px 12px 4px;
  color: #9aa3b2;
  font-size: 12px;
}
.games-grid {
  flex: 1;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 10px 28px;
  align-content: start;
  -webkit-overflow-scrolling: touch;
}
.game-tile {
  border: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  text-align: center;
  border-radius: 10px;
  overflow: hidden;
}
.game-tile .gthumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: #161820;
  display: block;
}
.game-tile .gfallback {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: linear-gradient(160deg, #2a3142, #141820);
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 700;
  color: #ffd703;
}
.game-tile strong {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  max-height: 2.5em;
  overflow: hidden;
}

.promo-row { padding: 0 10px 8px; }
.promo-card { width: 220px; }
.promo-card img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
  background: #151515;
}
.promo-card button {
  width: 100%;
  height: 45px;
  margin-top: 8px;
  border: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #111;
  background: linear-gradient(180deg, var(--gold-a), var(--gold-b));
}

.board-wrap { padding: 8px 12px 18px; }
.board {
  border: 2px solid #e6c35c;
  border-radius: 6px;
  background: #050505;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px #6a5420;
}
.board-cap { width: 100%; height: 18px; object-fit: cover; }
.board h2 {
  margin: 8px 12px 10px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}
.board-list { padding: 0 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.wrow {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 8px;
  padding: 8px 10px;
  background: #0b0b0b;
}
.bank-ico {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  color: #7b61ff;
}
.wmeta { font-size: 14px; line-height: 1.45; }
.wmeta b { color: #ffe14a; font-weight: 700; }
.wmeta .amt { color: #ffe14a; font-weight: 700; }

.foot {
  background: #2e3442;
  padding: 16px 12px 28px;
}
.foot h3 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}
.contacts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.contact {
  background: #111;
  border-radius: 10px;
  min-height: 78px;
  padding: 8px 6px 10px;
  text-align: center;
  border: 0;
  color: #fff;
}
.contact img { width: 36px; height: 36px; margin: 0 auto 4px; object-fit: contain; }
.contact .name { color: #3d7dff; font-size: 13px; font-weight: 600; line-height: 1.2; }
.contact .id { font-size: 12px; color: #fff; }
.contact.chat .name { color: #ff2a2a; }
.partners, .certs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 8px;
  align-items: center;
}
.partners { margin: 8px 0 18px; }
.partners img, .certs img {
  width: 100%;
  height: 36px;
  object-fit: contain;
  filter: grayscale(0.15);
}
.certs { margin-bottom: 8px; }
.legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  color: #d7d7d7;
  font-size: 13px;
}
.legal img { width: 36px; height: 36px; }

.line-fab {
  position: fixed;
  z-index: 35;
  width: 54px;
  height: 54px;
  right: calc(max(0px, (100vw - var(--col)) / 2) + 14px);
  bottom: 16px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.line-fab img { width: 100%; height: 100%; object-fit: cover; }

.drawer-back, .modal-back, .lightbox-back {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.45);
  display: none;
}
.drawer-back.show, .modal-back.show, .lightbox-back.show { display: block; }
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(86%, calc(var(--col) * 0.86));
  z-index: 60;
  background: #12141a;
  color: #fff;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow: auto;
  border-top-left-radius: 18px;
  border-bottom-left-radius: 18px;
}
.drawer.show {
  transform: translateX(0);
  right: calc(max(0px, (100vw - var(--col)) / 2));
}
.drawer-hero {
  padding: 28px 18px 8px;
  text-align: center;
}
.drawer-hero h3 { margin: 0 0 6px; font-size: 18px; line-height: 1.35; font-weight: 700; }
.drawer-hero p { margin: 0 0 14px; font-size: 14px; }
.cta {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 700;
  color: #111;
  background: linear-gradient(180deg, var(--gold-a), var(--gold-b));
}
.drawer-login-line {
  margin: 12px 0 8px;
  font-size: 14px;
}
.drawer-login-line button {
  border: 0;
  background: transparent;
  color: #ffe14a;
  font-weight: 700;
  text-decoration: underline;
  padding: 0;
  font-size: 14px;
}
.ditem {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 13px 22px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 16px;
}
.ditem svg { width: 22px; height: 22px; fill: currentColor; }
.vip-soon {
  background: #ff2d2d;
  color: #fff;
  font-size: 12px;
  border-radius: 999px;
  padding: 2px 8px;
  margin-right: auto;
  margin-left: 8px;
}

.sheet {
  position: fixed;
  z-index: 70;
  top: 0;
  bottom: 0;
  left: calc(max(0px, (100vw - var(--col)) / 2));
  width: min(100%, var(--col));
  background: #1a1e27;
  overflow: auto;
  display: none;
  padding: 18px 16px 28px;
}
.sheet.show { display: block; }
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: #111;
  font-size: 22px;
  line-height: 36px;
}
.sheet-logo { width: 92px; height: 40px; object-fit: contain; margin: 18px auto 16px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.auth-tabs button {
  height: 42px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  background: transparent;
  color: #ddd;
  border: 1px solid #8d8d8d;
}
.auth-tabs button.on {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.field { margin-top: 12px; }
.field label { display: block; font-size: 14px; margin-bottom: 4px; color: #eee; }
.field label i { color: #ff4d4d; font-style: normal; }
.input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: #222;
  border-radius: 12px;
  height: 48px;
  padding: 0 12px;
}
.input svg { width: 20px; height: 20px; fill: #222; flex: 0 0 auto; }
.input input {
  border: 0;
  outline: 0;
  width: 100%;
  font-size: 16px;
  background: transparent;
}
.eye {
  border: 0;
  background: transparent;
  padding: 0;
  width: 28px;
  height: 28px;
}
.forgot {
  display: block;
  margin: 10px auto 0;
  border: 0;
  background: transparent;
  color: #ff2a2a;
  text-decoration: underline;
  font-size: 15px;
}
.or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #ddd;
}
.or:before, .or:after { content: ""; height: 1px; background: #8a8a8a; flex: 1; }
.or span {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #222;
  display: grid;
  place-items: center;
  font-size: 14px;
}
.btn-line {
  width: 100%;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: #06c755;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.help {
  margin: 18px 4px 0;
  font-size: 13px;
  color: #d5d5d5;
  line-height: 1.45;
}
.hint { margin: 6px 2px 0; font-size: 12px; color: #bdbdbd; line-height: 1.4; }
.form-msg { min-height: 18px; margin: 8px 2px 0; font-size: 13px; color: #ffb4b4; }
.banks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.banks button {
  border: 2px solid transparent;
  background: #2a2f3a;
  border-radius: 8px;
  padding: 2px;
  height: 46px;
}
.banks button.on { border-color: #ffd703; }
.banks img { width: 100%; height: 100%; object-fit: contain; }
.pane { display: none; }
.pane.show { display: block; }

.lightbox {
  position: fixed;
  z-index: 80;
  left: calc(max(0px, (100vw - var(--col)) / 2));
  width: min(100%, var(--col));
  top: 10vh;
  background: #111;
  border-radius: 16px;
  padding: 12px;
  display: none;
}
.lightbox.show { display: block; }
.lightbox img { width: 100%; border-radius: 12px; }
.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  display: none;
  max-width: min(90vw, 420px);
}
.toast.show { display: block; }
