:root {
  --bg: #070707;
  --panel: #111111;
  --panel-2: #161616;
  --line: rgba(236, 202, 119, 0.28);
  --gold: #ECCA77;
  --gold-2: #FCDD9A;
  --gold-dim: #8B6832;
  --text: #f5f5f5;
  --text-2: #a8a8a8;
  --ok: #3dd68c;
  --danger: #ff5d6c;
  --radius: 12px;
  --font: "Prompt", "Noto Sans Thai", sans-serif;
  --display: "Cinzel", "Prompt", serif;
  --sidebar: 72px;
  --header: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  font-family: var(--font);
  background: radial-gradient(900px 420px at 50% -10%, rgba(212, 175, 55, 0.08), transparent 55%), var(--bg);
  /* ห้าม overflow-x:hidden — จะทำให้ fixed แถบล่างเลื่อนแล้วถูกตัดครึ่ง */
  overflow-x: clip;
  overflow-y: visible;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ——— Shell ——— */
.app {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto 1fr;
  grid-template-areas:
    "slider"
    "announce"
    "search"
    "workspace";
  padding-bottom: calc(12px + var(--safe-b));
}

.header {
  position: relative;
  z-index: 100;
  flex: 0 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header);
  min-height: var(--header);
  gap: 8px;
  padding: 0 10px;
  background: #0a0a0a;
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}

.header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  justify-self: start;
  grid-column: 1;
  min-width: 0;
}

.header-left-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header-uname {
  display: block;
  max-width: 108px;
  padding: 0 2px;
  color: #d4a84b;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.header-uname[hidden] {
  display: none !important;
}

.btn-menu {
  width: 36px;
  height: 36px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  justify-self: start;
  flex: 0 0 auto;
}

.btn-menu span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
}

.btn-support {
  display: none;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 0;
  border: none;
  background: transparent;
  flex: 0 0 auto;
  box-shadow: none;
}

.btn-support img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
  object-position: center;
}

body.is-logged .btn-support {
  display: grid;
}

body:not(.is-logged) .btn-support {
  display: none !important;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  grid-column: 2;
  justify-self: center;
  align-self: center;
  min-width: 140px;
  max-width: min(56vw, 220px);
  width: auto;
  line-height: 0;
  overflow: visible;
}

.logo-img {
  display: block;
  height: 48px;
  width: auto;
  max-width: 100%;
  max-height: 48px;
  object-fit: contain;
  object-position: center center;
  background: transparent;
  transform: none;
  /* เงาดำใต้ตัวอักษรแบบ UFABET + โกลว์ทองบาง */
  filter:
    drop-shadow(0 3px 2px rgba(0, 0, 0, 0.55))
    drop-shadow(0 8px 12px rgba(0, 0, 0, 0.72))
    drop-shadow(0 0 12px rgba(212, 175, 55, 0.18));
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 44px;
  min-height: 36px;
  justify-self: end;
  grid-column: 3;
}

.header-bal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 0 4px 0 8px;
  border: none;
  background: transparent;
  color: #FCDD9A;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.header-bal b {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: #fff;
  font-size: 14px;
}

.header-refresh {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(236, 202, 119, 0.28);
  border-radius: 50%;
  background: rgba(20, 18, 14, 0.55);
  color: #ECCA77;
  cursor: pointer;
  padding: 0;
}

.header-lang {
  width: 22px;
  height: 16px;
  display: grid;
  place-items: center;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 2px;
  overflow: hidden;
  flex: 0 0 auto;
}

.header-lang img {
  width: 20px;
  height: 14px;
  object-fit: cover;
  display: block;
  border-radius: 2px;
}

.header-refresh svg {
  width: 14px;
  height: 14px;
  display: block;
}

.header-refresh.is-spin svg {
  animation: hub-spin 0.7s linear;
}

@keyframes hub-spin {
  to { transform: rotate(360deg); }
}

.header-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  line-height: 1.15;
  text-align: right;
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 2px 0;
  color: var(--gold);
  font-family: inherit;
}

.header-user small {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}

.header-user b {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.header-right .btn-dep,
.header-right .btn-wd {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.75rem;
}

.workspace {
  grid-area: workspace;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 8px calc(100px + var(--safe-b)) 4px;
  min-width: 0;
  width: 100%;
}

.app > .slider {
  grid-area: slider;
  width: 100%;
  margin: 0;
  border-radius: 0;
  border: none;
  max-height: none;
  aspect-ratio: 1024 / 409;
  box-shadow: none;
  background: #000;
}

.announce-bar {
  grid-area: announce;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 12px;
  background: linear-gradient(90deg, #14110c 0%, #111111 40%, #0e0e0e 100%);
  border-bottom: 1px solid rgba(236, 202, 119, 0.14);
  overflow: hidden;
}

.announce-ico {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.announce-ico img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45));
}

.announce-label {
  flex: 0 0 auto;
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.announce-track {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.announce-text {
  margin: 0;
  white-space: nowrap;
  color: #e8e8e8;
  font-size: 0.7rem;
  animation: announce-marquee 22s linear infinite;
}

@keyframes announce-marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-55%); }
}

.game-search-top {
  grid-area: search;
  display: block;
  width: auto;
  margin: 8px 12px 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.84rem;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-outline {
  background: transparent;
  border-color: rgba(236, 202, 119, 0.65);
  color: #FCDD9A;
}

.btn-login {
  background: linear-gradient(180deg, #3dd68c, #1f9d5c);
  border-color: #2fbf78;
  color: #062816;
  box-shadow: 0 4px 14px rgba(45, 180, 110, 0.35);
}

.btn-gold {
  background: linear-gradient(180deg, #FCDD9A 0%, #ECCA77 42%, #8B6832 100%);
  color: #1a1205;
  box-shadow: 0 4px 14px rgba(139, 104, 50, 0.35);
  border-color: rgba(252, 221, 154, 0.55);
  font-weight: 700;
}

body:not(.is-logged) .header-actions {
  gap: 6px;
}

body:not(.is-logged) .header-actions .btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: 0.74rem;
  border-radius: 999px;
}

body:not(.is-logged) .header-actions .btn-login-header {
  min-width: 0;
  padding: 0 10px;
  background: transparent;
  border: 1px solid rgba(236, 202, 119, 0.7);
  color: #FCDD9A;
  box-shadow: none;
  font-weight: 600;
}

body:not(.is-logged) .header-actions .btn-register-short {
  min-width: 64px;
  padding: 0 14px;
  background: linear-gradient(180deg, #FCDD9A 0%, #ECCA77 45%, #8B6832 100%);
  color: #1a1205;
  border-color: rgba(252, 221, 154, 0.65);
  box-shadow: 0 3px 10px rgba(139, 104, 50, 0.35);
  font-weight: 700;
}

.btn-block {
  width: 100%;
  min-height: 44px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #121212;
  font-size: 0.82rem;
}

.user-chip b {
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.user-chip .btn {
  min-height: 30px;
  padding: 0 12px;
  font-size: 0.75rem;
}

/* ——— Logged-in header (UFA style) ——— */
body.is-logged {
  --header: 68px;
}

body.is-logged .header {
  gap: 4px;
  padding: 2px 12px 0;
  min-height: var(--header);
  height: var(--header);
  align-items: flex-end;
}

body.is-logged .header-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 1px;
  padding-bottom: 2px;
}

body.is-logged .header-uname {
  display: block;
  height: 12px;
  line-height: 12px;
  font-size: 0.64rem;
}

body.is-logged .header-left-tools {
  display: flex;
  align-items: center;
  height: 32px;
}

/* ยอด/ธง/รีเฟรช แถวเดียวกับเมนูสามขีด */
body.is-logged .header-actions {
  padding-top: 0;
  padding-bottom: 2px;
  align-self: flex-end;
  align-items: center;
  min-height: 32px;
}

body.is-logged .logo {
  min-width: 0;
  max-width: min(58vw, 230px);
  align-self: flex-end;
  margin-bottom: 0;
  padding-bottom: 1px;
  transform: translateY(4px);
}

body.is-logged .logo-img {
  height: 50px;
  max-height: 50px;
  filter:
    drop-shadow(0 3px 2px rgba(0, 0, 0, 0.55))
    drop-shadow(0 9px 14px rgba(0, 0, 0, 0.75))
    drop-shadow(0 0 14px rgba(212, 175, 55, 0.2));
}

body.is-logged .header-actions .btn {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.72rem;
}

/* Hide old chip-style member header extras if present */
.header-member {
  display: none;
}

.credit-box {
  display: none;
}

.btn-dep {
  background: linear-gradient(180deg, #49e090, #22b45f);
  color: #04140a;
  border: none;
  box-shadow: 0 4px 12px rgba(61, 214, 140, 0.28);
  min-height: 32px;
  padding: 0 14px;
  font-weight: 800;
  font-size: 0.82rem;
  border-radius: 999px;
}

.btn-wd {
  background: #0a0a0a;
  border: 1px solid rgba(212, 175, 55, 0.7);
  color: var(--gold-2);
  min-height: 32px;
  padding: 0 14px;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 999px;
}

.btn-user {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: #121212;
  color: var(--gold-2);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-user .uname-full {
  display: none;
}

.btn-user .chev {
  color: var(--gold-2);
  font-size: 0.65rem;
  line-height: 1;
}

body.is-logged .guest-only {
  display: none !important;
}

/* nav อยู่นอกสกอร์ล — เผื่อความสูง dock ตาม UFA (~100px) */
body.is-logged .app,
body:not(.is-logged) .app {
  padding-bottom: calc(100px + var(--safe-b));
}

.member-bar {
  display: none !important;
}

.member-bar[hidden] {
  display: none !important;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 4px;
}

.m-item {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--gold-2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 2px;
  -webkit-tap-highlight-color: transparent;
}

.m-item:active {
  opacity: 0.85;
}

.m-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--gold);
  background: transparent;
  border: 1.5px solid rgba(212, 175, 55, 0.75);
  box-shadow: none;
}

.m-icon svg {
  width: 26px;
  height: 26px;
  display: block;
  filter: none;
}

.m-text {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  color: #e0c060;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
}

@media (min-width: 640px) {
  .member-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 8px;
  }

  .m-icon {
    width: 58px;
    height: 58px;
  }
}

@media (min-width: 860px) {
  body.is-logged .app,
  body:not(.is-logged) .app {
    padding-bottom: 0;
  }

  .member-grid {
    grid-template-columns: repeat(9, 1fr);
    gap: 10px 6px;
  }

  .member-bar {
    padding: 16px 12px 14px;
    border-color: rgba(212, 175, 55, 0.2);
    background:
      radial-gradient(600px 120px at 50% 0%, rgba(212, 175, 55, 0.08), transparent 55%),
      linear-gradient(180deg, #161616 0%, #0d0d0d 100%);
  }

  .credit-box {
    align-items: center;
    justify-self: center;
  }

  .header-member {
    grid-template-columns: 1fr auto auto auto;
    gap: 8px;
  }

  .btn-user {
    width: auto;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 999px;
    gap: 6px;
  }

  .btn-user .uname-full {
    display: inline;
    font-size: 0.8rem;
    font-weight: 600;
  }

  .btn-dep,
  .btn-wd {
    min-height: 36px;
  }

  body.is-logged .logo-img {
    height: 56px;
    max-height: 56px;
  }

  body.is-logged .member-only {
    display: none !important;
  }
}

@media (min-width: 980px) {
  .member-grid {
    grid-template-columns: repeat(9, 1fr);
  }
}

/* Account / side menu drawer (UFA) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.62);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.account-drawer.side-menu {
  --sm-gold: #E8B84A;
  --sm-gold-soft: #F2D08A;
  --sm-gold-deep: #B8862E;
  --sm-gold-ink: #2A1A08;
  position: absolute;
  top: 0;
  left: 0;
  right: auto;
  width: min(86%, 320px);
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 55% at 50% -8%, rgba(232, 184, 74, 0.22), transparent 58%),
    radial-gradient(80% 40% at 50% 100%, rgba(139, 104, 50, 0.14), transparent 60%),
    linear-gradient(180deg, #1c150e 0%, #120e0a 48%, #0a0806 100%);
  border-right: 1px solid rgba(232, 184, 74, 0.32);
  border-left: none;
  padding: 14px 18px calc(18px + var(--safe-b));
  transform: translateX(-104%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.55);
}

.drawer-backdrop.open .account-drawer.side-menu {
  transform: translateX(0);
}

.side-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.side-menu-back,
.side-menu-lang {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 184, 74, 0.65);
  background: rgba(20, 14, 8, 0.55);
  color: var(--sm-gold-soft);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(184, 134, 46, 0.15);
}

.side-menu-back span {
  font-size: 1.45rem;
  line-height: 1;
  margin-top: -2px;
  font-weight: 300;
}

.side-menu-lang img {
  width: 22px;
  height: 22px;
  display: block;
  border-radius: 50%;
  object-fit: cover;
}

.side-menu-crest {
  display: grid;
  place-items: center;
  padding: 18px 12px 22px;
}

.side-menu-crest img {
  width: min(86%, 240px);
  height: auto;
  max-height: 78px;
  object-fit: contain;
  filter:
    drop-shadow(0 3px 2px rgba(0, 0, 0, 0.5))
    drop-shadow(0 8px 12px rgba(0, 0, 0, 0.65))
    drop-shadow(0 0 10px rgba(240, 200, 90, 0.18));
}

.side-menu-nav {
  display: grid;
  gap: 4px;
  flex: 1 1 auto;
  align-content: start;
  overflow: auto;
  padding: 4px 2px 12px;
}

.side-menu-nav button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 8px 8px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--sm-gold-soft);
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-menu-nav button:active {
  background: rgba(232, 184, 74, 0.1);
}

.side-menu-nav img {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  object-fit: contain;
  /* ดึงไอคอนให้ทองอุ่นใกล้โลโก้ */
  filter:
    sepia(0.35) saturate(1.55) hue-rotate(-8deg) brightness(1.08)
    drop-shadow(0 0 7px rgba(232, 184, 74, 0.35));
}

.side-menu-nav em {
  font-style: normal;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--sm-gold-soft);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.45);
}

.side-menu-foot {
  display: grid;
  gap: 10px;
  padding-top: 8px;
}

.side-menu-play,
.side-menu-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
}

.side-menu-play {
  border: 1px solid rgba(255, 220, 140, 0.35);
  color: var(--sm-gold-ink);
  background: linear-gradient(105deg, #8B6832 0%, #D4A017 40%, #F0C85A 68%, #C9A227 100%);
  box-shadow:
    0 8px 20px rgba(184, 134, 46, 0.4),
    inset 0 1px 0 rgba(255, 240, 200, 0.35);
}

.side-menu-play i {
  font-style: normal;
  font-size: 0.95rem;
  color: var(--sm-gold-ink);
}

.side-menu-logout {
  border: 1.5px solid rgba(232, 184, 74, 0.55);
  background: linear-gradient(180deg, #1c150e, #100c08);
  color: var(--sm-gold-soft);
}

.side-menu-logout i {
  font-style: normal;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--sm-gold);
}

/* legacy stubs (hidden ids still referenced) */
.account-head,
.account-balance,
.account-actions,
.account-menu,
.btn-refresh,
.btn-logout {
  display: none;
}

.btn-logout {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 93, 108, 0.35);
  background: rgba(255, 93, 108, 0.08);
  color: #ff8a96;
  font-weight: 800;
  cursor: pointer;
}

/* ——— ฝาก/ถอน: พื้นซุ้มโค้งทอง (แบบ UFA) ทุกทางเข้า ——— */
.wallet-sheet {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 6px 0 calc(20px + var(--safe-b));
  overflow: visible;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: none;
  color: var(--text);
  font-family: var(--font);
  display: flex;
  flex-direction: column;
}

#walletModal.wallet-backdrop,
#walletModal.modal-backdrop {
  z-index: 110;
  background: transparent;
  backdrop-filter: none;
  align-items: stretch;
  justify-items: stretch;
  place-items: stretch;
  padding: 0;
}

/* เหลือเฮดเดอร์โลโก้ + ยอด + ธง · X แทนรีเฟรช */
body.wallet-open #siteHeader {
  display: grid !important;
  position: relative;
  z-index: 120;
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

