/* modern — mobile (<=1280px). Linked via <link media>; no @media wrapper.
   Breakpoint matches the shell flip in modern/layout.astro (#2222, #2560).
   Per Figma `mb_home_before login` (5545:309753). Frame 390×844. */

.shell {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  /* A child spilling a few px past the viewport makes mobile browsers
     zoom-to-fit the wider page, which shrinks the visual viewport and drops
     the `position: fixed` bottom nav below the fold. Clip horizontal overflow
     so the page width can never exceed the viewport. `clip` (not `hidden`)
     doesn't create a scroll container, so the inner carousels keep their own
     `overflow-x: auto` scroll. */
  overflow-x: clip;
}

/* Visibility flip. This sheet is `<link media="(max-width: 1280px)">` so it
   only loads on mobile viewports — hide the desktop shell unconditionally.
   The inline critical CSS in `modern/layout.astro` also flips visibility
   for the LCP window, but Astro's vite-plugin-astro has a dev-mode race
   that can drop the inline `<style>` after HMR; without this backstop here
   both shells render simultaneously when the race hits. */
.shell-desktop { display: none; }

/* ─── Top navbar ─────────────────────────────────────────────────────── */

.nav-top {
  position: sticky;
  top: 0;
  z-index: 30;
  /* Same `--surface` as `.home-banner`'s gradient top stop so the two
     surfaces visually blend into one continuous block — no border or
     drop-shadow on the seam. */
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 8px;
  height: 72px;
  padding: 8px;
}
.nav-top-menu {
  background: transparent;
  border: 0;
  color: var(--fg);
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
}
.nav-top-menu svg { width: 24px; height: 24px; }
.nav-top-menu:hover { background: rgba(255, 255, 255, 0.06); }
.nav-top-brand {
  flex: 1;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--fg);
  min-width: 0;
}
.nav-top-brand img { display: block; height: 22px; width: auto; }
.nav-top-brand-text {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.5px;
  font-family: 'Kanit', sans-serif;
}
.nav-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-top-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'Kanit', sans-serif;
  text-decoration: none;
  white-space: nowrap;
  text-transform: capitalize;
  position: relative;
  cursor: pointer;
  box-shadow: var(--cta-shadow-outer);
}
.nav-top-cta:active { transform: translateY(1px); }
.nav-top-cta-outline {
  border: 1px solid #4bccff;
  color: var(--fg);
  background: transparent;
}
.nav-top-cta-outline::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
.nav-top-cta-fill {
  border: 2px solid var(--panel-border);
  color: var(--accent-fg);
  background: var(--accent-gradient);
}
.nav-top-cta-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 6px;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

/* ─── Banner section (navy bg block + carousel) ──────────────────────── */

.home-banner {
  position: relative;
  /* Soft gradient fade from the lighter banner surface (#18192e) to the
     darker page background (#0c0d22) so the section boundary doesn't
     read as a hard horizontal line. The carousel slides sit in the
     opaque top portion; the fade absorbs the bottom 40% before the
     type-rail + sections grid begins. */
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 60%, var(--bg) 100%);
  padding: 16px 0 32px;
  margin-bottom: 16px;
}

/* ─── Body: type rail + sections ─────────────────────────────────────── */

.home-body {
  display: grid;
  /* Rail narrower than the Figma's 88px so the popular-row cards
     don't visually crash into the active pill's gradient on a 390px
     viewport (placeholder cards fill the bg edge-to-edge; real game
     art tends to inset). Column-gap bumped to 24px for the same
     reason — Figma's 8px relies on rich art that empty placeholders
     don't have. */
  grid-template-columns: 64px minmax(0, 1fr);
  column-gap: 24px;
  /* 16px left padding gives the type-rail breathing room from the
     viewport edge (Figma's 8px inset feels too tight against the
     screen frame on real devices). 110px bottom clears the fixed
     bottom-nav (101 + 9 spacing). */
  padding: 0 16px 110px;
}

/* ─── Type rail (vertical column of pill buttons) ────────────────────── */

.type-rail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* Sticks below the 72px header with 16px breathing room once the
     banner above scrolls out of view. `align-self: start` keeps the
     rail at its natural height instead of stretching to fill the
     grid row — sticky inside a `align-items: stretch` grid would
     pin to the row, not the viewport. */
  position: sticky;
  top: 88px;
  align-self: start;
}
.type-rail-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 64px;
  height: 64px;
  padding: 6px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--fg);
  overflow: hidden;
  /* Inactive default per Figma — dark gradient frame matching the
     active pill's silhouette so the column reads as a uniform stack
     of buttons; only the active pill swaps the bg to cyan→purple. */
  background: linear-gradient(0deg, #0c1027 0%, #222944 100%);
  border: 1px solid #454663;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s, filter 0.12s;
}
.type-rail-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 4px 10px rgba(255, 255, 255, 0.1);
  pointer-events: none;
}
.type-rail-pill.is-active {
  background: var(--accent-gradient);
  border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}
.type-rail-pill.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 6px 10px rgba(255, 255, 255, 0.8);
  pointer-events: none;
}
.type-rail-pill:hover { filter: brightness(1.06); }
.type-rail-pill:active { transform: scale(0.97); }
.type-rail-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.type-rail-icon img { display: block; width: 32px; height: 32px; object-fit: contain; }
.type-rail-label {
  font-family: 'Kanit', sans-serif;
  font-weight: 400;
  font-size: 11px;
  line-height: 1;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
  position: relative;
  z-index: 1;
}

/* ─── Sections ───────────────────────────────────────────────────────── */

.home-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.home-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 30px;
}
.home-section-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 22px;
  font-weight: 500;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.home-section-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.home-empty {
  margin: 24px 12px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 14px;
}

/* ─── Popular Games — horizontal scroll row (124×186 cards) ──────────── */

.home-section-popular .home-section-head { margin-bottom: 0; }
.home-section-arrows {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.home-section-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--fg-dim);
}
.home-section-arrow svg { width: 16px; height: 16px; }

.modern-popular-row {
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.modern-popular-row::-webkit-scrollbar { display: none; }
.modern-popular-card {
  flex: 0 0 124px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-snap-align: start;
}
.modern-popular-card-art {
  position: relative;
  width: 124px;
  height: 164px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.modern-popular-card-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 65.85%, #1248bf 100%);
  pointer-events: none;
}
.modern-popular-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* Recently-played rail: `applyGameArt` hides this <img> via `hidden` on a
   404/missing key; the `display: block` above outranks the UA `[hidden]`. */
.modern-popular-card-art img[hidden] { display: none; }
.modern-popular-card-placeholder,
/* `.modern-popular-card-art-fallback` — runtime <span> for TenantImage
   404 path (#1838). Same posture as the placeholder, smaller font in
   the second rule for long game-name text. */
.modern-popular-card-art-fallback {
  width: 100%;
  height: 100%;
  background: color-mix(in oklab, var(--accent) 30%, var(--bg) 70%);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
}
.modern-popular-card-art-fallback {
  font-size: 12px;
  padding: 10px;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
}
.modern-popular-card-name {
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: capitalize;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Modern game grid (per-type 2-col, 135×100 art + label below) ──── */

.modern-game-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 8px;
  row-gap: 8px;
}
.modern-game-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modern-game-tile-art {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.modern-game-tile-art > img:not(.modern-game-tile-badge) {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* `applyGameArt` hides the tile <img> via `hidden` on a 404/missing key; the
   `display: block` above outranks the UA `[hidden]` default, so restore it. */
.modern-game-tile-art > img[hidden] { display: none; }
/* Single-entry studio LAUNCH tiles (ModernStudioTiles) reuse this game-tile
   box but render a brand LOGO — portrait 4:5 (matching the classic
   `.studio-tile` shape) + `contain` it (never crop) on the --surface-2
   surface, padded. The game-tile img rule above keeps cover for actual game
   thumbnails; these selectors are studio-scoped + more specific. */
.modern-game-tile-art.modern-studio-art {
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
}
.modern-game-tile-art.modern-studio-art > img.modern-studio-logo {
  box-sizing: border-box;
  padding: 12%;
  object-fit: contain;
}
.modern-game-tile-placeholder,
/* `.modern-game-tile-art-fallback` — runtime <span> swapped in by
   TenantImage on image 404 (#1838). Shares the placeholder's surface +
   centering; overrides font-size below for the long-name path. */
.modern-game-tile-art-fallback {
  width: 100%;
  height: 100%;
  background: color-mix(in oklab, var(--accent) 30%, var(--bg) 70%);
  color: var(--accent-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}
.modern-game-tile-art-fallback {
  font-size: 12px;
  padding: 10px;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
}
.modern-game-tile-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: auto;
  height: 18px;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.4));
}
.modern-game-tile-name {
  display: block;
  padding: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: capitalize;
  color: var(--fg);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Track B (#2560): clear the fixed NavBottom so a page's footer isn't
   hidden behind it. The bar is 101px but the elevated centre "Home" button
   lifts ~28px above it (`.nav-bottom-icon-center` margin-top:-28px → ~130px
   reach), and notched devices add a home-indicator inset — so 110px left the
   footer's centred payment row under the button. Clear the full reach + safe
   area. Mobile sheet only — desktop has no fixed NavBottom. */
.content { padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }

/* ─── Bottom nav (gradient bar with notch + elevated home) ───────────── */

.nav-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: 101px;
  pointer-events: none; /* tabs re-enable pointer events */
}
.nav-bottom-bg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  filter: drop-shadow(0 -4px 16px rgba(3, 131, 249, 0.35));
}
.nav-bottom-bg img {
  display: block;
  width: 100%;
  height: 100%;
}
.nav-bottom-tabs {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  height: 101px;
  padding: 0 8px 8px;
  gap: 8px;
  pointer-events: auto;
}
.nav-bottom-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 8px;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  text-transform: capitalize;
  min-width: 0;
}
.nav-bottom-tab[href]:hover { color: #ffffff; }
.nav-bottom-tab[aria-current='page'] {
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.nav-bottom-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
}
.nav-bottom-icon img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.nav-bottom-tab.is-center {
  /* The "Home" tab raises out of the bar via a circular highlight that
     sits inside the nav's notched cutout — see /img/modern/nav/bg.svg. */
  position: relative;
  gap: 4px;
}
.nav-bottom-icon-center {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: -28px; /* lift into the notch */
  box-shadow: inset 0 4px 4px rgba(255, 255, 255, 0.55);
  overflow: hidden;
}
.nav-bottom-icon-center img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 999px;
}
.nav-bottom-center-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--accent);
  text-transform: uppercase;
}
.nav-bottom-tab.is-center .nav-bottom-label { padding-top: 2px; }

.nav-bottom-label {
  display: block;
  width: 100%;
  /* Truncate rather than wrap so the 5-column grid stays uniform across
     locales (Thai labels are wider than English). */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Floating contact ──────────────────────────────────────────────── */

.floating-contact {
  position: fixed;
  right: 16px;
  bottom: 95px; /* sits just above the notch */
  z-index: 25;
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  filter: drop-shadow(0 4px 12px rgba(3, 131, 249, 0.4));
  transition: transform 0.12s;
}
.floating-contact:active { transform: scale(0.96); }
.floating-contact-icon { display: block; width: 64px; height: 64px; }

/* ─── Banner carousel inside the modern shell ───────────────────────── */

/* The shared `<BannerCarousel>` island uses .banner-* classes. We let
   the island's own <style> block own the layout — these overrides only
   tune the slide aspect ratio + rounding to the shared 2.5:1 carousel
   ratio and the dot indicator placement (above-the-bottom of the
   navy section). */
.home-banner .banner-carousel {
  padding: 0 8px;
  max-width: 100%;
}
.home-banner .banner-slide img {
  border-radius: 16px;
  aspect-ratio: 5 / 2;
  object-fit: cover;
  width: 100%;
}
.home-banner .banner-viewport {
  border-radius: 16px;
  overflow: hidden;
}
.home-banner .banner-dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  padding: 0;
}
.home-banner .banner-dot {
  width: 8px;
  height: 8px;
  background: rgba(255, 255, 255, 0.4);
}
.home-banner .banner-dot.is-active {
  background: #ffffff;
  transform: scale(1);
  width: 24px;
  border-radius: 4px;
}

/* --- Side drawer (modern/components/SideDrawer.astro) ---
   Slide-in menu opened by the NavTop hamburger. Backdrop covers the
   full viewport, panel slides in from the left at 291px wide (Figma
   `mb_menu`). Closed state translates the panel offscreen; backdrop
   fades to opacity 0. */
.side-drawer {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
}
.side-drawer[data-state="open"] {
  pointer-events: auto;
}
.side-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.side-drawer[data-state="open"] .side-drawer-backdrop {
  opacity: 1;
}
.side-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(291px, 80vw);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateX(-100%);
  transition: transform 0.24s ease;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.side-drawer[data-state="open"] .side-drawer-panel {
  transform: translateX(0);
}

.side-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  gap: 12px;
}
.side-drawer-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--fg);
}
.side-drawer-brand img {
  display: block;
  height: 22px;
  width: auto;
}
.side-drawer-brand-text {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
}
.side-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

