/* modern — desktop (>=1281px). Per Figma `Desktop_home_before login`
   (6218:335628). Frame 1440×1040. Same DOM as mobile, scaled up:
   163×104 type pills, 132×196 popular cards, 132×165 type cards (4:5 to
   fit portrait nara555 art), wider banner section, larger nav bar. */

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Visibility flip. This sheet is `<link media="(min-width: 1281px)">` so it
   only loads on desktop viewports — hide the mobile shell unconditionally.
   See modern-mobile.css for the matching rule and the reason both sheets
   carry this (Astro dev-mode HMR can drop the inline critical CSS). */
.shell-mobile { display: none; }

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

.nav-top {
  position: sticky;
  top: 0;
  z-index: 30;
  /* Same `--surface` as `.home-banner`'s gradient top stop — the two
     surfaces visually flow into one continuous block. */
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 16px;
  height: 72px;
  padding: 8px 24px;
}
.nav-top-menu {
  background: transparent;
  border: 0;
  color: var(--fg);
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  flex-shrink: 0;
}
.nav-top-menu:hover { background: rgba(255, 255, 255, 0.06); }
.nav-top-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--fg);
  margin-right: auto;
}
.nav-top-brand img { display: block; height: 32px; width: auto; }
.nav-top-brand-text {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.5px;
}
.nav-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.nav-top-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  font-family: 'Kanit', sans-serif;
  text-decoration: none;
  text-transform: capitalize;
  position: relative;
  cursor: pointer;
  box-shadow: var(--cta-shadow-outer);
}
.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 ────────────────────────────────────────────────── */

.home-banner {
  position: relative;
  /* Soft gradient fade from banner surface to page bg — see
     modern-mobile.css. */
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 60%, var(--bg) 100%);
  padding: 40px 0 48px;
}

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

.home-body {
  display: grid;
  grid-template-columns: 163px minmax(0, 1fr);
  column-gap: 24px;
  /* Figma uses 170px L/R padding on a 1440 frame (a literal value
     from the design); applied as-is at smaller viewports it leaves
     huge dead space on the sides. Cap content to 1100px (Figma's
     actual content-area width) and use a small responsive padding
     so narrow desktops (1024–1280) read tight without the rail
     floating in the middle of the viewport. */
  padding: 40px clamp(16px, 4vw, 80px) 130px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

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

.type-rail {
  display: flex;
  flex-direction: column;
  gap: 24px;
  /* Sticks below the 72px header on scroll — see modern-mobile.css. */
  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: 163px;
  height: 104px;
  padding: 8px;
  border-radius: 16px;
  text-decoration: none;
  color: var(--fg);
  overflow: hidden;
  /* Inactive default per Figma — dark gradient frame. See
     modern-mobile.css for the rationale. */
  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: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.type-rail-icon img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.type-rail-label {
  font-family: 'Kanit', sans-serif;
  font-weight: 400;
  font-size: 14px;
  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: 40px;
  min-width: 0;
}
.home-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 38px;
}
.home-section-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.home-section-icon {
  display: inline-block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.home-empty {
  margin: 32px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 15px;
}

/* ─── Popular Games — horizontal row (132×196 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: 38px;
  height: 38px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--fg-dim);
}
.home-section-arrow svg { width: 20px; height: 20px; }

.modern-popular-row {
  list-style: none;
  margin: 0;
  padding: 0 0 6px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.modern-popular-row::-webkit-scrollbar { display: none; }
.modern-popular-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modern-popular-card-art {
  position: relative;
  width: 100%;
  aspect-ratio: 132 / 196;
  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> swapped in by
   TenantImage on image 404 (#1838). Shares the placeholder posture;
   font-size override below for the game-name long-text path. */
.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: 36px;
  font-weight: 700;
}
.modern-popular-card-art-fallback {
  font-size: 13px;
  padding: 12px;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
}
.modern-popular-card-name {
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-transform: capitalize;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── Modern game grid (per-type 6-up wide row, 132×165 tile @ 4:5) ── */

.modern-game-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 24px;
}
.modern-game-tile {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.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;
}
.modern-game-tile-placeholder,
/* `.modern-game-tile-art-fallback` is the run-time `<span>` that
   TenantImage's `onerror` swaps in when the image URL 404s (#1838).
   The span sits directly inside `.modern-game-tile-art` (no parent
   wrapper); the existing aspect-ratio + overflow on the parent
   handle layout, this rule handles the surface + text. */
.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: 32px;
  font-weight: 700;
}
.modern-game-tile-art-fallback {
  /* When fallback is the game-name <span> (TenantImage 404 path), it
     gets the full game name as text content. Override font-size +
     padding so long names wrap and read cleanly — the `.placeholder`
     path uses 32px for the 2-char initial which is too aggressive
     here. */
  font-size: 13px;
  padding: 12px;
  line-height: 1.2;
  text-align: center;
  word-break: break-word;
  hyphens: auto;
}
.modern-game-tile-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 22px;
  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: 14px;
  font-weight: 400;
  text-transform: capitalize;
  color: var(--fg);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ─── 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;
}
.nav-bottom-bg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 80px;
  filter: drop-shadow(0 -8px 24px rgba(3, 131, 249, 0.4));
}
.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 16px 10px;
  gap: 16px;
  pointer-events: auto;
  max-width: 1440px;
  margin: 0 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: 16px;
  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: 40px;
  height: 40px;
}
.nav-bottom-icon img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.nav-bottom-tab.is-center {
  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;
  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: 32px;
  color: var(--accent);
  text-transform: uppercase;
}
.nav-bottom-tab.is-center .nav-bottom-label { padding-top: 2px; }