body.wallet-open .header-uname {
  visibility: hidden !important;
}

body.wallet-open .header-actions .header-bal {
  visibility: visible !important;
  pointer-events: auto !important;
}

body.wallet-open .header-actions .header-refresh {
  visibility: hidden !important;
  pointer-events: none !important;
  width: 34px;
  min-width: 34px;
}

/* ซ่อนเลเยอร์หลังฝาก — คงพื้นซุ้มที่ phone-shell */
body.wallet-open .phone-scroll,
body.wallet-open #appRoot,
body.wallet-open .sidebar,
body.wallet-open .workspace,
body.wallet-open .slider,
body.wallet-open .announce-bar,
body.wallet-open .game-search-top,
body.wallet-open .member-hub,
body.wallet-open .member-profile,
body.wallet-open .member-history {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body.wallet-open .mobile-nav {
  display: none !important;
}

body.wallet-open .phone-shell {
  background:
    #050505 url("/home/ufa/ui/hub/hub-home-backdrop.webp?v=hub5") center top / cover no-repeat !important;
}

.phone-shell > #walletModal.wallet-backdrop,
.phone-shell > #walletModal.modal-backdrop {
  position: absolute !important;
  top: var(--header) !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  place-items: stretch !important;
  background: transparent !important;
  backdrop-filter: none !important;
  z-index: 110 !important;
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

.phone-shell > #walletModal.wallet-backdrop.open,
.phone-shell > #walletModal.modal-backdrop.open {
  display: grid !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.phone-shell > #walletModal .wallet-sheet {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  min-height: 100% !important;
  border-radius: 0 !important;
  border: none !important;
  margin: 0 !important;
  transform: none !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* ——— Account activation (UFA full page) ——— */
#activateModal.activate-backdrop {
  align-items: stretch;
  justify-items: stretch;
  background: #0a0a0a;
  backdrop-filter: none;
  z-index: 85;
}

/* เปิดบัญชี: เหลือแค่โลโก้กลาง + แถบกลับ/หัวข้อ — ไม่ทับเมนู/ยอด */
body.activate-open,
html.activate-open,
body.is-logged.activate-open,
html.activate-open body.is-logged {
  --header: 68px !important;
}

body.activate-open #siteHeader {
  position: relative;
  z-index: 100;
  min-height: var(--header) !important;
  height: var(--header) !important;
  padding: 6px 12px !important;
  background: #0a0a0a !important;
  border-bottom: none !important;
  box-shadow: none !important;
  gap: 0 !important;
}

body.activate-open .header-left-tools,
body.activate-open .header-uname,
body.activate-open .header-actions,
body.activate-open .btn-support {
  display: none !important;
}

body.activate-open .header-left {
  min-width: 0;
  visibility: visible;
  pointer-events: auto;
  display: flex;
  align-items: center;
}

body.activate-open .header-activate-back {
  display: inline-flex !important;
  visibility: visible !important;
}

.header-activate-back {
  display: none;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: #ECCA77;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px 4px;
  z-index: 2;
}

.header-activate-back span {
  font-size: 1.4rem;
  line-height: 1;
}

body.activate-open .logo {
  min-width: 0;
  max-width: min(78vw, 300px);
}

body.activate-open .logo-img,
body.activate-open.is-logged .logo-img,
body.is-logged.activate-open .logo-img {
  height: 52px !important;
  max-height: 52px !important;
}

body.activate-open .phone-shell {
  background: #0a0a0a !important;
}

body.activate-open .phone-scroll,
body.activate-open #appRoot,
body.activate-open .sidebar,
body.activate-open .workspace {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ซ่อนแถบล่างตอนเปิดบัญชี — เต็มจอเหมือนตัวอย่าง */
body.activate-open .mobile-nav {
  display: none !important;
}

body.activate-open .activate-head {
  background: #121212;
}

body.activate-open #activateModal.activate-backdrop {
  background: #0a0a0a !important;
}

#needDepositModal.need-dep-backdrop {
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
  align-items: center !important;
  justify-items: center !important;
  place-items: center !important;
  padding: 20px 16px !important;
}

#historyModal.history-backdrop {
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(2px);
  align-items: center !important;
  justify-items: center !important;
  place-items: center !important;
  padding: 20px 16px !important;
}

.history-sheet {
  position: relative;
  width: min(94%, 380px);
  max-width: 380px;
  max-height: min(72dvh, 520px);
  display: flex;
  flex-direction: column;
  padding: 22px 18px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1a1612 0%, #0e0c0a 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.history-sheet h2 {
  margin: 0 0 12px;
  font-size: 1.05rem;
  color: #ECCA77;
  text-align: center;
}

.history-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  max-height: min(56dvh, 400px);
  padding-right: 2px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.history-item strong {
  font-size: 0.9rem;
  color: #f2f2f2;
}

.history-item em {
  font-style: normal;
  font-size: 0.78rem;
  color: #a8a8a8;
}

.history-item b {
  font-size: 0.9rem;
  color: #ECCA77;
  text-align: right;
}

.history-item span {
  grid-column: 2;
  font-size: 0.75rem;
  color: #a8a8a8;
  text-align: right;
}

.history-empty {
  margin: 18px 0;
  text-align: center;
  color: #a8a8a8;
  font-size: 0.9rem;
}

.need-dep-sheet {
  position: relative;
  width: min(92%, 340px);
  max-width: 340px;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  align-self: center !important;
  justify-self: center !important;
  padding: 26px 20px 18px;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: linear-gradient(180deg, #1c1c1c, #121212);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  text-align: center;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.modal-backdrop.open .need-dep-sheet {
  transform: none;
  opacity: 1;
}

.need-dep-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #aaa;
  font-size: 0.95rem;
  cursor: pointer;
}

.need-dep-sheet h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
}

.cashback-sheet {
  text-align: left;
}

.cashback-hero {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 10px;
  border-radius: 50%;
  border: 1.5px solid rgba(236, 202, 119, 0.55);
  background:
    radial-gradient(circle at 30% 22%, #555 0%, #2f2f2f 36%, #161616 74%, #0a0a0a 100%);
}

.cashback-sheet h2 {
  text-align: center;
  color: #ECCA77;
}

.cashback-status {
  margin: 0 0 12px !important;
  text-align: center;
  color: #FCDD9A !important;
  font-weight: 700 !important;
}

.cashback-balance-box {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(236, 202, 119, 0.45);
  background: linear-gradient(180deg, rgba(40, 32, 12, 0.65), rgba(12, 12, 12, 0.9));
  text-align: center;
}

.cashback-balance-box span {
  color: #c8b48a;
  font-size: 0.78rem;
  font-weight: 600;
}

.cashback-balance-box strong {
  color: #FCDD9A;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.cashback-actions {
  display: grid !important;
  gap: 8px;
  width: 100%;
}

.cashback-rules {
  margin: 0 0 12px;
  padding: 10px 12px 10px 28px;
  border-radius: 12px;
  border: 1px solid rgba(236, 202, 119, 0.28);
  background: rgba(0, 0, 0, 0.28);
  color: #e8e0c8;
  font-size: 0.86rem;
  line-height: 1.55;
}

.cashback-rules li {
  margin: 4px 0;
}

.cashback-note {
  margin: 0 0 14px !important;
  color: #bdb39a !important;
  font-size: 0.8rem !important;
  line-height: 1.45 !important;
  text-align: left !important;
}

.cashback-sheet .need-dep-actions {
  justify-content: stretch;
}

.cashback-sheet .need-dep-go {
  width: 100%;
}

.refer-code-box {
  display: grid;
  gap: 4px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(236, 202, 119, 0.45);
  background: linear-gradient(180deg, rgba(40, 32, 12, 0.65), rgba(12, 12, 12, 0.9));
  text-align: center;
}

.refer-code-box span {
  color: #c8b48a;
  font-size: 0.78rem;
  font-weight: 600;
}

.refer-code-box strong {
  color: #FCDD9A;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.02em;
  word-break: break-all;
}

.refer-link-field {
  display: grid;
  gap: 6px;
  margin: 0 0 14px;
  text-align: left;
}

.refer-link-field span {
  color: #c8b48a;
  font-size: 0.78rem;
  font-weight: 600;
}

.refer-link-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(236, 202, 119, 0.35);
  background: rgba(0, 0, 0, 0.45);
  color: #f5efd8;
  font-size: 0.82rem;
  outline: none;
}

.refer-sheet .cashback-status {
  color: #e8e0c8 !important;
  font-weight: 600 !important;
  font-size: 0.88rem;
  line-height: 1.45;
}

.reg-source-locked {
  pointer-events: none;
  opacity: 0.92;
}

.need-dep-sheet p {
  margin: 0 0 22px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #c8c8c8;
}

.need-dep-actions {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 10px;
}

.need-dep-later {
  min-height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #2a2a2a;
  color: #f0f0f0;
  font-weight: 700;
}

.need-dep-go {
  min-height: 46px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
  white-space: nowrap;
}

.activate-page {
  position: relative;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  overflow: hidden;
  border: none;
  border-radius: 0;
}

.activate-scroll {
  flex: 1;
  overflow: auto;
  padding: 18px 16px calc(28px + var(--safe-b));
  -webkit-overflow-scrolling: touch;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}

.activate-head {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: #121212;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  width: 100%;
  box-sizing: border-box;
}

/* เส้นคั่นบางจาง — ไม่ตัดทึบ */
.activate-head::after {
  content: none;
}

.activate-back {
  justify-self: start;
  border: none;
  background: transparent;
  color: #ECCA77;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.activate-back span {
  font-size: 1.35rem;
  line-height: 1;
}

.activate-head h2 {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.activate-head-spacer {
  width: 1px;
}

.activate-body {
  position: relative;
  padding: 4px 0 0;
  max-width: none;
  margin: 0;
  border: none;
  background: transparent;
}

.act-timeline {
  position: absolute;
  left: 19px;
  top: 38px;
  bottom: 88px;
  width: 2px;
  background: linear-gradient(180deg, rgba(236, 202, 119, 0.55), rgba(80, 80, 80, 0.4) 55%, rgba(60, 60, 60, 0.25));
  border-radius: 2px;
  pointer-events: none;
}

.act-step {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  margin-bottom: 20px;
  opacity: 0.45;
}

.act-step.is-active {
  opacity: 1;
}

.act-step-ico {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(120, 120, 120, 0.5);
  color: #888;
  background: #121212;
}

.act-step.is-active .act-step-ico {
  border-color: #ECCA77;
  color: #ECCA77;
  box-shadow: 0 0 18px rgba(236, 202, 119, 0.28);
  background: #1a160c;
}

.act-step-main h3 {
  margin: 8px 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: #f2f2f2;
}

.act-step:not(.is-active) .act-step-main h3 {
  color: #8a8a8a;
  margin-bottom: 0;
}

/* การ์ดงานเต็มความกว้างแบบตัวอย่าง UFA */
.act-task {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 14px 14px;
  border-radius: 12px;
  background: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.act-task.is-done {
  border-color: rgba(236, 202, 119, 0.28);
}

.act-task.is-locked {
  opacity: 0.48;
  pointer-events: none;
}

.act-task.is-locked .act-go {
  display: none;
}

.act-task.is-current {
  border-color: rgba(236, 202, 119, 0.45);
  box-shadow: 0 0 0 1px rgba(236, 202, 119, 0.12);
}

.act-task.is-current .act-go {
  display: inline-flex;
}

.act-task em {
  font-style: normal;
  color: #ececec;
  font-size: 0.92rem;
  font-weight: 600;
}

.act-dot {
  display: none;
}

.act-go {
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a1205;
  cursor: pointer;
  background: linear-gradient(180deg, #FCDD9A, #8B6832);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), 0 0 12px rgba(236, 202, 119, 0.18);
}

.act-go:disabled {
  opacity: 0.85;
  cursor: default;
  background: #2a2a2a;
  color: #9a9a9a;
  box-shadow: none;
}

.activate-help {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: 28px;
  padding-top: 4px;
  padding-bottom: 8px;
}

.activate-help p {
  margin: 0;
  color: #e8e8e8;
  font-size: 0.92rem;
}

.activate-help .auth-line-pill {
  margin: 0;
}

.activate-form {
  display: grid;
  gap: 12px;
}

/* display:grid ทับ [hidden] ในบางเบราว์เซอร์ — บังคับซ่อน */
#activateStepper[hidden],
#activateProfileForm[hidden],
#activateBankForm[hidden],
.activate-form[hidden],
.activate-body[hidden] {
  display: none !important;
}

.act-note {
  margin: 0 2px 4px;
  color: #ECCA77;
  font-size: 0.8rem;
  line-height: 1.45;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.act-note i {
  font-style: normal;
  flex-shrink: 0;
}

.act-card {
  border-radius: 14px;
  border: 1px solid rgba(236, 202, 119, 0.28);
  background: #121212;
  padding: 12px 14px;
}

.act-card-label {
  color: #9a9a9a;
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.act-stack-field {
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.act-card .act-stack-field:first-of-type {
  border-top: none;
  padding-top: 4px;
}

.act-stack-field > span {
  color: #bdbdbd;
  font-size: 0.78rem;
}

.act-stack-field input {
  width: 100%;
  min-height: 40px;
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  padding: 0;
}

.act-acc-field input {
  min-height: 52px;
  letter-spacing: 0.12em;
}

.act-card-rows {
  padding: 0;
  overflow: hidden;
}

.act-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.act-card-rows .act-row:last-child {
  border-bottom: none;
}

.act-row-k {
  color: #cfcfcf;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.act-row-v {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #f0f0f0;
  font-size: 0.88rem;
  min-width: 0;
}

.act-row-v img {
  border-radius: 50%;
  flex-shrink: 0;
}

.act-row-v i {
  font-style: normal;
  color: #ECCA77;
}

.act-row-v em {
  font-style: normal;
  color: #9a9a9a;
}

.act-row-v.has-bank em {
  color: #f0f0f0;
}

.act-row-v .bank-mini {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  background: #0a0a0a;
}

/* dark bank picker (แทน select ขาวของระบบ) — absolute ใน phone-shell */
.bank-picker {
  position: absolute;
  inset: 0;
  z-index: 130;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.72);
}

.phone-shell > .bank-picker {
  position: absolute;
}

.bank-picker[hidden] {
  display: none !important;
}

.bank-picker-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  max-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  border-radius: 18px 18px 0 0;
  border: 1px solid rgba(236, 202, 119, 0.28);
  border-bottom: none;
  background: #121212;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.55);
}

.bank-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.bank-picker-head h3 {
  margin: 0;
  color: #ECCA77;
  font-size: 1rem;
  font-weight: 700;
}

.bank-picker-x {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a1a1a;
  color: #ddd;
  cursor: pointer;
}

.bank-picker-list {
  overflow: auto;
  padding: 8px 10px calc(16px + var(--safe-b));
  -webkit-overflow-scrolling: touch;
}

.bank-pick-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #1a1a1a;
  color: #f2f2f2;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.bank-pick-item:hover,
.bank-pick-item.is-on {
  border-color: rgba(236, 202, 119, 0.45);
  background: #221c10;
}

.bank-pick-item img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  background: #0a0a0a;
  flex-shrink: 0;
}

.bank-pick-item span {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.bank-pick-item small {
  color: #ECCA77;
  font-size: 0.72rem;
  font-weight: 700;
}

@media (min-width: 860px) {
  .bank-picker {
    place-items: center;
    align-items: center;
    padding: 24px;
  }

  .bank-picker-sheet {
    border-radius: 16px;
    border: 1px solid rgba(236, 202, 119, 0.28);
    max-height: min(70vh, 560px);
  }
}

.act-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid rgba(236, 202, 119, 0.4);
  background: linear-gradient(180deg, #222, #141414);
  color: #b8b8b8;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.activate-form:valid .act-submit {
  color: #1a1205;
  border-color: transparent;
  background: linear-gradient(180deg, #FCDD9A, #8B6832);
}

@media (min-width: 860px) {
  /* ใน phone-shell ยังต้องเต็มความกว้าง — แต่เหลือหัวโลโก้ด้านบน */
  #activateModal.activate-backdrop {
    place-items: stretch !important;
    align-items: stretch !important;
    padding: 0 !important;
    background: #0a0a0a !important;
  }

  .phone-shell > #activateModal.activate-backdrop {
    top: var(--header) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    inset: auto !important;
    place-items: stretch !important;
    padding: 0 !important;
    background: #0a0a0a !important;
  }

  .activate-page,
  .phone-shell #activateModal .activate-page {
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    max-height: none !important;
    border-radius: 0 !important;
    border: none !important;
    background: #0a0a0a !important;
  }
}

/* สลับฝาก/ถอนจากเมนู — ไม่โชว์แท็บคู่ (แบบหน้าตัวอย่างเดิม) */
.wallet-tabs {
  display: none;
}

.wallet-tab {
  min-height: 40px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font-weight: 700;
  cursor: pointer;
}

.wallet-tab.is-on {
  color: #2a1e00;
  background: linear-gradient(180deg, #f0d78c, var(--gold));
}

.wallet-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 16px 28px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.wallet-bal {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 8px;
  color: #ECCA77;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
}

.wallet-bal-ico {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(236, 202, 119, 0.45);
  background: rgba(8, 8, 8, 0.45);
}

.wallet-bal-ico img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.wallet-bal-text b,
.wallet-bal b {
  color: #FCDD9A;
  font-weight: 800;
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.amount-grid button {
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: #161616;
  color: var(--gold-2);
  font-weight: 800;
  cursor: pointer;
}

.amount-grid button.is-on {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.08));
  border-color: var(--gold);
}

.wallet-section-title {
  margin: 14px 0 12px;
  color: #ECCA77;
  font-size: 0.98rem;
  font-weight: 700;
  text-align: center;
  position: relative;
  padding-bottom: 16px;
}

/* เส้นทอง + เพชรกลาง ใต้หัวข้อ */
#walletDeposit .dep-step-panel > .wallet-section-title::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 8px;
  height: 8px;
  transform: translateX(-50%) rotate(45deg);
  background: linear-gradient(145deg, #ffe7a8, #c4a04a);
  box-shadow: 0 0 6px rgba(236, 202, 119, 0.45);
  z-index: 1;
}

#walletDeposit .dep-step-panel > .wallet-section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: min(58%, 210px);
  height: 1px;
  transform: translateX(-50%);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(201, 164, 90, 0.35) 12%,
    #ecca77 50%,
    rgba(201, 164, 90, 0.35) 88%,
    transparent 100%
  );
}

