:root {
  --bg0: #02081a;
  --bg1: #061538;
  --bg2: #0a2a6a;
  --card: rgba(8, 28, 72, 0.42);
  --line: rgba(64, 210, 255, 0.42);
  --line-soft: rgba(64, 210, 255, 0.22);
  --text: #f4f8ff;
  --muted: #a9c2e0;
  --gold: #f0c75a;
  --gold2: #ffe08a;
  --cyan: #3fd8ff;
  --cyan2: #7aecff;
  --danger: #ff6b7a;
  --ok: #4ad295;
  --nav: rgba(4, 16, 42, 0.88);
  --shadow: 0 10px 28px rgba(0, 20, 60, 0.45);
  --glow-cyan: 0 0 12px rgba(63, 216, 255, 0.45);
  --glow-gold: 0 6px 16px rgba(240, 199, 90, 0.4);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Sarabun", "Noto Sans Thai", "Prompt", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0;
  background-color: #02081a;
  background-image: none;
  color: var(--text);
  font-family: var(--font);
  min-height: 100%;
}
body {
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  position: relative;
  z-index: 2;
  padding-bottom: calc(78px + var(--safe-b));
}

/* Full-bleed blue nebula + Thai palace (image 2). No fixed attachment. */
.bg-atmosphere {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-color: #02081a;
  background-image:
    linear-gradient(180deg, rgba(2, 10, 34, 0.22) 0%, rgba(2, 12, 40, 0.08) 34%, rgba(2, 8, 28, 0.34) 100%),
    url("/thai/atmosphere-bg.jpg?v=20261105b");
  background-position: center top, center top;
  background-size: cover, cover;
  background-repeat: no-repeat;
  background-attachment: scroll, scroll;
  opacity: 1;
  transform: translateZ(0);
  will-change: auto;
  contain: paint;
}
.bg-vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 64% at 50% 36%, transparent 30%, rgba(0, 8, 28, 0.38) 78%, rgba(0, 4, 18, 0.7) 100%),
    linear-gradient(180deg, rgba(0, 10, 30, 0.18) 0%, transparent 18%, transparent 72%, rgba(0, 8, 24, 0.42) 100%);
}
.bg-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 88% 40% at 78% 6%, rgba(255, 210, 90, 0.22), transparent 58%),
    radial-gradient(ellipse 70% 36% at 12% 12%, rgba(40, 180, 255, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 34% at 50% 100%, rgba(30, 140, 255, 0.16), transparent 58%);
  opacity: .55;
}
.bg-stars {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 18%, rgba(180, 240, 255, 0.5), transparent),
    radial-gradient(1px 1px at 78% 26%, rgba(255, 230, 140, 0.4), transparent),
    radial-gradient(1.6px 1.6px at 34% 68%, rgba(140, 220, 255, 0.28), transparent),
    radial-gradient(1px 1px at 68% 82%, rgba(255, 255, 255, 0.22), transparent);
  opacity: .45;
}