.nav-bottom-label {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.floating-contact {
  position: fixed;
  right: 24px;
  /* Track B (#2560): desktop has no fixed NavBottom below it, so drop the
     mobile-notch offset (110px) to a normal bottom margin. */
  bottom: 24px;
  z-index: 25;
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  filter: drop-shadow(0 4px 16px rgba(3, 131, 249, 0.4));
}
.floating-contact-icon { display: block; width: 64px; height: 64px; }

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

.home-banner .banner-carousel {
  padding: 0 clamp(16px, 4vw, 80px);
  max-width: 1260px; /* 1100 content + 80*2 max padding */
  margin: 0 auto;
}
.home-banner .banner-viewport {
  border-radius: 0;
  overflow: hidden;
}
/* 3-slide peek per Figma 6218:335628: each slide ≈ 445px in a 1100px
   container with ~24px gutter. The middle slide sits centered; the two
   neighbours peek into the gutter. */
.home-banner .banner-slide {
  flex: 0 0 41%;
  padding: 0 12px;
  min-width: 0;
}
.home-banner .banner-slide img {
  border-radius: 16px;
  aspect-ratio: 5 / 2;
  object-fit: cover;
  width: 100%;
}
.home-banner .banner-dots {
  position: absolute;
  bottom: 16px;
  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: 32px;
  border-radius: 4px;
}

/* --- Side drawer (modern/components/SideDrawer.astro) ---
   Same drawer used on desktop. Wider panel since the desktop hamburger
   sits above more available canvas; capped at 360px so the home content
   still reads from behind. */
.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: 360px;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateX(-100%);
  transition: transform 0.24s ease;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
  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: 20px 20px 14px;
  gap: 12px;
}
.side-drawer-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--fg);
}
.side-drawer-brand img {
  display: block;
  height: 26px;
  width: auto;
}
.side-drawer-brand-text {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.04em;
}
.side-drawer-close {
  width: 36px;
  height: 36px;
  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;
}

.side-drawer-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px 20px 20px;
}
.side-drawer-pill {
  height: 48px;
  border-radius: 24px;
  font-size: 15px;
  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);
}

.side-drawer-nav {
  display: flex;
  flex-direction: column;
  padding: 0 20px;
}
.side-drawer-row {
  display: grid;
  grid-template-columns: 40px 1fr 16px;
  align-items: center;
  gap: 14px;
  padding: 14px 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: 40px;
  height: 40px;
  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: 24px;
  height: 24px;
  object-fit: contain;
}
.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: 16px;
  font-weight: 500;
  color: var(--fg);
}
.side-drawer-row-chevron {
  color: var(--fg-dim);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.side-drawer-footer {
  margin-top: auto;
  padding: 12px 20px 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.side-drawer-row-toggle {
  grid-template-columns: 40px 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: 24px;
  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: 15px;
  border-radius: 8px;
}
.side-drawer-lang-item.is-current {
  background: var(--surface-2);
  font-weight: 600;
}
.side-drawer-lang-item-flag {
  font-size: 22px;
  line-height: 1;
}

body[data-drawer-active="true"] {
  overflow: hidden;
}

/* --- Category page (modern/sections/category.astro + studio-games.astro) --- */
.category-body {
  min-width: 0;
}
.category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0 16px;
  flex-wrap: wrap;
}
.category-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--fg);
}
.category-title-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.category-count {
  margin-left: 6px;
  color: var(--fg-dim);
  font-weight: 500;
  font-size: 16px;
}
.category-provider-name {
  margin-left: 8px;
  color: var(--fg-dim);
  font-weight: 500;
  font-size: 16px;
}
.category-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-sort-tab {
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg-dim);
  font-size: 14px;
  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 — composite-image tiles, see modern-mobile.css. */
.provider-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.provider-tile {
  display: flex;
}
.provider-tile-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--fg);
  transition: transform 0.15s ease;
}
.provider-tile-link:hover {
  transform: translateY(-2px);
}
.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: 10px;
  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: 10px;
  background: var(--surface-2);
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fg);
}
.provider-tile-caption {
  font-size: 13px;
  font-weight: 400;
  color: var(--fg);
  text-transform: capitalize;
  text-align: left;
  padding-left: 2px;
}

/* ─── Promotions page (desktop reflow of mb_promotion 5578:761129) ─────
   Figma has no separate desktop frame — same card system, wider grid. */
.promo-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}
.promo-page-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 0 24px;
}
.promo-page-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  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: 600;
  font-size: 32px;
  color: var(--fg);
}
.promo-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.promo-card-wrap { display: flex; }
.promo-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 0 12px 20px;
  border-radius: 18px;
  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);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.promo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}
.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> swapped in by TenantImage when the promo image
   404s (#1869). Sized to fill the parent `.promo-card-img`
   1:1 frame; theme-tinted with the promo title overlay so the
   card retains its meaning without the operator-uploaded art. */
.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: 16px;
  font-weight: 600;
  text-align: center;
  padding: 16px;
  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: 18px;
  color: var(--fg);
  text-align: center;
  width: 100%;
}
.promo-card-cta {
  position: relative;
  appearance: none;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 15px;
  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: 32px 0;
}

/* ─── Promotion detail modal (mb_promotion_deteil 5612:767587) ────────── */
.promo-modal {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--fg);
  max-width: min(420px, calc(100vw - 48px));
  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: 20px 28px 36px;
  max-height: 90vh;
  overflow-y: auto;
}
.promo-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  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: 10px;
  align-items: center;
  margin-top: 28px;
}
.promo-modal-image {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.promo-modal-image img,
/* Runtime <span> for TenantImage 404 inside the dialog template.
   The template element doesn't load its img until cloned into the
   dialog body, so the 404 is detected on first dialog-open. Same
   theme-tinted card pattern as .promo-card-img-fallback. */
.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: 14px;
  font-weight: 600;
  text-align: center;
  padding: 16px;
  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: 600;
  font-size: 18px;
  color: var(--fg);
  width: 100%;
  text-align: left;
}
.promo-modal-body {
  font-family: 'Kanit', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  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: 22px;
}
.promo-modal-body li { margin-bottom: 4px; }