/* ฝากเงินแบบขั้น — กึ่งกลางซุ้มเหนือเส้นโค้ง */
.dep-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: clamp(10px, 2.6dvh, 22px) 0 0;
}

.dep-step {
  text-align: center;
  padding: 9px 4px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #ECCA77;
  background: rgba(8, 8, 8, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.55);
}

.dep-step.is-on {
  color: #1a1205;
  background: linear-gradient(180deg, #ffe7a8, #ecca77 48%, #c4a04a);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(180, 140, 50, 0.28);
}

.dep-step.is-done {
  color: #F2D08A;
  border-color: rgba(232, 184, 74, 0.35);
  background: rgba(232, 184, 74, 0.1);
}

.dep-step-panel[hidden] {
  display: none !important;
}

/* การ์ด/ฟอร์ม — อยู่ใต้เส้นโค้งทองชัดๆ */
#walletDeposit .dep-step-panel {
  padding-top: clamp(78px, 15.5dvh, 150px);
}

/* ขั้น โอน/สลิป: ดึงขึ้นมาให้ฟอร์มพอดีจอ เลื่อนน้อยลง */
#walletDeposit #depStep3.dep-step-panel {
  padding-top: clamp(12px, 2.4dvh, 28px);
}

#walletDeposit #depStep3 .dep-back {
  margin-bottom: 6px;
}

#walletDeposit #depStep3 > .wallet-section-title:first-of-type {
  margin-top: 4px;
  margin-bottom: 8px;
}

/* ถอน: ดันฟอร์มลงใต้โค้งเช่นกัน */
#walletWithdraw {
  padding-top: clamp(4px, 1dvh, 12px);
}

#walletWithdraw > .wallet-section-title:first-of-type {
  /* คำหัวข้อดึงขึ้น · รายการบัญชีอยู่ตำแหน่งเดิม */
  margin-top: clamp(48px, 10dvh, 108px);
  margin-bottom: clamp(28px, 5dvh, 44px);
}

.dep-method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 auto 10px;
  max-width: 360px;
}

.dep-method {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 118px;
  padding: 14px 4px 12px;
  border-radius: 12px;
  border: 1px solid rgba(236, 202, 119, 0.62);
  background: rgba(8, 8, 8, 0.42);
  color: #f2e6c8;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}

.dep-method:hover:not(:disabled) {
  border-color: rgba(232, 184, 74, 0.55);
}

.dep-method.is-on {
  border-color: #E8B84A;
  box-shadow: 0 0 0 1px rgba(232, 184, 74, 0.25), 0 8px 18px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.dep-method:disabled,
.dep-method.is-empty {
  opacity: 0.4;
  cursor: not-allowed;
}

.dep-method-ico {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  line-height: 1;
}

.dep-method-ico img {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(232, 184, 74, 0.28));
}

.dep-method.is-on .dep-method-ico img {
  filter: drop-shadow(0 0 8px rgba(240, 200, 90, 0.45));
}

.dep-method strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ECCA77;
}

.dep-method em {
  font-style: normal;
  font-size: 0.7rem;
  color: #c8b48a;
}

.dep-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 10px;
  padding: 0;
  border: none;
  background: transparent;
  color: #E8B84A;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.dep-qr-note {
  display: block;
  margin-top: 2px;
  font-size: 0.68rem;
  color: #9a9a9a;
}

.dep-channels {
  display: grid;
  gap: 8px;
  margin-bottom: 4px;
}

.dep-channel {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #161616;
  color: #f2f2f2;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.dep-channel.is-on {
  border-color: rgba(236, 202, 119, 0.55);
  background: #1c1810;
  box-shadow: 0 0 0 1px rgba(236, 202, 119, 0.12);
}

.dep-channel img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: #0a0a0a;
  flex-shrink: 0;
}

.dep-channel-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dep-channel-meta b {
  font-size: 0.86rem;
  color: #fff;
}

.dep-channel-meta em {
  font-style: normal;
  font-size: 0.72rem;
  color: #9a9a9a;
}

.dep-channel-meta strong {
  font-size: 0.92rem;
  color: #ECCA77;
  letter-spacing: 0.02em;
}

.dep-channel-copy {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(236, 202, 119, 0.4);
  color: #ECCA77;
  font-size: 0.72rem;
  font-weight: 700;
}

.wd-banks {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.wd-bank {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: #141414;
  color: #eee;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.wd-bank.is-on {
  border-color: rgba(236, 202, 119, 0.85);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.16), #17140f);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.2);
}

.wd-bank img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
  flex: 0 0 auto;
}

.wd-bank-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.wd-bank-meta b {
  color: #fcdd9a;
  font-size: 0.86rem;
}

.wd-bank-meta em {
  font-style: normal;
  color: #c8c8c8;
  font-size: 0.74rem;
}

.wd-bank-meta strong {
  font-size: 0.78rem;
  color: #f5f5f5;
  letter-spacing: 0.02em;
}

.wallet-note {
  margin: 12px 0 0;
  text-align: center;
  color: #c4a86a;
  font-size: 0.75rem;
}

#depMethodHint.wallet-note {
  margin: 18px auto 0;
  max-width: 280px;
  padding: 10px 0 0;
  position: relative;
  color: #ECCA77;
  font-size: 0.72rem;
  font-weight: 500;
}

#depMethodHint.wallet-note::before,
#depMethodHint.wallet-note::after {
  content: "";
  display: block;
  position: absolute;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(236, 202, 119, 0.35),
    transparent
  );
}

#depMethodHint.wallet-note::before {
  top: 0;
}

#depMethodHint.wallet-note::after {
  bottom: -8px;
}

@media (max-width: 859px) {
  .main {
    width: 100%;
    margin: 0;
    gap: 10px;
    min-width: 0;
  }

  .workspace {
    padding-bottom: calc(100px + var(--safe-b));
  }

  .app {
    padding-bottom: calc(100px + var(--safe-b));
  }

  .app > .slider {
    aspect-ratio: 1024 / 409;
  }

  .slider-trust {
    display: none !important;
  }

  .games-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 2px 6px;
  }

  .games-head h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f2f2f2;
  }

  .games-all {
    border: none;
    background: transparent;
    color: var(--gold);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
  }

  .tile-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .tile {
    border-radius: 10px;
    aspect-ratio: 1 / 1;
    border-color: rgba(120, 120, 120, 0.35);
  }

  .chat-fab {
    bottom: calc(78px + var(--safe-b));
    right: 12px;
  }

  .promo-row,
  .info-bar {
    display: none;
  }

  .mobile-nav {
    display: grid !important;
  }

  .side-item {
    width: 62px;
    height: 62px;
    min-width: 62px;
    min-height: 62px;
    border-radius: 12px;
    font-size: 0.62rem;
  }

  .side-ico {
    width: 24px;
    height: 24px;
  }
}

/* ——— Sidebar ——— */
.sidebar {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  width: var(--sidebar);
  min-width: var(--sidebar);
  position: sticky;
  top: calc(var(--header) + 8px);
  align-self: flex-start;
  padding: 4px 0;
  max-height: calc(100vh - var(--header) - 16px);
  overflow-x: visible;
  overflow-y: auto;
  scrollbar-width: none;
  z-index: 12;
  visibility: visible !important;
  opacity: 1 !important;
}

/* มือถือ: เลื่อนทั้งหน้าไปด้วยกัน — ไม่ให้แถบซ้ายค้างกลางจอ */
@media (max-width: 859px) {
  .sidebar {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
    align-self: flex-start;
  }
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.side-item {
  position: relative;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  min-width: 64px;
  min-height: 64px;
  padding: 6px 3px 5px;
  border: 1px solid rgba(0, 0, 0, 0.55);
  border-radius: 12px;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 55%, #121212 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 10px rgba(0, 0, 0, 0.45);
  color: var(--gold);
  cursor: pointer;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.side-item:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 6px 14px rgba(0, 0, 0, 0.5),
    0 0 12px rgba(212, 175, 55, 0.12);
}

.side-item.is-active {
  color: #3a2a00;
  border-color: rgba(120, 90, 20, 0.55);
  background: linear-gradient(180deg, #f3e0a0 0%, #e0b84a 42%, #c9971e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 4px 14px rgba(212, 175, 55, 0.35);
}

.side-item.is-active .side-ico {
  color: #3a2a00;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.25));
}

.side-ico {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--gold);
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.35));
}

.side-ico svg,
.side-ico img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.side-item.is-active .side-ico {
  color: #3a2a00;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, 0.25));
}

.side-item.is-active .side-ico img {
  filter: brightness(0) saturate(100%) invert(16%) sepia(28%) saturate(900%) hue-rotate(6deg) brightness(0.95);
}

.side-label {
  line-height: 1.1;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.hot-badge {
  display: none;
}

/* ——— Main ——— */
.main {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.game-search {
  position: relative;
  display: block;
  width: 100%;
}

.game-search input {
  width: 100%;
  min-height: 40px;
  padding: 0 42px 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(236, 202, 119, 0.22);
  background: linear-gradient(180deg, #1a1814 0%, #141414 100%);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  outline: none;
}

.game-search input::placeholder {
  color: #8a8a8a;
}

.game-search input:focus {
  border-color: rgba(236, 202, 119, 0.55);
  box-shadow: 0 0 0 2px rgba(139, 104, 50, 0.18);
}

.game-search-ico {
  position: absolute;
  right: 14px;
  top: 50%;
  translate: 0 -50%;
  width: 20px;
  height: 20px;
  color: var(--gold);
  pointer-events: none;
}

.game-search-ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ——— Slider ——— */
.slider {
  position: relative;
  border-radius: 0;
  overflow: hidden;
  border: none;
  background: #000;
  aspect-ratio: 1024 / 409;
  max-height: none;
  box-shadow: none;
}

.slides {
  height: 100%;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.5s ease;
  background: #000;
}

.slide.is-on {
  opacity: 1;
  z-index: 1;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.slide-shade {
  display: none;
}

.slide-copy {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 42px;
  z-index: 2;
  max-width: 420px;
}

.slide-kicker {
  margin: 0 0 6px;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}

.slide-copy h1 {
  margin: 0 0 6px;
  font-size: clamp(1.05rem, 4.5vw, 1.55rem);
  line-height: 1.25;
  font-weight: 700;
}

.slide-copy p:last-child {
  margin: 0;
  color: var(--text-2);
  font-size: 0.85rem;
}

.slider-nav {
  display: none !important;
  position: absolute;
  top: 50%;
  z-index: 3;
  translate: 0 -50%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(0, 0, 0, 0.4);
  color: var(--gold-2);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
  backdrop-filter: blur(4px);
}

.slider-nav.prev {
  left: 8px;
}
.slider-nav.next {
  right: 8px;
}

.slider-dots {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 3;
  translate: -50% 0;
  display: flex;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}

.slider-dots button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.slider-dots button.is-on {
  background: var(--gold);
  transform: scale(1.15);
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

.slider-trust {
  display: none;
}

/* ——— Games ——— */
.games-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.games-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.games-sub {
  color: var(--text-2);
  font-size: 0.78rem;
}

.games-all {
  border: none;
  background: transparent;
  color: var(--gold);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background: #0c0c0c;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.tile:active {
  transform: scale(0.98);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.empty-tiles {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: var(--text-2);
  border: 1px dashed rgba(212, 175, 55, 0.25);
  border-radius: var(--radius);
}

/* ——— Promo ——— */
.promo-board {
  display: grid;
  gap: 10px;
  margin-bottom: 8px;
}

.promo-board-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px;
}

.promo-board-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: #fcdd9a;
  letter-spacing: 0.01em;
}

.promo-scroll-hint {
  margin: 0;
  font-size: 0.68rem;
  color: #8a8a8a;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.games.is-promo-only .games-head {
  margin-bottom: 8px;
}

body.view-promo .promo-board {
  display: grid;
}

body:not(.view-promo) .promo-board {
  display: none !important;
}

#tileGrid[hidden],
.games-all[hidden],
#gamesAllBtn[hidden] {
  display: none !important;
}

.promo-banner-stack {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
}

.promo-banner-full {
  width: 100%;
  height: auto;
  max-height: none;
  display: block;
  border-radius: 14px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(212, 175, 55, 0.12), transparent 55%),
    #050505;
  object-fit: contain;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.promo-pack-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: none;
  overflow: visible;
  padding: 0;
  margin: 0;
}

.promo-pack-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 12px 12px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.04), transparent 42%),
    #121212;
  color: #cfcfcf;
  font: inherit;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.promo-pack-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--promo-accent, #d4af37);
}

.promo-pack-card:active {
  transform: scale(0.985);
}