.page { position: relative; z-index: 2; display: none; }
.page.active { display: block; animation: fadeIn .28s ease; }
@keyframes fadeIn { from { opacity: .6; } to { opacity: 1; } }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px 8px;
  overflow: visible;
  background: transparent;
}
.brand {
  display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto;
  overflow: visible;
}
.brand-link {
  display: flex; align-items: center; min-width: 0; overflow: visible;
}
.brand img,
.brand #brand-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: min(112px, 30vw);
  object-fit: contain;
  object-position: left center;
  background: transparent !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  outline: none;
  mix-blend-mode: normal;
  flex-shrink: 0;
}
.brand-link,
.brand {
  background: transparent !important;
  box-shadow: none;
}
.brand-text {
  min-width: 0;
  flex: 0 1 auto;
  line-height: 1.05;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.brand-text strong {
  display: inline-block;
  font-size: clamp(12px, 3.6vw, 15px);
  letter-spacing: .45px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1;
  padding: 4px 11px 5px;
  border-radius: 999px;
  border: 1.25px solid #f0a52e;
  /* sampled from XYK99 crop letter faces */
  background-image: linear-gradient(
    180deg,
    #EDF38F 0%,
    #F9F2AE 8%,
    #F8F299 12%,
    #FFF49C 24%,
    #FFF095 32%,
    #FAEE8A 36%,
    #F6EB62 40%,
    #F8DC43 44%,
    #F2C438 48%,
    #E6B31E 52%,
    #DFA526 56%,
    #DDA111 60%,
    #E1A519 64%,
    #FCAA32 68%,
    #F5C343 72%,
    #FFCC69 80%,
    #D0B54C 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  box-shadow:
    0 0 0 0.5px rgba(255, 190, 70, 0.35),
    0 0 10px rgba(240, 165, 46, 0.28);
  text-shadow: none;
  filter:
    drop-shadow(0 0 0.6px rgba(20, 10, 0, 0.95))
    drop-shadow(0 1px 1.2px rgba(0, 0, 0, 0.72));
}
.brand-text span {
  display: block;
  font-size: clamp(9px, 2.5vw, 11px);
  margin-top: 0;
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: .3px;
  color: rgba(255, 255, 255, 0.94);
  -webkit-text-fill-color: rgba(255, 255, 255, 0.94);
  background: none;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.4);
}

.wallet {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.bal {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(6, 24, 64, 0.55);
  border: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.bal b { color: var(--text); font-weight: 700; }
.btn-gold {
  padding: 8px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffe58a, #f0c24a 45%, #d4a028);
  color: #2a1c05;
  font-weight: 800;
  font-size: 12px;
  box-shadow: var(--glow-gold);
}
.btn-ghost {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: rgba(8, 28, 72, 0.5);
  display: grid; place-items: center;
  color: var(--cyan2);
}

.hero {
  margin: 8px 14px 0;
  height: 132px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  border: 1.5px solid rgba(80, 220, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 210, 100, 0.22),
    0 0 18px rgba(40, 180, 255, 0.28),
    var(--shadow);
  background:
    linear-gradient(135deg, rgba(10, 40, 96, 0.55), rgba(4, 16, 48, 0.62)),
    radial-gradient(circle at 86% 28%, rgba(255, 210, 90, 0.28), transparent 42%),
    radial-gradient(circle at 18% 78%, rgba(40, 170, 255, 0.28), transparent 48%),
    linear-gradient(160deg, rgba(12, 48, 110, 0.78), rgba(4, 14, 40, 0.88));
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  box-shadow:
    inset 1px 1px 0 rgba(140, 240, 255, 0.35),
    inset -1px -1px 0 rgba(255, 210, 110, 0.28);
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(2, 12, 36, 0.5), transparent 58%);
}
.hero-copy {
  position: absolute; z-index: 1; left: 16px; bottom: 16px; right: 16px;
}
.hero-copy small {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .7px;
  font-weight: 800;
  line-height: 1.15;
  /* brighter metallic gold — readable at small size vs muted champagne */
  background-image: linear-gradient(
    180deg,
    #FFF700 0%,
    #FFFFC2 22%,
    #FFFFFF 40%,
    #FFE566 48%,
    #FFB600 58%,
    #FF9500 78%,
    #D47800 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 0 0.4px rgba(255, 210, 80, 0.85))
    drop-shadow(0 0 1.2px rgba(255, 180, 40, 0.55))
    drop-shadow(0 1px 1px rgba(0, 0, 0, 0.65));
}
.hero-copy h1 {
  margin: 4px 0 0; font-size: 22px; line-height: 1.2; font-weight: 800;
  /* same bright metallic gold family as OFFICIAL / header XYK99 */
  background-image: linear-gradient(
    180deg,
    #FFF700 0%,
    #FFFFC2 22%,
    #FFFFFF 40%,
    #FFE566 48%,
    #FFB600 58%,
    #FF9500 78%,
    #D47800 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter:
    drop-shadow(0 0 0.4px rgba(255, 210, 80, 0.85))
    drop-shadow(0 0 1.4px rgba(255, 180, 40, 0.45))
    drop-shadow(0 1px 1px rgba(0, 0, 0, 0.65));
}
.hero-copy p { margin: 6px 0 0; color: #d7e4f5; font-size: 12px; opacity: .92; }

.hero.hero-combo,
.hero.hero-ticker {
  height: auto;
  min-height: 0;
  display: block;
}
.hero.hero-combo::after,
.hero.hero-ticker::after { display: none; }
.hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 14px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}
.hero.hero-combo .hero-copy {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 1;
}
.hero.hero-combo .hero-copy h1 {
  font-size: clamp(18px, 5.2vw, 22px);
}
.hero.hero-combo .hero-copy p {
  margin-top: 4px;
  font-size: 11.5px;
}
.wd-ticker {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero.hero-combo .wd-ticker {
  border-top: 1px solid rgba(120, 230, 255, 0.16);
  padding-top: 10px;
}
.wd-ticker-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wd-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(74, 210, 149, 0.22), 0 0 10px rgba(74, 210, 149, 0.55);
  animation: wdPulse 1.8s ease-in-out infinite;
}
@keyframes wdPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .65; transform: scale(.92); }
}
.wd-ticker-label {
  font-size: 12.5px;
  letter-spacing: .55px;
  color: var(--gold2);
  font-weight: 700;
  text-transform: uppercase;
}
.wd-ticker-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 46px;
}
.wd-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(4, 18, 48, 0.42);
  border: 1px solid rgba(120, 230, 255, 0.18);
  opacity: 0;
  transform: translateY(10px);
  animation: wdIn .55s ease forwards;
}
.wd-item.is-out {
  animation: wdOut .4s ease forwards;
}
@keyframes wdIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes wdOut {
  to { opacity: 0; transform: translateY(-8px); }
}
.wd-item .wd-ico {
  flex-shrink: 0;
  width: 22px; height: 22px; margin-top: 1px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 800;
  color: #062018;
  background: linear-gradient(135deg, #7dffc2, #3fd8ff);
}
.wd-item .wd-msg {
  min-width: 0;
  flex: 1;
  font-size: 14px;
  line-height: 1.45;
  color: #e8f2ff;
  font-weight: 600;
}
.wd-item .wd-msg b { color: var(--gold2); font-weight: 800; }
.wd-item .wd-msg .wd-method { color: var(--cyan2); font-weight: 700; }
.wd-empty {
  color: #c5d6ea;
  font-size: 13.5px;
  opacity: .85;
  padding: 6px 2px;
}
@media (max-width: 360px) {
  .brand-text strong { font-size: 12px; }
  .brand-text span { font-size: 9px; }
  .wallet { gap: 6px; }
  .btn-gold { padding: 8px 10px; }
}

.shortcuts {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 14px 12px 6px;
}
.sc {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 8px 2px;
}
.sc-ico {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(18, 56, 120, 0.72), rgba(6, 24, 64, 0.78));
  border: 1.5px solid rgba(70, 220, 255, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 12px rgba(40, 180, 255, 0.28),
    0 8px 16px rgba(0, 20, 60, 0.28);
  font-size: 18px;
}
.sc span { font-size: 12.5px; color: var(--muted); line-height: 1.2; text-align: center; }
.sc:active .sc-ico { transform: scale(.96); }

.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 14px 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(70, 210, 255, 0.4);
  background: rgba(6, 28, 72, 0.55);
  color: #e8f4ff;
  font-size: 13.5px;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(40, 170, 255, 0.12);
}
.chip.active {
  color: #2a1c05;
  background: linear-gradient(135deg, #ffe58a, #f0c24a 48%, #d4a028);
  border-color: transparent;
  font-weight: 800;
  box-shadow: var(--glow-gold);
}

.section { padding: 10px 0 4px; }
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px 8px;
}
.sec-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 700;
}
.sec-title .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px rgba(240, 199, 90, 0.75);
}
.sec-nav { display: flex; gap: 6px; }
.sec-nav button {
  width: 28px; height: 28px; border-radius: 8px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 28, 72, 0.55);
  color: var(--muted);
}