/* ─── Tournament module (desktop) ─────────────────────────────────── */
/* The Figma has mobile-only frames; on desktop we keep the same layout
   primitives but cap width and re-flow the body so it doesn't read as
   a stretched mobile page. Per Figma section `🟡 mobile_tournament`
   (5697:649449) adapted to the 1281px+ shell. */

.tournament-shell {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px 80px;
  color: var(--fg);
}

.tournament-coinbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 4px 0 16px;
}
.tournament-coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #0c0d22;
  border-radius: 999px;
  padding: 6px 16px 6px 8px;
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.tournament-coin-icon { display: inline-flex; align-items: center; }
.tournament-coin-amount { line-height: 1; }
.tournament-avatar {
  width: 40px;
  height: 40px;
  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);
}

.tournament-subhead {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 24px 0 20px;
}
.tournament-back {
  width: 36px;
  height: 36px;
  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: 28px;
  font-weight: 600;
  flex: 1;
  text-align: center;
  padding-right: 44px;
  line-height: 1;
}

.tournament-hub-panel {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
  padding-bottom: 20px;
}
.tournament-hub-banner {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 374 / 149;
  object-fit: cover;
}

.tournament-countdown-label {
  margin: 16px 0 12px;
  font-family: 'Kanit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--fg);
  text-align: center;
  line-height: 1;
}
.tournament-countdown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
}
.tournament-countdown-box {
  flex: 1;
  max-width: 96px;
  background: linear-gradient(180deg, #1f2547 0%, #131634 100%);
  border: 1px solid rgba(75, 204, 255, 0.18);
  border-radius: 10px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  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: 28px;
  color: #ffffff;
  line-height: 1.05;
  letter-spacing: 0.02em;
}
.tournament-countdown-unit {
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
}
.tournament-countdown-sep {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 26px;
  color: rgba(255, 255, 255, 0.85);
  padding-bottom: 26px;
  flex-shrink: 0;
}

.tournament-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.tournament-card {
  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);
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.tournament-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}
.tournament-card-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px;
  text-decoration: none;
  color: var(--fg);
  min-height: 135px;
}
.tournament-card-art {
  width: 120px;
  height: 120px;
  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: 6px 0;
  gap: 12px;
}
.tournament-card-text { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tournament-card-title {
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--fg);
  line-height: 1.2;
}
.tournament-card-subtitle {
  font-family: 'Kanit', sans-serif;
  font-weight: 400;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.35;
  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: 42px;
  min-width: 130px;
  padding: 0 20px;
  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);
}

/* ── Wheel page (desktop) ─── per Figma `mb_tournment_วงล้อ` ── */
.tournament-wheel-shell {
  max-width: 480px;
  padding: 0 12px 80px;
}

.wheel-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0 16px;
}
.wheel-stat {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 4px 10px;
  border-radius: 10px;
  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:hover { background: rgba(255, 255, 255, 0.08); }
.wheel-stat-coins {
  flex: 1.4;
  justify-content: flex-start;
  padding-left: 8px;
}
.wheel-stat-icon { display: block; width: 32px; height: 32px; flex-shrink: 0; }
.wheel-stat-label {
  font-size: 15px;
  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: 24px;
  color: #ffffff;
  margin-left: auto;
  padding-right: 6px;
  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. */
.wheel-disc {
  display: block;
  width: 100%;
  max-width: 400px;
  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: 13px;
  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: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 24px 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: 14px; }
.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: 14px;
  padding: 20px 40px 0;
}
.wheel-spin-btn {
  width: 100%;
  height: 52px;
  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: 17px;
  cursor: pointer;
  box-shadow: var(--panel-cta-shadow);
}
.wheel-note {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  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: 14px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.wheel-details-link svg { flex-shrink: 0; }

/* Modals — desktop tweaks layered on top of the mobile rules */
.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: 24px;
}
.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: 380px;
  background: linear-gradient(180deg, #1d234a 0%, #14193d 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px;
  color: var(--fg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.wheel-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.wheel-modal-head-stacked { align-items: flex-start; }
.wheel-modal-title {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 20px;
  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);
}
.wheel-modal-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  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); }

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

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

.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: 84px; }
.wheel-prize-table thead th:last-child { border-radius: 0 10px 0 0; }
.wheel-prize-table tbody td {
  padding: 14px 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: 76px; text-align: center; }
.wheel-prize-icon { display: block; width: 52px; height: 52px; margin: 0 auto; }
.wheel-prize-name {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.25;
}
.wheel-prize-value {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}
.wheel-prize-credits {
  list-style: disc;
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 13px;
  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 (desktop) ── per Figma `mb_tournment_แลกรางวัล` ── */
.rewards-shell {
  max-width: 480px;
  padding: 0 16px 80px;
}

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

.rewards-expiry {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  padding: 18px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.rewards-expiry-cell { padding: 4px 12px; text-align: center; }
.rewards-expiry-divider {
  width: 1px;
  height: 64px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 auto;
}
.rewards-expiry-label {
  margin: 0 0 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1;
}
.rewards-expiry-value {
  margin: 0 0 8px;
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 24px;
  color: #ffffff;
  line-height: 1;
}
.rewards-expiry-meta {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1.2;
}

.rewards-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  margin-top: 18px;
  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: 17px;
  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-history-link {
  display: block;
  text-align: center;
  margin-top: 14px;
  font-family: 'Kanit', sans-serif;
  font-size: 15px;
  color: #4bccff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.rewards-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.rewards-card {
  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: 18px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 4px rgba(0, 0, 0, 0.25);
}
.rewards-card-art {
  width: 140px;
  height: 140px;
  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: 15px;
  color: #ffffff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}
.rewards-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 42px;
  padding: 0 10px 0 20px;
  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: 15px;
  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; width: 26px; height: 26px; flex-shrink: 0; }
.rewards-card-cta-coin img { width: 26px; height: 26px; display: block; }

.rewards-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 0 8px;
}
.rewards-pagination-tab {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Kanit', sans-serif;
  font-size: 15px;
  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);
}