.promo-pack-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.promo-pack-top b {
  color: var(--promo-accent, #fcdd9a);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.promo-pack-top i {
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  color: #1a1205;
  background: var(--promo-accent, #ECCA77);
  border-radius: 999px;
  padding: 3px 7px;
  line-height: 1.2;
}

.promo-pack-deal {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 4px;
  line-height: 1.15;
}

.promo-pack-deal em {
  font-style: normal;
  font-size: 0.62rem;
  color: #8f8f8f;
}

.promo-pack-deal strong {
  font-size: 0.92rem;
  font-weight: 800;
  color: #f5f5f5;
}

.promo-pack-deal .promo-pack-credit {
  color: var(--promo-accent, #ffe7a8);
}

.promo-pack-arrow {
  color: #666;
  font-size: 0.75rem;
  margin: 0 1px;
}

.promo-pack-meta {
  display: block;
  font-size: 0.62rem;
  color: #8a8a8a;
  letter-spacing: 0.01em;
}

.promo-pack-card.is-on,
.promo-pack-card:hover {
  border-color: rgba(236, 202, 119, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.22), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.promo-tier-bronze {
  --promo-accent: #cd7f32;
}

.promo-tier-bronze.is-on,
.promo-tier-bronze:hover {
  border-color: rgba(205, 127, 50, 0.7);
  box-shadow: 0 0 0 1px rgba(205, 127, 50, 0.28), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.promo-tier-silver {
  --promo-accent: #c0c7d1;
}

.promo-tier-silver.is-on,
.promo-tier-silver:hover {
  border-color: rgba(192, 199, 209, 0.7);
  box-shadow: 0 0 0 1px rgba(192, 199, 209, 0.28), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.promo-tier-gold {
  --promo-accent: #e8c34a;
}

.promo-tier-gold.is-on,
.promo-tier-gold:hover {
  border-color: rgba(232, 195, 74, 0.75);
  box-shadow: 0 0 0 1px rgba(232, 195, 74, 0.28), 0 8px 18px rgba(0, 0, 0, 0.28);
}

.promo-tier-platinum {
  --promo-accent: #9fd4ff;
}

.promo-tier-platinum.is-on,
.promo-tier-platinum:hover {
  border-color: rgba(159, 212, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(159, 212, 255, 0.28), 0 8px 18px rgba(0, 0, 0, 0.28);
}

@media (max-width: 380px) {
  .promo-pack-grid {
    grid-template-columns: 1fr;
  }
}

.dep-promo-hint-top {
  margin: -4px 0 8px;
  text-align: left;
}

/* โมดัลฝาก: ช่องเลือกโปรแบบพับ — กดเปิดแล้วเลื่อนลงเล็กน้อย */
.dep-promo-dd {
  margin-bottom: 12px;
}

.dep-promo-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(236, 202, 119, 0.55);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.14), #17140f);
  color: #eee;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dep-promo-trigger-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.dep-promo-trigger-copy strong {
  color: #ffe7a8;
  font-size: 0.9rem;
  font-weight: 700;
}

.dep-promo-trigger-copy em {
  font-style: normal;
  color: #bdbdbd;
  font-size: 0.72rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dep-promo-chevron {
  flex: 0 0 auto;
  font-style: normal;
  font-size: 0.65rem;
  color: #ECCA77;
  transition: transform 0.18s ease;
}

.dep-promo-dd.is-open .dep-promo-chevron {
  transform: rotate(180deg);
}

.dep-promo-list {
  display: grid;
  gap: 6px;
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.22s ease, margin-top 0.22s ease, opacity 0.18s ease, padding 0.22s ease;
}

.dep-promo-dd.is-open .dep-promo-list {
  max-height: 168px;
  margin-top: 8px;
  padding: 2px 1px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 1;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.45) transparent;
}

.dep-promo-card {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 10px;
  background: #141414;
  color: #cfcfcf;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dep-promo-card::before {
  content: none;
}

.dep-promo-card strong {
  font-size: 0.84rem;
  color: #fcdd9a;
  font-weight: 700;
}

.dep-promo-card span {
  display: block;
  color: #ddd;
  font-size: 0.72rem;
  font-weight: 600;
}

.dep-promo-card em {
  display: block;
  font-style: normal;
  color: #8f8f8f;
  font-size: 0.66rem;
}

.dep-promo-card i {
  display: none;
}

.dep-promo-card.is-on {
  border-color: rgba(236, 202, 119, 0.75);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.14), #17140f);
}

.dep-promo-card.is-on strong {
  color: #ffe7a8;
}

.amount-grid.is-locked {
  opacity: 0.45;
  pointer-events: none;
}

#depAmount:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.slip-upload {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.slip-pick {
  min-height: 44px;
  border-radius: 10px;
  border: 1px dashed rgba(212, 175, 55, 0.45);
  background: #141414;
  color: #fcdd9a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.slip-preview {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: #0a0a0a;
}

.slip-preview img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  background: #000;
}

.slip-clear {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.promo-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.promo-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.12), transparent 50%), #121212;
}

.promo-card span {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.promo-card strong {
  display: block;
  margin: 4px 0;
  font-size: 1.6rem;
  color: var(--gold-2);
  font-family: var(--display);
}

.promo-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.85rem;
}

/* ——— Info bar ——— */
.info-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #101010;
}

.info-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px;
}

.info-ico {
  font-size: 1.1rem;
  filter: grayscale(0.2) sepia(1) hue-rotate(5deg) saturate(2.5);
}

.info-item b {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
}

.info-item small {
  color: var(--text-2);
  font-size: 0.68rem;
}

/* ——— Member hub (logged-in home) ——— */
.member-hub {
  grid-area: slider / slider / workspace / workspace;
  position: relative;
  min-height: 0;
  padding: 2px 16px calc(100px + var(--safe-b));
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  background: transparent;
}

.member-hub:not(.member-profile) {
  overflow-x: hidden;
  overflow-y: auto;
  /* เว้นล่างให้แท่น nav — ข้างจัดชิดแนว UFA · บนชิดหัวเว็บให้ประกาศ */
  padding: 0 14px calc(108px + var(--safe-b));
}

/*
  พื้นหลัง hub โค้งทอง — ยินดีต้อนรับ+ยอดอยู่ในซุ้ม
  · แถบเปิดบัญชี+ไอคอนอยู่ใต้ขอบโค้ง (ไม่ทับวงทอง)
*/
.member-hub:not(.member-profile) .hub-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  min-height: clamp(158px, calc(28dvh - var(--header)), 248px);
  padding: 4px 0 max(26px, 3.6dvh);
  margin: 0;
}

.member-hub:not(.member-profile) .hub-welcome {
  padding-top: 0;
  margin-top: 6px;
}

.member-hub:not(.member-profile) .hub-welcome h1 {
  margin-top: 2px;
}

.member-hub:not(.member-profile) .hub-balance-row {
  margin-top: max(12px, 1.4dvh);
  margin-bottom: 0;
  padding-top: 0;
  transform: translateY(0);
}

/* ชุดแถบเปิดบัญชี + ไอคอน — เลื่อนลงใต้ขอบโค้ง */
.member-hub:not(.member-profile) .hub-activate {
  position: relative;
  z-index: 2;
  margin: 12px 0 12px;
}

.member-hub:not(.member-profile) .hub-grid {
  position: relative;
  z-index: 1;
  margin-top: 0;
  padding-top: 4px;
}

/* คำประกาศ — ชิดใต้เมนูสามขีด + เต็มความกว้าง */
.member-hub:not(.member-profile) > .hub-announce,
.hub-announce {
  position: relative;
  z-index: 3;
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: calc(100% + 28px);
  max-width: none;
  margin: 0 -14px 0;
  left: 0;
  right: 0;
  min-height: 28px;
  padding: 4px 10px;
  box-sizing: border-box;
  border-radius: 0;
  background: linear-gradient(90deg, rgba(24, 20, 12, 0.96) 0%, rgba(12, 12, 12, 0.92) 100%) !important;
  border-bottom: 1px solid rgba(236, 202, 119, 0.3) !important;
  border-top: none;
}

:is(html, body).page-hub .header::after {
  display: none !important;
}

.hub-announce .announce-text {
  color: #f2e6c4;
  font-size: 0.72rem;
}

.hub-announce .announce-label {
  flex: 0 0 auto;
}

.member-hub::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.member-hub[hidden] {
  display: none !important;
}

.hub-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: transparent;
}

/* หน้าหลัก: พื้นหลังซุ้มโลหะจากรูป (คนละชุดกับ login) — วาดที่ shell ให้ไม่โดนคลิป */
:is(html, body).page-hub .phone-shell,
:is(html, body).page-profile .phone-shell {
  background:
    #050505 url("/home/ufa/ui/hub/hub-home-backdrop.webp?v=hub5") center top / cover no-repeat !important;
}

.member-hub:not(.member-profile) > .hub-bg,
.member-profile > .hub-bg {
  display: none;
}

.hub-bg::before,
.hub-bg::after {
  content: none;
}

/* โซนหัว: ยินดีต้อนรับ + ยอด — วางบนซุ้มจากรูป */
.hub-hero {
  position: relative;
  z-index: 1;
  padding: 4px 0 42px;
  margin: 0 -8px;
  overflow: visible;
}

/* ปิดซุ้ม CSS ปลอม — ใช้รูปจริงแทน (หน้าหลัก + โปรไฟล์) */
.member-hub:not(.member-profile) .hub-bowl,
.member-profile .hub-bowl {
  display: none !important;
}

/* โปรไฟล์ยังใช้ซุ้ม CSS (ไม่มีรูปแยก) */
.hub-hero > .hub-bowl,
.member-hub > .hub-bowl {
  position: absolute;
  left: 50%;
  top: -72px;
  z-index: 0;
  width: min(190%, 760px);
  height: calc(100% + 96px);
  min-height: 210px;
  transform: translateX(-50%);
  pointer-events: none;
  overflow: visible;
}

.hub-bowl-shade,
.member-hub .hub-bowl-shade {
  position: absolute;
  left: 50%;
  top: 0;
  width: 142%;
  height: 104%;
  transform: translateX(-50%);
  border-radius: 0 0 50% 50% / 0 0 72% 72%;
  background:
    radial-gradient(70% 48% at 50% 18%, rgba(255, 255, 255, 0.09) 0%, transparent 58%),
    linear-gradient(180deg, #3d3d3d 0%, #2c2c2c 34%, #1f1f1f 68%, #171717 100%);
  box-shadow:
    0 1px 0 rgba(210, 210, 210, 0.22),
    0 10px 18px rgba(0, 0, 0, 0.55),
    0 22px 40px rgba(0, 0, 0, 0.72),
    inset 0 -10px 18px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  -webkit-mask-image: none;
  mask-image: none;
}

.hub-bowl-shade::after,
.member-hub .hub-bowl-shade::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -18px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.35) 42%, transparent 72%);
  filter: blur(6px);
  pointer-events: none;
}

.hub-bowl-arc,
.member-hub .hub-bowl-arc {
  position: absolute;
  left: 7%;
  right: 7%;
  bottom: 4px;
  width: 86%;
  height: 54px;
  margin: 0 auto;
  display: block;
  opacity: 0.92;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
  overflow: visible;
}

.hub-inner {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  margin: 0 auto;
}

.hub-welcome {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2px 10px 0;
}

.hub-welcome p {
  margin: 0;
  color: #d4a84b;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.hub-welcome h1 {
  margin: 4px 0 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #fff;
  line-height: 1.12;
  word-break: break-word;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.hub-balance-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px auto 0;
  min-height: 36px;
}

.hub-balance {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-sizing: border-box;
  min-width: 152px;
  height: 36px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(12, 12, 12, 0.82);
  border: 1px solid rgba(180, 150, 90, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.28);
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hub-balance:active {
  border-color: #fcdd9a;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 3px rgba(236, 202, 119, 0.12);
}

.hub-ccy {
  color: #ecca77;
  font-weight: 700;
  font-size: 14px;
}

.hub-balance strong {
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
}

.hub-caret {
  color: #ecca77;
  font-size: 0.64rem;
  opacity: 0.95;
  margin-left: -2px;
}

.hub-plus {
  box-sizing: border-box;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(252, 221, 154, 0.55);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffe7a8 0%, #ecca77 46%, #a87b2e 100%);
  color: #1a1205;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 4px 10px rgba(168, 123, 46, 0.4);
  transition: transform 0.12s ease, filter 0.15s ease;
}

.hub-plus:active {
  transform: scale(0.94);
  filter: brightness(1.05);
}

.hub-divider {
  display: none;
}

.hub-activate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 12px;
  padding: 7px 8px 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: rgba(14, 14, 14, 0.92);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
  backdrop-filter: none;
}

.hub-activate[hidden],
#hubActivate[hidden] {
  display: none !important;
}

.hub-activate p {
  margin: 0;
  color: #f3f3f3;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 5px;
}

.hub-activate p i {
  font-style: normal;
  color: #ecca77;
  line-height: 1;
}

.hub-activate-btn {
  flex-shrink: 0;
  border: none;
  border-radius: 7px;
  padding: 6px 11px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #1a1205;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe7a8, #ecca77 48%, #a87b2e);
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 4px 12px rgba(168, 123, 46, 0.38);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 12px;
  padding: 4px 4px 0;
  margin-top: 0;
}

.hub-grid-compact {
  justify-items: center;
}

.hub-grid-compact .hub-item:nth-child(5) {
  grid-column: 1;
}

.hub-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  color: #ecca77;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.hub-ico {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #f0d060;
  background:
    radial-gradient(circle at 30% 22%, #555 0%, #2f2f2f 36%, #161616 74%, #0a0a0a 100%);
  border: 1.6px solid rgba(236, 202, 119, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -12px 18px rgba(0, 0, 0, 0.5),
    0 0 0 3px rgba(20, 16, 8, 0.85),
    0 0 0 4px rgba(236, 202, 119, 0.22),
    0 10px 18px rgba(0, 0, 0, 0.42);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.hub-item:active .hub-ico {
  transform: scale(0.94);
  border-color: rgba(252, 221, 154, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 0 0 3px rgba(20, 16, 8, 0.85),
    0 0 0 4px rgba(252, 221, 154, 0.35),
    0 8px 16px rgba(0, 0, 0, 0.4);
}

.hub-ico img,
.hub-ico svg {
  width: 38px;
  height: 38px;
  display: block;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.35));
}

.hub-ico-brand,
.hub-ico-play {
  padding: 6px;
  overflow: hidden;
}

.hub-ico-brand img,
.hub-ico-play img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
}

/* ไอคอนหวย — ขนาดเท่า .hub-ico อื่น รูปมีวงในตัวจึงไม่ซ้อนกรอบ CSS */
.hub-ico.hub-ico-lotto {
  width: 56px;
  height: 56px;
  padding: 0;
  overflow: hidden;
  border: none;
  background: transparent;
  box-shadow:
    0 0 0 3px rgba(20, 16, 8, 0.85),
    0 0 0 4px rgba(236, 202, 119, 0.22),
    0 10px 18px rgba(0, 0, 0, 0.42);
}

.hub-ico-lotto img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  object-position: center;
  border-radius: 50%;
  transform: scale(1.42);
  filter: none;
  background: transparent;
}

.hub-item-soon .hub-ico-lotto {
  opacity: 1;
  filter: none;
}

/* แบนเนอร์โปรใต้แถวไอคอน — รูปเดียว โชว์เต็ม ไม่ครอป */
.hub-promo-rail {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 42px 0 28px;
  padding: 0 2px;
  box-sizing: border-box;
}

.hub-promo-card {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 14px;
  overflow: hidden;
  background: #0a0a0a;
  border: 1.5px solid rgba(236, 202, 119, 0.55);
  box-shadow:
    0 0 0 1px rgba(20, 16, 8, 0.9),
    0 12px 24px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: hub-promo-float 4.5s ease-in-out infinite;
}

.hub-promo-motion {
  display: block;
  width: 100%;
  line-height: 0;
}

.hub-promo-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  object-position: center;
}