/* Auth pills row — anon only (global toggle below). */
.side-drawer-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px 16px 16px;
}
.side-drawer-pill {
  height: 44px;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  font-family: inherit;
}
.side-drawer-pill-outline {
  background: var(--surface-2);
  color: var(--fg);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.side-drawer-pill-fill {
  background: var(--accent-gradient);
  color: var(--accent-fg);
}

/* Nav rows */
.side-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 0 16px;
}
.side-drawer-row {
  display: grid;
  grid-template-columns: 36px 1fr 16px;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  text-decoration: none;
  color: var(--fg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.side-drawer-nav .side-drawer-row:last-of-type {
  border-bottom: none;
}
.side-drawer-row-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-gradient);
}
.side-drawer-row-icon img,
.side-drawer-row-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
}
/* Per-row circle gradients to match the Figma palette. */
.side-drawer-row[data-row="home"]      .side-drawer-row-icon { background: linear-gradient(180deg, #4bccff 0%, #2566ff 100%); }
.side-drawer-row[data-row="promotions"] .side-drawer-row-icon { background: linear-gradient(180deg, #ff7ad1 0%, #d3357a 100%); }
.side-drawer-row[data-row="tournament"] .side-drawer-row-icon { background: linear-gradient(180deg, #ffd25a 0%, #f08d1c 100%); }
.side-drawer-row[data-row="reward"]    .side-drawer-row-icon { background: linear-gradient(180deg, #c47bff 0%, #6f3fd1 100%); }
.side-drawer-row[data-row="affiliate"] .side-drawer-row-icon { background: linear-gradient(180deg, #54e1c8 0%, #1f9b8a 100%); }
.side-drawer-row-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
}
.side-drawer-row-chevron {
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Footer (theme + language) */
.side-drawer-footer {
  margin-top: auto;
  padding: 8px 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.side-drawer-row-toggle {
  /* Wider trailing column so the theme switch (44px) doesn't overflow
     the panel; the nav rows' 16px chevron column is too narrow here. */
  grid-template-columns: 36px 1fr auto;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  list-style: none;
}
.side-drawer-row-toggle::-webkit-details-marker { display: none; }
.side-drawer-row-icon-lang {
  background: transparent;
  font-size: 22px;
  line-height: 1;
}
.side-drawer-row-chevron-down {
  transition: transform 0.2s ease;
}
.side-drawer-lang[open] .side-drawer-row-chevron-down {
  transform: rotate(180deg);
}
.side-drawer-lang-list {
  list-style: none;
  margin: 0;
  padding: 8px 0 0;
}
.side-drawer-lang-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  text-decoration: none;
  color: var(--fg);
  font-size: 14px;
  border-radius: 8px;
}
.side-drawer-lang-item.is-current {
  background: var(--surface-2);
  font-weight: 600;
}
.side-drawer-lang-item-flag {
  font-size: 20px;
  line-height: 1;
}

/* When the drawer is open lock background scroll. */
body[data-drawer-active="true"] {
  overflow: hidden;
}

/* --- Category page (modern/sections/category.astro) ---
   Provider selection grid. Lives in the right column of `.home-body`.
   2-column tile grid; each tile = provider logo + horizontal strip of
   sample game thumbs. Tapping a tile navigates to
   `/games/<type>/<provider>` (the games grid). */
.category-body {
  min-width: 0;
}
.category-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 12px;
}
.category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}
.category-title-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}
.category-count {
  margin-left: 4px;
  color: var(--fg-dim);
  font-weight: 400;
  font-size: 13px;
}
.category-provider-name {
  margin-left: 6px;
  color: var(--fg-dim);
  font-weight: 500;
  font-size: 13px;
}
.category-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.category-sort-tab {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg-dim);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
}
.category-sort-tab.is-active {
  color: var(--fg);
  background: var(--accent-gradient);
}

/* Provider tile grid — 2-col grid; each tile is a single composite
   image (provider hero art + logo baked in by the designer) per Figma
   `mb_home_slot` (5479:83564), with a small provider name caption
   underneath the tile. Composite assets live under
   `public/_demo/modern/providers/{code}.webp` (see `modernProviderLogo`
   in category.astro). */
.provider-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.provider-tile {
  display: flex;
}
.provider-tile-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--fg);
}
.provider-tile-art {
  /* border-box so the 4:5 box is the BORDER box — keeps the img and the
     padded/bordered fallback below the exact same size (no global box-sizing
     reset exists; default content-box would push padding/border outside the
     aspect-ratio box and make the fallback larger). */
  box-sizing: border-box;
  display: block;
  width: 100%;
  /* Portrait 4:5 box for the studio logo (NavStudio.image_url — one canonical
     icon per studio, migration 0061) — matches the classic `.studio-tile`
     shape. contain + padding so heterogeneous brand logos (wide wordmarks AND
     square badges) are never cropped; the --surface-2 bg fills the padding.
     The fallback placeholder below MUST keep the same 4:5 ratio so filled and
     empty studio tiles render the same size. (Game thumbnails keep
     object-fit:cover — logos are different.) */
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  padding: 12%;
  object-fit: contain;
  background: var(--surface-2);
}
.provider-tile-art-fallback {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  background: var(--surface-2);
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg);
}
.provider-tile-caption {
  font-size: 12px;
  font-weight: 400;
  color: var(--fg);
  text-transform: capitalize;
  text-align: left;
  padding-left: 2px;
}

/* ─── Promotions page (mb_promotion 5578:761129) ──────────────────────── */
.promo-page { padding: 8px 8px 24px; }
.promo-page-head {
  display: flex;
  align-items: center;
  gap: 8px;
  /* No fixed height (it floated the title in a tall empty band under the
     topbar); match the tournament sub-page header's top rhythm. */
  padding: 12px 0 16px;
}
.promo-page-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--fg);
  background: transparent;
  text-decoration: none;
}
.promo-page-back:hover { background: rgba(255, 255, 255, 0.06); }
.promo-page-title {
  flex: 1;
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: var(--fg);
}
.promo-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.promo-card-wrap { display: flex; }
.promo-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 8px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(
    180deg,
    rgba(3, 131, 249, 0) 20.5%,
    rgba(11, 92, 175, 0.13) 55.5%,
    #18192e 100%
  );
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}
.promo-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.promo-card-img img,
/* Runtime <span> for TenantImage 404 (#1869) — see modern-desktop.css
   for rationale; this is the mobile-shell mirror. Tighter padding +
   font for the narrower mobile card. */
.promo-card-img-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.promo-card-img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklab, var(--accent) 22%, var(--bg) 78%);
  border: 1px solid color-mix(in oklab, var(--accent) 50%, transparent);
  color: var(--fg-muted, var(--fg));
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 12px;
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
  box-sizing: border-box;
}
.promo-card-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--fg);
  text-align: center;
  width: 100%;
}
.promo-card-cta {
  position: relative;
  appearance: none;
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 10px 18px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--accent-fg);
  background: var(--accent-gradient);
  cursor: pointer;
  box-shadow: var(--panel-cta-shadow);
  width: 100%;
  white-space: nowrap;
}
.promo-card-cta:hover { filter: brightness(1.05); }
.promo-card-cta:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.promo-empty {
  opacity: 0.7;
  text-align: center;
  margin: 24px 0;
}

/* ─── Promotion detail modal (mb_promotion_deteil 5612:767587) ────────── */
.promo-modal {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--fg);
  max-width: min(342px, calc(100vw - 32px));
  width: 100%;
  max-height: 90vh;
  overflow: hidden;
}
.promo-modal::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.promo-modal:not([open]) { display: none; }
.promo-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--panel-bg);
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5));
  padding: 16px 24px 32px;
  max-height: 90vh;
  overflow-y: auto;
}
.promo-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 120px;
  border: 1px solid rgba(238, 240, 244, 0.04);
  background: rgba(238, 240, 244, 0.06);
  color: var(--fg);
  cursor: pointer;
  padding: 0;
}
.promo-modal-close:hover { background: rgba(238, 240, 244, 0.12); }
.promo-modal-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.promo-modal-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-top: 32px;
}
.promo-modal-image {
  width: 100%;
  max-width: 268px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.promo-modal-image img,
/* Runtime <span> for TenantImage 404 in the dialog template (#1869);
   mobile-shell mirror of modern-desktop's rule. */
.promo-modal-image-fallback {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.promo-modal-image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklab, var(--accent) 22%, var(--bg) 78%);
  border: 1px solid color-mix(in oklab, var(--accent) 50%, transparent);
  color: var(--fg-muted, var(--fg));
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 12px;
  line-height: 1.3;
  word-break: break-word;
  hyphens: auto;
  box-sizing: border-box;
}
.promo-modal-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--fg);
  width: 100%;
  text-align: left;
}
.promo-modal-body {
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--fg);
  width: 100%;
}
.promo-modal-body p {
  margin: 0 0 8px;
  color: var(--accent);
  font-weight: 500;
}
.promo-modal-body ul {
  margin: 0;
  padding-left: 21px;
}
.promo-modal-body li { margin-bottom: 4px; }

/* ─── Tournament module ────────────────────────────────────────────── */
/* Per Figma section `🟡 mobile_tournament` (5697:649449). All four
   sub-screens (hub / wheel / rewards / missions) share the same shell
   chrome — coin-balance strip → optional back-arrow subheader → page
   body — so the layout primitives live up top and the per-screen
   styles follow below. */

.tournament-shell {
  /* Bottom-nav is 101px fixed; leave room so the last row clears it.
     Page is full-bleed on mobile — internal sections handle their own
     horizontal padding so the hero/banner can run edge-to-edge per
     Figma. */
  padding: 0 0 120px;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
}

/* ── Shared coinbar (used by sub-pages that need the standalone
   header strip). The hub uses the global NavTop instead, so the
   coinbar block here is preserved for wheel/rewards/missions. ── */
.tournament-coinbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 4px 16px 12px;
}
.tournament-coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #0c0d22;
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.tournament-coin-icon { display: inline-flex; align-items: center; justify-content: center; }
.tournament-coin-amount { line-height: 1; }
.tournament-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--accent-gradient);
  color: #fff;
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.25);
}

/* ── Subheader: back arrow + page title (centered) ── */
.tournament-subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 20px 8px 18px;
}
.tournament-back {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.tournament-back:hover { background: rgba(255, 255, 255, 0.12); }
.tournament-subtitle {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 24px;
  font-weight: 600;
  color: var(--fg);
  flex: 1;
  text-align: center;
  /* Balance the 32px back button on the left so the title is
     visually centered in the row. */
  padding-right: 40px;
  line-height: 1;
}

/* ── Hub: banner + countdown wrapped into a single panel ──
   Per Figma `card_tournament` (5627:277139) — the hero artwork sits
   atop a navy panel that also hosts the "ระยะเวลาร่วมสนุก" label
   and the 4-segment timer. Panel is 16px inset from the page on the
   sides per the design's 8px page-padding model. */
.tournament-hub-panel {
  margin: 0 8px 12px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  padding-bottom: 18px;
}
.tournament-hub-banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 374 / 149;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

/* ── Countdown row ── */
.tournament-countdown-label {
  margin: 14px 0 10px;
  font-family: 'Kanit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--fg);
  text-align: center;
  line-height: 1;
}
.tournament-countdown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 8px;
}
.tournament-countdown-box {
  flex: 1;
  max-width: 78px;
  background: linear-gradient(180deg, #1f2547 0%, #131634 100%);
  border: 1px solid rgba(75, 204, 255, 0.18);
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.tournament-countdown-num {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: #ffffff;
  line-height: 1.05;
  letter-spacing: 0.02em;
}
.tournament-countdown-unit {
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
  letter-spacing: 0.02em;
}
.tournament-countdown-sep {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: rgba(255, 255, 255, 0.85);
  padding-bottom: 22px; /* nudge above the unit baseline */
  flex-shrink: 0;
}

/* ── Hub cards: image · text · CTA ── */
.tournament-cards {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tournament-card {
  /* Diagonal blue gradient panel matching Figma stops
     (transparent → #0B5CAF·0.13 → #18192e). Adds a subtle
     1px alpha border + soft drop shadow per design tokens. */
  background:
    linear-gradient(
      90deg,
      rgba(3, 131, 249, 0) 0%,
      rgba(3, 131, 249, 0) 21.988%,
      rgba(11, 92, 175, 0.13) 56.333%,
      #18192e 100%
    );
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}
.tournament-card-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;
  text-decoration: none;
  color: var(--fg);
  /* Card is 131px tall in Figma; 115px image + 8px padding top/bottom = 131. */
  min-height: 131px;
}
.tournament-card-art {
  width: 115px;
  height: 115px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.tournament-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-self: stretch;
  padding: 4px 0;
  gap: 12px;
}
.tournament-card-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tournament-card-title {
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--fg);
  line-height: 1.2;
}
.tournament-card-subtitle {
  font-family: 'Kanit', sans-serif;
  font-weight: 400;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.3;
  /* Two-line clamp keeps card height stable across locales whose
     translations are longer than the Thai sample copy. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tournament-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  height: 40px;
  min-width: 120px;
  padding: 0 18px;
  border-radius: 8px;
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  border: 2px solid var(--panel-border);
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: var(--panel-cta-shadow);
}
.tournament-card:hover .tournament-card-cta { filter: brightness(1.05); }
.tournament-card:active .tournament-card-cta { transform: translateY(1px); }

/* ── Wheel page ─── per Figma `mb_tournment_วงล้อ` (5627:278206) ── */
.tournament-wheel-shell {
  padding: 0 8px 120px;
}

.wheel-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0 14px;
}
.wheel-stat {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-family: 'Kanit', sans-serif;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  cursor: pointer;
}
.wheel-stat-button { color: inherit; }
.wheel-stat-button:hover { background: rgba(255, 255, 255, 0.08); }
.wheel-stat-coins {
  flex: 1.4;
  justify-content: flex-start;
  padding-left: 6px;
}
.wheel-stat-icon {
  display: block;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.wheel-stat-label {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1;
}
.wheel-stat-value {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #ffffff;
  margin-left: auto;
  padding-right: 4px;
  line-height: 1;
}

.wheel-stage {
  position: relative;
  width: 100%;
  margin: 0 auto;
  padding: 4px 0 8px;
}
/* Track B (#2560): the disc is now a conic-gradient <div> the island paints
   with the real segments (was a static <img>). */
.wheel-disc {
  display: block;
  width: 100%;
  max-width: 374px;
  aspect-ratio: 1;
  margin: 0 auto;
  position: relative;
  border-radius: 50%;
  border: 6px solid #7a4d00;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), inset 0 0 0 2px rgba(255, 255, 255, 0.15);
  background: #5a3f00;
  transform: rotate(0deg);
  transform-origin: 50% 50%;
  transition: transform 4.2s cubic-bezier(0.17, 0.67, 0.21, 1);
  will-change: transform;
}
.wheel-disc-label {
  position: absolute;
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 12px;
  color: #3a2400;
  white-space: nowrap;
  pointer-events: none;
}
.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid #ff4d4d;
  z-index: 2;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.45));
}
.wheel-status { margin: 8px 0 0; text-align: center; color: var(--danger); font-size: 13px; }
.wheel-history-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.wheel-history-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
}
.wheel-history-name { font-size: 14px; color: var(--fg); }
.wheel-history-coins { font-weight: 700; color: #f6c453; font-size: 14px; }
@media (prefers-reduced-motion: reduce) {
  .wheel-disc { transition: none; }
}
.wheel-spin-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  filter: saturate(0.85);
}