.tournament-tabs {
  display: flex;
  gap: 4px;
  background: var(--surface);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 14px;
}
.tournament-tab {
  flex: 1;
  text-align: center;
  padding: 12px 14px;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font-family: 'Kanit', sans-serif;
  font-size: 15px;
  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: 10px;
}
.tournament-mission {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px;
}
.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: 14px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1.3;
}
.tournament-mission-subtitle {
  margin: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  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: 14px;
  padding: 8px 14px;
  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. */
.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) ---
   Desktop variant — same controls as mobile, larger spacing. */
.provider-games-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0 16px;
  font-size: 16px;
  font-weight: 500;
}
.provider-games-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  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: 28px;
  height: 28px;
  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: 14px;
  margin-left: auto;
}

.provider-games-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  position: relative;
}
.provider-games-search {
  flex: 1;
  /* min-width:0 so the field can shrink below the <input>'s intrinsic width and
     never push the fixed-width Filter button off-row — see modern-mobile.css. */
  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: 12px;
  padding: 0 14px 0 44px;
  min-height: 48px;
}
.provider-games-search-icon {
  position: absolute;
  left: 14px;
  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: 15px;
  padding: 10px 0;
}
.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: 8px;
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  background: var(--accent-gradient);
  color: var(--accent-fg);
  border: 0;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.provider-games-filter-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface-2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  z-index: 10;
  min-width: 200px;
}
.provider-games-filter-menu ul { list-style: none; margin: 0; padding: 0; }
.provider-games-filter-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 15px;
  color: var(--fg);
}
.provider-games-filter-option:hover { background: rgba(255, 255, 255, 0.04); }
.provider-games-filter-option input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

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

/* --- NavTop authed branch (desktop) — see modern-mobile.css comment.
   Global auth toggle below; the per-element rules used to live here. */
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: 12px;
  flex-shrink: 0;
}
.nav-top-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 40px;
  background: var(--surface);
  border: 1px solid #4bccff;
  box-shadow: inset 0 4px 4px rgba(255, 255, 255, 0.14);
  color: var(--fg);
  font-size: 15px;
  font-weight: 400;
  font-family: 'Kanit', sans-serif;
}
.nav-top-balance-coin {
  display: block;
  width: 28px;
  height: 28px;
  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: 16px;
  height: 16px;
  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: 48px;
  height: 48px;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-top-avatar-medal {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* ── Wheel modal: prize-won (desktop variant) ── */
.wheel-modal-prize-won {
  text-align: center;
  padding: 36px 28px 32px;
  max-width: 360px;
}
.wheel-modal-close-floating {
  position: absolute;
  top: 14px;
  right: 14px;
}
.wheel-prize-won-coin {
  display: block;
  width: 104px;
  height: 104px;
  margin: 0 auto 18px;
  filter: drop-shadow(0 6px 16px rgba(255, 184, 28, 0.35));
}
.wheel-prize-won-body {
  margin: 0 0 10px;
  font-family: 'Kanit', sans-serif;
  font-size: 15px;
  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: 22px;
  color: #4bccff;
  line-height: 1.2;
}

/* ── Rewards-page modals (desktop) ── */
.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: 24px;
}
.rewards-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 10, 28, 0.7);
  backdrop-filter: blur(2px);
  border: 0;
  cursor: pointer;
}
.rewards-modal {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 360px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 32px 28px;
  color: var(--fg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}
.rewards-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  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-confirm,
.rewards-modal-insufficient { text-align: center; }
.rewards-modal-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.rewards-modal-title {
  margin: 0 0 10px;
  font-family: 'Kanit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.25;
}
.rewards-modal-body {
  margin: 0 0 22px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.4;
}
.rewards-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.rewards-modal-btn {
  height: 46px;
  border-radius: 8px;
  font-family: 'Kanit', sans-serif;
  font-weight: 500;
  font-size: 16px;
  cursor: pointer;
}
.rewards-modal-btn-cancel {
  background: transparent;
  border: 1px solid var(--secondary-2);
  color: #ffffff;
}
.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);
}

.rewards-modal-root-withdraw .rewards-modal-withdraw {
  max-width: 380px;
  padding: 24px 24px 28px;
  text-align: left;
}
.rewards-modal-withdraw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.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: 6px;
  padding: 14px 0 18px;
}
.rewards-withdraw-balance-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}
.rewards-withdraw-balance-row {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.rewards-withdraw-balance-value {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 32px;
  color: #ffffff;
  line-height: 1;
}
.rewards-withdraw-refresh {
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}
.rewards-withdraw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rewards-withdraw-field-label {
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1;
}
.rewards-withdraw-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  padding: 10px 10px 10px 16px;
  height: 52px;
}
.rewards-withdraw-input-el {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  color: #ffffff;
  min-width: 0;
}
.rewards-withdraw-input-el::placeholder { color: rgba(255, 255, 255, 0.35); }
.rewards-withdraw-output {
  flex: 1;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  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: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}
.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: 8px 0;
}
.rewards-withdraw-rate {
  margin: 10px 0 0;
  text-align: center;
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
}
.rewards-withdraw-submit {
  margin-top: 18px;
  width: 100%;
  height: 52px;
  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: 17px;
  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) — see modern-mobile.css. */
.home-wallet-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 24px clamp(16px, 4vw, 80px) 24px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.home-wallet-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  border-radius: 14px;
  font-size: 16px;
  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 8px 20px 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-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). Identical envelope to the
   mobile rule-set — the panel is 283px regardless of viewport. */
.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: 283px;
  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;
}
.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,
.profile-drawer-card-username-value {
  font-weight: 400;
  color: var(--fg);
}
.profile-drawer-card-username-value {
  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;
}
.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);
}
.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;
}
.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;
}
body[data-profile-drawer-active="true"] {
  overflow: hidden;
}