@keyframes hub-promo-float {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
    filter: brightness(1);
  }
  50% {
    transform: translate3d(0, -5px, 0);
    filter: brightness(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hub-promo-card {
    animation: none;
  }
}

.hub-item em {
  font-style: normal;
  display: block;
  width: 100%;
  min-height: 1.15em;
  padding: 0 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  color: #ecca77;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.hub-item-soon {
  cursor: default;
  opacity: 0.92;
}

.hub-item-soon .hub-ico {
  opacity: 0.72;
  filter: grayscale(0.25);
}

.hub-item-soon .hub-ico-lotto {
  opacity: 1;
  filter: none;
}

.hub-item-soon:active .hub-ico {
  transform: none;
}

.hub-soon-tag {
  display: block;
  margin-top: -4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  color: #ff5d6c;
  text-align: center;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.hub-badge {
  position: absolute;
  top: -6px;
  left: calc(50% - 40px);
  z-index: 2;
  padding: 3px 7px;
  border-radius: 8px 8px 8px 2px;
  background: linear-gradient(180deg, #ff6a3d, #d62828);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.45);
  white-space: nowrap;
}

/* page modes */
/* html.page-* — early boot class before body exists (stops hub↔games FOUC) */
:is(html, body).page-hub .slider,
:is(html, body).page-hub .workspace,
:is(html, body).page-hub .game-search-top,
:is(html, body).page-profile .slider,
:is(html, body).page-profile .workspace,
:is(html, body).page-profile .announce-bar,
:is(html, body).page-profile .game-search-top,
:is(html, body).page-history .slider,
:is(html, body).page-history .workspace,
:is(html, body).page-history .announce-bar,
:is(html, body).page-history .game-search-top {
  display: none !important;
}

:is(html, body).page-hub .app {
  grid-template-rows: 1fr !important;
  grid-template-areas:
    "hub" !important;
  padding-bottom: 0 !important;
}

:is(html, body).page-profile .app,
:is(html, body).page-history .app {
  grid-template-rows: 1fr !important;
  grid-template-areas:
    "hub" !important;
  padding-bottom: 0 !important;
}

/* แถบประกาศนอก hub ซ่อน — ใช้ .hub-announce แทน */
:is(html, body).page-hub .app > .announce-bar {
  display: none !important;
}

:is(html, body).page-hub .member-hub:not(.member-profile),
:is(html, body).page-hub .member-hub:not(.member-profile)[hidden] {
  grid-area: hub !important;
  display: block !important;
}

/* เปิดฝาก/ถอน: บังคับซ่อน hub แม้ page-hub ตั้ง display:block */
:is(html, body).wallet-open .member-hub,
:is(html, body).wallet-open .member-hub:not(.member-profile),
:is(html, body).wallet-open .member-hub:not(.member-profile)[hidden],
:is(html, body).wallet-open .member-profile,
:is(html, body).wallet-open .member-profile[hidden],
:is(html, body).wallet-open .member-history,
:is(html, body).wallet-open .member-history[hidden] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

:is(html, body).wallet-open .header,
:is(html, body).wallet-open #siteHeader {
  display: grid !important;
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

:is(html, body).wallet-open .header::after {
  display: none !important;
}

:is(html, body).wallet-open .phone-shell {
  background:
    #050505 url("/home/ufa/ui/hub/hub-home-backdrop.webp?v=hub5") center top / cover no-repeat !important;
}

:is(html, body).page-profile .member-profile,
:is(html, body).page-profile .member-profile[hidden] {
  grid-area: hub !important;
  display: block !important;
}

:is(html, body).page-history .member-history,
:is(html, body).page-history .member-history[hidden] {
  grid-area: hub !important;
  display: flex !important;
}

:is(html, body).page-hub .member-profile,
:is(html, body).page-hub .member-history,
:is(html, body).page-profile .member-hub:not(.member-profile),
:is(html, body).page-profile .member-history,
:is(html, body).page-history .member-hub,
:is(html, body).page-history .member-profile,
:is(html, body).page-games .member-hub,
:is(html, body).page-games .member-history {
  display: none !important;
}

:is(html, body).page-hub .header,
:is(html, body).page-profile .header,
:is(html, body).page-history .header,
:is(html, body).page-games .header {
  display: grid;
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
  position: relative;
  z-index: 100;
}

/* เส้นคั่นบางจางขอบ — ไม่ตัดสีทึบ */
:is(html, body).page-hub .header::after,
:is(html, body).page-profile .header::after,
:is(html, body).page-history .header::after,
:is(html, body).page-games .header::after {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(176, 148, 90, 0.1) 22%,
    rgba(200, 170, 110, 0.16) 50%,
    rgba(176, 148, 90, 0.1) 78%,
    transparent 100%
  );
  pointer-events: none;
  opacity: 0.85;
}

/* ——— History page (UFA style) ——— */
.member-history {
  grid-area: slider / slider / workspace / workspace;
  position: relative;
  min-height: 0;
  display: none;
  flex-direction: column;
  background: transparent;
  padding: 0 0 calc(100px + var(--safe-b));
  overflow: hidden;
}

.member-history[hidden] {
  display: none !important;
}

.hist-top-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
}

.hist-top-tab {
  position: relative;
  border: none;
  background: transparent;
  color: #bdbdbd;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 8px 12px;
  cursor: pointer;
}

.hist-top-tab.is-on {
  color: #ECCA77;
}

.hist-top-tab.is-on::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 36px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: #ECCA77;
  transform: translateX(-50%);
}

.hist-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 10px 12px 0;
  padding: 16px 14px 18px;
  border-radius: 16px 16px 0 0;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: none;
  overflow: hidden;
}

.hist-title {
  margin: 0 0 14px;
  text-align: center;
  color: #ECCA77;
  font-size: 1rem;
  font-weight: 700;
}

.hist-sub-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hist-sub-tab {
  position: relative;
  border: none;
  background: transparent;
  color: #9a9a9a;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 6px 12px;
  cursor: pointer;
}

.hist-sub-tab.is-on {
  color: #ECCA77;
}

.hist-sub-tab.is-on::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: #ECCA77;
}

.hist-body {
  flex: 1;
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: auto;
}

.hist-empty {
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px 12px 40px;
  color: #8a8a8a;
}

.hist-empty p {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.hist-empty-ico {
  opacity: 0.85;
}

.hist-list {
  width: 100%;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 12px;
}

.hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.hist-row strong {
  display: block;
  color: #f0f0f0;
  font-size: 0.9rem;
}

.hist-row em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  color: #8a8a8a;
  font-size: 0.75rem;
}

.hist-row-right {
  text-align: right;
}

.hist-row-right b {
  display: block;
  color: #ECCA77;
  font-size: 0.95rem;
}

.hist-row-right span {
  display: block;
  margin-top: 3px;
  color: #9a9a9a;
  font-size: 0.75rem;
}

:is(html, body).page-history .app {
  background: transparent !important;
}

/* พื้นรวมต่อเนื่องแบบตัวอย่าง — ไม่ตัดแถบดำใต้เฮดเดอร์ */
:is(html, body).page-hub .app,
:is(html, body).page-profile .app,
:is(html, body).page-history .app,
:is(html, body).page-games .app {
  background: transparent !important;
}

:is(html, body).page-hub .app > .announce-bar {
  display: none !important;
}

:is(html, body).page-hub .phone-shell,
:is(html, body).page-profile .phone-shell {
  /* hub backdrop — shared with home */
  background:
    #050505 url("/home/ufa/ui/hub/hub-home-backdrop.webp?v=hub5") center top / cover no-repeat !important;
}

:is(html, body).page-history .phone-shell,
:is(html, body).page-games .phone-shell {
  background:
    radial-gradient(120% 48% at 50% -2%, #363636 0%, #222222 18%, #121212 42%, #0a0a0a 68%, #050505 100%) !important;
}

:is(html, body).page-hub .phone-scroll,
:is(html, body).page-profile .phone-scroll,
:is(html, body).page-history .phone-scroll,
:is(html, body).page-games .phone-scroll {
  background: transparent !important;
}

:is(html, body).page-hub .member-hub,
:is(html, body).page-profile .member-hub,
:is(html, body).page-history .member-history {
  background: transparent !important;
}

body.is-logged.page-hub .header-actions .btn-dep,
body.is-logged.page-hub .header-actions .btn-wd,
body.is-logged.page-profile .header-actions .btn-dep,
body.is-logged.page-profile .header-actions .btn-wd {
  display: none;
}

body.is-logged.page-hub .chat-fab,
body.is-logged.page-profile .chat-fab,
body.is-logged.page-history .chat-fab {
  display: none;
}

/* Keep games chrome stable while lobby paints; hide only empty shells */
html.boot-logged.page-games:not(.lobby-ready) #slides:empty,
html.boot-logged.page-games:not(.lobby-ready) #tileGrid:empty {
  min-height: 120px;
  background: #0c0c0c;
}

/* ——— Profile page ——— */
.member-profile {
  padding: 2px 0 calc(100px + var(--safe-b));
}

.member-profile .hub-inner.profile-inner {
  width: 100%;
  max-width: none;
  padding: 0 12px;
  box-sizing: border-box;
}

.member-profile .hub-welcome {
  padding-top: 2px;
}

.member-profile .hub-welcome p {
  color: #fff;
}

.member-profile .hub-balance-row {
  margin-top: max(10px, 1.2dvh);
  margin-bottom: 0;
  padding-top: 0;
  transform: translateY(-6px);
}

.member-profile .hub-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
  min-height: clamp(176px, calc(33dvh - var(--header)), 300px);
  padding: max(12px, 2dvh) 0 max(36px, 5dvh);
}

.profile-card {
  position: relative;
  z-index: 2;
  margin-top: 8px;
  border-radius: 16px 16px 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1c1c1c;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.profile-row strong:empty::before {
  content: "\00a0";
}

.profile-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  background: #141414;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-tab {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 14px 6px 12px;
  border: none;
  background: transparent;
  color: #9a9a9a;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.profile-tab-ico {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
}

.profile-tab-ico img {
  width: 28px;
  height: 28px;
  display: block;
  object-fit: contain;
  opacity: 0.72;
  filter: grayscale(0.15) brightness(0.95);
  transition: filter 0.15s ease, opacity 0.15s ease;
}

.profile-tab em {
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
}

.profile-tab.is-on {
  color: #f2f2f2;
  background: #2a2a2a;
  box-shadow: none;
}

.profile-tab.is-on .profile-tab-ico img {
  opacity: 1;
  filter: none;
}

.profile-pane {
  padding: 10px 14px 18px;
}

.profile-pane[hidden] {
  display: none !important;
}

.profile-block {
  padding: 8px 0 4px;
}

.profile-block + .profile-block {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 4px;
  padding-top: 10px;
}

.profile-block h3 {
  margin: 4px 0 8px;
  color: #cfcfcf;
  font-size: 0.8rem;
  font-weight: 600;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 2px;
  color: #bdbdbd;
  font-size: 0.8rem;
}

.profile-row strong {
  color: #f2f2f2;
  font-weight: 600;
  text-align: right;
}

.profile-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-phone img {
  width: 18px;
  height: 12px;
  object-fit: cover;
  border-radius: 2px;
}

.profile-phone em {
  font-style: normal;
}

.profile-row-edit {
  position: relative;
  cursor: pointer;
}

.profile-row-edit input[type="date"] {
  appearance: none;
  border: none;
  background: transparent;
  color: #f2f2f2;
  font: inherit;
  font-weight: 600;
  text-align: right;
  padding-right: 22px;
  max-width: 150px;
  color-scheme: dark;
}

.profile-row-edit input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0;
  position: absolute;
  inset: 0;
  width: 100%;
  cursor: pointer;
}

.profile-edit-ico {
  position: absolute;
  right: 0;
  color: #ECCA77;
  font-style: normal;
  font-size: 0.85rem;
  pointer-events: none;
}

.profile-add-bank {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 120px;
  margin: 6px 0 18px;
  padding: 22px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #121212;
  color: #E8B84A;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.profile-add-bank span {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid #E8B84A;
  background: transparent;
  color: #E8B84A;
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1;
}

.profile-bank-head {
  color: #cfcfcf;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 2px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.profile-bank-list {
  display: grid;
  gap: 8px;
  min-height: 24px;
}

.profile-bank-empty {
  margin: 8px 0 0;
  color: #8a8a8a;
  font-size: 0.78rem;
  text-align: center;
}

.profile-bank-item {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 8px;
  border-radius: 12px;
  background: #171717;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.profile-bank-item img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: contain;
  background: #0a0a0a;
}

.profile-bank-item b {
  display: block;
  color: #fff;
  font-size: 0.82rem;
}

.profile-bank-item em {
  display: block;
  font-style: normal;
  color: #9a9a9a;
  font-size: 0.72rem;
}

.profile-bank-item .mono {
  color: #ECCA77;
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-bank-status {
  font-size: 0.68rem;
  font-weight: 700;
  color: #9a9a9a;
}

.profile-bank-status.is-ok { color: #3dd68c; }
.profile-bank-status.is-pending { color: #ECCA77; }

.profile-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 46px;
  padding: 10px 2px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: #bdbdbd;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
}

.profile-link-row strong {
  color: #f2f2f2;
  font-weight: 600;
}

.profile-link-row i {
  font-style: normal;
  color: #8a8a8a;
  margin-left: 6px;
}

.profile-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 2px;
  color: #f2f2f2;
  font-size: 0.84rem;
  cursor: pointer;
}

.profile-toggle-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.profile-switch {
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #3a3a3a;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.profile-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #d0d0d0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.profile-toggle-row input:checked + .profile-switch {
  background: linear-gradient(180deg, #FCDD9A, #8B6832);
}

.profile-toggle-row input:checked + .profile-switch::after {
  transform: translateX(20px);
  background: #1a1205;
}

.profile-logout {
  width: 100%;
  margin-top: 18px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 93, 108, 0.35);
  background: rgba(255, 93, 108, 0.08);
  color: #ff8a95;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ——— Mobile nav ——— */
.mobile-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  bottom: var(--nav-bottom, 0px);
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  padding: 8px 4px calc(8px + var(--safe-b));
  background: linear-gradient(180deg, #161616 0%, #0a0a0a 100%);
  border-top: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
  /* แยกเลเยอร์ ไม่ให้ถูกคลิปตอนเลื่อน */
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.mobile-nav button {
  display: grid;
  gap: 3px;
  place-items: center;
  border: none;
  background: transparent;
  color: #9a9a9a;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 6px 2px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav button.is-active {
  color: var(--gold-2);
}

.mobile-nav button.is-active .m-ico {
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.45));
}

.mobile-nav .m-ico {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: inherit;
}

.mobile-nav .m-ico svg {
  width: 100%;
  height: 100%;
}

/* แถบ UFA — ร่องวงกลมจริง (mask) + ชิปกลางโอบพอดีแบบตัวอย่าง */
.mobile-nav.is-guest,
.mobile-nav.is-member {
  --nav-dock-h: 7.35rem;
  --nav-bar-h: 3.9rem;
  --nav-chip: 72px;
  /* ร่องให้ชิดวงทองจริงของ SVG (มี padding ในไฟล์) */
  --notch-r: 34px;
  --chip-sink: 0.5;
  position: fixed;
  height: calc(var(--nav-dock-h) + var(--safe-b));
  min-height: calc(var(--nav-dock-h) + var(--safe-b));
  padding: 0 0 var(--safe-b);
  align-items: stretch;
  border: none !important;
  border-top: none !important;
  outline: none !important;
  box-shadow: none !important;
  overflow: visible;
  pointer-events: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background-color: transparent !important;
  /* เส้นทองอยู่นอก mask — ไม่วูบตอนกัดร่อง */
  background-image:
    linear-gradient(
      90deg,
      rgba(201, 164, 90, 0.12),
      rgba(236, 202, 119, 0.92) 42%,
      rgba(252, 221, 154, 1) 100%
    ),
    linear-gradient(
      90deg,
      rgba(252, 221, 154, 1),
      rgba(236, 202, 119, 0.92) 58%,
      rgba(201, 164, 90, 0.12) 100%
    ),
    url("/home/ufa/ui/menu/nav-dock-arc.svg?v=arc2") !important;
  background-repeat: no-repeat !important;
  background-size:
    calc(50% - var(--notch-r) + 3px) 1.6px,
    calc(50% - var(--notch-r) + 3px) 1.6px,
    calc(var(--notch-r) * 2 + 14px) calc(var(--notch-r) + 10px) !important;
  background-position:
    left 0 bottom calc(var(--safe-b) + var(--nav-bar-h) - 1px),
    right 0 bottom calc(var(--safe-b) + var(--nav-bar-h) - 1px),
    center bottom calc(var(--safe-b) + var(--nav-bar-h) - 1px) !important;
}

/* แท่นดำ + กัดร่องวงกลมกลาง (ไม่ยืดวง) */
.mobile-nav.is-guest::before,
.mobile-nav.is-member::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: calc(var(--nav-bar-h) + var(--safe-b));
  z-index: 0;
  pointer-events: none;
  background: #0a0a0a;
  -webkit-mask-image: radial-gradient(
    circle var(--notch-r) at 50% 0,
    transparent calc(var(--notch-r) - 0.5px),
    #000 calc(var(--notch-r))
  );
  mask-image: radial-gradient(
    circle var(--notch-r) at 50% 0,
    transparent calc(var(--notch-r) - 0.5px),
    #000 calc(var(--notch-r))
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transform: translateZ(0);
}

/* เติมมุมล่างให้ทึบชิดขอบจอ */
.mobile-nav.is-guest::after,
.mobile-nav.is-member::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(2.55rem + var(--safe-b));
  z-index: 0;
  pointer-events: none;
  background: #0a0a0a;
}