.wheel-cta-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 32px 0;
}
.wheel-spin-btn {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  border: 2px solid var(--panel-border);
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--panel-cta-shadow);
}
.wheel-spin-btn:active { transform: translateY(1px); }
.wheel-note {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1;
}
.wheel-note-icon { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.wheel-details-link {
  background: none;
  border: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wheel-details-link svg { flex-shrink: 0; }

/* ── Wheel modals (details / history / prizes) ── */
.wheel-modal-root[hidden] { display: none; }
.wheel-modal-root {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.wheel-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 28, 0.7);
  backdrop-filter: blur(2px);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.wheel-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 342px;
  background: linear-gradient(180deg, #1d234a 0%, #14193d 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
  color: var(--fg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.wheel-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.wheel-modal-head-stacked { align-items: flex-start; }
.wheel-modal-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}
.wheel-modal-subtitle {
  margin: 4px 0 0;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.2;
}
.wheel-modal-close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.wheel-modal-close:hover { background: rgba(255, 255, 255, 0.18); }

/* Details modal */
.wheel-modal-section {
  margin: 0 0 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #ff6b7a;
}
.wheel-modal-list {
  margin: 0;
  padding-left: 18px;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wheel-modal-list li::marker { color: rgba(255, 255, 255, 0.45); }

/* History modal (empty state) */
.wheel-modal-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 8px 12px;
}
.wheel-modal-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wheel-modal-empty-label {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
}

/* Prizes modal */
.wheel-prize-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-family: 'Kanit', sans-serif;
}
.wheel-prize-table thead th {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  text-align: left;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.06);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.wheel-prize-table thead th:first-child { border-radius: 10px 0 0 0; width: 80px; }
.wheel-prize-table thead th:last-child { border-radius: 0 10px 0 0; }
.wheel-prize-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}
.wheel-prize-table tbody tr:last-child td { border-bottom: 0; }
.wheel-prize-icon-cell { width: 72px; text-align: center; }
.wheel-prize-icon {
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto;
}
.wheel-prize-name {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.25;
}
.wheel-prize-value {
  margin: 0;
  font-size: 12px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
}
.wheel-prize-credits {
  list-style: disc;
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wheel-prize-credits li::marker { color: rgba(255, 255, 255, 0.4); }

/* ── Rewards page ── per Figma `mb_tournment_แลกรางวัล` (5658:578754) ── */
.rewards-shell {
  padding: 0 8px 120px;
}

/* Profile + exchange card */
.rewards-profile {
  background: linear-gradient(180deg, #1d234a 0%, #14193d 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 16px 24px 20px;
  margin: 8px 0 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.rewards-profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
}
.rewards-profile-badge {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: block;
}
.rewards-profile-meta { flex: 1; min-width: 0; }
.rewards-profile-id {
  margin: 0 0 6px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.2;
}
.rewards-profile-coins {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Kanit', sans-serif;
  line-height: 1;
}
.rewards-coin-icon { width: 24px; height: 24px; display: block; flex-shrink: 0; }
.rewards-coin-amount {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: #ffffff;
  line-height: 1;
}
.rewards-coin-label {
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
  margin-left: 2px;
}

/* Expiry stats — two cells with a thin vertical divider */
.rewards-expiry {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  padding: 16px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.rewards-expiry-cell { padding: 4px 8px; text-align: center; }
.rewards-expiry-divider {
  width: 1px;
  height: 56px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 auto;
}
.rewards-expiry-label {
  margin: 0 0 6px;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
}
.rewards-expiry-value {
  margin: 0 0 6px;
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #ffffff;
  line-height: 1;
}
.rewards-expiry-meta {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.2;
}

/* Gold redeem CTA */
.rewards-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  margin-top: 16px;
  background: linear-gradient(180deg, #ffd16b 0%, #c87f00 100%);
  border: 2px solid rgba(238, 240, 244, 0.12);
  color: #1a1230;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.15),
    0 6px 14px rgba(255, 184, 28, 0.25);
}
.rewards-cta:active { transform: translateY(1px); }
.rewards-history-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  color: #4bccff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Items section */
.rewards-list { padding: 4px 0 0; }
.rewards-list-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 4px 0 12px;
}
.rewards-list-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1;
}
.rewards-list-count {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
}

/* 2-column reward grid */
.rewards-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rewards-card {
  /* Match Figma vertical gradient: transparent → 0B5CAF·0.13 → #18192e
     with stops at 20.5% / 55.5% / 100% */
  background:
    linear-gradient(
      180deg,
      rgba(3, 131, 249, 0) 0%,
      rgba(3, 131, 249, 0) 20.5%,
      rgba(11, 92, 175, 0.13) 55.5%,
      #18192e 100%
    );
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}
.rewards-card-art {
  width: 132px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 8px 4px rgba(0, 0, 0, 0.25));
}
.rewards-card-art img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.rewards-card-name {
  margin: 0;
  width: 100%;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  line-height: 1.3;
  /* Two-line clamp keeps cards a uniform height regardless of name
     length (iPhone vs short credit voucher). */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.rewards-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 40px;
  padding: 0 8px 0 18px;
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  border: 2px solid var(--panel-border);
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--panel-cta-shadow);
}
.rewards-card-cta-text {
  flex: 1;
  text-align: center;
  line-height: 1;
}
.rewards-card-cta-coin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}
.rewards-card-cta-coin img { width: 24px; height: 24px; display: block; }

/* Pagination */
.rewards-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 0 8px;
}
.rewards-pagination-tab {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.rewards-pagination-tab.is-active {
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  color: #ffffff;
  font-weight: 600;
  border-color: transparent;
}
.rewards-pagination-tab.is-ellipsis {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.45);
}

/* ── Missions ── */
.tournament-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 12px;
}
.tournament-tab {
  flex: 1;
  text-align: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}
.tournament-tab.is-active {
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(75, 204, 255, 0.3);
}

.tournament-mission-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tournament-mission {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px;
}
.tournament-mission-avatar { flex-shrink: 0; display: inline-flex; }
.tournament-mission-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tournament-mission-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.3;
}
.tournament-mission-subtitle {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}
.tournament-mission-reward {
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffd16b 0%, #c87f00 100%);
  color: #0c0d22;
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(255, 209, 107, 0.35);
}
/* Track B (#2560): real-data states + completed treatment for the missions
   list (the island toggles these; SSR ships the loading row visible). */
.tournament-mission-status {
  padding: 16px;
  text-align: center;
  color: var(--fg);
  opacity: 0.7;
  font-size: 14px;
}
.tournament-mission-status-error { color: var(--danger); opacity: 1; }
.tournament-mission-empty-title { margin: 0 0 4px; font-weight: 700; opacity: 1; }
.tournament-mission.is-done { opacity: 0.6; }
.tournament-mission.is-done .tournament-mission-title { text-decoration: line-through; }

/* --- Studio-games page (modern/sections/studio-games.astro) ---
   Heading row (back arrow + breadcrumb + game count) + search input +
   filter dropdown button. Per Figma `mb_home_slot` (5490:472064). */
.provider-games-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px 0 12px;
  font-size: 14px;
  font-weight: 500;
}
.provider-games-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
  flex-shrink: 0;
}
.provider-games-back:hover { background: rgba(255, 255, 255, 0.06); }
.provider-games-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}
.provider-games-category { font-weight: 700; color: var(--fg); }
.provider-games-sep { color: var(--fg-dim); }
.provider-games-provider { color: var(--fg); font-weight: 500; }
.provider-games-count {
  color: var(--fg-dim);
  font-weight: 400;
  font-size: 13px;
  margin-left: auto;
}

.provider-games-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
}
.provider-games-search {
  flex: 1;
  /* Let the field shrink below the <input>'s intrinsic ~170px min-content
     width (flex default is min-width:auto). On the studio-games page the type
     rail steals ~104px, so without this the fixed-width Filter button is pushed
     off the right edge — clipped and unclickable on narrow viewports. */
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 0 10px 0 36px;
  min-height: 40px;
}
.provider-games-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fg-dim);
  display: inline-flex;
}
.provider-games-search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  padding: 8px 0;
  /* Hide the default WebKit search clear button — chrome looks
     inconsistent across browsers; if we add a clear button later
     it'll match the rest of the chrome. */
}
.provider-games-search-input::placeholder { color: var(--fg-dim); }
.provider-games-search-input::-webkit-search-cancel-button { display: none; }

.provider-games-filter { position: relative; flex-shrink: 0; }
.provider-games-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--accent-gradient);
  color: var(--accent-fg);
  border: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.provider-games-filter-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 6px 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10;
  min-width: 160px;
}
.provider-games-filter-menu ul { list-style: none; margin: 0; padding: 0; }
.provider-games-filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fg);
}
.provider-games-filter-option:hover { background: rgba(255, 255, 255, 0.04); }
.provider-games-filter-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.provider-games-empty-filtered {
  margin: 24px 12px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 14px;
}

/* --- NavTop authed branch (post-login) ---
   Anon: Register + Sign In pills (already styled above).
   Authed: balance chip on the right + circular avatar w/ notif badge.
   Auth toggle is global — `body[data-auth]` set by the inline script
   in modern/layout.astro; everything with `data-auth-only="anon"` or
   `data-auth-only="authed"` is hidden when the body's state mismatches. */
body[data-auth="authed"] [data-auth-only="anon"] { display: none !important; }
body[data-auth="anon"] [data-auth-only="authed"] { display: none !important; }

.nav-top-actions-authed {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.nav-top-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border-radius: 40px;
  /* Cyan-bordered pill per Figma `mb_home_after login` (5831:285536). */
  background: var(--surface);
  border: 1px solid #4bccff;
  box-shadow: inset 0 4px 4px rgba(255, 255, 255, 0.14);
  color: var(--fg);
  font-size: 14px;
  font-weight: 400;
  font-family: 'Kanit', sans-serif;
}
.nav-top-balance-coin {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  object-fit: contain;
}
.nav-top-balance-amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
  line-height: 1;
}
.nav-top-balance-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border: 0;
  background: transparent;
  color: var(--fg);
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-top-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-top-avatar-medal {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* === Affiliate (อินไวต์เพื่อนรับทรัพย์) — Figma 5821:640870 ===
   All affiliate-specific selectors are prefixed `.aff-`. Both the mobile
   and desktop shells render the same markup (see modern/sections/affiliate.astro);
   only one is visible per the media gates above. Modals are document-level
   <dialog> singletons opened by data-action delegation. */
.aff-page {
  padding: 0 8px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aff-pagehead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 8px;
}
.aff-back {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--fg);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.aff-back:hover { background: rgba(255,255,255,0.06); }
.aff-pagetitle {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--fg);
  flex: 1;
  text-align: center;
  padding-right: 32px;
}

/* Tab strip (Figma `Frame 633691`) — 4 equal-weight tabs, active one
   gets the cyan→purple gradient (`var(--accent-gradient)`). */
.aff-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 12px;
}
.aff-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--fg);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 400;
  font-family: inherit;
  min-width: 0;
}
.aff-tab.is-active {
  background: var(--accent-gradient);
  box-shadow: 0 4px 8px rgba(72, 69, 225, 0.18);
}
.aff-tab-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aff-tab-icon img { width: 100%; height: 100%; object-fit: contain; }
.aff-tab-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.aff-pane { display: flex; flex-direction: column; gap: 16px; }
.aff-pane[hidden] { display: none; }

/* Shared card — gradient-edged "glass" panel used by overview + tables */
.aff-card {
  position: relative;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background:
    linear-gradient(180deg, rgba(3, 131, 249, 0) 0%, rgba(11, 92, 175, 0.13) 55.5%, #18192e 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.aff-card-title { margin: 0; font-size: 24px; font-weight: 500; text-align: center; color: var(--fg); }
.aff-card-subtitle { margin: 0; font-size: 20px; font-weight: 500; text-align: center; color: var(--fg); }
.aff-section { display: flex; flex-direction: column; gap: 16px; padding: 16px 8px; }
.aff-section-head { text-align: center; }
.aff-section-title { margin: 0; font-size: 20px; font-weight: 500; color: var(--fg); }
.aff-section-sub { margin: 4px 0 0; font-size: 14px; color: var(--fg-dim); }

/* Income card */
.aff-card-income { gap: 16px; align-items: center; }
.aff-income-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--fg);
}
.aff-coin {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffcf70 0%, #fdbb05 100%);
  color: #4a2d00;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.4);
}
.aff-income-amount {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
}
.aff-income-amount strong {
  font-size: 24px;
  font-weight: 500;
  color: var(--fg);
}
.aff-refresh {
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--fg);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.aff-refresh:hover { background: rgba(255,255,255,0.06); }
.aff-refresh.is-spinning svg { animation: aff-spin 0.6s linear; }
@keyframes aff-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
/* Track B (#2560): reduced-motion — no spinning refresh glyph. */
@media (prefers-reduced-motion: reduce) {
  .aff-refresh.is-spinning svg { animation: none; }
}

/* Buttons */
.aff-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 2px solid var(--panel-border);
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(255,255,255,0.1);
  color: var(--fg);
}
.aff-btn-primary {
  background: linear-gradient(180deg, #ffcf70 0%, #fdbb05 100%);
  color: #fff;
  box-shadow: 0 8px 15px rgba(255, 203, 89, 0.25), inset 0 2px 8px rgba(255,255,255,0.1);
}
.aff-btn-secondary {
  background: var(--surface);
  color: var(--fg);
  border-color: var(--surface-3);
}
.aff-btn-ghost {
  background: transparent;
  border-color: var(--surface-3);
  color: var(--fg);
}
.aff-card-income .aff-btn { width: 100%; }
.aff-card-income .aff-share { width: 100%; display: flex; flex-direction: column; gap: 16px; }
.aff-share-head { display: flex; flex-direction: column; gap: 2px; }
.aff-share-title { margin: 0; font-size: 16px; font-weight: 500; color: var(--fg); }
.aff-share-sub { margin: 0; font-size: 12px; color: var(--fg-dim); }

/* Input group (share link + copy CTA) */
.aff-input-group {
  display: flex;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
}
.aff-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 17px;
  border-radius: 12px 0 0 12px;
  border: 1px solid var(--surface-3);
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  font-family: inherit;
}
.aff-input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.aff-input-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 48px;
  padding: 0 14px;
  border: 0;
  background: var(--accent-gradient);
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-radius: 0 12px 12px 0;
}

/* Social row */
.aff-socials {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.aff-social {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.aff-social img { width: 100%; height: 100%; display: block; }

/* Stats grid */
.aff-stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.aff-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(0deg, #0c1027 0%, #222944 100%);
}
.aff-stat-icon { width: 40px; height: 40px; object-fit: contain; }
.aff-stat-label { margin: 0; font-size: 14px; color: var(--fg); }
.aff-stat-value { margin: 0; font-size: 32px; font-weight: 600; color: #0383f9; }
.aff-stat-link {
  border: 0;
  background: transparent;
  color: #0383f9;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.aff-pct-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.aff-pct {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(0deg, #0c1027 0%, #222944 100%);
  text-align: center;
}
.aff-pct-label { margin: 0; font-size: 14px; color: var(--fg); line-height: 1.2; }
.aff-pct-value { margin: 0; font-size: 16px; color: #0383f9; }
.aff-update-note { margin: 0; font-size: 12px; color: #0383f9; text-align: center; }

/* How-to list */
.aff-howto { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 16px; }
.aff-howto-item {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 16px 8px;
  border-radius: 16px;
  background: var(--bg);
}
.aff-howto-icon { flex-shrink: 0; object-fit: contain; }
.aff-howto-icon-1 { transform: rotate(-12deg); }
.aff-howto-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.aff-howto-title { margin: 0; font-size: 16px; font-weight: 500; color: var(--fg); }
.aff-howto-desc { margin: 0; font-size: 14px; color: var(--fg); line-height: 1.4; }

/* Examples list */
.aff-examples { padding: 0 8px; }
.aff-examples-title { margin: 0 0 8px; font-size: 16px; font-weight: 500; color: #0383f9; }
.aff-examples-list { margin: 0; padding-left: 24px; font-size: 16px; color: var(--fg); line-height: 1.4; }
.aff-examples-list li { margin: 0 0 4px; }

/* Reports sub-tabs */
.aff-subtabs {
  display: flex;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px;
  border: 1px solid var(--surface-3);
}
.aff-subtab {
  flex: 1;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--fg);
  font-size: 14px;
  font-family: inherit;
  border-radius: 6px;
  cursor: pointer;
}
.aff-subtab.is-active {
  background: var(--accent-gradient);
  color: #fff;
}
.aff-subpane[hidden] { display: none; }
.aff-subpane { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; }

/* Filter row */
.aff-filter { display: flex; flex-direction: column; gap: 8px; }
.aff-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--surface-3);
  border-radius: 8px;
  color: var(--fg-dim);
}
.aff-search-compact { height: 32px; padding: 0 8px; font-size: 12px; }
.aff-search input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
.aff-search input::placeholder { color: var(--fg-dim); }
.aff-filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.aff-datepicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--surface-3);
  border-radius: 8px;
  color: var(--fg);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  flex: 1;
  min-width: 120px;
  justify-content: space-between;
}
.aff-datepicker-flex { flex: 1 1 auto; gap: 12px; }
.aff-date-arrow { color: var(--fg-dim); font-size: 14px; }
.aff-chip {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--surface-3);
  color: var(--fg);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.aff-chip.aff-chip-active, .aff-chip:hover {
  background: var(--accent-gradient);
  border-color: transparent;
}
.aff-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--surface-3);
  border-radius: 8px;
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}