/* === Deposit modal (modern/components/DepositModal.astro) ===
   Same rules as mobile; the modal is viewport-agnostic (centered with a
   fixed max-width of 358px). Loaded into the desktop bundle so the modal
   renders correctly when the desktop chrome triggers it 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-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); }
.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; }
.deposit-modal-root[data-stage="5"] .deposit-banner { display: none; }
.deposit-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.deposit-section-tight { gap: 8px; }
.deposit-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  line-height: 1;
}
.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;
  overflow: hidden;
  box-shadow: inset 0 2px 10px rgba(255, 255, 255, 0.1);
}
.deposit-balance-card-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
}
.deposit-balance-card-icon img { width: 16px; height: 16px; display: block; object-fit: contain; }
.deposit-balance-card-label { font-size: 14px; color: #ffffff; line-height: 1; }
.deposit-balance-card-amount-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.deposit-balance-card-amount {
  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;
}
.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-size: 14px;
  cursor: pointer;
  text-transform: capitalize;
  text-align: left;
  overflow: hidden;
}
.deposit-method-card-static { cursor: default; }
.deposit-method-icon { flex-shrink: 0; display: block; width: 40px; height: 40px; object-fit: contain; }
.deposit-method-label {
  white-space: nowrap;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.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-size: 14px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  text-transform: capitalize;
}
.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;
  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; 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; }
.deposit-amount-block { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.deposit-amount-limits {
  margin: 0;
  font-size: 14px;
  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;
  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;
  cursor: pointer;
}
.deposit-quick-btn:hover { border-color: rgba(238, 240, 244, 0.22); }
/* 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; }
.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-receipt-head { display: flex; flex-direction: column; width: 100%; text-transform: capitalize; line-height: 1.2; }
.deposit-receipt-head-label { margin: 0; font-size: 14px; color: #ffffff; }
.deposit-receipt-head-warn { margin: 0; font-size: 14px; 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-size: 20px;
  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-text { font-size: 12px; 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-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-size: 10px;
  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-size: 10px;
  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-size: 14px;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1.4;
}
.deposit-receipt-expiry-time { display: block; }
.deposit-receipt-expiry-clock {
  color: #dcad04;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* Stage 4 — auto deposit / bank transfer. Mirrors the mobile rules. */
.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%);
  box-sizing: border-box;
}
.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; }

.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-size: 12px;
  text-transform: capitalize;
  cursor: pointer;
}
.deposit-banner img { width: 15px; height: 15px; display: block; object-fit: contain; }
body[data-deposit-modal-active="true"] { overflow: hidden; }

/* === Modern account-announcement (modern/sections/account-announcement.astro) ===
   Mirror of the mobile rules; same surface fits both viewports because
   the list + overlays are width-capped at 374px / 342px regardless of
   the underlying shell. Loaded into the desktop bundle so the overlays
   render on desktop too. */
.ma-section {
  position: relative;
  padding: 16px 8px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.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; }
.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;
  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; }
.ma-total {
  margin: 0;
  padding: 0 8px;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
}
.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; 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;
  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;
  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; }
.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;
  color: #ffffff;
  opacity: 0.5;
  text-transform: capitalize;
  white-space: nowrap;
}
.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-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-size: 16px;
  font-weight: 500;
  color: #0383f9;
  line-height: 1.2;
}
.ma-modal-bullets {
  margin: 0;
  padding-left: 21px;
  list-style: disc;
  font-size: 14px;
  color: #ffffff;
  text-transform: capitalize;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.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);
}
body[data-ma-overlay-active="true"] { overflow: hidden; }

/* === Modern profile detail + membership — desktop ===
   Same selector set as mobile; rules below are minor tweaks (wider
   max card width). The bulk of the styling stays mobile-first since
   the page surface is the same on both viewports. */
.mp-section,
.mm-section {
  padding: 16px 8px 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.mp-pagehead,
.mm-pagehead {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.mp-back,
.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;
}
.mp-pagetitle,
.mm-pagetitle {
  margin: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 500;
  color: var(--fg);
}
.mp-card {
  max-width: 420px;
  width: 100%;
  margin: 0 auto;
  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, .mp-card-meta-row dd { margin: 0; font-size: 16px; font-weight: 500; color: var(--fg); }
.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; flex-shrink: 0;
  box-shadow: inset 0 -2px 2px rgba(0,0,0,0.1), inset -2px 2px 4px rgba(0,0,0,0.3);
}
.mp-bank-icon img { display: block; width: 24px; height: 24px; object-fit: contain; }
.mp-bank-details { display: flex; flex-direction: column; color: var(--fg); }
.mp-bank-number { margin: 0; font-size: 20px; font-variant-numeric: tabular-nums; }
.mp-bank-holder, .mp-bank-name { margin: 0; font-size: 14px; }
.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; }

.mm-scroller { position: relative; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.mm-scroller::-webkit-scrollbar { display: none; }
.mm-track { list-style: none; margin: 0; padding: 0 16px; display: flex; gap: 20px; align-items: stretch; justify-content: center; flex-wrap: wrap; }
.mm-card {
  position: relative; flex: 0 0 320px; 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; }
.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 — desktop ===
   Same card design as mobile, just a wider max width. */
.mt-section { padding: 16px 8px 32px; display: flex; justify-content: center; }
.mt-card {
  width: 100%; max-width: 460px;
  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; color: var(--fg); text-decoration: none; text-transform: capitalize; }
.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; }
.mt-row-kind { color: var(--fg); }
.mt-row-amount { font-variant-numeric: tabular-nums; }
.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;
}
.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;
}
.mt-page-btn[data-state="active"] { background: linear-gradient(180deg, #4bccff 0%, #384cff 100%); border-color: transparent; }
.mt-page-btn-arrow { border: 0; }
.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). Mobile-first design — desktop reuses
   the same 358px-wide centred card; only the scrim padding changes
   because desktop viewports are wider. */
.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: 24px;
}
.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 - 48px);
  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;
}
.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,
.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; }
.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;
}
.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; }