.mobile-nav.is-guest button,
.mobile-nav.is-member button {
  position: relative;
  z-index: 1;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  height: 100%;
  align-self: stretch;
  min-width: 0;
  padding: 0 2px 10px;
  color: #ecca77;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.05;
  opacity: 1;
  transition: color 0.15s ease, filter 0.15s ease;
}

.mobile-nav.is-guest button:active,
.mobile-nav.is-member button:active {
  color: #fcdd9a;
}

.mobile-nav.is-guest button.is-active,
.mobile-nav.is-member button.is-active {
  color: #fcdd9a;
}

.mobile-nav.is-member button.is-active .m-ico-side,
.mobile-nav.is-guest button.is-active .m-ico-side {
  filter: drop-shadow(0 0 7px rgba(252, 221, 154, 0.55));
}

.mobile-nav.is-guest .m-label,
.mobile-nav.is-member .m-label {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.05;
  margin: 0;
  padding: 0;
  text-transform: none;
  color: inherit;
}

.mobile-nav.is-guest .m-ico,
.mobile-nav.is-guest .m-ico-side,
.mobile-nav.is-member .m-ico,
.mobile-nav.is-member .m-ico-side {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  background: transparent;
  margin: 0 0 2px;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.mobile-nav.is-guest .m-ico-side img,
.mobile-nav.is-member .m-ico img,
.mobile-nav.is-member .m-ico-side img {
  width: 26px;
  height: 26px;
  display: block;
  object-fit: contain;
  background: transparent;
}

/* กลาง: ชิปเข้าเล่น — สไตล์ UFA (ครึ่งบนโผล่ + วงโกลว์) */
.mobile-nav.is-guest .nav-center,
.mobile-nav.is-member .nav-center {
  z-index: 2;
  font-weight: 700;
  color: #fcdd9a !important;
  opacity: 1 !important;
  justify-content: flex-end;
  padding: 0 2px 10px;
  overflow: visible;
}

.mobile-nav.is-guest .nav-center .m-play,
.mobile-nav.is-member .nav-center .m-play {
  position: absolute;
  left: 50%;
  /* กดชิปลงแนบร่อง — ปิดช่องว่าง */
  bottom: calc(var(--safe-b) + var(--nav-bar-h) - (var(--nav-chip) * var(--chip-sink)));
  top: auto;
  width: var(--nav-chip);
  height: var(--nav-chip);
  transform: translateX(-50%);
  display: block !important;
  z-index: 2;
  pointer-events: none;
  filter:
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 10px rgba(236, 202, 119, 0.45))
    drop-shadow(0 0 22px rgba(252, 221, 154, 0.35));
  animation: ufa-chip-pulse 2.8s ease-in-out infinite;
}

/* วงเรืองแสงด้านหลังชิป */
.mobile-nav.is-guest .nav-center .m-play::before,
.mobile-nav.is-member .nav-center .m-play::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 48%;
  width: 108%;
  height: 108%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(252, 221, 154, 0.38) 0%,
    rgba(236, 202, 119, 0.14) 40%,
    rgba(236, 202, 119, 0) 68%
  );
  z-index: -1;
  pointer-events: none;
}

.mobile-nav.is-guest .nav-center .m-play img,
.mobile-nav.is-member .nav-center .m-play img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  /* ขยายกิน padding ใน SVG ให้ขอบทองชิดร่อง */
  transform: scale(1.12);
  transform-origin: center center;
  position: relative;
  z-index: 1;
}

.mobile-nav.is-guest .nav-center.is-active .m-play,
.mobile-nav.is-member .nav-center.is-active .m-play {
  filter:
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.55))
    drop-shadow(0 0 12px rgba(252, 221, 154, 0.65))
    drop-shadow(0 0 28px rgba(236, 202, 119, 0.5));
}

.mobile-nav.is-guest .nav-center .m-label,
.mobile-nav.is-member .nav-center .m-label {
  position: relative;
  z-index: 2;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  color: #fcdd9a;
  text-shadow:
    0 0 8px rgba(252, 221, 154, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.75);
}

.mobile-nav.is-guest .nav-center .m-play-hit,
.mobile-nav.is-member .nav-center .m-play-hit {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-b) + var(--nav-bar-h) - (var(--nav-chip) * var(--chip-sink)) - 4px);
  top: auto;
  width: calc(var(--nav-chip) + 14px);
  height: calc(var(--nav-chip) + 14px);
  transform: translateX(-50%);
  border-radius: 50%;
  z-index: 3;
  pointer-events: auto;
}

@keyframes ufa-chip-pulse {
  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.035);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-nav.is-guest .nav-center .m-play,
  .mobile-nav.is-member .nav-center .m-play {
    animation: none;
  }
}

.mobile-nav .m-ico-badge,
.mobile-nav .m-ico-img {
  display: none;
}

body:not(.is-logged) .header {
  background: linear-gradient(270deg, #202020 0.07%, #575656 51.6%, #202020 100.02%);
  border-bottom: 1px solid rgba(236, 202, 119, 0.22);
}

body:not(.is-logged) .workspace {
  padding: 2px 8px 18px 4px;
  gap: 6px;
}

/* ——— Guest dock refinements ——— */
body:not(.is-logged) .mobile-nav.is-guest button {
  color: #ECCA77;
  opacity: 1;
}

body:not(.is-logged) .mobile-nav.is-guest button:active,
body:not(.is-logged) .mobile-nav.is-guest .nav-center {
  color: #FCDD9A;
  opacity: 1;
}

body:not(.is-logged) .header-actions .btn-register-only {
  min-width: 64px;
  padding-inline: 14px;
  border-radius: 999px;
  font-weight: 700;
}

body:not(.is-logged) .chat-fab {
  display: none;
}

/* ——— FAB ——— */
.chat-fab {
  position: fixed;
  right: 12px;
  bottom: calc(76px + var(--safe-b));
  z-index: 44;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: linear-gradient(180deg, #f0d78c, var(--gold));
  color: #111;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(212, 175, 55, 0.35);
  font-weight: 700;
}

.chat-fab span {
  font-size: 1.2rem;
}

.chat-fab em {
  font-style: normal;
  font-size: 0.68rem;
  line-height: 1.2;
  text-align: left;
}

/* ——— Auth modal (UFA style) ——— */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  align-items: end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

#authModal.modal-backdrop {
  align-items: stretch;
  justify-items: stretch;
  background: #050505;
  backdrop-filter: none;
}

.auth-sheet {
  position: relative;
  width: 100%;
  max-height: min(92vh, 720px);
  overflow: auto;
  border-radius: 22px 22px 0 0;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-bottom: none;
  background:
    radial-gradient(500px 180px at 50% -10%, rgba(212, 175, 55, 0.16), transparent 60%),
    linear-gradient(180deg, #1a1a1a 0%, #101010 40%, #0a0a0a 100%);
  box-shadow: 0 -24px 80px rgba(0, 0, 0, 0.55);
  transform: translateY(28px);
  transition: transform 0.25s ease;
  scrollbar-width: thin;
}

.modal-backdrop.open .auth-sheet {
  transform: translateY(0);
}

.auth-sheet.auth-ufa {
  max-width: 480px;
  max-height: 100%;
  height: 100%;
  margin: 0 auto;
  border: none;
  border-radius: 0;
  background: #111;
  box-shadow: none;
  transform: none;
  padding: 0 18px calc(18px + var(--safe-b));
  font-family: var(--font);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

/* หน้าล็อกอิน: จัดแนวตั้ง ตามตัวอย่าง — เลื่อนได้ถ้าจอสั้นมาก */
.auth-sheet.auth-ufa.is-login {
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 16px max(10px, var(--safe-b));
}

.modal-backdrop.open .auth-sheet.auth-ufa {
  transform: none;
}

/* Guest fullscreen login: remove lobby from layout/find-in-page (F flash).
   display:none only — visibility:hidden still lets Find reveal/ghost sidebar. */
html.is-guest-auth #phoneShell > .phone-scroll,
html.is-guest-auth #phoneShell > .mobile-nav,
html.is-guest-auth #appRoot,
html.is-guest-auth .mobile-nav,
html.is-guest-auth .sidebar,
html.is-guest-auth .workspace,
html.is-guest-auth .header,
html.is-guest-auth .announce-bar,
html.is-guest-auth .slider,
body.is-guest-auth #phoneShell > .phone-scroll,
body.is-guest-auth #phoneShell > .mobile-nav,
body.is-guest-auth #appRoot,
body.is-guest-auth .mobile-nav,
body.is-guest-auth .sidebar,
body.is-guest-auth .workspace,
body.is-guest-auth .header,
body.is-guest-auth .announce-bar,
body.is-guest-auth .slider {
  display: none !important;
  pointer-events: none !important;
}

html.boot-guest #authModal.modal-backdrop,
html.is-guest-auth #authModal.modal-backdrop,
body.is-guest-auth #authModal.modal-backdrop {
  z-index: 120;
  opacity: 1;
  pointer-events: auto;
  background: #0a0a0a;
  isolation: isolate;
}

html.boot-logged #authModal.modal-backdrop:not(.open),
html:not(.is-guest-auth):not(.boot-guest) body:not(.is-guest-auth) #authModal.modal-backdrop:not(.open) {
  opacity: 0;
  pointer-events: none;
}

html.boot-guest #authModal .auth-sheet.auth-ufa,
html.is-guest-auth #authModal .auth-sheet.auth-ufa {
  transform: none;
}

body.is-guest-auth #entryPopup {
  display: none !important;
}

body.is-guest-auth .auth-sheet.auth-ufa .modal-x {
  display: none !important;
}

.auth-login-top {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 0 0;
  min-height: 40px;
}

.auth-login-top .auth-line-pill {
  margin-left: 0;
}

.auth-ufa.is-register .auth-login-top {
  display: none;
}

.auth-ufa.is-register .modal-x,
.auth-ufa.is-register #authHero,
.auth-ufa.is-register #authFootLogin {
  display: none;
}

.auth-ufa.is-login #authRegBar {
  display: none !important;
}

.auth-bg {
  position: absolute;
  /* ล้นขอบแล้วซูมขยับแบบ UFA .login-bg */
  inset: -8%;
  pointer-events: none;
  z-index: 0;
  background: #111 url("/home/ufa/ui/auth-login-backdrop.webp?v=auth3") center center / cover no-repeat;
  will-change: transform;
  animation: kb-drift 18s ease-in-out infinite alternate;
}

.auth-bg::before,
.auth-bg::after {
  content: none;
}

@keyframes kb-drift {
  0% { transform: scale(1.08) translate(0); }
  33% { transform: scale(1.08) translate(-1.5%, 1%); }
  66% { transform: scale(1.08) translate(1%, -1.5%); }
  100% { transform: scale(1.08) translate(-0.5%, 0.5%); }
}

@media (prefers-reduced-motion: reduce) {
  .auth-bg {
    animation: none;
    transform: scale(1.06);
  }
}

.modal-x {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #cfcfcf;
  cursor: pointer;
  font-size: 0.95rem;
}

/* ฝาก/ถอน: X ในแถวเฮดเดอร์ (ดึงขึ้นเหนือแผ่นฝาก) */
#walletModal .wallet-sheet > .modal-x,
#walletClose.modal-x {
  position: absolute !important;
  top: calc(-1 * var(--header) / 2 - 17px) !important;
  left: auto !important;
  right: 12px !important;
  z-index: 130 !important;
  width: 34px !important;
  height: 34px !important;
  border: 1px solid rgba(236, 202, 119, 0.65) !important;
  border-radius: 50% !important;
  background: rgba(8, 8, 8, 0.45) !important;
  color: #ECCA77 !important;
  box-shadow: 0 0 10px rgba(236, 202, 119, 0.12);
}

.phone-shell > #walletModal.wallet-backdrop.open,
.phone-shell > #walletModal.modal-backdrop.open {
  overflow: visible !important;
}

.auth-lang {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(236, 202, 119, 0.35);
  border-radius: 50%;
  background: #141414;
  cursor: pointer;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.auth-lang img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-lang-inline {
  position: static;
  flex-shrink: 0;
}

.auth-hero {
  position: relative;
  z-index: 1;
  padding: clamp(18px, 3.5dvh, 36px) 4px clamp(16px, 3dvh, 28px);
  text-align: center;
}

.auth-logo {
  position: relative;
  display: block;
  width: min(94%, 420px);
  height: auto;
  max-height: clamp(110px, 18dvh, 160px);
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
  background: transparent;
  filter:
    drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55))
    drop-shadow(0 18px 28px rgba(0, 0, 0, 0.42));
}

/* ล็อกอิน: โลโก้ใหญ่ช่วงบน + เว้นระยะก่อนกล่อง — แบบตัวอย่าง UFABET */
.auth-ufa.is-login .auth-login-top {
  padding: 8px 0 0;
  min-height: 40px;
  flex-shrink: 0;
}

.auth-ufa.is-login .auth-hero {
  /* ดันโลโก้ลงอีก · ยังเว้นระยะก่อนกล่อง */
  padding: clamp(48px, 9dvh, 88px) 4px clamp(28px, 5.5dvh, 56px);
  flex-shrink: 0;
}

.auth-ufa.is-login .auth-logo {
  width: min(94%, 420px);
  max-height: clamp(120px, 19dvh, 168px);
}

.auth-ufa.is-login .auth-welcome {
  margin: 0 0 8px;
  font-size: 0.86rem;
}

.auth-ufa.is-login .auth-card.auth-form {
  flex: 0 0 auto;
  padding: 12px 14px 11px;
  width: min(100%, 352px);
  margin: 0 auto;
}

.auth-ufa.is-login .login-mode {
  margin-bottom: 8px;
  gap: 6px;
}

.auth-ufa.is-login .login-mode-btn {
  min-height: 34px;
  padding: 6px 4px;
  font-size: 0.72rem;
}

.auth-ufa.is-login .ufa-stack {
  margin-bottom: 10px;
}

.auth-ufa.is-login .ufa-stack .ufa-field-tight {
  padding: 9px 10px 8px;
}

.auth-ufa.is-login .auth-submit-ufa {
  min-height: 40px;
  margin-top: 4px;
}

.auth-ufa.is-login .auth-forgot-row {
  margin-top: 8px;
}

.auth-ufa.is-login .auth-foot {
  margin-top: clamp(16px, 3dvh, 28px);
  margin-bottom: 4px;
  gap: 10px 12px;
  flex-shrink: 0;
  padding-bottom: 4px;
}

.auth-ufa.is-login .auth-foot p {
  font-size: 0.86rem;
}

.auth-ufa.is-login .auth-outline-btn {
  min-height: 34px;
  padding: 6px 18px;
  font-size: 0.86rem;
}

.auth-welcome {
  position: relative;
  margin: 0 0 10px;
  text-align: center;
  color: #ECCA77;
  font-size: 0.88rem;
  font-weight: 600;
}

.auth-card.auth-form {
  position: relative;
  z-index: 1;
  width: min(100%, 352px);
  margin: 0 auto;
  padding: 14px 14px 12px;
  border-radius: 12px;
  border: 1px solid rgba(236, 202, 119, 0.42);
  background: linear-gradient(180deg, rgba(22, 22, 22, 0.92), rgba(10, 10, 10, 0.94));
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(236, 202, 119, 0.08);
  font-family: var(--font);
}

/* วงโหลดตรงกลางฟอร์มแบบ UFA */
.auth-loading {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(8, 8, 8, 0.28);
  pointer-events: all;
}

.auth-loading[hidden] {
  display: none !important;
}

.auth-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(236, 202, 119, 0.18);
  border-top-color: #FCDD9A;
  border-right-color: rgba(236, 202, 119, 0.65);
  animation: auth-spin 0.75s linear infinite;
  box-shadow: 0 0 16px rgba(236, 202, 119, 0.2);
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* F5 / boot: โหลดหมุนเต็มจอจนกว่าสมาชิกพร้อม */
.boot-splash {
  position: absolute;
  inset: 0;
  z-index: 250;
  display: none;
  place-items: center;
  margin: 0;
  padding: 0;
  border: none;
  background: #0a0a0a;
  pointer-events: all;
}