.hscroll {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 0 14px 8px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }

.gcard {
  flex: 0 0 118px;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  background: rgba(6, 24, 64, 0.62);
  border: 1.5px solid rgba(70, 220, 255, 0.62);
  box-shadow:
    0 0 14px rgba(40, 180, 255, 0.32),
    0 8px 18px rgba(0, 16, 48, 0.35);
}
.gcard::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: 16px;
  pointer-events: none;
  box-shadow:
    inset 0 0 0 1px rgba(160, 240, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.gcard img {
  width: 118px; height: 150px; object-fit: cover; background: rgba(4, 16, 42, 0.55);
}
.gcard .meta {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 8px 8px;
  background: linear-gradient(180deg, transparent, rgba(2, 10, 28, 0.92));
}
.gcard .meta b {
  display: block; font-size: 11px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gcard .meta small {
  color: var(--muted); font-size: 10px;
}
.gcard.soon {
  height: 150px;
  display: grid; place-items: center;
  color: var(--muted);
  background: linear-gradient(160deg, rgba(12, 40, 96, 0.7), rgba(4, 14, 40, 0.82));
  font-size: 12px; text-align: center; padding: 12px;
}

.empty-row {
  color: var(--muted); font-size: 12px; padding: 8px 14px 12px;
}

.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(10px + var(--safe-b));
  width: min(440px, calc(100% - 20px));
  z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  padding: 8px 6px;
  border-radius: 22px;
  background: var(--nav);
  border: 1.5px solid rgba(70, 210, 255, 0.35);
  box-shadow: 0 8px 22px rgba(0, 16, 48, 0.45), 0 0 16px rgba(40, 160, 255, 0.12);
}
.bn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 1px; color: var(--muted); font-size: 11.5px; line-height: 1.15; text-align: center;
}
.bn .ico { font-size: 16px; line-height: 1; }
.bn.active { color: var(--gold2); }
.bn.active .ico { }