/* ════════════════════════════════════════════════════════════════════
   Modern desktop chrome — rail + topbar + grid (epic #2222).

   The chrome activates at ≥1281px on every modern tenant (the v2
   feature flag was retired in Phase 4 / #2233; what remains is the
   chrome itself). Mobile chrome (NavTop + NavBottom) renders below
   the breakpoint.

   Decision record: docs/design/modern-desktop-layout.md.
   ──────────────────────────────────────────────────────────────────── */

body[data-template="modern"] {
  /* Tokens consumed by NavTopDesktop + SideRail + PageGridLayout.
     Override via TenantTheme.astro if a tenant ever needs a wider
     rail or taller topbar. */
  --rail-width: 240px;
  --topbar-height: 64px;
}

/* Hide the legacy NavTop hamburger + NavBottom inside `.shell-desktop`.
   The desktop chrome is the rail + topbar; the mobile shell renders
   NavTop + NavBottom unchanged inside `.shell-mobile`. */
.shell-desktop .nav-top { display: none; }
.shell-desktop .nav-bottom { display: none; }

/* ─── Topbar (NavTopDesktop) ──────────────────────────────────────── */

.nav-top-desktop {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-height);
  padding: 0 24px 0 calc(var(--rail-width) + 24px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.nav-top-desktop-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--fg);
  font-size: 18px;
  font-weight: 700;
}
.nav-top-desktop-brand-text { color: var(--fg); }
.nav-top-desktop-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-top-desktop-cta {
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 120ms ease;
}
.nav-top-desktop-cta:hover { filter: brightness(1.08); }
.nav-top-desktop-cta-outline {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--fg);
}
.nav-top-desktop-cta-fill {
  background: var(--panel-cta-bg);
  border: 0;
  color: var(--accent-fg);
  box-shadow: var(--cta-shadow-outer);
}
.nav-top-desktop-balance {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--surface-2);
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.nav-top-desktop-balance-coin { display: block; }
.nav-top-desktop-balance-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
}
.nav-top-desktop-avatar {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.nav-top-desktop-avatar-medal { display: block; border-radius: 50%; }

/* ─── SideRail ────────────────────────────────────────────────────── */

.side-rail {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  bottom: 0;
  width: var(--rail-width);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 25;
}
.side-rail-brand {
  display: block;
  padding: 4px 12px 16px;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.side-rail-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}
.side-rail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 120ms ease;
}
.side-rail-item:hover { background: var(--surface-2); }
.side-rail-item[aria-current="page"] {
  background: var(--panel-cta-bg);
  color: var(--accent-fg);
}
.side-rail-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.side-rail-icon-fallback {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--panel-cta-bg);
  color: var(--accent-fg);
  font-weight: 700;
  font-size: 14px;
}
.side-rail-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-rail-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.side-rail-item-button { color: var(--fg-dim); }

/* Language switcher (Track B #2560) — desktop-rail parity with the mobile
   drawer's picker. Native <details>; the summary reuses the rail-item row. */
.side-rail-lang { padding-top: 4px; }
.side-rail-lang-summary { list-style: none; cursor: pointer; }
.side-rail-lang-summary::-webkit-details-marker { display: none; }
.side-rail-lang-flag { font-size: 18px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.side-rail-lang-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.side-rail-lang-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px 8px 14px; border-radius: 8px;
  color: var(--fg-dim); text-decoration: none; font-size: 14px;
}
.side-rail-lang-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--fg); }
.side-rail-lang-item.is-current { color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.side-rail-lang-item-flag { font-size: 16px; line-height: 1; }

/* ─── PageGridLayout ──────────────────────────────────────────────── */

.page-grid-layout {
  /* Reserve the rail's column so the main content begins at
     `--rail-width`. The rail itself is position:fixed so it doesn't
     participate in flow; the grid is here purely to lock the left
     padding without hard-coding 240px on every page. */
  display: grid;
  grid-template-columns: var(--rail-width) 1fr;
}
.page-grid-layout > * { grid-column: 2; min-width: 0; }

/* ─── Home desktop v2 (#2228) ──────────────────────────────────────
   Real desktop composition for the home page: hero band + two-pane
   body (main game canvas + right widgets). Replaces the legacy
   widened-mobile flex layout when the flag is on. */

.home-desktop-v2 {
  /* Sized to leave the SideRail's left-column track free; the rest
     of the canvas fills with content up to a comfortable reading
     max-width so 1920+ monitors don't paint a 1500px popular row. */
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.home-banner-desktop-v2 {
  /* Hero spans the full main-canvas width. The carousel island sizes
     itself to its parent, so this just sets the outer band. */
  border-radius: 16px;
  overflow: hidden;
}
.home-wallet-tabs-desktop-v2 {
  /* Authed-only quick actions. Sized inline-flex so the two buttons
     don't stretch across the whole hero band. */
  display: flex;
  gap: 12px;
  margin-top: -8px;
}
/* Home deposit/withdrawal info strip + auth CTAs (ModernStatsBand) — full-width
   band in the hero column below the banner, full parity with the classic
   StatsBar (info columns + dual-shape auth CTAs). Defined here AND in
   modern-mobile.css (each viewport sheet owns its sizing), same split as
   .home-wallet-tabs. */
.home-statsband {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin: 0 0 16px;
}
.home-statsband-info {
  flex: 2 1 0;
  display: flex;
  align-items: stretch;
  padding: 14px 24px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.home-statsband-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 16px;
  text-align: center;
}
.home-statsband-label {
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}
.home-statsband-value {
  font-family: 'Kanit', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
}
.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;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  border-radius: 12px;
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid var(--panel-border);
  transition: filter 120ms ease;
}
.home-statsband-cta:hover {
  filter: brightness(1.06);
}
.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-desktop-v2-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  align-items: start;
}
.home-desktop-v2-main {
  /* Game-section column. Each section's heading uses the legacy
     `.home-section-head` styling from above; the grid INSIDE each
     section is the new 4-col `.modern-game-grid-desktop`. */
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}
.home-desktop-v2-aside {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
}
.home-desktop-v2-widget {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 16px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--fg);
  transition: filter 120ms ease, transform 120ms ease;
}
.home-desktop-v2-widget:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.home-desktop-v2-widget-eyebrow {
  font-family: 'Kanit', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.home-desktop-v2-widget-title {
  font-family: 'Kanit', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--fg);
}
.home-desktop-v2-widget-cta {
  margin-top: 6px;
  font-family: 'Kanit', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-dim);
}
.home-desktop-v2-widget-jackpot {
  background: linear-gradient(135deg, var(--surface-2) 0%, rgba(75, 204, 255, 0.12) 100%);
}
.home-desktop-v2-widget-promo {
  background: linear-gradient(135deg, var(--surface-2) 0%, rgba(72, 69, 225, 0.15) 100%);
}