.boot-splash .boot-spinner {
  width: 48px;
  height: 48px;
}

html.boot-logged.is-booting .boot-splash,
html.boot-logged:not(.boot-ready) .boot-splash {
  display: grid;
}

html.boot-logged.is-booting .boot-splash[hidden],
html.boot-logged:not(.boot-ready) .boot-splash[hidden],
.boot-splash[hidden] {
  display: none !important;
}

html.is-guest-auth .boot-splash,
html.boot-guest .boot-splash,
html.boot-ready .boot-splash {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .auth-spinner {
    animation: none;
    border-top-color: #FCDD9A;
    opacity: 0.85;
  }
}

.auth-sheet.is-auth-loading .auth-card.auth-form {
  min-height: 220px;
}

.auth-ufa.is-register .auth-card.auth-form {
  margin-top: 8px;
  width: min(100%, 360px);
}

.login-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 10px;
  padding: 0;
  border-radius: 0;
  border: none;
  background: transparent;
}

.login-mode-btn {
  min-height: 36px;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(236, 202, 119, 0.55);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.login-mode-btn.is-on {
  border-color: #ECCA77;
  color: #FCDD9A;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: none;
}

/* กล่องรวม user/phone + password แบบ UFA */
.ufa-stack {
  display: grid;
  gap: 0;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(236, 202, 119, 0.28);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.ufa-stack .ufa-field-tight {
  margin: 0;
  padding: 9px 10px 8px;
  gap: 4px;
}

.ufa-stack > .ufa-field-tight:last-of-type {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.ufa-box-bare {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 34px;
  padding: 0;
  border-radius: 0;
}

.auth-verify,
.auth-bot {
  display: none !important;
}

.auth-bot input {
  width: 18px;
  height: 18px;
  accent-color: #ECCA77;
  flex-shrink: 0;
}

.ufa-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.ufa-field > span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ECCA77;
}

.ufa-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(236, 202, 119, 0.28);
  background: rgba(0, 0, 0, 0.35);
}

.ufa-box:focus-within {
  border-color: #ECCA77;
  box-shadow: 0 0 0 2px rgba(236, 202, 119, 0.12);
}

.ufa-box input,
.ufa-box select {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: #f2f2f2;
  font-size: 15px;
  min-height: 44px;
  padding: 0;
  font-family: inherit;
  appearance: none;
}

.ufa-box input::placeholder,
.ufa-box select:invalid {
  color: #7a7a7a;
}

.ufa-box-phone {
  padding-left: 6px;
  gap: 6px;
}

.ufa-cc {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: #e8e8e8;
  padding: 4px 6px 4px 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  cursor: default;
  pointer-events: none;
  font-size: 0.85rem;
}
.ufa-cc i { display: inline; font-style: normal; opacity: 0.7; font-size: 0.7rem; }

.ufa-cc img {
  border-radius: 50%;
  display: block;
}

.ufa-cc .locale-flag,
.ufa-select-left .locale-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.ufa-cc em {
  font-style: normal;
  font-weight: 600;
}

.ufa-cc i,
.ufa-select-like i,
.ufa-select-wrap i {
  font-style: normal;
  color: #ECCA77;
  font-size: 1rem;
  line-height: 1;
}

.field-eye {
  border: none;
  background: transparent;
  color: #ECCA77;
  cursor: pointer;
  padding: 6px 2px;
  display: grid;
  place-items: center;
  opacity: 0.9;
}

.auth-submit-ufa {
  width: 100%;
  min-height: 40px;
  margin-top: 4px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(180deg, #FCDD9A 0%, #8B6832 100%);
  color: #1a1205;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(139, 104, 50, 0.24);
  transition: filter 0.15s, transform 0.12s, opacity 0.15s;
}

.auth-submit-ufa:not(:disabled):hover {
  filter: brightness(1.06);
}

.auth-submit-ufa:not(:disabled):active {
  transform: translateY(1px);
}

.auth-submit-ufa:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  color: #8a8a8a;
  border-color: rgba(236, 202, 119, 0.2);
  background: linear-gradient(180deg, #2a2a2a, #161616);
  box-shadow: none;
}

.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.linkish {
  border: none;
  background: none;
  color: #ECCA77;
  cursor: pointer;
  font-weight: 600;
  padding: 0;
  font-size: 0.85rem;
}

.auth-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  margin-top: clamp(18px, 3.2dvh, 28px);
  text-align: center;
}

.auth-foot p {
  margin: 0;
  color: #d0d0d0;
  font-size: 0.88rem;
  font-weight: 500;
}

.auth-outline-btn {
  width: auto;
  min-width: 0;
  min-height: 34px;
  padding: 6px 18px;
  border-radius: 999px;
  border: 1px solid rgba(236, 202, 119, 0.7);
  background: transparent;
  color: #ECCA77;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.auth-outline-btn:hover {
  background: rgba(236, 202, 119, 0.08);
  border-color: #ECCA77;
}

/* register top bar */
.auth-reg-bar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0 10px;
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: #ECCA77;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  padding: 4px 0;
  flex-shrink: 0;
}

.auth-back span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(236, 202, 119, 0.45);
  font-size: 1.2rem;
  line-height: 1;
}

.auth-back em {
  font-style: normal;
}

.auth-line-pill {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #06C755;
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.auth-line-pill img {
  width: 20px;
  height: 20px;
  display: block;
  border-radius: 5px;
  object-fit: cover;
  background: transparent;
  /* ไม่ invert — ใช้โลโก้ LINE เขียว+ขาวตามต้นฉบับ */
  filter: none;
}

.auth-reg-panel {
  padding-top: 2px;
}

.reg-lead {
  margin: 0 0 6px;
  text-align: center;
  color: #b8b8b8;
  font-size: 0.84rem;
  font-weight: 500;
}

.reg-sub {
  margin: 0 0 18px;
  padding-bottom: 10px;
  text-align: center;
  color: #ECCA77;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-bottom: 1px solid rgba(236, 202, 119, 0.22);
}

.ufa-group {
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ufa-group:last-of-type {
  border-bottom: none;
}

.ufa-select-like {
  width: 100%;
  justify-content: space-between;
  cursor: pointer;
  color: #eaeaea;
  font: inherit;
  text-align: left;
}

.ufa-select-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ufa-select-left em {
  font-style: normal;
  font-size: 0.92rem;
}

.ufa-select-wrap {
  position: relative;
  padding-right: 28px;
}

.ufa-select-wrap select {
  width: 100%;
  cursor: pointer;
}

.ufa-select-wrap i {
  position: absolute;
  right: 12px;
  top: 50%;
  translate: 0 -50%;
  pointer-events: none;
}

#regSourceLabel.is-placeholder {
  color: #7a7a7a;
}

.bank-picker.source-picker {
  z-index: 140;
}

.bank-pick-item.is-on {
  border-color: rgba(236, 202, 119, 0.55);
  color: #ECCA77;
}

.bank-pick-item span {
  color: #ECCA77;
  font-weight: 700;
}

.auth-submit-next {
  margin-top: 10px;
}

.reg-terms {
  margin: 14px 2px 0;
  color: #8a8a8a;
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: left;
}

.reg-terms .linkish {
  font-size: inherit;
  display: inline;
}

/* legacy field helpers still used by wallet sheet */
.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.field > span {
  font-size: 0.78rem;
  color: var(--text-2);
  font-weight: 500;
}

.field-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: rgba(0, 0, 0, 0.38);
}

.field-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  min-height: 46px;
  padding: 0;
}

.auth-submit {
  min-height: 48px;
  font-size: 1rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + var(--safe-b));
  z-index: 120;
  transform: translate(-50%, 12px);
  translate: none;
  width: max-content;
  max-width: min(92vw, 360px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 999px;
  background: #1a1a1a;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  box-sizing: border-box;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  translate: none;
}

/* ——— Tablet / Desktop (UFABET shell) ——— */
@media (min-width: 860px) {
  :root {
    --sidebar: 96px;
    --header: 72px;
    --shell: 1360px;
  }

  body {
    background:
      radial-gradient(1200px 520px at 50% -8%, rgba(212, 175, 55, 0.12), transparent 55%),
      radial-gradient(800px 400px at 90% 30%, rgba(212, 175, 55, 0.04), transparent 50%),
      linear-gradient(180deg, #0d0d0d 0%, #070707 40%, #050505 100%);
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    grid-template-areas:
      "slider"
      "announce"
      "workspace";
    padding-bottom: 0;
    padding-right: 0;
  }

  .header {
    grid-template-columns: 56px 1fr auto;
    gap: 16px;
    padding: 0 clamp(18px, 3vw, 40px);
    height: var(--header);
    background:
      linear-gradient(180deg, rgba(212, 175, 55, 0.08), transparent 60%),
      linear-gradient(180deg, #161616 0%, #0a0a0a 100%);
    border-bottom: 1px solid rgba(212, 175, 55, 0.32);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  }

  .btn-menu {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    background: rgba(255, 255, 255, 0.03);
  }

  .btn-menu span {
    width: 18px;
  }

  .logo {
    max-width: none;
    justify-self: center;
  }

  .logo-img {
    height: 48px;
    max-height: 48px;
    filter:
      drop-shadow(0 3px 2px rgba(0, 0, 0, 0.55))
      drop-shadow(0 8px 12px rgba(0, 0, 0, 0.72))
      drop-shadow(0 0 12px rgba(212, 175, 55, 0.18));
  }

  .header-actions .btn {
    min-height: 40px;
    padding: 0 18px;
    font-size: 0.88rem;
  }

  .header-right {
    gap: 10px;
  }

  .header-user small {
    font-size: 0.78rem;
  }

  .header-user b {
    font-size: 0.86rem;
  }

  .header-right .btn-dep,
  .header-right .btn-wd {
    min-height: 38px;
    padding: 0 16px;
    font-size: 0.86rem;
  }

  .app > .slider {
    width: min(100% - 48px, var(--shell));
    margin: 18px auto 0;
    aspect-ratio: 1024 / 409;
    max-height: 360px;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    box-shadow:
      0 0 0 1px rgba(0, 0, 0, 0.4),
      0 16px 48px rgba(0, 0, 0, 0.5),
      0 0 40px rgba(212, 175, 55, 0.06);
    overflow: hidden;
  }

  .slider-nav {
    width: 42px;
    height: 42px;
    border-color: rgba(212, 175, 55, 0.45);
    background: rgba(0, 0, 0, 0.55);
    font-size: 1.4rem;
  }

  .slider-nav.prev {
    left: 14px;
  }

  .slider-nav.next {
    right: 14px;
  }

  .slider-dots {
    bottom: 14px;
    padding: 6px 12px;
    gap: 8px;
  }

  .slider-dots button {
    width: 8px;
    height: 8px;
  }

  .slide-copy {
    left: 48px;
    bottom: 56px;
  }

  .slider-trust {
    display: none;
  }

  .workspace {
    display: flex;
    gap: 22px;
    padding: 22px clamp(16px, 2.5vw, 24px) 48px;
    max-width: var(--shell);
    margin: 0 auto;
    width: 100%;
  }

  .sidebar {
    top: calc(var(--header) + 16px);
    gap: 12px;
    width: var(--sidebar);
    min-width: var(--sidebar);
    padding: 14px 10px;
    border-radius: 18px;
    border: 1px solid rgba(212, 175, 55, 0.18);
    background:
      linear-gradient(180deg, rgba(212, 175, 55, 0.07), transparent 40%),
      linear-gradient(180deg, #171717 0%, #0d0d0d 100%);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  }

  .side-item {
    width: 76px;
    height: 76px;
    min-width: 76px;
    min-height: 76px;
    border-radius: 16px;
    font-size: 0.74rem;
    padding: 8px 4px 6px;
  }

  .side-item:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 175, 55, 0.45);
  }

  .side-ico {
    width: 30px;
    height: 30px;
  }

  .main {
    width: auto;
    margin: 0;
    max-width: none;
    gap: 18px;
  }

  .game-search input {
    min-height: 50px;
    padding: 0 52px 0 20px;
    font-size: 0.95rem;
    border: 1px solid rgba(212, 175, 55, 0.22);
    background: linear-gradient(180deg, #1f1f1f, #161616);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  }

  .game-search input:focus {
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
  }

  .game-search-ico {
    right: 18px;
    width: 22px;
    height: 22px;
  }

  .games-head {
    display: flex;
    align-items: baseline;
    margin-bottom: 14px;
  }

  .games-head h2 {
    font-family: var(--display);
    font-size: 1.35rem;
    letter-spacing: 0.04em;
    color: var(--gold-2);
    text-shadow: 0 0 18px rgba(212, 175, 55, 0.25);
  }

  .games-sub {
    font-size: 0.85rem;
    color: var(--text-2);
  }

  .tile-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
  }

  .tile {
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    border: 1px solid rgba(212, 175, 55, 0.38);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
  }

  .tile:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(240, 215, 140, 0.85);
    box-shadow:
      0 0 0 1px rgba(212, 175, 55, 0.25),
      0 0 24px rgba(212, 175, 55, 0.22),
      0 18px 36px rgba(0, 0, 0, 0.5);
  }

  .app {
    padding-bottom: 0;
  }

  .mobile-nav {
    display: none !important;
  }

  .chat-fab {
    bottom: 28px;
    right: 28px;
    padding: 10px 16px 10px 12px;
    box-shadow: 0 12px 32px rgba(212, 175, 55, 0.4);
  }

  .promo-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .info-bar {
    grid-template-columns: repeat(4, 1fr);
    padding: 14px 18px;
  }

  .modal-backdrop {
    place-items: center;
    align-items: center;
    padding: 24px;
  }

  #authModal.modal-backdrop {
    background: rgba(0, 0, 0, 0.82);
  }

  .auth-sheet {
    width: min(100%, 420px);
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.28);
    max-height: min(90vh, 760px);
    transform: translateY(16px) scale(0.98);
  }

  .modal-backdrop.open .auth-sheet {
    transform: translateY(0) scale(1);
  }

  .auth-sheet.auth-ufa {
    width: min(100%, 440px);
    max-height: min(92vh, 820px);
    border-radius: 18px;
    border: 1px solid rgba(236, 202, 119, 0.28);
  }

  .toast {
    bottom: 28px;
  }
}

@media (min-width: 1100px) {
  :root {
    --sidebar: 108px;
    --header: 76px;
    --shell: 1440px;
  }

  .logo-img {
    height: 50px;
  }

  .side-item {
    width: 84px;
    height: 84px;
    min-width: 84px;
    min-height: 84px;
    border-radius: 18px;
  }

  .side-ico {
    width: 34px;
    height: 34px;
  }

  .side-label {
    font-size: 0.8rem;
  }

  .tile-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
  }

  .app > .slider {
    max-height: 400px;
    border-radius: 18px;
  }
}

@media (min-width: 1400px) {
  :root {
    --shell: 1520px;
  }

  .tile-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: 18px;
  }
}

/* ——— Lock: โหมดมือถือเท่านั้น (ไม่มีเลย์เอาต์คอม) ——— */
html {
  height: 100%;
  background: #000;
}

body {
  display: flex !important;
  justify-content: center !important;
  align-items: stretch !important;
  margin: 0 !important;
  height: 100% !important;
  height: 100dvh !important;
  min-height: 100dvh !important;
  background: #050505 !important;
  overflow: hidden !important;
}

.phone-shell {
  --phone-max: 430px;
  --nav-bottom: 0px;
  width: 100%;
  max-width: var(--phone-max);
  height: 100%;
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 420px at 50% -10%, rgba(212, 175, 55, 0.08), transparent 55%),
    #070707;
  /* ไม่ใส่วง 1px ขาว — ทำให้ขอบซ้าย/ขวาเป็นเส้น */
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.9);
  isolation: isolate;
  overflow: hidden;
  overscroll-behavior: none;
  border: none;
}