.promo-hero { text-align: center; }
.promo-hero-art {
  display: flex; justify-content: center; margin: 0 0 12px;
}
.promo-hero-art img {
  width: min(220px, 58vw); height: auto; aspect-ratio: 1;
  border-radius: 50%; object-fit: cover;
  box-shadow: 0 8px 18px rgba(0, 20, 60, 0.4), 0 0 16px rgba(40, 180, 255, 0.2);
}

.promo-list { padding: 8px 14px 20px; display: grid; gap: 12px; }
.promo-card {
  border-radius: 16px;
  border: 1.5px solid rgba(70, 210, 255, 0.38);
  background: linear-gradient(165deg, rgba(10, 40, 96, 0.58), rgba(4, 16, 48, 0.72));
  overflow: hidden;
  box-shadow: var(--shadow), 0 0 14px rgba(40, 170, 255, 0.14);
}
.promo-card .banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 210, 90, 0.22), transparent 40%),
    linear-gradient(120deg, rgba(14, 48, 110, 0.78), rgba(6, 20, 56, 0.9));
  border-bottom: 1px solid var(--line-soft);
}
.promo-card .banner-cover {
  width: 72px; height: 72px; flex: 0 0 72px;
  border-radius: 50%; object-fit: cover; background: #050b18;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(40, 180, 255, 0.2);
}
.promo-card .banner-copy { min-width: 0; flex: 1; }
.promo-card .banner .tag {
  display: inline-block; font-size: 10px; color: #2a1c05;
  background: linear-gradient(135deg, #ffe58a, #f0c24a);
  padding: 3px 8px; border-radius: 999px; font-weight: 700;
}
.promo-card .banner-copy h3,
.promo-card h3 { margin: 6px 0 0; font-size: 15px; line-height: 1.35; }
.promo-card .body { padding: 14px 16px 16px; color: #d5e1f0; font-size: 13px; line-height: 1.55; }
.promo-card .actions { display: grid; gap: 8px; margin: 12px 0 4px; }
.promo-card .actions .btn-line { text-decoration: none; color: inherit; cursor: pointer; }
.promo-card .body a { color: #ffe58a; text-decoration: underline; }

.promo-card ul { margin: 8px 0 0; padding-left: 18px; }
.promo-card li { margin: 4px 0; }
.promo-card .rules {
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(100, 200, 255, 0.22);
  color: var(--muted); font-size: 12px;
}
.table {
  width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px;
}
.table th, .table td {
  border: 1px solid rgba(100, 200, 255, 0.18);
  padding: 6px 8px; text-align: center;
}
.table th { background: rgba(240, 199, 90, 0.12); color: var(--gold2); }

.panel {
  margin: 12px 14px; padding: 18px;
  border-radius: 16px;
  border: 1.5px solid rgba(70, 210, 255, 0.38);
  background: var(--card);
  box-shadow: 0 0 14px rgba(40, 170, 255, 0.12);
}
.panel h2 { margin: 0 0 8px; font-size: 18px; }
.panel p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.panel .actions { display: grid; gap: 8px; margin-top: 14px; }
.btn-line {
  display: block; text-align: center;
  padding: 12px; border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 28, 72, 0.55);
}
.btn-line.primary {
  background: linear-gradient(135deg, #ffe58a, #f0c24a 48%, #d4a028);
  color: #2a1c05; border: 0; font-weight: 800;
  box-shadow: var(--glow-gold);
}

.toast {
  position: fixed; left: 50%; top: 18%; transform: translateX(-50%) translateY(-8px);
  background: rgba(4, 16, 42, 0.94); color: #fff; border: 1px solid var(--line);
  padding: 10px 14px; border-radius: 12px; font-size: 12px; z-index: 99;
  opacity: 0; pointer-events: none; transition: .2s ease; max-width: 80%;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading {
  padding: 24px; text-align: center; color: var(--muted); font-size: 13px;
}

.profile-grid {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.app.form-mode { padding-bottom: 24px; }
.app.form-mode .topbar { display: none; }

.form-page { min-height: 70dvh; }
.form-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(4, 16, 42, 0.92);
  border-bottom: 1px solid var(--line-soft);
}
.form-bar button {
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 28, 72, 0.62);
  color: var(--gold2); font-size: 13px; font-weight: 700;
}
.form-bar b { font-size: 15px; }
.form-body { padding: 14px; }
.thai-form {
  display: grid; gap: 12px;
  padding: 4px 0 20px;
}
.thai-form label {
  display: grid; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.thai-form input,
.thai-form select {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: rgba(6, 22, 58, 0.62);
  color: var(--text);
  font: inherit;
  outline: none;
}
.thai-form input:focus,
.thai-form select:focus {
  border-color: rgba(70, 220, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(40, 180, 255, 0.14);
}
.thai-form .check {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px;
}
.thai-form .check input { width: auto; }
.captcha-row { display: grid; grid-template-columns: 1fr 110px; gap: 8px; }
.captcha-box {
  border-radius: 12px;
  border: 1px dashed rgba(240, 199, 90, 0.5);
  background: rgba(240, 199, 90, 0.1);
  color: var(--gold2);
  font-weight: 800;
  letter-spacing: 4px;
  font-size: 18px;
}
.way-row { padding: 0; }
.muted { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 0; }
.mono {
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
  font-size: 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line-soft);
}
.panel.tight { margin: 0; }
.loading-game {
  min-height: 50dvh;
  display: grid; place-content: center; gap: 10px;
  text-align: center; padding: 24px;
}
.spinner {
  width: 42px; height: 42px; margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(70, 210, 255, 0.2);
  border-top-color: var(--cyan);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.cs-frame {
  width: 100%;
  min-height: 62dvh;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: #061538;
  margin-top: 10px;
}

@media (min-width: 481px) {
  .app { box-shadow: 0 0 0 1px rgba(70, 210, 255, 0.08), 0 30px 80px rgba(0, 10, 40, 0.5); }
}

.sc-ico .ico-svg,
.bn .ico .ico-svg {
  display: block;
  color: #e8f6ff;
}
.sc-ico { color: #e8f6ff; }
.bn .ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  font-size: 0;
  line-height: 0;
}
.bn.active .ico .ico-svg { color: var(--gold2); }

@media (max-width: 640px) {
  .bg-stars { display: none; }
  .bg-glow { opacity: .42; }
  .bg-vignette { opacity: .9; }
}
@media (prefers-reduced-motion: reduce) {
  .page.active { animation: none; }
}

.wd-item.is-win .wd-ico {
  color: #3a2208;
  background: linear-gradient(135deg, #ffe08a, #ffb347);
}
.wd-item.is-real {
  border-color: rgba(255, 210, 100, 0.42);
  box-shadow: 0 0 12px rgba(255, 190, 80, 0.18);
}
.wd-item .wd-msg .wd-game {
  color: var(--cyan2);
  font-weight: 700;
}
.wd-item .wd-msg .wd-win {
  color: #ffd56a;
  font-weight: 800;
}


.sec-count {
  margin-left: 6px;
  font-weight: 500;
  opacity: 0.55;
  font-size: 0.75em;
}
.gcard.more-card {
  border: 1px dashed rgba(255,255,255,0.28);
  background: rgba(0,0,0,0.18);
}
.gcard.more-card.loading {
  opacity: 0.55;
  pointer-events: none;
}

/* Vendor-first lobby: horizontal swipe row (like .hscroll game rows) */
.vwall {
  display: flex;
  flex-direction: row;
  gap: 12px;
  overflow-x: auto;
  padding: 0 14px 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.vwall::-webkit-scrollbar { display: none; }
.vcard {
  display: flex;
  align-items: stretch;
  flex: 0 0 min(78vw, 300px);
  width: min(78vw, 300px);
  min-height: 158px;
  height: 158px;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  color: #eaf6ff;
  scroll-snap-align: start;
  border: 1.5px solid rgba(70, 220, 255, 0.55);
  background:
    linear-gradient(115deg, rgba(8, 40, 104, 0.96) 0%, rgba(10, 56, 128, 0.9) 42%, rgba(4, 20, 56, 0.94) 100%);
  box-shadow:
    0 0 14px rgba(40, 180, 255, 0.28),
    0 8px 18px rgba(0, 16, 48, 0.35);
  position: relative;
}
.vcard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 16px;
  box-shadow:
    inset 0 0 0 1px rgba(160, 240, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.vcard-left {
  flex: 0 0 42%;
  max-width: 46%;
  padding: 12px 10px 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  z-index: 1;
}
.vcard-brand {
  font-size: 10px;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: #f0c24a;
  text-shadow: 0 0 8px rgba(240, 194, 74, 0.35);
  margin-bottom: 6px;
}
.vcard-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 210, 100, 0.28);
  margin-bottom: 6px;
}
.vcard-logo-fallback {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  color: #2a1c05;
  background: linear-gradient(135deg, #ffe58a, #f0c24a 48%, #d4a028);
  margin-bottom: 6px;
}
.vcard-name {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.vcard-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}
.vcard-art {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 70% 40%, rgba(80, 200, 255, 0.18), transparent 55%),
    linear-gradient(160deg, rgba(12, 48, 112, 0.2), rgba(2, 12, 36, 0.35));
}
.vcard-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 68% 12%;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.45));
  pointer-events: none;
}
.vcard-art.no-art {
  background:
    linear-gradient(135deg, rgba(20, 70, 150, 0.35), rgba(4, 18, 48, 0.5));
}
.vendor-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 8px;
}
.vendor-bar > div {
  min-width: 0;
}
.vendor-bar b {
  display: block;
  font-size: 15px;
}
.vendor-bar small {
  color: var(--muted);
  font-size: 11px;
}
.vendor-bar .btn-line {
  flex: 0 0 auto;
  padding: 8px 10px;
  font-size: 12px;
}
.ggrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 14px 16px;
}
.ggrid .gcard {
  flex: none;
  width: 100%;
  scroll-snap-align: unset;
}
.ggrid .gcard img {
  width: 100%;
  height: auto;
  aspect-ratio: 118 / 150;
  object-fit: cover;
  display: block;
}
.vendor-more {
  padding: 0 14px 18px;
}
.vendor-more .btn-line {
  width: 100%;
}

/* CS page + avatar float: one ZhiDesk panel, our avatar button only */
.cs-page .actions { margin-top: 12px; }

/* Hide default ZhiDesk launcher bubble — keep our #cs-fab only */
html.xyk99-cs-avatar-mode #zhidesk-launcher,
html.xyk99-cs-avatar-mode [id*="zhidesk-launcher"],
html.xyk99-cs-avatar-mode .zhidesk-launcher,
html.xyk99-cs-avatar-mode [class*="zhidesk"][class*="launcher"],
html.xyk99-cs-avatar-mode [class*="zhidesk"][class*="bubble"] {
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  max-width: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  display: none !important;
}

.cs-fab.xyk99-cs-fab {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(72px + env(safe-area-inset-bottom));
  width: 62px;
  height: 62px;
  padding: 0;
  border: 2px solid #f0c24a;
  border-radius: 50%;
  z-index: 80;
  display: block;
  overflow: visible;
  background: #1a1208;
  /* label is position:absolute against this fixed box */
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 220, 120, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.cs-fab.xyk99-cs-fab:active { transform: scale(0.94); }
.cs-fab-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  pointer-events: none;
}
.cs-fab-label {
  position: absolute;
  left: 50%;
  bottom: -18px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffe58a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}


/* ===== iOS Add to Home Screen sheet ===== */
.a2hs-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.a2hs-overlay:not([hidden]) {
  pointer-events: auto;
}
.a2hs-overlay[hidden] { display: none !important; }
.a2hs-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 6, 20, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.a2hs-sheet {
  position: relative;
  width: min(480px, 100%);
  max-height: min(88dvh, 640px);
  overflow: auto;
  margin: 0;
  padding: 10px 18px calc(18px + var(--safe-b));
  border-radius: 22px 22px 0 0;
  background:
    linear-gradient(180deg, rgba(18, 42, 96, 0.98) 0%, rgba(4, 14, 40, 0.98) 55%, #02081a 100%);
  border: 1px solid rgba(240, 199, 90, 0.38);
  border-bottom: 0;
  box-shadow: 0 -12px 40px rgba(0, 10, 40, 0.55), 0 0 0 1px rgba(63, 216, 255, 0.08) inset;
  color: var(--text);
  transform: translateY(110%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.a2hs-overlay.is-open .a2hs-sheet {
  transform: translateY(0);
}
.a2hs-handle {
  width: 42px; height: 4px; border-radius: 99px;
  background: rgba(240, 199, 90, 0.45);
  margin: 2px auto 12px;
}
.a2hs-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: rgba(8, 28, 72, 0.65);
  color: var(--gold2); font-size: 22px; line-height: 1;
  display: grid; place-items: center;
}
.a2hs-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px;
}
.a2hs-brand img {
  width: 56px; height: 56px; object-fit: contain;
  border-radius: 14px;
  background: rgba(2, 8, 26, 0.55);
  border: 1px solid rgba(240, 199, 90, 0.35);
  box-shadow: var(--glow-gold);
}
.a2hs-brand strong {
  display: block; font-size: 20px; letter-spacing: 0.04em;
  color: var(--gold2);
}
.a2hs-brand span {
  display: block; font-size: 12px; color: var(--muted); margin-top: 2px;
}
.a2hs-sheet h2 {
  margin: 0 0 6px;
  font-size: 1.28rem;
  color: var(--gold);
  font-weight: 800;
}
.a2hs-lead {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}
.a2hs-steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 10px;
}
.a2hs-steps li {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(8, 28, 72, 0.55);
  border: 1px solid var(--line-soft);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
}
.a2hs-step-num {
  flex: 0 0 24px;
  width: 24px; height: 24px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ffe58a, #f0c24a 48%, #d4a028);
  color: #2a1c05;
  font-weight: 800; font-size: 12px;
}
.a2hs-ico-share {
  display: inline-block;
  font-style: normal;
  font-weight: 800;
  color: var(--cyan2);
  margin: 0 2px;
}
.a2hs-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(240, 199, 90, 0.08);
  border: 1px dashed rgba(240, 199, 90, 0.35);
  color: var(--gold2);
  font-size: 0.86rem;
  line-height: 1.5;
}
.a2hs-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}
.a2hs-actions .btn-line,
.a2hs-actions a.btn-line {
  text-align: center;
}
.a2hs-dont {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  user-select: none;
}
.a2hs-dont input { width: 16px; height: 16px; accent-color: var(--gold); }