/* ─── Desktop game tile grid (HomeGameGridDesktop) ─────────────────
   Distinct class space from the legacy `.modern-game-grid` so the
   two grids can co-exist (mobile widened-mobile vs. v2 desktop).
   Single CSS surface; the legacy grid's selectors stay untouched. */

.modern-game-grid-desktop {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.modern-game-tile-desktop {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
  transition: transform 120ms ease;
}
.modern-game-tile-desktop:hover {
  transform: translateY(-2px);
}
.modern-game-tile-desktop-art {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface-3);
}
.modern-game-tile-desktop-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* `applyGameArt` (client-appended + recently-played tiles) hides the tile
   <img> via the `hidden` attribute on a 404/missing key and shows the text
   placeholder instead. The author `display` rules above outrank the UA
   `[hidden]{display:none}`, so a hidden <img> would otherwise still render its
   broken-image box (and `alt`) under the placeholder — restore the guard
   explicitly, as every other hidden-toggled element in this sheet does. */
.modern-game-tile-art > img[hidden],
.modern-game-tile-desktop-art img[hidden] { display: none; }
/* Single-entry studio LAUNCH tiles (ModernStudioTiles) reuse this game-tile
   box but render a brand LOGO, not game art. Portrait 4:5 (matching the
   classic `.studio-tile` shape) + `contain` the logo (never crop — logos are
   heterogeneous) on the --surface-2 surface, padded for breathing room. The
   game-tile img rule above keeps cover for actual game thumbnails; these
   selectors are studio-scoped + more specific. */