/* เลื่อนเฉพาะคอนเทนต์ — แถบล่างอยู่นอกสกอร์ล */
.phone-scroll {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-x: clip;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.phone-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* อย่าบังคับสูงเท่า viewport ทั้งจอ — จะเกินพื้นที่เลื่อนเพราะหักแถบล่างแล้ว */
.phone-shell .phone-scroll .app {
  min-height: 100%;
}

/* แถบนำทางทับเนื้อหาด้านล่าง — โปร่งเหนือโค้งทอง (อย่าดันเป็น flex sibling จะเป็นแถบดำ) */
.phone-shell > .mobile-nav,
.phone-shell > .mobile-nav.is-member,
.phone-shell > .mobile-nav.is-guest {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100%;
  flex: 0 0 auto;
  z-index: 45;
  transform: none !important;
  -webkit-backface-visibility: visible;
  backface-visibility: visible;
  overflow: visible !important;
  background-color: transparent !important;
  pointer-events: none;
}

/* ในกรอบมือถือ: เปิดบัญชีใต้โลโก้ เต็มความกว้างถึงล่าง */
.phone-shell > #activateModal.activate-backdrop {
  position: absolute;
  top: var(--header);
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
  max-width: none;
  margin: 0;
  place-items: stretch !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  padding: 0 !important;
  background: #0a0a0a !important;
  z-index: 90;
}

.phone-shell #activateModal .activate-page {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  border: none !important;
  border-radius: 0 !important;
  background: #0a0a0a !important;
  margin: 0 !important;
}

/* โมดัล / เมนู / โทสต์ อยู่ในกรอบมือถือ */
.phone-shell > .modal-backdrop,
.phone-shell > .drawer-backdrop {
  position: absolute;
  inset: 0;
}

.phone-shell > .toast {
  position: absolute !important;
  left: 50% !important;
  right: auto !important;
  bottom: calc(100px + var(--safe-b)) !important;
  transform: translate(-50%, 12px) !important;
  translate: none !important;
  width: max-content !important;
  max-width: min(92%, 340px) !important;
  margin: 0 !important;
  text-align: center !important;
  z-index: 200 !important;
}

.phone-shell > .toast.show {
  transform: translate(-50%, 0) !important;
  opacity: 1 !important;
}

@media (min-width: 431px) {
  .phone-shell {
    border-left: none;
    border-right: none;
  }
}

/* ทับเลย์เอาต์เดสก์ท็อปทั้งหมด — บังคับมือถือ */
@media (min-width: 860px) {
  :root {
    --sidebar: 72px !important;
    --header: 72px !important;
    --shell: 430px !important;
  }

  body.is-logged {
    --header: 68px !important;
  }

  body.is-logged.activate-open,
  html.activate-open body.is-logged {
    --header: 68px !important;
  }

  .app {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto 1fr !important;
    grid-template-areas:
      "slider"
      "announce"
      "search"
      "workspace" !important;
    padding-bottom: calc(100px + var(--safe-b)) !important;
    padding-right: 0 !important;
  }

  .phone-shell > .header {
    flex: 0 0 auto !important;
    width: 100% !important;
    z-index: 100 !important;
  }

  .header {
    grid-template-columns: 1fr auto 1fr !important;
    gap: 8px !important;
    padding: 0 12px !important;
    height: var(--header) !important;
    background: #0a0a0a !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.18) !important;
    box-shadow: none !important;
  }

  :is(html, body).page-hub .header,
  :is(html, body).page-profile .header,
  :is(html, body).page-history .header,
  :is(html, body).page-games .header {
    background: transparent !important;
    border-bottom: none !important;
    box-shadow: none !important;
  }

  body.wallet-open #siteHeader {
    display: grid !important;
    background: transparent !important;
    border-bottom: none !important;
  }

  body.activate-open #siteHeader {
    background: #0a0a0a !important;
    border-bottom: none !important;
  }

  .btn-menu {
    width: 36px !important;
    height: 36px !important;
    border: none !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  .btn-menu span {
    width: 20px !important;
  }

  .logo {
    min-width: 0 !important;
    max-width: min(58vw, 230px) !important;
    width: auto !important;
    justify-self: center !important;
    grid-column: 2 !important;
  }

  .logo-img {
    height: 50px !important;
    width: auto !important;
    max-width: 220px !important;
    max-height: 50px !important;
    object-fit: contain !important;
    filter:
      drop-shadow(0 3px 2px rgba(0, 0, 0, 0.55))
      drop-shadow(0 8px 12px rgba(0, 0, 0, 0.72))
      drop-shadow(0 0 12px rgba(212, 175, 55, 0.18)) !important;
  }

  body.is-logged .logo-img {
    height: 50px !important;
    max-height: 50px !important;
    filter:
      drop-shadow(0 3px 2px rgba(0, 0, 0, 0.55))
      drop-shadow(0 9px 14px rgba(0, 0, 0, 0.75))
      drop-shadow(0 0 14px rgba(212, 175, 55, 0.2)) !important;
  }

  body.is-logged .header-actions {
    padding-top: 0 !important;
    padding-bottom: 2px !important;
    min-height: 32px !important;
  }

  :is(html, body).page-hub .app,
  :is(html, body).page-profile .app,
  :is(html, body).page-history .app {
    grid-template-rows: 1fr !important;
    grid-template-areas:
      "hub" !important;
    padding-bottom: 0 !important;
  }

  :is(html, body).page-hub .app > .announce-bar {
    display: none !important;
  }

  :is(html, body).page-hub .member-hub:not(.member-profile),
  :is(html, body).page-profile .member-profile,
  :is(html, body).page-history .member-history {
    grid-area: hub !important;
  }

  :is(html, body).wallet-open .member-hub,
  :is(html, body).wallet-open .member-hub:not(.member-profile),
  :is(html, body).wallet-open .member-profile,
  :is(html, body).wallet-open .member-history {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  :is(html, body).wallet-open .phone-shell {
    background:
      #050505 url("/home/ufa/ui/hub/hub-home-backdrop.webp?v=hub5") center top / cover no-repeat !important;
  }

  :is(html, body).page-history .header {
    background: #0a0a0a !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  }

  .header-actions .btn {
    min-height: 32px !important;
    padding: 0 14px !important;
    font-size: 0.82rem !important;
  }

  .app > .slider {
    width: 100% !important;
    margin: 0 !important;
    max-height: none !important;
    aspect-ratio: 1024 / 409 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  .app > .slider .slide,
  .app > .slider .slide img {
    border-radius: 0 !important;
  }

  .slider-trust {
    display: none !important;
  }

  .workspace {
    display: flex !important;
    gap: 10px !important;
    padding: 10px 10px calc(100px + var(--safe-b)) !important;
    max-width: none !important;
    margin: 0 !important;
    width: 100% !important;
  }

  .sidebar {
    position: static !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
    align-self: flex-start !important;
    gap: 8px !important;
    width: var(--sidebar) !important;
    min-width: var(--sidebar) !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .side-item {
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    min-height: 62px !important;
    border-radius: 12px !important;
    font-size: 0.62rem !important;
    padding: 6px 3px 5px !important;
  }

  .side-item:hover {
    transform: none !important;
  }

  .side-ico {
    width: 24px !important;
    height: 24px !important;
  }

  .main {
    width: 100% !important;
    margin: 0 !important;
    max-width: none !important;
    gap: 10px !important;
    min-width: 0 !important;
  }

  .game-search input {
    min-height: 42px !important;
    padding: 0 44px 0 14px !important;
    font-size: 0.86rem !important;
  }

  .games-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 6px !important;
  }

  .games-head h2 {
    font-family: var(--font) !important;
    font-size: 0.95rem !important;
    letter-spacing: normal !important;
    color: #f2f2f2 !important;
    text-shadow: none !important;
  }

  .tile-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  .tile {
    aspect-ratio: 1 / 1 !important;
    border-radius: 10px !important;
    border-color: rgba(120, 120, 120, 0.35) !important;
    box-shadow: none !important;
  }

  .tile:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .mobile-nav {
    display: grid !important;
  }

  .promo-row,
  .info-bar {
    display: none !important;
  }

  .chat-fab {
    bottom: calc(78px + var(--safe-b)) !important;
    right: 12px !important;
  }

  /* Auth login/register only — ไม่ดึง wallet ไป fullscreen ผิดรูป */
  #authModal.modal-backdrop {
    place-items: stretch !important;
    align-items: stretch !important;
    padding: 0 !important;
    background: #050505 !important;
  }

  #authModal .auth-sheet,
  #authModal .auth-sheet.auth-ufa {
    width: 100% !important;
    max-width: none !important;
    max-height: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    transform: none !important;
  }

  #authModal.modal-backdrop.open .auth-sheet,
  #authModal.modal-backdrop.open .auth-sheet.auth-ufa {
    transform: none !important;
  }

  #walletModal.modal-backdrop,
  #walletModal.wallet-backdrop,
  .phone-shell > #walletModal.modal-backdrop,
  .phone-shell > #walletModal.wallet-backdrop {
    top: var(--header) !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: none !important;
    place-items: stretch !important;
    align-items: stretch !important;
    justify-items: stretch !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    z-index: 110 !important;
  }

  .phone-shell > #walletModal.wallet-backdrop:not(.open),
  .phone-shell > #walletModal.modal-backdrop:not(.open) {
    display: none !important;
  }

  .phone-shell > #walletModal.wallet-backdrop.open,
  .phone-shell > #walletModal.modal-backdrop.open {
    display: grid !important;
  }

  #walletModal .wallet-sheet,
  .phone-shell > #walletModal .wallet-sheet {
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    height: 100% !important;
    min-height: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    transform: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  body.wallet-open .sidebar,
  body.activate-open .sidebar {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }

  /* Keep compact dialogs centered (deposit gate, etc.) */
  #needDepositModal.need-dep-backdrop,
  #localeModal.locale-backdrop,
  #historyModal.history-backdrop {
    place-items: center !important;
    align-items: center !important;
    justify-items: center !important;
    padding: 20px 16px !important;
  }

  #needDepositModal .need-dep-sheet,
  #localeModal .locale-sheet,
  #historyModal .history-sheet {
    width: min(92%, 300px) !important;
    max-width: 300px !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    border-radius: 16px !important;
    align-self: center !important;
    justify-self: center !important;
  }

  #needDepositModal .need-dep-sheet {
    max-width: 340px !important;
    width: min(92%, 340px) !important;
    border: 1px solid rgba(212, 175, 55, 0.35) !important;
  }

  #historyModal .history-sheet {
    max-width: 380px !important;
    width: min(94%, 380px) !important;
    max-height: min(72dvh, 520px) !important;
  }

  .toast {
    bottom: calc(90px + var(--safe-b)) !important;
    left: 50% !important;
    transform: translate(-50%, 12px) !important;
    translate: none !important;
  }

  .toast.show {
    transform: translate(-50%, 0) !important;
  }

@media (min-width: 1100px), (min-width: 1400px) {
  :root {
    --sidebar: 72px !important;
    --header: 72px !important;
    --shell: 430px !important;
  }

  body.is-logged {
    --header: 68px !important;
  }

  body.is-logged.activate-open,
  html.activate-open body.is-logged {
    --header: 68px !important;
  }

  .tile-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }

  .side-item {
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    min-height: 62px !important;
  }

  .side-ico {
    width: 24px !important;
    height: 24px !important;
  }

  .logo-img {
    height: 50px !important;
    max-height: 50px !important;
    width: auto !important;
  }

  body.is-logged .logo-img {
    height: 54px !important;
    max-height: 54px !important;
  }

  .app > .slider {
    max-height: none !important;
    border-radius: 0 !important;
  }

  .mobile-nav {
    display: grid !important;
  }
}

/* ——— Entry popup (เปิดครั้งแรก / รายวัน) ——— */
.entry-popup-backdrop.modal-backdrop,
.phone-shell > .entry-popup-backdrop {
  display: grid !important;
  place-items: center !important;
  align-content: center !important;
  justify-content: center !important;
  padding: 16px 14px calc(16px + var(--safe-b)) !important;
  background: rgba(0, 0, 0, 0.78);
  z-index: 170;
}

.entry-popup-sheet {
  width: min(100%, 360px);
  height: auto !important;
  max-height: min(90dvh, 640px);
  margin: 0 auto;
  flex: 0 0 auto !important;
  align-self: center !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 10px 10px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1a1612 0%, #0e0c0a 100%);
  border: 1px solid rgba(232, 184, 74, 0.35);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.6);
  overflow: auto;
}

.entry-popup-banner {
  width: 100%;
  height: auto;
  max-height: min(62dvh, 480px);
  object-fit: contain;
  object-position: center top;
  border-radius: 10px;
  background: #000;
  display: block;
  flex: 0 0 auto;
}

.entry-popup-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 12px 4px 10px;
  color: #e8dcc0;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.entry-popup-check input {
  width: 16px;
  height: 16px;
  accent-color: #E8B84A;
  cursor: pointer;
}

.entry-popup-close {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 46px;
  border: none;
  border-radius: 10px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  color: #1a1205;
  cursor: pointer;
  background: linear-gradient(105deg, #8B6832 0%, #D4A017 42%, #F0C85A 72%, #C9A227 100%);
  box-shadow: 0 8px 18px rgba(184, 134, 46, 0.35);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ——— Locale (ภาษา / ประเทศ) ——— */
#localeModal.locale-backdrop,
.locale-backdrop {
  place-items: center !important;
  align-items: center !important;
  justify-items: center !important;
  padding: 20px 18px !important;
  background: rgba(0, 0, 0, 0.72);
}

.locale-sheet {
  position: relative;
  width: min(100%, 300px);
  max-width: 300px;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  align-self: center !important;
  justify-self: center !important;
  margin: auto;
  padding: 18px 16px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #1c1814 0%, #12100e 100%);
  border: 1px solid rgba(232, 184, 74, 0.38);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  text-align: center;
}

.locale-x {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: #c8b48a;
  font-size: 1rem;
  cursor: pointer;
}

.locale-ico {
  font-size: 1.55rem;
  line-height: 1;
  margin: 2px auto 8px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, rgba(120, 170, 255, 0.35), transparent 62%);
  filter: drop-shadow(0 0 8px rgba(232, 184, 74, 0.35));
}

.locale-sheet h2 {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f5e6c0;
  line-height: 1.3;
}

.locale-sub {
  margin: 0 0 14px;
  font-size: 0.72rem;
  color: #a89878;
  line-height: 1.35;
}

.locale-field {
  display: grid;
  gap: 5px;
  text-align: left;
  margin-bottom: 10px;
}

.locale-field:last-child {
  margin-bottom: 0;
}

.locale-field > span {
  font-size: 0.72rem;
  font-weight: 600;
  color: #E8B84A;
}

.locale-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  border-radius: 10px;
  border: 1px solid rgba(232, 184, 74, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: #f2e6c8;
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
}

.locale-select-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.locale-select-left b {
  font-weight: 600;
  font-size: 0.9rem;
  text-align: left;
}

.locale-flag {
  font-style: normal;
  font-size: 1.25rem;
  line-height: 1;
}

.locale-select i {
  font-style: normal;
  color: #E8B84A;
  opacity: 0.85;
}

.locale-picker {
  position: absolute;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 20px 16px;
}

.locale-picker[hidden] {
  display: none !important;
}

.locale-picker-sheet {
  width: min(100%, 300px);
  max-height: min(58dvh, 380px);
  display: flex;
  flex-direction: column;
  background: #14110e;
  border-radius: 14px;
  border: 1px solid rgba(232, 184, 74, 0.35);
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.locale-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.locale-picker-head h3 {
  margin: 0;
  font-size: 1rem;
  color: #F2D08A;
}

.locale-picker-x {
  border: none;
  background: transparent;
  color: #c8b48a;
  font-size: 1.1rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
}

.locale-picker-list {
  overflow: auto;
  padding: 6px 0 calc(12px + var(--safe-b));
}

.locale-pick-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: #f0e6d0;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.locale-pick-item.is-on {
  background: rgba(232, 184, 74, 0.12);
  color: #F2D08A;
}

.locale-pick-item .locale-flag {
  width: 28px;
  text-align: center;
}

.locale-pick-item em {
  font-style: normal;
  flex: 1;
}

.locale-pick-item i {
  font-style: normal;
  color: #E8B84A;
  opacity: 0;
}

.locale-pick-item.is-on i {
  opacity: 1;
}
