/* ======================================================================
   amd168.css — theme 7, a CLONE of https://w1.amd168.app/ (26 พ.ย. 2569).

   Restatement of the old site's own CSS (React/CRA + Bootstrap 5 + a
   `--theme-*` variable layer), class for class, with its LITERAL values —
   the one place in the member site where a hex is right, because the brief
   is "เหมือนเป๊ะ 100%" and the numbers are MEASUREMENTS, not choices
   (docs/CLONE-AMD168-DESIGN.md). Every class is prefixed `amd-` so it
   cannot clash with another theme, and the file is loaded ONLY when this
   theme is active (by amd168/font.tsx), so the other six never download it.

   COLOURS GO THROUGH OUR TOKENS. The old site's `--theme-*` vars are bridged
   to our swappable palette (`--brand-*`, `--bg-*`, …) just below, so a client
   changing the DB palette later (owner's note: "ลูกค้าค่อยมาเปลี่ยนสี")
   recolours this theme without touching the layout. The structural px, the
   gradients' shape and the notch geometry are the measurements and stay.
   ====================================================================== */

.amd-shell {
  /* --- bridge: old site's --theme-* vars → our palette tokens --- */
  --amd-text: var(--text-primary, #fff);
  --amd-header-bg: linear-gradient(180deg, var(--bg-surface, #120920), var(--bg-surface, #120920));
  --amd-card-bg: linear-gradient(180deg, var(--bg-surface, #120920), var(--bg-elevated, #1c1030));
  --amd-footer-bg: linear-gradient(180deg, var(--bg-surface, #120920), var(--bg-elevated, #1c1030));
  --amd-footer-stop-1: var(--bg-surface, #120920);
  --amd-footer-stop-2: var(--bg-elevated, #1c1030);
  --amd-gold: var(--gradient-brand, linear-gradient(180deg, #f8dc37, #cda506));
  --amd-gold-text: var(--text-on-brand, #070210);
  --amd-register-bg: linear-gradient(90deg, var(--brand-900, #8d0b02), var(--danger, #fb0001));
  --amd-login-bg: linear-gradient(90deg, var(--brand-500, #cda506), var(--brand-300, #f8dc37));
  --amd-gold-flat: var(--brand-500, #cda506);
  --amd-tertiary: var(--accent, #f8dc37);

  /* The inner page views are cloned from นิวเจน (a LIGHT theme with a dark
     "inverse" surface for its cards). amd168 is already DARK, so these three
     "inverse" names alias straight to the theme's own dark tokens — a card is
     just a surface here, not an inversion. Lets the page views stay verbatim. */
  --surface-inverse: var(--bg-elevated, #1c1030);
  --border-inverse: var(--border-strong, rgba(205, 165, 6, 0.5));
  --text-on-inverse: var(--text-primary, #fff);

  color: var(--amd-text);
  background: var(--bg-base, #070210);
  min-height: 100vh;
  font-family: var(--font-sans, "Noto Sans Thai", sans-serif);
}

/* ---------------------------------------------------------------------- *
   Header — `.fpm-header` / `.fpm-header-content`.
   Fixed, 58px, the dark gradient, logo 42px. On the old site it is centred
   text with a brand on the left and a user block on the right.
 * ---------------------------------------------------------------------- */

.amd-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9;
  text-align: center;
  color: #fff;
  backface-visibility: hidden;
}
.amd-header-content {
  background: var(--amd-header-bg);
  padding: 0.5rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}
.amd-header-in {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0.75rem;
}
.amd-brand {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5rem;
}
.amd-brand img {
  height: 42px;
  width: auto;
  transition: transform 0.2s;
}
.amd-brand:hover img {
  transform: scale(1.1);
}
.amd-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}
.amd-user {
  text-align: right;
  line-height: 1.2;
  font-size: 0.8rem;
}
.amd-user .name {
  color: var(--amd-tertiary);
  font-weight: 600;
}
.amd-user .bal {
  color: #fff;
}
.amd-user .bal b {
  color: var(--amd-tertiary);
}
.amd-lang {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: #fff;
  white-space: nowrap;
}
/* Hamburger — `.navbar-toggler`, white 3-bar. */
.amd-burger {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
}
.amd-burger span {
  display: block;
  height: 2px;
  width: 22px;
  margin: 0 auto;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.85);
}
/* Spacer under the fixed header. */
.amd-header-spacer {
  height: 58px;
}

/* ---------------------------------------------------------------------- *
   Bottom bar — footer-style-5: four items + a centred play button that
   sits in an SVG notch. ft-home / ft-deposit | play | ft-withdraw /
   ft-contact. The notch gradient is the footer's two stops.
 * ---------------------------------------------------------------------- */

.amd-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 30;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
}
.amd-footer-menu {
  position: relative;
  display: flex;
  height: 58px;
}
.amd-footer-item {
  flex-grow: 1;
  width: 25%;
  text-align: center;
  /* w1.amd168.app .footer-menu-item = dark gradient bar (was transparent) */
  background: linear-gradient(to bottom, #120920, #1c1030);
  border-top: 0;
}
.amd-footer-item#amd-ft-home {
  border-top-left-radius: 10px;
}
.amd-footer-item#amd-ft-deposit {
  border-top-right-radius: 22px;
}
.amd-footer-item#amd-ft-withdraw {
  border-top-left-radius: 22px;
}
.amd-footer-item#amd-ft-contact {
  border-top-right-radius: 10px;
}
.amd-footer-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  padding-top: 0.4rem;
  padding-bottom: 0.6rem;
  text-decoration: none;
  color: var(--amd-text);
  transition: transform 0.25s;
}
.amd-footer-link:hover {
  transform: scale(1.1);
}
.amd-footer-link .img {
  display: inline-block;
  height: 2.5rem;
  width: 2.5rem;
  margin: 0 auto;
}
.amd-footer-link .img img {
  display: block;
  width: 100%;
}
.amd-footer-link .text {
  display: block;
  line-height: 1;
  font-size: 0.72rem;
  color: #fff;
}
/* Centre play button — pops above the bar, gold, over the SVG notch. */
.amd-footer-play {
  position: relative;
  min-width: 92px;
  max-width: 92px;
  flex: 0 0 92px;
  background: transparent !important;
  border-top: 0 !important;
}
.amd-footer-play .notch {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 58px;
  overflow: hidden;
  z-index: -1;
}
.amd-footer-play .notch svg {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  height: 110px;
}
.amd-footer-play .btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 5rem;
  height: 5rem;
  margin: -2.75rem auto 0;
  border-radius: 50%;
  background: var(--amd-gold);
  box-shadow: var(--shadow-float, 0 10px 34px rgba(205, 165, 6, 0.45));
}
.amd-footer-play .btn img {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
}
.amd-footer-play .text {
  display: block;
  margin-top: -10px;
  font-size: 0.72rem;
  color: var(--amd-gold-text);
  position: relative;
}

/* ---------------------------------------------------------------------- *
   Page body — the old `.fpm-body` is a fixed, centred, scrolling column.
   We keep the ordinary document flow (our app scrolls the page) but match
   its ground, top offset and bottom clearance for the fixed bars.
 * ---------------------------------------------------------------------- */

.amd-body {
  min-height: 100vh;
  padding-top: 58px;
  padding-bottom: calc(58px + 24px + env(safe-area-inset-bottom));
  background: var(--bg-base, #070210);
}
.amd-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  padding: 0 0.75rem;
}
.amd-page-title {
  text-align: center;
  font-weight: 600;
  font-size: 1.25rem;
  color: #fff;
  padding: 1rem 0;
}

/* ---------------------------------------------------------------------- *
   Shared buttons — gold (login/primary), red (register/withdraw action).
 * ---------------------------------------------------------------------- */

.amd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 0;
  border-radius: 0.25rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, filter 0.2s;
}
.amd-btn:hover {
  filter: brightness(1.05);
}
.amd-btn-gold {
  background: var(--amd-gold);
  color: var(--amd-gold-text);
}
.amd-btn-register {
  background: var(--amd-register-bg);
  color: #fff;
}
.amd-btn-login {
  background: var(--amd-login-bg);
  color: var(--amd-gold-text);
}
.amd-btn-block {
  width: 100%;
}

/* ---------------------------------------------------------------------- *
   Home sections — hero, marquee, credit card, quick menu, game wall,
   promotions. Values measured from the old site; colours via tokens.
 * ---------------------------------------------------------------------- */

.amd-home {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.5rem 0;
}

/* Hero banner carousel (one slide shown). */
.amd-hero {
  margin: 0 0.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
}
.amd-hero-slide {
  display: block;
}
.amd-hero-slide img {
  display: block;
  width: 100%;
  height: auto;
}

/* Marquee — dark strip, gold text scrolling. */
.amd-marquee {
  margin: 0 0.5rem;
  background: var(--amd-card-bg);
  border: 1px solid var(--border-subtle, rgba(205, 165, 6, 0.3));
  border-radius: 0.4rem;
  overflow: hidden;
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
  color: var(--amd-tertiary);
}
.amd-marquee .track {
  display: inline-block;
  padding-left: 100%;
  animation: amd-marquee 22s linear infinite;
}
@keyframes amd-marquee {
  to {
    transform: translateX(-100%);
  }
}

/* Credit card. */
.amd-credit {
  margin: 0 0.5rem;
  text-align: center;
  background: var(--amd-card-bg);
  border: 1px solid var(--border-subtle, rgba(205, 165, 6, 0.35));
  border-radius: 0.6rem;
  padding: 0.9rem 1rem;
}
.amd-credit-label {
  font-size: 0.8rem;
  color: #cfcfcf;
}
.amd-credit-amount {
  font-size: 2rem;
  font-weight: 700;
  color: var(--amd-tertiary);
  line-height: 1.2;
}
.amd-credit-sub {
  font-size: 0.78rem;
  color: #bdbdbd;
}
/* Green เครดิตเงินคืน button + ยอดเล่น line (w1.amd168.app .bg-play + turnover) */
.amd-credit-cashback {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  padding: 4px 24px; border-radius: 4px; text-decoration: none;
  background: linear-gradient(45deg, #7adb02, #64c700 35%, #33a000);
  color: #fff; font-weight: 700; font-size: 0.9rem;
}
.amd-credit-turnover { margin-top: 10px; font-size: 1rem; color: #fff; }
.amd-credit-turnover .money { color: var(--amd-tertiary); font-weight: 700; }

/* ======================================================================
   The old site's OWN component, w1.amd168.app `.tab-games-selector-item`,
   used by BOTH the quick menu (.tab-games-selector-style-0) AND the game
   category tabs (inside .main-popular-games). Values measured from the live
   site at 392px: tile 68x59, radius 8, dark gradient; icon 50px FLOATING
   (margin-top -25px); h5 label 11.76px; active = gold gradient, black text.
   auto-fill makes the per-row count respond EXACTLY like the original
   (5 across at 392, fewer when narrower). Rows are spaced 15px (the tile's
   margin-bottom on the old site) so the next row's floating icon never
   overlaps, and the container's top padding holds the first row's float.
   ====================================================================== */
.main-popular-games { padding: 0 0.5rem; }
.tab-games-selector {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  column-gap: 4px;
  row-gap: 15px;
  padding-top: 18px;
}
.tab-games-selector-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  padding: 10px 0 5px;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(to bottom, #120920, #1c1030);
  color: #fff;
}
.tab-games-selector-item > img {
  width: 50px;
  height: 50px;
  margin-top: -25px;
  object-fit: contain;
  display: block;
}
.tab-games-selector-item .title {
  margin: 5px 0 0;
  font-size: 0.735rem;
  line-height: 1.2;
  font-weight: 600;
  max-width: 100%;
}
.tab-games-selector-item.active {
  background: linear-gradient(to bottom, var(--brand-500, #cda506), var(--brand-300, #f8dc37));
  color: #070210;
}
.tab-games-selector-item.active .title { color: #070210; }
/* Category tabs (inside .amd-games): ONE row that scrolls right, matching the
   live original at this width (the extra ค่าย — ไพ่/ยิงปลา — continue to the
   right instead of wrapping to a second line). The quick menu keeps its grid
   (.tab-games-selector-style-0), which holds five items on one line. */
.amd-games .tab-games-selector {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  column-gap: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.amd-games .tab-games-selector::-webkit-scrollbar { display: none; }
.amd-games .tab-games-selector-item {
  flex: 0 0 auto;
  width: 64px;
}
/* Bootstrap-name utilities the old markup uses, SCOPED to this component so
   they cannot touch anything else on the amd168 page. */
.tab-games-selector-item .text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-games-selector-item .text-white { color: #fff; }
.tab-games-selector-item .text-center { text-align: center; }
.tab-games-selector-item .w-100 { width: 100%; }

/* Game wall — tabs + ค่าย grid. */
.amd-games {
  padding: 0 0.5rem;
}
.amd-game-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
@media (min-width: 768px) {
  .amd-game-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
.amd-game-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  aspect-ratio: 1 / 1;
  width: 100%;
  border: 0;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--amd-card-bg);
  cursor: pointer;
}
.amd-game-tile .cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.amd-game-tile .fallback {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--amd-tertiary);
  margin: auto;
}
.amd-game-tile .name {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0.25rem;
  font-size: 0.68rem;
  color: #fff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.8));
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.amd-tile-err {
  font-size: 0.7rem;
  color: var(--danger, #fb0001);
  text-align: center;
}
.amd-empty {
  text-align: center;
  color: #cfcfcf;
  padding: 1.5rem 0;
}
.amd-room-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.amd-room-head .back {
  background: var(--amd-card-bg);
  color: #fff;
  border: 0;
  border-radius: 0.3rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
}
.amd-room-head h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
}
.amd-room-head h2 span {
  font-weight: 300;
  color: #bdbdbd;
  font-size: 0.85rem;
}

/* Hot promotions. */
.amd-promos {
  padding: 0 0.5rem;
}
.amd-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  padding: 0.5rem 0;
}
.amd-promo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}
@media (min-width: 768px) {
  .amd-promo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.amd-promo-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--amd-card-bg);
  border: 1px solid var(--border-subtle, rgba(205, 165, 6, 0.25));
  border-radius: 0.5rem;
  overflow: hidden;
}
.amd-promo-card img {
  width: 100%;
  height: auto;
  display: block;
}
.amd-promo-name {
  padding: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--amd-tertiary);
}
.amd-promo-desc {
  padding: 0 0.5rem 0.5rem;
  font-size: 0.72rem;
  color: #cfcfcf;
}

/* ---------------------------------------------------------------------- *
   Inner pages (phase 3-5) — the "← ชื่อหน้า" strip and the dark content
   card the deposit/withdraw/promotions/referrals/wheel views sit on. The
   card is the site's own card gradient with a gold hairline; the strip is
   a 32px gold-outlined back box and the title. Structural px measured off
   the old site's inner pages; colours via tokens.
 * ---------------------------------------------------------------------- */

.amd-pg-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.25rem 0.1rem 0.75rem;
}
.amd-pg-back {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  flex: 0 0 32px;
  color: var(--amd-gold-text);
  background: var(--amd-gold);
}
.amd-pg-title h1 {
  font-size: 0.98rem;
  font-weight: 600;
  color: #fff;
}
.amd-pg-card {
  background: var(--amd-card-bg);
  border: 1px solid var(--border-subtle, rgba(205, 165, 6, 0.22));
  border-radius: 0.6rem;
  padding: 0.9rem;
  box-shadow: var(--shadow-card);
}
.amd-pg-head {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--amd-tertiary);
}
.amd-pg-note-red {
  display: block;
  font-size: 0.8rem;
  color: var(--danger, #fb0001);
  text-decoration: underline;
}

/* ---------------------------------------------------------------------- *
   Auth screens (login / register) — a centred dark card on the black
   ground with a gold hairline. TODO-AMD: the real amd168 login/register
   were not measured; this is the นิวเจน template restyled (see auth.tsx).
 * ---------------------------------------------------------------------- */

.amd-auth {
  min-height: 100vh;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  background: var(--bg-base, #070210);
}
.amd-auth-logo {
  display: block;
  width: 60%;
  max-width: 220px;
  margin: 0 auto 1.5rem;
}
.amd-auth-logo img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.amd-auth-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--amd-card-bg);
  border: 1px solid var(--border-strong, rgba(205, 165, 6, 0.5));
  border-radius: 0.6rem;
  padding: 1.1rem;
  box-shadow: var(--shadow-card);
}
.amd-auth-field {
  display: block;
}
.amd-auth-field > span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
}
.amd-auth-row {
  display: flex;
  justify-content: flex-end;
  font-size: 0.8rem;
}
.amd-auth-error {
  border-radius: 0.3rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  background: var(--danger, #fb0001);
  color: #fff;
}
.amd-auth-foot {
  margin-top: auto;
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted, #9a9a9a);
}

/* Withdraw quick-amount chips (amd168). */
.amd-wd-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.amd-wd-chips button {
  border: 1px solid var(--border-strong, rgba(205, 165, 6, 0.5));
  background: var(--amd-card-bg);
  color: var(--amd-tertiary);
  border-radius: 0.25rem;
  padding: 0.4rem 0;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.amd-wd-chips button:hover {
  background: var(--amd-gold);
  color: var(--amd-gold-text);
}

/* ====================================================================== *
   Phase 7 (26 พ.ย.) — match รูป2/3/4: member header, gold icon menus,
   gold bottom nav with ship-wheel, drawer grid. Overrides earlier rules.
 * ====================================================================== */

/* --- Header: member user block + hamburger --- */
.amd-header-content { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6); }
.amd-header-in { gap: 0.4rem; }
.amd-user { text-align: right; line-height: 1.25; font-size: 0.72rem; color: #fff; }
.amd-user .name b { color: var(--amd-tertiary); font-weight: 700; }
.amd-user .bal .money { color: var(--amd-tertiary); font-weight: 700; }
.amd-bal-refresh {
  display: inline-flex; vertical-align: middle; margin-left: 0.25rem;
  color: var(--danger, #fb0001);
}
.amd-burger { color: #fff; width: 32px; height: 32px; gap: 0; align-items: center; }
.amd-btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; }

/* --- Category pill: dark ribbon header over the grid --- */
.amd-cat-pill {
  margin: 0.4rem auto 0.6rem; text-align: center;
}
.amd-cat-pill span {
  display: inline-block; padding: 0.35rem 2.2rem; border-radius: 999px;
  background: linear-gradient(180deg, #19102e, #0b061a);
  border: 1px solid var(--border-subtle, rgba(205, 165, 6, 0.25));
  color: #fff; font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* --- Bottom nav: gold icons + labels, ship-wheel centre --- */
.amd-footer { height: calc(79px + env(safe-area-inset-bottom)); }
.amd-footer-menu { height: 79px; }
.amd-footer-link { color: var(--amd-tertiary); }
.amd-footer-link .ic { display: grid; place-items: center; height: 40px; color: var(--amd-tertiary); }
.amd-footer-link .ic img { width: 40px; height: 40px; object-fit: contain; }
.amd-footer-link .text { font-size: 0.68rem; font-weight: 600; color: var(--amd-tertiary); }
.amd-footer-play .btn {
  width: 80px; height: 80px; margin: -30px auto 0;
  background: radial-gradient(circle at 50% 35%, #1b1234, #0a0518);
  border: 2px solid var(--brand-500, #cda506);
  color: var(--amd-tertiary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 14px color-mix(in srgb, var(--brand-500, #cda506) 35%, transparent);
}
.amd-footer-play .btn img { display: none; }
.amd-footer-play .text { color: var(--amd-tertiary); margin-top: 2px; }

/* --- Drawer: grid of labelled gold-icon tiles (รูป4) --- */
.amd-drawer-scrim {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.6);
  transition: opacity 0.2s;
}
.amd-drawer {
  position: fixed; inset-block: 0; right: 0; z-index: 50;
  width: 360px; max-width: 90vw; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #0e091e, #070210); color: #fff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.6); transition: transform 0.25s ease;
  overflow-y: auto;
}
.amd-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--border-subtle, rgba(205, 165, 6, 0.25));
}
.amd-drawer-logo { height: 34px; width: auto; }
.amd-drawer-x { color: #fff; width: 34px; height: 34px; display: grid; place-items: center; background: none; border: 0; cursor: pointer; }
.amd-drawer-lang {
  display: flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.6rem; font-size: 0.8rem; color: #fff;
}
.amd-drawer-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; padding: 0.75rem;
}
.amd-drawer-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.4rem; padding: 0.9rem 0.3rem; text-decoration: none; cursor: pointer;
  background: linear-gradient(180deg, #150c26, #090414);
  border: 1px solid var(--border-subtle, rgba(205, 165, 6, 0.25)); border-radius: 0.6rem;
  color: #fff; font-size: 0.72rem; font-weight: 600;
}
.amd-drawer-tile .ic {
  display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #211539, #0d081c);
  border: 1px solid var(--border-strong, rgba(205, 165, 6, 0.5));
  color: var(--amd-tertiary);
}
.amd-drawer-tile .ic.out { color: var(--danger, #fb0001); border-color: var(--danger, rgba(251, 0, 1, 0.5)); }

/* Phase 8 — use the old site's own icon PNGs (client's files). The centre
   play button is the animated ship-wheel art itself, so no dark disc/ring. */
.amd-footer-play .btn { background: transparent; border: 0; box-shadow: none; }
.amd-footer-play .btn img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* The icon discs hold a pre-coloured PNG; drop the glyph tint. */
.amd-drawer-tile .ic img, .amd-footer-link .ic img { object-fit: contain; }

/* Phase 11 — original gold frame on game tiles (our own styling, NOT the old
   site's branded g-banner frames, which carry another brand's mark). Gives the
   "framed" look with a hairline gold edge + inner glow. */
.amd-game-tile {
  border: 1px solid var(--border-strong, rgba(205, 165, 6, 0.5));
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.amd-game-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand-500, #cda506) 30%, transparent);
  pointer-events: none;
  z-index: 2;
}