.modern-game-tile-desktop-art.modern-studio-art {
  aspect-ratio: 4 / 5;
  background: var(--surface-2);
}
.modern-game-tile-desktop-art.modern-studio-art > img.modern-studio-logo {
  box-sizing: border-box;
  padding: 12%;
  object-fit: contain;
}
.modern-game-tile-desktop-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Kanit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--fg-dim);
  text-transform: uppercase;
}
.modern-game-tile-desktop-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: auto;
}
.modern-game-tile-desktop-name {
  font-family: 'Kanit', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* On narrower v2 viewports (1281-1499) collapse the aside under the
   main column so the 4-col grid stays usable. */
@media (max-width: 1499px) {
  .home-desktop-v2-body {
    grid-template-columns: 1fr;
  }
  .home-desktop-v2-aside {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .home-desktop-v2-widget {
    flex: 1 1 240px;
  }
}

/* ─── Lobby desktop v2 (#2229) ─────────────────────────────────────
   Wraps the category (studio picker) + studio-games (game grid)
   surfaces in the same v2 canvas the home page uses. Reuses the
   legacy `.provider-grid` / `.provider-tile` styling from the
   widened-mobile lobby — those rules sit unscoped above and will
   still match within `.lobby-desktop-v2-*` containers; the new
   selectors here only adjust outer spacing + grid density. */

.lobby-desktop-v2 {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.lobby-desktop-v2-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
.lobby-desktop-v2-head {
  /* Larger header band on desktop — title + count read at glance from
     the multi-column grid below. */
  padding: 4px 0 8px;
}
/* 4-col studio picker on desktop. The legacy `.provider-grid` is a
   responsive auto-fill; v2 locks it to 4 columns for visual rhythm
   with the home grid + game grid. */
.lobby-desktop-v2-provider-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* On narrower v2 viewports keep the 4-col density above 1280 + drop
   gracefully on tighter widths. Below 1281 the mobile shell takes
   over anyway via the layout breakpoint flip. */
@media (max-width: 1499px) {
  .lobby-desktop-v2-provider-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ─── Promotions desktop v2 (#2230) ───────────────────────────────
   Two routes share the `.promo-desktop-v2` outer canvas: the list
   (3-col card grid) and the detail page (2-pane hero + body). The
   legacy `.promo-page` / `.promo-card` / `.promotion-detail*` rules
   above still cascade in; these overrides only adjust the outer
   wrapping + grid density. */

.promo-desktop-v2 {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px 48px;
}
.promo-desktop-v2-page {
  /* Drop the legacy page's max-width / padding — the outer canvas
     owns those now. The inner content is just the head + grid. */
  max-width: none;
  padding: 0;
  margin: 0;
}
.promo-desktop-v2-head {
  margin-bottom: 24px;
}
.promo-desktop-v2-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}
@media (max-width: 1499px) {
  .promo-desktop-v2-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Detail page two-pane: hero left, prose body right. Collapses to
   stacked single-column below 1280 — but the layout breakpoint flip
   has already swapped to the mobile shell by then, so this is just
   defensive. */
.promotion-detail-desktop-v2 {
  max-width: none;
  margin: 0;
  padding: 0;
}
.promotion-detail-desktop-v2-head {
  margin-bottom: 24px;
}
.promotion-detail-desktop-v2-body {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.promotion-detail-desktop-v2-hero {
  /* Override the legacy `margin: 12px 0 16px` so the grid spacing
     owns the gap. */
  margin: 0;
}
.promotion-detail-desktop-v2-prose {
  /* Body lives in the right column — give it slightly larger
     reading line-height than the mobile column variant. */
  line-height: 1.7;
}
@media (max-width: 1499px) {
  .promotion-detail-desktop-v2-body {
    grid-template-columns: 1fr;
  }
}

/* ─── Tournament desktop v2 (#2231) ───────────────────────────────
   The four tournament sections (`tournament-hub`, `tournament-wheel`,
   `tournament-rewards`, `tournament-missions`) all wrap their content
   in `.tournament-shell` (max-width: 640px on the legacy widened-
   mobile shell). Inside the v2 chrome (rail + topbar from #2243 +
   PageGridLayout) the 640px column reads as a too-narrow stripe.
   Widen the shell + bump padding under the v2 flag without touching
   the Astro templates — the legacy shell stays narrow on flag-OFF
   tenants for visual parity with the mobile layout.

   No deeper restructure (side widgets / 2-col body) lands this PR:
   tournament backend data is mock today (worker-tournament tracked
   at #2148 / #2149 / #2150). Adding widgets that point at fake
   numbers would mislead operators reviewing the surface. Re-visit
   when one of those backend issues ships. */

/* `:not(.tournament-wheel-shell)` — the wheel page deliberately caps
   at 480px for the spin UI sizing (line 1474 above). Stretching it
   to 1440px would scale the spin CTA + stats row to absurd widths.
   Keep the wheel narrow; widen the hub / rewards / missions surfaces. */
.tournament-shell:not(.tournament-wheel-shell) {
  max-width: 1440px;
  padding: 24px 32px 80px;
}

/* On viewports between 1281 (the v2 mobile→desktop flip) and 1499,
   pull the canvas in slightly so the tournament cards don't stretch
   beyond a comfortable reading width. Same carve-out for the wheel. */
@media (max-width: 1499px) {
  .tournament-shell:not(.tournament-wheel-shell) {
    max-width: 1100px;
    padding: 20px 24px 64px;
  }
}

/* ─── Account 2-pane (#2232) ──────────────────────────────────────
   When `page === 'account'` under the v2 flag, the main canvas
   gets a second left column — an account-area sidebar with links
   to each `/account/*` surface. Mobile chrome keeps the drawer
   model (`ProfileDrawer.astro`); this 2-pane is desktop-only. */

.account-2pane {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 24px 32px 48px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}
.account-2pane-content {
  min-width: 0;
}

.account-side-nav {
  position: sticky;
  top: calc(var(--topbar-height) + 24px);
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
}
.account-side-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.account-side-nav-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  transition: background 120ms ease;
}
.account-side-nav-item:hover {
  background: var(--surface-2);
}
.account-side-nav-item[aria-current="page"] {
  background: var(--panel-cta-bg);
  color: var(--accent-fg);
}

/* On v2 viewports between 1281 and 1499 the 220px sidebar plus the
   account content crowds; collapse to single-column with the sidebar
   stacked at the top so the content gets the full width. */
@media (max-width: 1499px) {
  .account-2pane {
    grid-template-columns: 1fr;
  }
  .account-side-nav {
    position: static;
  }
  .account-side-nav-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .account-side-nav-item {
    flex: 0 0 auto;
  }
}


/* === Affiliate — desktop mirror ===========================================
   The /affiliate page renders the SAME AffiliateBody markup in the desktop and
   mobile shells (see modern/sections/affiliate.astro), but the `.aff-*` rules
   live only in modern-mobile.css, so /affiliate was unstyled on web view. This
   sheet is loaded exclusively on desktop (media-gated <link>), so the block is
   mirrored here. The block has no @media inside it; keep it in sync with the
   modern-mobile.css affiliate section. The single-column mobile layout is
   centered (below) instead of stretching across the desktop canvas. */
.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; }

/* Desktop: center the mobile-derived affiliate column. */
.aff-page { max-width: 720px; margin-inline: auto; box-sizing: border-box; }

/* ─── home (#2559) — game/studio tile launch ──────────────────────────────
   Stretched-link launch overlay for the desktop grids — see modern-mobile.css
   for the rationale. The desktop tile already carries `cursor: pointer` + a
   hover lift; the overlay anchor is what actually navigates into `/play`. */
.modern-game-tile-desktop {
  position: relative;
}
.modern-tile-launch {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.modern-tile-launch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.modern-game-tile-desktop.is-launching {
  opacity: 0.6;
  transform: scale(0.98);
}

/* home (#2559) — game-name search input (top of the main column) */
.modern-home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0 16px;
  height: 46px;
  max-width: 480px;
  border-radius: 12px;
  background: var(--surface-2, 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) — 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);
  backdrop-filter: blur(4px);
  cursor: pointer;
}
.modern-promo-dialog-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  padding: 30px 28px 26px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--panel-bg, var(--surface));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.modern-promo-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  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: 22px;
  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) ────────────────────────────
   Shimmer placeholder generalised from the balance-pill skeleton. Applied to
   history rows + game tiles while a page is in flight (initial load + the
   appended next-page batch under infinite scroll). `legion-skel` paints the
   shimmer; the element keeps its real layout class so it occupies the same box
   as the row/tile it stands in for. */
.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; }
}
@media (prefers-reduced-motion: reduce) {
  .legion-skel::after { animation: none; }
  .legion-skel { opacity: 0.55; }
}
/* Skeleton history row — mirrors `.hs-row`; the inner bars carry `legion-skel`. */
.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; }
/* Bottom sentinel — zero-height marker the infinite-scroll observer watches. */
.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; }
}