/* Tables */
.aff-table-card {
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--surface);
  overflow: hidden;
}
.aff-table-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  font-size: 12px;
  color: var(--fg);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.aff-table-row:last-child { border-bottom: 0; }
.aff-table-head { background: var(--surface); font-weight: 400; }
.aff-table-total { background: var(--surface); font-weight: 500; }
.aff-revenue-row { grid-template-columns: 1fr 1fr auto; }
.aff-history-row { grid-template-columns: 1.4fr 1fr auto; }
.aff-detail-row { grid-template-columns: 1fr auto; }
.aff-table-user, .aff-table-date { color: var(--fg); }
.aff-table-amount { text-align: right; font-weight: 500; }
.aff-amount-positive { color: #1ca305; }
.aff-link-btn {
  border: 0;
  background: transparent;
  color: #0383f9;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.aff-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  justify-self: end;
}
.aff-badge-success { background: rgba(28, 163, 5, 0.18); color: #51f934; }
.aff-badge-pending { background: rgba(255, 203, 89, 0.18); color: #ffcf70; }
.aff-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
}
.aff-page-btn {
  min-width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--surface-3);
  background: transparent;
  color: var(--fg);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}
.aff-page-btn.is-active {
  background: var(--accent-gradient);
  border-color: transparent;
}

/* Marketing cards */
.aff-marketing-head { display: flex; flex-direction: column; gap: 2px; padding: 0 4px; }
.aff-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.aff-card-banner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 8px 8px 16px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background:
    linear-gradient(180deg, rgba(3, 131, 249, 0) 0%, rgba(11, 92, 175, 0.13) 55.5%, #18192e 100%);
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
}
.aff-banner-img {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
.aff-banner-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.aff-banner-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #00d719;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 8px;
  box-shadow: 0 4px 4px rgba(0,215,25,0.29);
}
.aff-banner-title {
  margin: 0;
  font-size: 13px;
  color: var(--fg);
  line-height: 1.3;
  min-height: 34px;
}
.aff-card-banner .aff-btn { height: 36px; padding: 0 12px; font-size: 14px; }

/* Modal / dialog base — overlays the modern shell */
.aff-modal, .aff-popup, .aff-drawer, .aff-toast {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  max-width: 100vw;
  max-height: 100vh;
}
.aff-modal::backdrop, .aff-popup::backdrop, .aff-drawer::backdrop, .aff-toast::backdrop {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
}
.aff-modal { width: 100%; max-width: 358px; margin: auto; }
.aff-modal-card, .aff-popup-card, .aff-drawer-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 16px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  box-shadow: 0 4px 5px rgba(0,0,0,0.5);
}
.aff-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.aff-modal-head h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--fg); }
.aff-modal-head-text { display: flex; flex-direction: column; gap: 4px; }
.aff-modal-head-text h2 { font-size: 20px; }
.aff-modal-head-text p { margin: 0; font-size: 14px; color: var(--fg-dim); }
.aff-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(238, 240, 244, 0.04);
  background: rgba(238, 240, 244, 0.06);
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.aff-modal-body { display: flex; flex-direction: column; gap: 24px; }
.aff-balance-card {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(0deg, #0c1027 0%, #222944 100%);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.aff-balance-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--fg);
}

/* Amount stepper + quick selectors */
.aff-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
}
.aff-stepper-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ffcf70;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.aff-stepper-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  text-align: center;
  font-family: inherit;
  font-size: 16px;
  outline: none;
}
.aff-quick-amounts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.aff-quick-btn {
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--surface);
  color: var(--fg);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
}
.aff-quick-btn.is-active {
  background: var(--accent-gradient);
  border-color: transparent;
}
.aff-modal-actions { display: flex; gap: 8px; }
.aff-modal-actions .aff-btn { flex: 1; }
.aff-support-pill {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-radius: 24px;
  background: #1db05a;
  color: #fff;
  border: 0;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.aff-support-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #fff;
  color: #1db05a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
}

/* Confirm popup (smaller) */
.aff-popup { width: 100%; max-width: 342px; margin: auto; }
.aff-popup-card { padding: 16px 16px 32px; gap: 16px; align-items: center; text-align: center; position: relative; }
.aff-popup-close { position: absolute; top: 16px; right: 16px; }
.aff-popup-icon { margin: 8px auto 0; }
.aff-popup-title { margin: 0; font-size: 20px; font-weight: 500; color: var(--fg); }
.aff-popup-actions { display: flex; gap: 8px; width: 100%; padding-top: 16px; }
.aff-popup-actions .aff-btn { flex: 1; }

/* Filter drawer — right-anchored vertical sheet */
.aff-drawer {
  margin: 0 0 0 auto;
  height: 100vh;
  width: 100%;
  max-width: 283px;
}
.aff-drawer-card {
  border-radius: 0;
  padding: 0;
  gap: 0;
  height: 100vh;
  background: var(--panel-bg);
  display: flex;
  flex-direction: column;
}
.aff-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
}
.aff-drawer-head h2 { margin: 0; font-size: 20px; font-weight: 500; color: var(--fg); }
.aff-drawer-body { flex: 1; overflow-y: auto; padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 24px; }
.aff-drawer-divider { width: 100%; height: 1px; background: rgba(255,255,255,0.05); border: 0; margin: 0; }
.aff-filter-group { display: flex; flex-direction: column; gap: 8px; }
.aff-filter-group-label { margin: 0; font-size: 16px; color: var(--fg); }
.aff-pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.aff-pill {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}
.aff-pill.is-active {
  background: #0383f9;
  color: var(--fg);
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
}
.aff-drawer-foot { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.05); }
.aff-drawer-foot .aff-btn { flex: 1; height: 44px; }

/* Toast — top-anchored mini alert */
.aff-toast {
  margin: 16px auto 0;
  width: calc(100% - 16px);
  max-width: 358px;
}
.aff-toast-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 16px;
  color: #fff;
  box-shadow: 0 4px 2px rgba(0,0,0,0.25);
}
.aff-toast-card span { flex: 1; }
.aff-toast-success { background: #1ca305; border: 1px solid #51f934; }
.aff-toast .aff-modal-close { background: transparent; border-color: transparent; color: #fff; }

/* ── Wheel modal: prize-won (modal_รางวัลที่ได้รับ 5637:473946) ── */
.wheel-modal-prize-won {
  text-align: center;
  padding: 32px 24px 28px;
  /* Slightly wider than the standard modal — Figma shows 342×222 with
     more horizontal breathing room around the centered coin. */
  max-width: 320px;
}
.wheel-modal-close-floating {
  position: absolute;
  top: 12px;
  right: 12px;
}
.wheel-prize-won-coin {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  filter: drop-shadow(0 6px 16px rgba(255, 184, 28, 0.35));
}
.wheel-prize-won-body {
  margin: 0 0 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.3;
}
.wheel-prize-won-reward {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: #4bccff;
  line-height: 1.2;
}

/* ── Rewards-page modals ── per Figma popup_ยืนยัน (5691:596347),
   modal_ถอนเหรียญ (5691:602599), and insufficient-coins
   (5691:598288). Shared overlay + frame; per-modal contents follow. */
.rewards-modal-root[hidden] { display: none; }
.rewards-modal-root {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rewards-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 28, 0.7);
  backdrop-filter: blur(2px);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.rewards-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 28px 24px;
  color: var(--fg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.rewards-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.rewards-modal-close:hover { background: rgba(255, 255, 255, 0.18); }

/* Confirm + insufficient share the icon + title + body + 2-button row */
.rewards-modal-confirm,
.rewards-modal-insufficient {
  text-align: center;
}
.rewards-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.rewards-modal-title {
  margin: 0 0 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.25;
}
.rewards-modal-body {
  margin: 0 0 20px;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}
.rewards-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.rewards-modal-btn {
  height: 42px;
  border-radius: 8px;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
}
.rewards-modal-btn-cancel {
  background: transparent;
  border: 1px solid var(--secondary-2);
  color: #ffffff;
}
.rewards-modal-btn-cancel:hover { background: rgba(255, 255, 255, 0.06); }
.rewards-modal-btn-confirm {
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  border: 2px solid var(--panel-border);
  color: #ffffff;
  box-shadow: var(--panel-cta-shadow);
}

/* Withdraw modal — bigger, full-form layout */
.rewards-modal-root-withdraw .rewards-modal-withdraw {
  max-width: 342px;
  padding: 20px 20px 24px;
  text-align: left;
}
.rewards-modal-withdraw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.rewards-modal-withdraw-head .rewards-modal-close {
  position: static;
}
.rewards-modal-withdraw-head .rewards-modal-title {
  margin: 0;
  text-align: left;
}

.rewards-withdraw-balance {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 0 16px;
}
.rewards-withdraw-balance-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
.rewards-withdraw-balance-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.rewards-withdraw-balance-value {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: #ffffff;
  line-height: 1;
}
.rewards-withdraw-refresh {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.rewards-withdraw-refresh:hover { background: rgba(255, 255, 255, 0.18); }

.rewards-withdraw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}
.rewards-withdraw-field-label {
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1;
}
.rewards-withdraw-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 8px 8px 8px 14px;
  height: 48px;
}
.rewards-withdraw-input-el {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 15px;
  color: #ffffff;
  min-width: 0;
}
.rewards-withdraw-input-el::placeholder { color: rgba(255, 255, 255, 0.35); }
.rewards-withdraw-input-readonly { padding-right: 8px; }
.rewards-withdraw-output {
  flex: 1;
  font-family: 'Kanit', sans-serif;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.55);
}
.rewards-withdraw-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(180deg, #ffd16b 0%, #c87f00 100%);
  color: #1a1230;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  flex-shrink: 0;
}
.rewards-withdraw-tag-credit {
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  color: #ffffff;
}
.rewards-withdraw-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 6px 0;
}
.rewards-withdraw-rate {
  margin: 8px 0 0;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}
.rewards-withdraw-submit {
  margin-top: 16px;
  width: 100%;
  height: 48px;
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  border: 2px solid var(--panel-border);
  border-radius: 12px;
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.10),
    0 8px 20px rgba(3, 131, 249, 0.3);
}

/* --- Home wallet shortcuts (authed-only) — Figma `mb_home_after login`
   (5831:285445): two CTAs below the banner, green deposit + amber
   withdraw. Re-added after a concurrent edit dropped them. */
.home-wallet-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px 16px 20px;
}
.home-wallet-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Kanit', sans-serif;
  text-decoration: none;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  padding: 0;
  cursor: pointer;
}
.home-wallet-tab-deposit {
  background: linear-gradient(180deg, #2ed975 0%, #19a356 100%);
}
.home-wallet-tab-withdraw {
  background: linear-gradient(180deg, #ffb43d 0%, #e2861a 100%);
}
.home-wallet-tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Home deposit/withdrawal info strip + auth CTAs (ModernStatsBand) — full
   parity with the classic StatsBar. Info card grows; the dual-shape auth CTAs
   share the row (and wrap above the card on phones, matching classic). */
.home-statsband {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin: 4px 16px 16px;
}
.home-statsband-info {
  flex: 1 1 100%;
  order: 1; /* CTAs take row 1; the info card drops to row 2 (classic parity) */
  display: flex;
  align-items: stretch;
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.home-statsband-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 6px;
  text-align: center;
}
.home-statsband-label {
  font-family: 'Kanit', sans-serif;
  font-size: 11px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.home-statsband-value {
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.home-statsband-sep {
  flex: 0 0 1px;
  align-self: stretch;
  background: var(--border);
  margin: 4px 0;
}
.home-statsband-cta {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 12px;
  font-family: 'Kanit', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--panel-border);
}
.home-statsband-cta-primary {
  background: var(--accent-gradient);
  color: var(--accent-fg);
  border-color: transparent;
}
.home-statsband-cta-ghost {
  background: transparent;
  color: var(--fg);
  border-color: var(--accent);
}
.home-section-recent .home-section-title { font-weight: 600; }

/* --- Profile drawer (modern/components/ProfileDrawer.astro) ---
   Right-anchored slide-in opened by the NavTop avatar (medal). Mirrors
   Figma `mb_home_profile` (5891:686557). Same animation envelope as the
   left-anchored SideDrawer, just translated from the +X axis and with a
   darker scrim per the design. Hidden entirely when not authenticated
   so the trigger can never reveal an empty panel. */
.profile-drawer {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}
.profile-drawer[data-auth="anon"] {
  display: none;
}
.profile-drawer[data-state="open"] {
  pointer-events: auto;
}
.profile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.22s ease;
}
.profile-drawer[data-state="open"] .profile-drawer-backdrop {
  opacity: 1;
}
.profile-drawer-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: min(283px, 80vw);
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.profile-drawer[data-state="open"] .profile-drawer-panel {
  transform: translateX(0);
}

.profile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 12px 16px;
  flex-shrink: 0;
}
.profile-drawer-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(238, 240, 244, 0.06);
  border: 1px solid rgba(238, 240, 244, 0.04);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.profile-drawer-body {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 16px 24px;
}

/* User card — bronze medal + rank + balances. The card has a soft
   blue → ink gradient sourced from Figma 5403:163298. */
.profile-drawer-card {
  position: relative;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: linear-gradient(104deg, #002a51 5%, #181a2f 117%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.profile-drawer-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.profile-drawer-card-medal {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
}
.profile-drawer-card-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.profile-drawer-card-username {
  margin: 0;
  font-size: 14px;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.profile-drawer-card-username-label {
  font-weight: 400;
  color: var(--fg);
}
.profile-drawer-card-username-value {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.profile-drawer-rank-tag {
  align-self: flex-start;
  font-size: 10px;
  line-height: 1;
  text-transform: capitalize;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 16px;
  border: 1px solid #c96832;
  background: linear-gradient(178deg, #9f491b 12%, #ff9961 48%, #9f491b 96%);
}
.profile-drawer-balances {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.profile-drawer-balance-row {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #06274a;
  border: 1px solid var(--panel-border);
  border-radius: 40px;
  padding: 4px 8px 4px 4px;
  color: var(--fg);
  font-size: 14px;
  font-family: 'Kanit', sans-serif;
}
.profile-drawer-balance-coin {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.profile-drawer-balance-coin-3x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffd25a 0%, #f08d1c 100%);
  color: #18192e;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}
.profile-drawer-balance-amount {
  flex: 1 0 0;
  min-width: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.profile-drawer-balance-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border: 0;
  background: transparent;
  color: var(--fg);
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.profile-drawer-balance-unit {
  font-size: 10px;
  color: var(--fg);
  text-align: right;
  text-transform: capitalize;
  flex-shrink: 0;
  padding-right: 2px;
}

/* Wallet CTAs — same gradient palette as `.home-wallet-tab`. */
.profile-drawer-wallet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.profile-drawer-wallet-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Kanit', sans-serif;
  text-decoration: none;
  color: #ffffff;
  border: 2px solid var(--panel-border);
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.1);
}
.profile-drawer-wallet-btn-deposit {
  background: linear-gradient(180deg, #80dbcb 0%, #04c18b 100%);
  box-shadow: 0 8px 15px rgba(4, 193, 139, 0.25), inset 0 2px 8px rgba(255, 255, 255, 0.1);
}
.profile-drawer-wallet-btn-withdraw {
  background: linear-gradient(180deg, #ffcf70 0%, #fdbb05 100%);
  box-shadow: 0 8px 15px rgba(255, 203, 89, 0.25), inset 0 2px 8px rgba(255, 255, 255, 0.1);
}
.profile-drawer-wallet-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.profile-drawer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}

.profile-drawer-nav {
  display: flex;
  flex-direction: column;
}
.profile-drawer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  text-decoration: none;
  color: var(--fg);
}
.profile-drawer-row-icon {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}
.profile-drawer-row-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 400;
  color: var(--fg);
}
.profile-drawer-row-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  min-width: 16px;
  padding: 0 8px;
  border-radius: 8px;
  background: #ff4d4f;
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  font-family: 'Kanit', sans-serif;
  flex-shrink: 0;
}

/* Logout — outlined pill aligned to the bottom of the drawer body. */
.profile-drawer-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 40px;
  border-radius: 8px;
  background: #18192e;
  border: 1px solid var(--panel-border);
  color: var(--fg);
  font-size: 16px;
  font-weight: 500;
  font-family: 'Kanit', sans-serif;
  cursor: pointer;
  padding: 0 17px;
  text-transform: capitalize;
  margin-top: auto;
}
.profile-drawer-logout-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Lock background scroll while the drawer is open. */
body[data-profile-drawer-active="true"] {
  overflow: hidden;
}

/* === Deposit modal (modern/components/DepositModal.astro) ===
   Center-anchored modal that walks the player through the deposit flow
   in four stages. Mirrors Figma `mb_ฝากเงิน` (5915:749699) → step1
   → step2 → step3. Same z-stack as the profile drawer (60-95); the
   modal sits at 100 so it can open on top of the side drawer too. */
.deposit-modal-root[hidden] { display: none; }
.deposit-modal-root *,
.deposit-modal-root *::before,
.deposit-modal-root *::after { box-sizing: border-box; }
.deposit-modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.deposit-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.deposit-modal-root[data-state="open"] .deposit-modal-overlay { opacity: 1; }

.deposit-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 358px;
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 16px 24px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.25));
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.18s ease;
  align-items: stretch;
  min-width: 0;
}
.deposit-modal-root[data-state="open"] .deposit-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.deposit-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.deposit-modal-title {
  margin: 0;
  flex: 1 0 0;
  font-family: 'Kanit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1;
}
.deposit-modal-close {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 999px;
  background: rgba(238, 240, 244, 0.06);
  border: 1px solid rgba(238, 240, 244, 0.04);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.deposit-modal-close:hover { background: rgba(238, 240, 244, 0.12); }

/* Stage panes — only the active stage is shown. */
.deposit-stage {
  display: none;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}
.deposit-modal-root[data-stage="0"] .deposit-stage[data-stage-pane="0"],
.deposit-modal-root[data-stage="1"] .deposit-stage[data-stage-pane="1"],
.deposit-modal-root[data-stage="2"] .deposit-stage[data-stage-pane="2"],
.deposit-modal-root[data-stage="3"] .deposit-stage[data-stage-pane="3"],
.deposit-modal-root[data-stage="4"] .deposit-stage[data-stage-pane="4"],
.deposit-modal-root[data-stage="5"] .deposit-stage[data-stage-pane="5"] {
  display: flex;
}
.deposit-modal-root[data-stage="0"] .deposit-banner { display: none; }
/* Hide the bottom report-issue banner on the manual success pane. */
.deposit-modal-root[data-stage="5"] .deposit-banner { display: none; }

/* Shared section + title spacing. */
.deposit-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.deposit-section-tight { gap: 8px; }
.deposit-section-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1;
}

/* Balance card (stage 0) — soft blue→ink gradient with inner glow. */
.deposit-balance-card {
  position: relative;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(0deg, #0c1027 0%, #222944 100%);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.1);
}
.deposit-balance-card-glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.deposit-balance-card-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
}
.deposit-balance-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}
.deposit-balance-card-icon img {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
}
.deposit-balance-card-label {
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  line-height: 1;
}
.deposit-balance-card-amount-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.deposit-balance-card-amount {
  font-family: 'Kanit', sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.deposit-balance-card-refresh {
  width: 16px;
  height: 16px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Method picker (stages 0 + 2). Stage 0 has 2 cards side-by-side,
   stage 2 has a single full-width card showing the chosen method. */
.deposit-method-grid {
  display: flex;
  gap: 16px;
  width: 100%;
}
.deposit-method-grid-single .deposit-method-card { flex: 1 1 0; }
.deposit-method-card {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(0deg, #0c1027 0%, #222944 100%);
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  text-transform: capitalize;
  text-align: left;
  overflow: hidden;
}
.deposit-method-card-static { cursor: default; }
.deposit-method-card:not(.deposit-method-card-static):hover {
  border-color: rgba(238, 240, 244, 0.2);
}
.deposit-method-icon {
  flex-shrink: 0;
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: transparent;
}
.deposit-method-label {
  white-space: nowrap;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "Change deposit method" link (stage 2). */
.deposit-change-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
  background: transparent;
  border: 0;
  padding: 0;
  color: #0383f9;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 2px;
  cursor: pointer;
  text-transform: capitalize;
}
.deposit-change-link-icon { color: #0383f9; }

/* Stage 1 — list of QR Payment rows. */
.deposit-qr-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.deposit-qr-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: #18192e;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  cursor: pointer;
  text-align: left;
}
.deposit-qr-row:hover { border-color: rgba(238, 240, 244, 0.22); }
.deposit-qr-row-icon {
  flex-shrink: 0;
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.deposit-qr-row-meta {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  flex: 1 1 0;
  min-width: 0;
  font-size: 14px;
  text-transform: capitalize;
  line-height: 1;
}
.deposit-qr-row-name { color: #ffffff; }
.deposit-qr-row-range {
  color: #0383f9;
  margin-top: 4px;
}

/* Stage 2 — amount input + quick presets + primary CTA. */
.deposit-amount-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.deposit-amount-limits {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  text-transform: capitalize;
  white-space: pre-wrap;
  line-height: 1;
}
.deposit-amount-input {
  display: inline-flex;
  align-items: center;
  height: 48px;
  width: 100%;
  border-radius: 12px;
  background: #18192e;
  border: 1px solid var(--panel-border);
  padding: 0 17px;
  gap: 8px;
}
.deposit-amount-step {
  background: transparent;
  border: 0;
  padding: 0;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.deposit-amount-input-field {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  height: 30px;
  padding: 0;
}
.deposit-amount-input-field::placeholder {
  color: #ffffff;
  opacity: 1;
}

.deposit-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}
.deposit-quick-btn {
  min-width: 0;
  height: 48px;
  border-radius: 8px;
  background: #18192e;
  border: 1px solid var(--panel-border);
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  padding: 0 4px;
}
.deposit-quick-btn:hover { border-color: rgba(238, 240, 244, 0.22); }

/* Primary gradient CTA — reused for "Confirm" (stage 2) and "Save image"
   (stage 3). Inner highlight + blue glow per Figma `button` effect. */
.deposit-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--panel-border);
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  text-transform: capitalize;
  cursor: pointer;
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  box-shadow: var(--panel-cta-shadow);
}
.deposit-primary-btn-with-icon { padding: 0 18px; }
.deposit-primary-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* Promotion picker (stage 2 + manual stage 4). */
.deposit-promo-section { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.deposit-promo-list { display: flex; flex-direction: column; gap: 8px; }
.deposit-promo-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #18192e;
  border: 1px solid var(--panel-border);
  cursor: pointer;
}
.deposit-promo-card:hover { border-color: rgba(238, 240, 244, 0.22); }
.deposit-promo-card input { margin-top: 3px; accent-color: #4bccff; }
.deposit-promo-card[data-state="disabled"] { opacity: 0.45; cursor: not-allowed; }
.deposit-promo-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  font-family: 'Kanit', sans-serif;
}
.deposit-promo-title { font-size: 14px; font-weight: 500; color: #ffffff; }
.deposit-promo-chip {
  align-self: flex-start;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(3, 131, 249, 0.18);
  color: #4bccff;
  font-size: 11px;
  font-weight: 600;
}
.deposit-promo-min { font-size: 12px; color: rgba(238, 240, 244, 0.55); }

/* Proof-slip upload (manual stage 4). */
.deposit-proof-section { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.deposit-proof-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px;
  border-radius: 8px;
  border: 1px dashed rgba(238, 240, 244, 0.25);
  background: #18192e;
  cursor: pointer;
}
.deposit-proof-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.deposit-proof-cta { font-family: 'Kanit', sans-serif; font-size: 14px; color: rgba(238, 240, 244, 0.8); }
.deposit-proof-status { margin: 0; font-family: 'Kanit', sans-serif; font-size: 13px; color: rgba(238, 240, 244, 0.7); }
.deposit-proof-status[hidden] { display: none; }
.deposit-proof-preview { display: flex; align-items: center; gap: 10px; }
.deposit-proof-preview-img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(238, 240, 244, 0.12);
}
.deposit-proof-preview-img[hidden] { display: none; }
.deposit-proof-preview-name { font-family: 'Kanit', sans-serif; font-size: 12px; color: rgba(238, 240, 244, 0.7); word-break: break-all; }

/* Manual deposit pending receipt (stage 5). */
.deposit-manual-success { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; width: 100%; }
.deposit-manual-success-check { line-height: 0; }
.deposit-manual-success-title { margin: 0; font-family: 'Kanit', sans-serif; font-size: 18px; font-weight: 600; color: #ffffff; }
.deposit-manual-success-body { margin: 0; font-family: 'Kanit', sans-serif; font-size: 14px; color: rgba(238, 240, 244, 0.8); }
.deposit-manual-success-list { margin: 4px 0 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.deposit-manual-success-row { display: flex; justify-content: space-between; gap: 12px; font-family: 'Kanit', sans-serif; font-size: 13px; }
.deposit-manual-success-row dt { margin: 0; color: rgba(238, 240, 244, 0.55); }
.deposit-manual-success-row dd { margin: 0; color: #eef0f4; font-weight: 500; text-align: right; word-break: break-all; }

/* Stage 3 — QR receipt panel. */
.deposit-receipt-head {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  text-transform: capitalize;
  line-height: 1.2;
}
.deposit-receipt-head-label {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
}
.deposit-receipt-head-warn {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ff4d4f;
}
.deposit-receipt-input {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: #34354b;
  border: 1px solid #34354b;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Kanit', sans-serif;
  font-size: 20px;
  font-weight: 400;
  text-transform: capitalize;
  padding: 0 17px;
}
.deposit-receipt-alert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  background: rgba(255, 77, 79, 0.2);
  border: 1px solid #ff8a8b;
  border-radius: 8px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}
.deposit-receipt-alert-icon { flex-shrink: 0; }
.deposit-receipt-alert-text {
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1;
}

.deposit-receipt-qr-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  align-items: center;
}
.deposit-receipt-qr-title {
  margin: 0;
  width: 100%;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1.1;
}
.deposit-receipt-qr-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 0 0 16px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  width: 100%;
  max-width: 276px;
}
.deposit-receipt-qr-header {
  width: 100%;
  height: 89px;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.deposit-receipt-qr-header img {
  display: block;
  width: 100%;
  height: auto;
}
.deposit-receipt-qr-txn {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: rgba(12, 13, 34, 0.5);
  text-align: center;
  text-transform: capitalize;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.deposit-receipt-qr-code {
  display: block;
  width: 180px;
  height: 180px;
}
.deposit-receipt-qr-divider {
  width: calc(100% - 32px);
  max-width: 244px;
  height: 1px;
  border-top: 1px dashed #c4c4c4;
}
.deposit-receipt-qr-one-time {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 10px;
  font-weight: 400;
  color: #ff4d4f;
  text-align: center;
  text-transform: capitalize;
  white-space: nowrap;
  line-height: 1;
}
.deposit-receipt-expiry {
  margin: 0;
  width: 100%;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1.4;
}
.deposit-receipt-expiry-label { color: #ffffff; }
.deposit-receipt-expiry-time { display: block; color: #ffffff; }
.deposit-receipt-expiry-date { color: #ffffff; }
.deposit-receipt-expiry-clock {
  color: #dcad04;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* Stage 4 — auto deposit / bank transfer. Per Figma `mb_ฝากเงิน_auto`
   (5938:771597). Bank account card with copy button + warning alert,
   then a primary CTA that opens the user's banking app. */
.deposit-auto-block {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.deposit-bank-card {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(0deg, #0c1027 0%, #222944 100%);
}
.deposit-bank-card-icon {
  flex-shrink: 0;
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  object-fit: contain;
}
.deposit-bank-card-meta {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Kanit', sans-serif;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1.2;
}
.deposit-bank-card-meta p {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 400;
}
.deposit-bank-card-number { font-size: 20px; }
.deposit-bank-card-name { font-size: 14px; }
.deposit-bank-card-bank { font-size: 14px; }
.deposit-bank-card-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  align-self: stretch;
}
.deposit-bank-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 24px;
  background: #0383f9;
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: capitalize;
  cursor: pointer;
}
.deposit-bank-copy:hover { background: #1f93fb; }
.deposit-bank-copy[data-copied="true"] { background: #1db05a; }

/* Green banner — "Report deposit/withdraw issue". Persists below stages
   1–4 but hidden on stage 0 (no banner in the method-picker frame). */
.deposit-banner {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border-radius: 24px;
  background: #1db05a;
  border: 0;
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: capitalize;
  cursor: pointer;
}
.deposit-banner img {
  width: 15px;
  height: 15px;
  display: block;
  object-fit: contain;
}

/* Lock background scroll while the deposit modal is open. */
body[data-deposit-modal-active="true"] {
  overflow: hidden;
}

/* === Modern account-announcement (modern/sections/account-announcement.astro) ===
   List of in-app announcements with date dividers, plus a detail modal,
   a gear-icon dropdown, and a confirm popup. Mirrors Figma frames
   5894:691400 (list) / 5907:493768 (detail) / 5907:494082 (dropdown) /
   5907:494214 (confirm). Selectors are prefixed `.ma-` for "modern
   account announcement"; the section sits under the layout chrome and
   owns all three overlays so the interaction state is local. */
.ma-section {
  position: relative;
  padding: 16px 8px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.ma-pagehead {
  position: relative;
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.ma-back {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(238, 240, 244, 0.06);
  border: 1px solid rgba(238, 240, 244, 0.04);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.ma-pagetitle {
  margin: 0;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1;
}
.ma-gear {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  justify-self: end;
}
.ma-gear:hover { color: #4bccff; }

/* Dropdown anchored to the gear (top-right of pagehead). */
.ma-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  width: 183px;
  z-index: 25;
  filter: drop-shadow(0 8px 7.5px rgba(3, 131, 249, 0.25));
}
.ma-dropdown[hidden] { display: none; }
.ma-dropdown-arrow {
  position: absolute;
  top: -5px;
  right: 22px;
  width: 12px;
  height: 7px;
  background: #ffffff;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.ma-dropdown-list {
  list-style: none;
  margin: 0;
  padding: 9px 1px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.1);
}
.ma-dropdown-item {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 4px 16px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #212529;
  text-align: left;
  cursor: pointer;
  text-transform: capitalize;
}
.ma-dropdown-item:hover { background: rgba(13, 110, 253, 0.08); }
.ma-dropdown-item-primary {
  background: #0d6efd;
  color: #ffffff;
}
.ma-dropdown-item-primary:hover { background: #0d6efd; opacity: 0.92; }

/* "ประกาศทั้งหมด (5)" subtitle. */
.ma-total {
  margin: 0;
  padding: 0 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
}

/* List + cards. Unread cards keep full surface opacity; read cards drop
   to 40% so the eye scans past them naturally. */
.ma-list {
  list-style: none;
  margin: 0;
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ma-card {
  display: flex;
  gap: 8px;
  padding: 16px;
  border-radius: 16px;
  background: #18192e;
}
.ma-card[data-ma-unread="false"] {
  background: rgba(24, 25, 46, 0.4);
}
.ma-card[hidden] { display: none; }
.ma-card-body {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ma-card-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1.2;
}
.ma-card-readmore {
  align-self: flex-start;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #0383f9;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  line-height: 1.2;
  text-transform: capitalize;
}
.ma-card-time {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #ffffff;
  opacity: 0.5;
  text-transform: capitalize;
  line-height: 1;
}
.ma-card-trash {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: flex-start;
  justify-content: center;
}
.ma-card-trash:hover { color: #ff4d4f; }

/* Date dividers between groups — ---- 13 December 2024 ---- */
.ma-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.ma-divider[hidden] { display: none; }
.ma-divider-line {
  flex: 1 1 0;
  min-width: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.ma-divider-label {
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  color: #ffffff;
  opacity: 0.5;
  text-transform: capitalize;
  white-space: nowrap;
}

/* Detail modal (Figma 5907:493768) — centered, fixed-width card with a
   hero image and a bullet body. */
.ma-modal-root[hidden] { display: none; }
.ma-modal-root *,
.ma-modal-root *::before,
.ma-modal-root *::after { box-sizing: border-box; }
.ma-modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.ma-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.ma-modal-root[data-state="open"] .ma-modal-overlay { opacity: 1; }
.ma-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 342px;
  max-height: calc(100vh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 32px;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5));
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.18s ease;
}
.ma-modal-root[data-state="open"] .ma-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.ma-modal-head {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 16px 16px 0;
}
.ma-modal-head-spacer { width: 32px; height: 32px; }
.ma-modal-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  text-transform: capitalize;
  line-height: 1;
}
.ma-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(238, 240, 244, 0.06);
  border: 1px solid rgba(238, 240, 244, 0.04);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
}
.ma-modal-close:hover { background: rgba(238, 240, 244, 0.12); }
.ma-modal-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  padding: 16px 24px;
}
.ma-modal-image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 294px;
  align-self: center;
  border-radius: 8px;
  object-fit: cover;
}
.ma-modal-subtitle {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #0383f9;
  line-height: 1.2;
}
.ma-modal-bullets {
  margin: 0;
  padding-left: 21px;
  list-style: disc;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Confirm popup (Figma 5907:494214) — info icon + 2-line message +
   Cancel / Confirm pair. Shares overlay backdrop with the detail modal
   but lives at a higher z-index so it can sit on top when both open. */
.ma-confirm-root[hidden] { display: none; }
.ma-confirm-root *,
.ma-confirm-root *::before,
.ma-confirm-root *::after { box-sizing: border-box; }
.ma-confirm-root {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}
.ma-confirm-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.ma-confirm-root[data-state="open"] .ma-confirm-overlay { opacity: 1; }
.ma-confirm {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 342px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: 24px;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5));
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.18s ease;
}
.ma-confirm-root[data-state="open"] .ma-confirm {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.ma-confirm-head {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  padding: 16px 16px 0;
}
.ma-confirm-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding: 0 16px 8px;
}
.ma-confirm-icon {
  display: block;
  width: 64px;
  height: 64px;
}
.ma-confirm-text {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 20px;
  font-weight: 500;
  color: #ffffff;
  text-align: center;
  text-transform: capitalize;
  white-space: pre-wrap;
  line-height: 1.3;
}
.ma-confirm-footer {
  display: flex;
  gap: 8px;
  width: 100%;
  padding: 16px 16px 32px;
}
.ma-confirm-btn {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  border-radius: 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  text-transform: capitalize;
  cursor: pointer;
  padding: 0 17px;
}
.ma-confirm-btn-cancel {
  background: transparent;
  border: 1px solid #34354b;
  box-shadow: var(--cta-shadow-outer);
}
.ma-confirm-btn-cancel:hover { background: rgba(255, 255, 255, 0.04); }
.ma-confirm-btn-ok {
  border: 2px solid var(--panel-border);
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  box-shadow: var(--panel-cta-shadow);
}

/* Lock background scroll while either overlay is open. */
body[data-ma-overlay-active="true"] {
  overflow: hidden;
}

/* === Modern profile detail (modern/sections/account-profile.astro) ===
   Page header (back arrow + centered title) over a gradient card with
   the user's rank, masked details, and bank account. Selectors are
   prefixed `.mp-` (modern profile). */
.mp-section {
  padding: 16px 8px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mp-pagehead {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.mp-back {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(238, 240, 244, 0.06);
  border: 1px solid rgba(238, 240, 244, 0.04);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.mp-pagetitle {
  margin: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 500;
  color: var(--fg);
  font-family: 'Kanit', sans-serif;
}
.mp-card {
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background:
    linear-gradient(180deg,
      rgba(3, 131, 249, 0) 20.5%,
      rgba(11, 92, 175, 0.13) 55.5%,
      #18192e 100%);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.mp-card-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.mp-card-medal {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
  flex-shrink: 0;
}
.mp-card-meta {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
}
.mp-card-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mp-card-meta-row dt {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
}
.mp-card-meta-row dd {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.mp-rank-tag {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  line-height: 1;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 16px;
  border: 1px solid #c96832;
  background: linear-gradient(178deg, #9f491b 12%, #ff9961 48%, #9f491b 96%);
  text-transform: capitalize;
}

.mp-bank-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mp-bank-heading {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--fg);
}
.mp-bank-card {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
}
.mp-bank-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 100px;
  background: #00a950;
  box-shadow: inset 0 -2px 2px rgba(0, 0, 0, 0.1), inset -2px 2px 4px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.mp-bank-icon img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}
.mp-bank-details {
  display: flex;
  flex-direction: column;
  color: var(--fg);
  min-width: 0;
}
.mp-bank-number {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.mp-bank-holder,
.mp-bank-name {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
}
.mp-help {
  margin: 0;
  text-align: center;
  font-size: 14px;
  color: var(--fg);
}
.mp-help-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* === Modern membership / rank (modern/sections/account-membership.astro) ===
   Horizontal-scroll list of rank cards anchored under a back-arrow page
   header. Each card carries a per-rank radial gradient and a medal
   pair (faded backdrop + crisp foreground). Selectors are prefixed
   `.mm-`. */
.mm-section {
  position: relative;
  padding: 16px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mm-pagehead {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
}
.mm-back {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(238, 240, 244, 0.06);
  border: 1px solid rgba(238, 240, 244, 0.04);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.mm-pagetitle {
  margin: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 500;
  color: var(--fg);
  font-family: 'Kanit', sans-serif;
}

.mm-scroller {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mm-scroller::-webkit-scrollbar { display: none; }
.mm-track {
  list-style: none;
  margin: 0;
  padding: 0 16px;
  display: flex;
  gap: 16px;
  align-items: stretch;
}
.mm-card {
  position: relative;
  flex: 0 0 calc(100% - 80px);
  max-width: 320px;
  scroll-snap-align: center;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 8.8px rgba(0, 0, 0, 0.25);
  display: flex;
}
.mm-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 3px 10px rgba(255, 255, 255, 0.2);
  pointer-events: none;
}
.mm-card-bg {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}
/* Per-rank radial gradients sourced from Figma 6489:246694. The
   ellipse-from-top look comes from a radial gradient at 50% -10% with
   a tall vertical stretch; the rank's accent fades into the page bg
   (#0c0d22) at the bottom. */
.mm-card[data-rank="bronze"]   .mm-card-bg { background: radial-gradient(ellipse 90% 100% at 50% -8%, #de9d63 0%, #aa7953 25%, #755543 50%, #5b433a 62.5%, #413132 75%, #261f2a 87.5%, #0c0d22 100%); }
.mm-card[data-rank="silver"]   .mm-card-bg { background: radial-gradient(ellipse 90% 100% at 50% -8%, #ebfbff 0%, #b3c0c8 25%, #97a2ac 37.5%, #7c8491 50%, #606675 62.5%, #444959 75%, #282b3e 87.5%, #1a1c30 93.75%, #0c0d22 100%); }
.mm-card[data-rank="gold"]     .mm-card-bg { background: radial-gradient(ellipse 90% 100% at 50% -8%, #fee280 0%, #c2ad69 25%, #a3925d 37.5%, #857851 50%, #675d45 62.5%, #49423a 75%, #2a282e 87.5%, #1b1a28 93.75%, #0c0d22 100%); }
.mm-card[data-rank="platinum"] .mm-card-bg { background: radial-gradient(ellipse 90% 100% at 50% -8%, #7edde7 0%, #62a9b6 25%, #457585 50%, #375b6c 62.5%, #294153 75%, #1a273b 87.5%, #0c0d22 100%); }
.mm-card[data-rank="diamond"]  .mm-card-bg { background: radial-gradient(ellipse 90% 100% at 50% -8%, #fa2727 0%, #be2126 25%, #831a25 50%, #651724 62.5%, #471423 75%, #2a1023 87.5%, #1b0f22 93.75%, #0c0d22 100%); }

.mm-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 8px 16px 24px;
  width: 100%;
}
.mm-card-corner {
  display: flex;
  justify-content: flex-end;
  color: rgba(255, 255, 255, 0.65);
  height: 24px;
  margin-bottom: -16px;
}
.mm-card[data-state="current"] .mm-card-corner { visibility: hidden; }
/* Cleared tiers below the player's current rank read as dimmed/done (#2435),
   distinct from the full-opacity 'locked' tiers ahead. */
.mm-card[data-state="past"] { opacity: 0.78; }

.mm-medal {
  position: relative;
  align-self: center;
  width: 148px;
  height: 148px;
}
.mm-medal-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.1;
}
.mm-medal-fg {
  position: absolute;
  top: 16.22%;
  bottom: 16.22%;
  left: 50%;
  width: auto;
  height: 67.56%;
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  object-fit: contain;
}

.mm-meta {
  display: flex;
  flex-direction: column;
}
.mm-meta-label {
  margin: 0;
  font-size: 12px;
  text-transform: capitalize;
}
.mm-meta-name {
  margin: 0;
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  margin-top: 4px;
  text-transform: capitalize;
}
.mm-card[data-rank="bronze"]   .mm-meta-label { color: rgba(255, 225, 205, 0.5); }
.mm-card[data-rank="bronze"]   .mm-meta-name  { color: #ffe1cd; }
.mm-card[data-rank="silver"]   .mm-meta-label { color: rgba(255, 255, 255, 0.5); }
.mm-card[data-rank="silver"]   .mm-meta-name  { color: #ffffff; }
.mm-card[data-rank="gold"]     .mm-meta-label { color: rgba(254, 226, 128, 0.5); }
.mm-card[data-rank="gold"]     .mm-meta-name  { color: #fee280; }
.mm-card[data-rank="platinum"] .mm-meta-label { color: rgba(126, 221, 231, 0.5); }
.mm-card[data-rank="platinum"] .mm-meta-name  { color: #7edde7; }
.mm-card[data-rank="diamond"]  .mm-meta-label { color: rgba(250, 39, 39, 0.5); }
.mm-card[data-rank="diamond"]  .mm-meta-name  { color: #fa2727; }

/* EXP-balance summary chip above the ladder (membership-rank.ts). */
.mm-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(238, 240, 244, 0.04);
  border: 1px solid rgba(238, 240, 244, 0.08);
}
.mm-summary-label { font-size: 13px; color: rgba(238, 240, 244, 0.7); }
.mm-summary-value {
  font-size: 18px;
  font-weight: 700;
  color: #4bccff;
  font-variant-numeric: tabular-nums;
}

/* Loading / error / empty state rows (island toggles `hidden`). */
.mm-loading,
.mm-state-msg {
  margin: 0;
  padding: 24px 8px;
  text-align: center;
  font-size: 14px;
  color: rgba(238, 240, 244, 0.6);
}
.mm-loading[hidden],
.mm-state-msg[hidden] { display: none; }

/* Current-tier pill (replaces the fixed-rank progress label). */
.mm-card-pill {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: #0383f9;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.mm-card-pill[hidden] { display: none; }

/* Operator deposit / turnover thresholds (replaces requirements/benefits). */
.mm-thresholds {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mm-threshold-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}
.mm-threshold-row[hidden] { display: none; }
.mm-threshold-row dt { margin: 0; color: rgba(238, 240, 244, 0.5); }
.mm-threshold-row dd {
  margin: 0;
  font-weight: 600;
  color: #eef0f4;
  font-variant-numeric: tabular-nums;
}
.mm-threshold-starter {
  margin: 0;
  font-size: 13px;
  font-style: italic;
  color: rgba(238, 240, 244, 0.5);
}
.mm-threshold-starter[hidden] { display: none; }

.mm-divider {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
}
.mm-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding-top: 12px;
}
.mm-dot {
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: rgba(238, 240, 244, 0.08);
}
.mm-dot[data-state="active"] {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--accent);
}

/* === Modern transactions (modern/sections/account-transactions.astro) ===
   Single centered card with title + close, 3-segment tab strip, zebra
   transaction list, and bottom pagination. Selectors prefixed `.mt-`.
   Active tab is driven by `?tab=` so each segment is a real link. */
.mt-section {
  padding: 16px 8px 32px;
  display: flex;
  justify-content: center;
}
.mt-card {
  width: 100%;
  max-width: 342px;
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  background: var(--panel-bg);
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.5));
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 16px 0 32px;
}
.mt-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 0 16px;
}
.mt-header-meta {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mt-title {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  color: var(--fg);
}
.mt-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--fg);
  opacity: 0.5;
}
.mt-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: rgba(238, 240, 244, 0.06);
  border: 1px solid rgba(238, 240, 244, 0.04);
  color: var(--fg);
  text-decoration: none;
  flex-shrink: 0;
}
.mt-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 16px;
}
.mt-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  height: 40px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
}
.mt-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--fg);
  text-decoration: none;
  text-transform: capitalize;
  font-family: 'Kanit', sans-serif;
}
.mt-tab[data-state="active"] {
  background: #0383f9;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}
.mt-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.mt-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px;
  border-radius: 8px;
}
.mt-row[data-row-zebra="odd"] {
  background: #18192e;
}
.mt-row-main {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.mt-row-line {
  margin: 0;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 14px;
  font-family: 'Kanit', sans-serif;
}
.mt-row-kind { color: var(--fg); }
.mt-row-amount {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}
.mt-row-amount-deposit { color: #1ca305; }
.mt-row-amount-withdraw { color: #ff4d4f; }
.mt-row-time {
  margin: 0;
  font-size: 10px;
  color: var(--fg);
  opacity: 0.5;
}
.mt-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  align-self: stretch;
  gap: 2px;
}
.mt-status {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  line-height: 1;
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 16px;
  border: 1px solid transparent;
  text-transform: capitalize;
  font-family: 'Kanit', sans-serif;
}
.mt-status-success { background: #1ca305; border-color: #27e307; }
.mt-status-failed  { background: #ff4d4f; border-color: #ff8081; }
.mt-status-pending { background: #dcad04; border-color: #fbd650; }
.mt-row-cancelled {
  font-size: 10px;
  color: var(--fg);
  opacity: 0.5;
  text-transform: capitalize;
}
.mt-pagination {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}
.mt-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #18192e;
  border: 1px solid rgba(238, 240, 244, 0.05);
  color: var(--fg);
  font-size: 14px;
  font-weight: 300;
  text-decoration: none;
  font-family: 'Kanit', sans-serif;
}
.mt-page-btn[data-state="active"] {
  background: linear-gradient(180deg, #4bccff 0%, #384cff 100%);
  border-color: transparent;
}
.mt-page-btn-arrow { border: 0; background: #18192e; }
.mt-page-btn-arrow-right { border: 1px solid var(--panel-border); }
.mt-page-btn[data-state="disabled"] { opacity: 0.4; pointer-events: none; }

/* --- Withdrawal modal (modern/components/WithdrawModal.astro) ---
   Figma `mb_ถอนเงิน` (5950:168294). Centered modal opened via
   `[data-withdraw-open]` triggers; full-screen scrim + 358px-wide card
   with the dark gradient surface that matches the profile drawer panel. */
.withdraw-modal-root[hidden] { display: none; }
.withdraw-modal-root {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.withdraw-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
}
.withdraw-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 358px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 16px 16px 24px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  color: #ffffff;
  filter: drop-shadow(0 4px 2px rgba(0, 0, 0, 0.25));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}
.withdraw-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
}
.withdraw-modal-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
  color: #ffffff;
  text-transform: capitalize;
}
.withdraw-modal-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(238, 240, 244, 0.06);
  border: 1px solid rgba(238, 240, 244, 0.04);
  border-radius: 120px;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  flex-shrink: 0;
}
.withdraw-modal-close:hover { background: rgba(238, 240, 244, 0.14); }

.withdraw-modal-body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

/* Account block — heading + card + balance row, stacked at 8px gap */
.withdraw-account {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}
.withdraw-account-heading {
  margin: 0;
  width: 100%;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  color: #ffffff;
}
.withdraw-account-card {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(0deg, #0c1027 0%, #222944 100%);
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-sizing: border-box;
}
.withdraw-account-icon {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  flex-shrink: 0;
  display: block;
}
.withdraw-account-meta {
  flex: 1 0 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-family: 'Kanit', sans-serif;
  color: #ffffff;
  text-transform: capitalize;
}
.withdraw-account-meta p { margin: 0; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.withdraw-account-number { font-size: 20px; font-weight: 400; }
.withdraw-account-name { font-size: 14px; font-weight: 400; }
.withdraw-account-bank { font-size: 14px; font-weight: 400; }
.withdraw-balance {
  margin: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  color: #ffffff;
  line-height: 1;
}
.withdraw-balance-label { white-space: nowrap; }
.withdraw-balance-value { white-space: nowrap; }
.withdraw-balance-refresh {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  flex-shrink: 0;
}
.withdraw-balance-refresh:hover { color: #ffffff; }

/* Form: amount input + quick-amount grid, stacked at 32px */
.withdraw-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: stretch;
}
.withdraw-amount-input {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 9px 17px;
  gap: 8px;
  background: var(--surface, #18192e);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  box-sizing: border-box;
}
.withdraw-amount-step {
  width: 16px;
  height: 16px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.withdraw-amount-step svg { display: block; }
.withdraw-amount-step:hover svg { opacity: 0.85; }
.withdraw-amount-field {
  flex: 1 0 0;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 0;
  font-family: 'Kanit', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: #ffffff;
  text-align: center;
  height: 30px;
  line-height: 30px;
}
.withdraw-amount-field::placeholder { color: rgba(255, 255, 255, 0.85); }
.withdraw-amount-field::-webkit-outer-spin-button,
.withdraw-amount-field::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.withdraw-amount-field[type='number'] { -moz-appearance: textfield; }

.withdraw-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.withdraw-quick-btn {
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 17px;
  background: var(--surface, #18192e);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-family: 'Kanit', sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: #ffffff;
  cursor: pointer;
}
.withdraw-quick-btn:hover { background: #1f213a; }
.withdraw-quick-btn:active { background: #2a2d4d; }

.withdraw-submit {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%);
  border: 2px solid var(--panel-border);
  border-radius: 8px;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 16px;
  color: #ffffff;
  text-transform: capitalize;
  cursor: pointer;
  box-shadow: var(--panel-cta-shadow);
}

/* Inline submit / load error (withdraw.ts) */
.withdraw-error {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  line-height: 1.35;
  color: #ff6b6b;
  text-align: center;
}
.withdraw-error[hidden] { display: none; }

/* Success pane swapped in after a 2xx withdrawal (withdraw.ts) */
.withdraw-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 4px;
  text-align: center;
}
.withdraw-success[hidden] { display: none; }
.withdraw-success-check { line-height: 0; }
.withdraw-success-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: #ffffff;
}
.withdraw-success-body {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(238, 240, 244, 0.85);
}
.withdraw-success-ref {
  margin: 0;
  display: inline-flex;
  gap: 6px;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  color: rgba(238, 240, 244, 0.6);
}
.withdraw-success-ref-value {
  color: rgba(238, 240, 244, 0.9);
  font-variant-numeric: tabular-nums;
}

/* Green LINE-style support pill below the modal frame */
.withdraw-support {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  background: #1db05a;
  border-radius: 24px;
  text-decoration: none;
  color: #ffffff;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 400;
  text-transform: capitalize;
  flex-shrink: 0;
}
.withdraw-support-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

/* ── /account/referral (modern) ─────────────────────────────────────── */
.rf-section { display: flex; flex-direction: column; gap: 16px; padding: 16px; width: 100%; box-sizing: border-box; }
.rf-pagehead { display: flex; align-items: center; gap: 12px; }
.rf-back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(238, 240, 244, 0.06); color: #eef0f4; text-decoration: none; flex-shrink: 0; }
.rf-pagetitle { margin: 0; font-family: 'Kanit', sans-serif; font-size: 18px; font-weight: 600; color: #ffffff; }
.rf-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border-radius: 12px; background: rgba(238, 240, 244, 0.04); border: 1px solid rgba(238, 240, 244, 0.08); }
.rf-card-label { margin: 4px 0 0; font-family: 'Kanit', sans-serif; font-size: 12px; color: rgba(238, 240, 244, 0.6); }
.rf-copy-row { display: flex; align-items: center; gap: 8px; }
.rf-copy-value { flex: 1 1 auto; min-width: 0; font-family: 'Kanit', sans-serif; font-size: 16px; font-weight: 600; color: #ffffff; letter-spacing: 0.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-copy-value-link { font-size: 13px; font-weight: 400; color: rgba(238, 240, 244, 0.8); letter-spacing: 0; }
.rf-copy-btn { flex-shrink: 0; padding: 6px 14px; border-radius: 8px; border: 1px solid rgba(3, 131, 249, 0.5); background: rgba(3, 131, 249, 0.12); color: #4bccff; font-family: 'Kanit', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; }
.rf-copy-btn[data-copied="true"] { background: #0383f9; color: #ffffff; }
.rf-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 12px; background: rgba(238, 240, 244, 0.04); border: 1px solid rgba(238, 240, 244, 0.08); }
.rf-summary[hidden] { display: none; }
.rf-card[hidden] { display: none; }
.rf-share { display: flex; flex-direction: column; gap: 8px; }
.rf-share[hidden] { display: none; }
.rf-share-label { font-family: 'Kanit', sans-serif; font-size: 12px; color: rgba(238, 240, 244, 0.6); }
.rf-share-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.rf-share-btn { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(238, 240, 244, 0.12); background: rgba(238, 240, 244, 0.04); color: #eef0f4; font-family: 'Kanit', sans-serif; font-size: 12px; font-weight: 600; text-decoration: none; }
.rf-share-btn[data-channel='whatsapp']:hover { color: #25d366; border-color: #25d366; }
.rf-share-btn[data-channel='telegram']:hover { color: #229ed9; border-color: #229ed9; }
.rf-share-btn[data-channel='twitter']:hover { color: #1da1f2; border-color: #1da1f2; }
.rf-no-code { margin: 0; padding: 14px 16px; font-family: 'Kanit', sans-serif; font-size: 13px; color: rgba(238, 240, 244, 0.7); border: 1px dashed rgba(238, 240, 244, 0.12); border-radius: 10px; text-align: center; }
.rf-no-code[hidden] { display: none; }
.rf-summary-label { font-family: 'Kanit', sans-serif; font-size: 13px; color: rgba(238, 240, 244, 0.7); }
.rf-summary-value { font-family: 'Kanit', sans-serif; font-size: 18px; font-weight: 700; color: #4bccff; font-variant-numeric: tabular-nums; }
.rf-list-heading { margin: 4px 0 0; font-family: 'Kanit', sans-serif; font-size: 14px; font-weight: 600; color: rgba(238, 240, 244, 0.85); }
.rf-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rf-list-truncated { margin: 8px 0 0; font-family: 'Kanit', sans-serif; font-size: 12px; color: rgba(238, 240, 244, 0.6); font-variant-numeric: tabular-nums; }
.rf-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 10px; background: rgba(238, 240, 244, 0.04); border: 1px solid rgba(238, 240, 244, 0.08); font-family: 'Kanit', sans-serif; }
.rf-row-name { font-size: 14px; font-weight: 500; color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rf-row-date { font-size: 12px; color: rgba(238, 240, 244, 0.55); font-variant-numeric: tabular-nums; }
.rf-row-status { padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--panel-border); color: rgba(238, 240, 244, 0.6); }
.rf-row-status[data-active="true"] { background: rgba(29, 176, 90, 0.18); color: #4ade80; }
.rf-state { margin: 0; padding: 20px 8px; text-align: center; font-family: 'Kanit', sans-serif; font-size: 14px; color: rgba(238, 240, 244, 0.6); }
.rf-state[hidden] { display: none; }

/* ── /account/loyalty-reward (modern) ───────────────────────────────── */
.lr-section { display: flex; flex-direction: column; gap: 14px; padding: 16px; width: 100%; box-sizing: border-box; }
.lr-pagehead { display: flex; align-items: center; gap: 12px; }
.lr-back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(238, 240, 244, 0.06); color: #eef0f4; text-decoration: none; flex-shrink: 0; }
.lr-pagetitle { margin: 0; font-family: 'Kanit', sans-serif; font-size: 18px; font-weight: 600; color: #ffffff; }
.lr-tier-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border-radius: 12px; background: linear-gradient(93deg, rgba(75, 204, 255, 0.14) 0%, rgba(72, 69, 225, 0.10) 100%); border: 1px solid rgba(75, 204, 255, 0.35); }
.lr-tier-meta, .lr-tier-exp { display: flex; flex-direction: column; gap: 4px; font-family: 'Kanit', sans-serif; }
.lr-tier-exp { text-align: right; }
.lr-tier-label, .lr-tier-exp-label { font-size: 12px; color: rgba(238, 240, 244, 0.6); }
.lr-tier-name { font-size: 18px; font-weight: 700; color: #ffffff; }
.lr-tier-exp-value { font-size: 18px; font-weight: 700; color: #4bccff; font-variant-numeric: tabular-nums; }
.lr-heading { margin: 6px 0 0; font-family: 'Kanit', sans-serif; font-size: 14px; font-weight: 600; color: rgba(238, 240, 244, 0.85); }
.lr-catalog { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.lr-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px; border-radius: 12px; background: rgba(238, 240, 244, 0.04); border: 1px solid rgba(238, 240, 244, 0.08); text-align: center; font-family: 'Kanit', sans-serif; }
.lr-item-img { width: 64px; height: 64px; object-fit: contain; }
.lr-item-name { font-size: 13px; font-weight: 500; color: #ffffff; }
.lr-item-cost { font-size: 12px; color: #4bccff; font-weight: 600; }
.lr-item-reward { font-size: 11px; color: rgba(238, 240, 244, 0.7); }
.lr-item-reward[hidden] { display: none; }
.lr-next-tier { margin: 8px 0 0; font-family: 'Kanit', sans-serif; font-size: 12px; color: rgba(238, 240, 244, 0.6); display: flex; gap: 6px; }
.lr-next-tier[hidden] { display: none; }
.lr-next-tier-name { color: #4bccff; font-weight: 600; }
.lr-item-redeem { width: 100%; padding: 8px; border-radius: 8px; border: 0; background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%); color: #ffffff; font-family: 'Kanit', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer; }
.lr-item-redeem:disabled { cursor: not-allowed; }
.lr-item-redeem[data-affordable="false"] { background: var(--panel-border); color: rgba(238, 240, 244, 0.5); }
.lr-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.lr-history-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; border-radius: 10px; background: rgba(238, 240, 244, 0.04); border: 1px solid rgba(238, 240, 244, 0.08); font-family: 'Kanit', sans-serif; }
.lr-history-name { font-size: 14px; font-weight: 500; color: #ffffff; }
.lr-history-cost { font-size: 12px; color: #4bccff; text-align: right; font-weight: 600; }
.lr-history-date { font-size: 12px; color: rgba(238, 240, 244, 0.55); }
.lr-history-status { font-size: 11px; font-weight: 600; text-align: right; padding: 2px 8px; border-radius: 999px; align-self: center; justify-self: end; background: var(--panel-border); color: rgba(238, 240, 244, 0.6); }
.lr-history-status[data-status="approved"] { background: rgba(29, 176, 90, 0.18); color: #4ade80; }
.lr-history-status[data-status="rejected"] { background: rgba(250, 39, 39, 0.18); color: #ff8a8b; }
.lr-state { margin: 0; padding: 20px 8px; text-align: center; font-family: 'Kanit', sans-serif; font-size: 14px; color: rgba(238, 240, 244, 0.6); }
.lr-state[hidden] { display: none; }
/* ── /account/bonus (modern) ────────────────────────────────────────── */
.bn-section { display: flex; flex-direction: column; gap: 14px; padding: 16px; width: 100%; box-sizing: border-box; }
.bn-pagehead { display: flex; align-items: center; gap: 12px; }
.bn-back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(238, 240, 244, 0.06); color: #eef0f4; text-decoration: none; flex-shrink: 0; }
.bn-pagetitle { margin: 0; font-family: 'Kanit', sans-serif; font-size: 18px; font-weight: 600; color: #ffffff; }
.bn-heading { margin: 6px 0 0; font-family: 'Kanit', sans-serif; font-size: 14px; font-weight: 600; color: rgba(238, 240, 244, 0.85); }
.bn-redeem-form { display: flex; gap: 8px; }
.bn-redeem-input { flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px; border-radius: 8px; background: #18192e; border: 1px solid var(--panel-border); color: #ffffff; font-family: 'Kanit', sans-serif; font-size: 15px; }
.bn-redeem-input:focus { outline: none; border-color: rgba(75, 204, 255, 0.6); }
.bn-redeem-submit { flex: 0 0 auto; height: 44px; padding: 0 20px; border-radius: 8px; border: 0; background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%); color: #ffffff; font-family: 'Kanit', sans-serif; font-size: 15px; font-weight: 500; cursor: pointer; }
.bn-redeem-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.bn-banner { margin: 0; padding: 10px 14px; border-radius: 8px; font-family: 'Kanit', sans-serif; font-size: 13px; font-weight: 500; }
.bn-banner[hidden] { display: none; }
.bn-banner-success { background: rgba(29, 176, 90, 0.16); color: #4ade80; border: 1px solid rgba(29, 176, 90, 0.4); }
.bn-banner-error { background: rgba(250, 39, 39, 0.16); color: #ff8a8b; border: 1px solid rgba(250, 39, 39, 0.4); }
.bn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bn-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 12px; background: rgba(238, 240, 244, 0.04); border: 1px solid rgba(238, 240, 244, 0.08); font-family: 'Kanit', sans-serif; min-width: 0; }
.bn-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bn-card-name { font-size: 14px; font-weight: 600; color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bn-card-amount { margin: 0; font-size: 15px; font-weight: 700; color: #4bccff; font-variant-numeric: tabular-nums; }
.bn-card-amount-label { font-size: 11px; font-weight: 500; color: rgba(238, 240, 244, 0.55); text-transform: uppercase; letter-spacing: 0.5px; }
.bn-status-pill { flex-shrink: 0; font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--panel-border); color: rgba(238, 240, 244, 0.6); }
.bn-status-pill[data-status="active"] { background: rgba(250, 204, 21, 0.18); color: #facc15; }
.bn-status-pill[data-status="released"] { background: rgba(29, 176, 90, 0.18); color: #4ade80; }
.bn-turnover { display: flex; flex-direction: column; gap: 5px; }
.bn-turnover-labels { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bn-turnover-label { font-size: 11px; font-weight: 500; color: rgba(238, 240, 244, 0.55); text-transform: uppercase; letter-spacing: 0.5px; }
.bn-turnover-value { font-size: 12px; color: rgba(238, 240, 244, 0.8); font-variant-numeric: tabular-nums; }
.bn-progress { height: 7px; border-radius: 999px; background: rgba(238, 240, 244, 0.1); overflow: hidden; }
.bn-progress-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #4bccff 0%, #4845e1 100%); transition: width 0.2s ease; }
.bn-state { margin: 0; padding: 20px 8px; text-align: center; font-family: 'Kanit', sans-serif; font-size: 14px; color: rgba(238, 240, 244, 0.6); }
.bn-state[hidden] { display: none; }

/* ── /account/bank (modern) ─────────────────────────────────────────── */
.bk-section { display: flex; flex-direction: column; gap: 12px; padding: 16px; width: 100%; box-sizing: border-box; }
.bk-pagehead { display: flex; align-items: center; gap: 12px; }
.bk-back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(238, 240, 244, 0.06); color: #eef0f4; text-decoration: none; flex-shrink: 0; }
.bk-pagetitle { margin: 0; font-family: 'Kanit', sans-serif; font-size: 18px; font-weight: 600; color: #ffffff; }
.bk-heading { margin: 6px 0 0; font-family: 'Kanit', sans-serif; font-size: 14px; font-weight: 600; color: rgba(238, 240, 244, 0.85); }
.bk-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bk-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px; border-radius: 12px; background: rgba(238, 240, 244, 0.04); border: 1px solid rgba(238, 240, 244, 0.08); }
.bk-row-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-family: 'Kanit', sans-serif; }
.bk-row-bank { font-size: 14px; font-weight: 600; color: #ffffff; }
.bk-row-number { font-size: 13px; color: rgba(238, 240, 244, 0.8); letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.bk-row-holder { font-size: 12px; color: rgba(238, 240, 244, 0.55); }
.bk-row-default { flex-shrink: 0; padding: 2px 10px; border-radius: 999px; background: rgba(3, 131, 249, 0.18); color: #4bccff; font-family: 'Kanit', sans-serif; font-size: 11px; font-weight: 600; }
.bk-row-default[hidden] { display: none; }
.bk-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 12px; background: rgba(238, 240, 244, 0.04); border: 1px solid rgba(238, 240, 244, 0.08); }
.bk-input { width: 100%; height: 44px; padding: 0 12px; border-radius: 8px; background: #18192e; border: 1px solid var(--panel-border); color: #ffffff; font-family: 'Kanit', sans-serif; font-size: 15px; }
.bk-input:focus { outline: none; border-color: rgba(75, 204, 255, 0.6); }
.bk-form-error { margin: 0; font-family: 'Kanit', sans-serif; font-size: 13px; color: #ff8a8b; }
.bk-form-error[hidden] { display: none; }
.bk-submit { width: 100%; height: 48px; border-radius: 8px; border: 0; background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%); color: #ffffff; font-family: 'Kanit', sans-serif; font-size: 16px; font-weight: 500; cursor: pointer; }
.bk-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.bk-state { margin: 0; padding: 20px 8px; text-align: center; font-family: 'Kanit', sans-serif; font-size: 14px; color: rgba(238, 240, 244, 0.6); }
.bk-state[hidden] { display: none; }

/* ── /account/games — history (modern) ──────────────────────────────── */
.hs-section { display: flex; flex-direction: column; gap: 12px; padding: 16px; width: 100%; box-sizing: border-box; }
.hs-pagehead { display: flex; align-items: center; gap: 12px; }
.hs-back { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; background: rgba(238, 240, 244, 0.06); color: #eef0f4; text-decoration: none; flex-shrink: 0; }
.hs-pagetitle { margin: 0; font-family: 'Kanit', sans-serif; font-size: 18px; font-weight: 600; color: #ffffff; }
.hs-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px; border-radius: 10px; background: rgba(238, 240, 244, 0.04); }
.hs-tab { padding: 8px; border: 0; border-radius: 8px; background: transparent; color: rgba(238, 240, 244, 0.6); font-family: 'Kanit', sans-serif; font-size: 14px; font-weight: 500; cursor: pointer; }
.hs-tab[data-active="true"] { background: linear-gradient(180deg, #4bccff 0%, #4845e1 100%); color: #ffffff; }
.hs-pane[hidden] { display: none; }
.hs-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.hs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 10px; background: rgba(238, 240, 244, 0.04); border: 1px solid rgba(238, 240, 244, 0.08); font-family: 'Kanit', sans-serif; }
.hs-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hs-row-title { font-size: 14px; font-weight: 500; color: #ffffff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-row-sub { font-size: 12px; color: rgba(238, 240, 244, 0.55); font-variant-numeric: tabular-nums; }
.hs-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.hs-row-amount { font-size: 12px; color: rgba(238, 240, 244, 0.7); font-variant-numeric: tabular-nums; }
.hs-row-amount-label { color: rgba(238, 240, 244, 0.5); }
.hs-row-net { font-size: 14px; font-weight: 600; color: #ffffff; font-variant-numeric: tabular-nums; }
.hs-row-net[data-sign="pos"] { color: #4ade80; }
.hs-row-net[data-sign="neg"] { color: #ff8a8b; }
.hs-row-status { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--panel-border); color: rgba(238, 240, 244, 0.6); }
.hs-row-status[data-status="settled"], .hs-row-status[data-status="success"] { background: rgba(29, 176, 90, 0.18); color: #4ade80; }
.hs-row-status[data-status="voided"], .hs-row-status[data-status="failed"] { background: rgba(250, 39, 39, 0.18); color: #ff8a8b; }
.hs-state { margin: 0; padding: 20px 8px; text-align: center; font-family: 'Kanit', sans-serif; font-size: 14px; color: rgba(238, 240, 244, 0.6); }
.hs-state[hidden] { display: none; }
/* Game-round provider code (#2452). */
.hs-row-provider { font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.7; margin-right: 6px; }
/* Rich txn rows (#2451). */
.hs-row-txn { flex-wrap: wrap; }
.hs-row-fee { font-size: 11px; color: rgba(238, 240, 244, 0.5); font-variant-numeric: tabular-nums; }
.hs-row-fee[hidden] { display: none; }
.hs-row-method-badge { font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px; background: rgba(75, 204, 255, 0.18); color: #4bccff; }
.hs-row-method-badge[hidden] { display: none; }
.hs-row-qr { flex-basis: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(238, 240, 244, 0.08); }
.hs-row-qr[hidden] { display: none; }
.hs-row-qr-img { width: 200px; height: 200px; background: #ffffff; border-radius: 8px; }
.hs-row-qr-heading, .hs-row-qr-expire, .hs-row-qr-wait { margin: 0; font-size: 12px; color: rgba(238, 240, 244, 0.7); text-align: center; }
.hs-row-qr-expire[hidden] { display: none; }
/* Numbered pager (#2450). */
/* Inline retry shown after a failed next-page append (#player-infinite-scroll). */
.hs-retry-row { list-style: none; display: flex; justify-content: center; margin-top: 12px; }
.hs-retry { padding: 8px 16px; border: 1px solid rgba(238, 240, 244, 0.12); border-radius: 8px; background: rgba(238, 240, 244, 0.04); color: rgba(238, 240, 244, 0.85); font-family: 'Kanit', sans-serif; font-size: 13px; font-weight: 600; cursor: pointer; }
.hs-retry:hover, .hs-retry:focus-visible { border-color: rgba(75, 204, 255, 0.6); outline: none; }

/* ─── home (#2559) — game/studio tile launch ──────────────────────────────
   Lobby tiles navigate into the shared `/play` shell via a transparent
   stretched-link <a class="modern-tile-launch"> overlaying the whole tile —
   the existing art/name markup underneath is untouched, and launch works with
   zero JS. `.is-launching` is the pressed state `islands/tile-launch.ts` flips
   on tap for instant feedback before the shell paints its loading screen.
   Covers the mobile 2-col game grid, single-entry studio tiles (same classes),
   and the popular row. */
.modern-game-tile,
.modern-popular-card {
  position: relative;
}
.modern-tile-launch {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.modern-tile-launch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.modern-game-tile.is-launching,
.modern-popular-card.is-launching {
  opacity: 0.6;
  transform: scale(0.97);
  transition: opacity 0.1s ease, transform 0.1s ease;
}

/* home (#2559) — game-name search input */
.modern-home-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 0 12px;
  height: 42px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.modern-home-search:focus-within { border-color: var(--accent); }
.modern-home-search-icon { flex: 0 0 auto; color: var(--fg-dim); }
.modern-home-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
}
.modern-home-search-input::placeholder { color: var(--fg-dim); }
.modern-home-search-input:focus { outline: none; }
.home-search-clear {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

/* home (#2559) — popular-row arrows are now real <button>s (reset chrome) */
.home-section-arrow { border: 0; padding: 0; cursor: pointer; }

/* home (#2559) — one-time promo dialog */
.modern-promo-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modern-promo-dialog[hidden] { display: none; }
.modern-promo-dialog-overlay {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.65);
  cursor: pointer;
}
.modern-promo-dialog-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 28px 24px 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--panel-bg, var(--surface));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.modern-promo-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(238, 240, 244, 0.06);
  background: rgba(238, 240, 244, 0.06);
  color: var(--fg);
  cursor: pointer;
}
.modern-promo-dialog-close:hover { background: rgba(238, 240, 244, 0.12); }
.modern-promo-dialog-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modern-promo-dialog-title {
  margin: 0 0 12px;
  padding-right: 32px;
  font-family: 'Kanit', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}
.modern-promo-dialog-body { margin: 0; line-height: 1.5; color: var(--fg); }

/* ─── page-change flash fix ────────────────────────────────────────────────
   The <html> canvas had no background, so the default ClientRouter
   cross-fade dipped through it (white flash on iOS Safari). Paint the canvas
   the same dark as the content, and replace the root transition with an
   old-stays / new-fades-in pair that never dips to transparent. Literal
   #0c0d22 mirrors `--bg` + the layout's theme-color meta — keep them in sync. */
html { background-color: #0c0d22; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: nav-root-fade 180ms ease both; }
@keyframes nav-root-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-new(root) { animation: none; }
}

/* ─── nav progress bar (ClientRouter soft-nav feedback) ────────────────────
   Element is created + driven by `shared/scripts/nav-progress.ts`. The bar
   mounts on <html> (to survive ClientRouter body swaps), so it sits ABOVE the
   body-scoped `--accent` tokens and can't read them — the literal modern
   accent is the real value here, not a fallback. */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  z-index: 2000;
  background: var(--accent-gradient, linear-gradient(180deg, #4bccff 0%, #4845e1 100%));
  box-shadow: 0 0 8px var(--accent, #4bccff);
  opacity: 0;
  pointer-events: none;
  transition: width 0.2s ease, opacity 0.2s ease;
}
.nav-progress.is-active { opacity: 1; }
.nav-progress.is-done { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .nav-progress { transition: opacity 0.2s ease; }
}

/* ── Loading skeletons (#player-infinite-scroll) ────────────────────────────
   See modern-desktop.css for the rationale — same rules, served at the mobile
   breakpoint. */
.legion-skel {
  position: relative;
  overflow: hidden;
  background: color-mix(in oklab, var(--fg, #fff) 8%, transparent);
  border-radius: 6px;
}
.legion-skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    100deg,
    rgba(255, 255, 255, 0) 30%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0) 70%
  );
  background-size: 200% 100%;
  animation: legion-skel-shimmer 1.1s ease-in-out infinite;
}
.legion-skel-text { min-height: 1em; border-radius: 4px; }
@keyframes legion-skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.hs-row-skel { pointer-events: none; }
.hs-row-skel .hs-skel-bar { display: block; height: 12px; }
.hs-row-skel .hs-skel-bar-title { width: 60%; height: 14px; margin-bottom: 8px; }
.hs-row-skel .hs-skel-bar-sub { width: 40%; }
.hs-row-skel .hs-skel-bar-amt { width: 64px; height: 14px; }
.hs-sentinel, .modern-grid-sentinel { width: 100%; height: 1px; }
/* Skeleton game tile — shimmer over the art block + name bar (#player-infinite-scroll). */
.modern-tile-skel { pointer-events: none; }
.modern-tile-skel .modern-game-tile-art,
.modern-tile-skel .modern-game-tile-desktop-art,
.modern-tile-skel .modern-game-tile-name,
.modern-tile-skel .modern-game-tile-desktop-name {
  position: relative;
  overflow: hidden;
  background: rgba(238, 240, 244, 0.08);
}
.modern-tile-skel .modern-game-tile-name,
.modern-tile-skel .modern-game-tile-desktop-name { height: 12px; border-radius: 4px; color: transparent; }
.modern-tile-skel .modern-game-tile-art::after,
.modern-tile-skel .modern-game-tile-desktop-art::after,
.modern-tile-skel .modern-game-tile-name::after,
.modern-tile-skel .modern-game-tile-desktop-name::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(100deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0) 70%);
  background-size: 200% 100%;
  animation: legion-skel-shimmer 1.1s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .modern-tile-skel .modern-game-tile-art::after,
  .modern-tile-skel .modern-game-tile-desktop-art::after,
  .modern-tile-skel .modern-game-tile-name::after,
  .modern-tile-skel .modern-game-tile-desktop-name::after { animation: none; }
  .modern-tile-skel { opacity: 0.55; }
}
