/* FAH STORE: a calm, mobile-first storefront. Customer tokens do not affect admin. */
body.storefront-shell {
  color-scheme: light;
  --bg: #f7f5f0; --surface: #fff; --surface-2: #f1efe9;
  --line: #e3e0d8; --line-strong: #c2bdb1; --fg: #222823; --fg-2: #656a62;
  --accent: #222823; --accent-fg: #fff; --accent-soft: #eceee8;
  --ok: #326146; --ok-soft: #edf4ee; --warn: #805d25; --warn-soft: #fbf3e5;
  --err: #a33337; --err-soft: #fff0ef; --brass: #86633d;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --shadow: none; --shadow-lift: none;
  --bg-main: var(--bg); --bg-secondary: var(--surface); --surface-soft: var(--surface-2);
  --surface-blue: var(--accent-soft); --primary: var(--accent); --primary-hover: #3b443b;
  --primary-light: var(--accent-soft); --text-primary: var(--fg); --text-secondary: var(--fg-2);
  --text-muted: var(--fg-2); --border: var(--line); --border-blue: var(--line-strong);
  --success: var(--ok); --success-bg: var(--ok-soft);
  --radius-sm: var(--r-sm); --radius-md: var(--r); --radius-lg: var(--r-lg); --radius-xl: 16px;
  --shadow-sm: none; --shadow-md: none; --shadow-blue: none;
  font-family: -apple-system, BlinkMacSystemFont, "Noto Sans Thai", "Thonburi", "Tahoma", "Segoe UI", sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; padding: 12px 20px; background: #222823; color: #fff; border-radius: 6px; }
.skip-link:focus { top: 12px; }
.storefront-shell :focus-visible { outline: 2px solid var(--brass); outline-offset: 4px; }
.storefront-shell main:focus { outline: none; }
.storefront-shell :is(a,button,input,summary) { touch-action: manipulation; }
.storefront-shell svg { width: 20px; height: 20px; flex: none; }
.storefront-shell main { max-width: 960px; padding: 28px 20px 48px; min-width: 0; }
.storefront-shell main.catalog-main { max-width: 1160px; }
#journey-store { width: 100%; }
/* Solid surfaces keep scroll and the 3D handoff inexpensive. */
.storefront-shell .topbar { min-height: 72px; gap: 16px; padding: max(12px,env(safe-area-inset-top)) 20px 12px; border-bottom: 1px solid var(--line); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
.storefront-shell .brand { color: var(--fg); flex: none; }
.brand-wordmark { display: flex; align-items: baseline; gap: 10px; font: 500 30px/1 Georgia, "Times New Roman", serif; letter-spacing: -1px; }
.brand-word { font: 500 9px/1.2 -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: 2px; color: var(--fg-2); }
.storefront-shell .topnav { display: none; order: 2; margin-left: auto; gap: 4px; }
.storefront-shell .topnav a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 12px; border-radius: 4px; font-size: 14px; }
.storefront-shell .topnav a.on { background: transparent; color: var(--fg); text-decoration: underline; text-underline-offset: 9px; text-decoration-color: var(--brass); }
.customer-actions { display: flex; order: 3; margin-left: auto; }
.signin-link,.account-menu>summary { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; color: var(--fg); padding: 8px 12px; font-size: 13px; border: 1px solid #cbbb9f; border-radius: 7px; background: linear-gradient(#fffdf8,#f1ede4); box-shadow: 0 2px 6px #22282308; cursor: pointer; }
.signin-link svg,.account-menu>summary svg { width: 18px; height: 18px; }
.account-menu { position: relative; }
.account-menu>summary { list-style: none; }
.account-menu>summary::-webkit-details-marker { display: none; }
.account-menu[open]>summary { background: var(--surface-2); border-color: var(--line-strong); }
.account-menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; width: 220px; max-width: calc(100vw - 40px); padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 8px 24px #22282314; }
.account-menu-panel a,.account-menu-panel button { display: flex; align-items: center; min-height: 44px; width: 100%; padding: 8px 12px; color: var(--fg); font: inherit; font-size: 13px; text-align: left; border: 0; border-radius: 4px; background: transparent; cursor: pointer; }
.account-menu-panel a:hover,.account-menu-panel button:hover { background: var(--surface-2); }
.account-menu-panel form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--line); }
.storefront-shell .tabbar { position: fixed; bottom: 0; left: 0; min-height: calc(66px + env(safe-area-inset-bottom)); padding: 4px 8px max(4px,env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); backdrop-filter: none; -webkit-backdrop-filter: none; }
.storefront-shell .tabbar a { min-height: 56px; color: var(--fg-2); font-size: 10px; border-radius: 4px; gap: 4px; }
.storefront-shell .tabbar a.on { color: var(--fg); font-weight: 650; }
.storefront-shell .tabbar svg { width: 20px; height: 20px; }
.storefront-shell .btn { min-height: 48px; padding: 12px 20px; border: 1px solid #494b3c; border-radius: 7px; background: linear-gradient(#354035,#222823); color: #fbf8f0; font-size: 14px; font-weight: 550; box-shadow: inset 0 1px 0 #d8c69b30,0 3px 8px #22282312; }
.storefront-shell .btn.block { display: flex; }
.storefront-shell .btn.sm { min-height: 44px; font-size: 13px; }
.storefront-shell .btn:hover { opacity: .9; }
.storefront-shell .btn.ghost { background: var(--surface); color: var(--fg); border: 1px solid var(--line-strong); }
.storefront-shell .btn.soft { background: linear-gradient(#faf7ef,#eee7db); border-color: #cbbb9f; color: var(--fg); box-shadow: none; }
.storefront-shell .btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.storefront-shell .card { border-radius: 10px; box-shadow: none; }
.storefront-shell input:not([type=radio]):not([type=checkbox]),.storefront-shell select,.storefront-shell textarea { font-size: 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.storefront-shell label { color: var(--fg); }
.storefront-shell .flash { padding: 14px 16px; margin-bottom: 18px; border-radius: 6px; font-size: 14px; }
/* The catalogue starts with products, not a second full-screen introduction. */
.shop-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 16px 0 32px; }
.eyebrow { color: var(--brass); font-size: 10px; font-weight: 500; letter-spacing: 2px; margin: 0 0 12px; }
.shop-intro h1 { font-size: clamp(30px,5vw,46px); font-weight: 500; line-height: 1.45; letter-spacing: -.7px; margin: 0; }
.intro-description { color: var(--fg-2); font-size: 14px; margin: 12px 0 0; line-height: 1.8; }
.world-return,.text-link { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; color: var(--fg-2); font: inherit; font-size: 12px; border: 0; background: transparent; cursor: pointer; }
.world-return { flex: none; color: var(--brass); }
.world-return svg,.text-link svg { width: 16px; height: 16px; }
.world-status { padding: 12px 16px; border: 1px solid var(--line); border-radius: 6px; color: var(--fg-2); font-size: 13px; }
.catalog-section { scroll-margin-top: 90px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; border-top: 1px solid var(--line); margin-bottom: 16px; }
.section-heading h2 { margin: 0; font-size: 17px; font-weight: 550; line-height: 1.5; }
.catalog-search { display: flex; align-items: center; gap: 12px; margin: 0; padding: 0 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--fg-2); }
.storefront-shell .catalog-search input { border: 0; background: transparent; min-width: 0; min-height: 50px; padding: 12px 0; border-radius: 0; }
.storefront-shell .catalog-search input:focus { box-shadow: none; }
.catalog-search:focus-within { outline: 2px solid var(--brass); outline-offset: 3px; }
.storefront-shell .catalog-search input:focus-visible { outline: none; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0 18px; }
.catalog-filters { display: flex; align-items: center; gap: 4px; }
.filter-chip { min-height: 44px; padding: 8px 14px; border: 1px solid transparent; border-radius: 5px; color: var(--fg-2); background: transparent; font: inherit; font-size: 12px; cursor: pointer; }
.filter-chip.active { background: #eee8dc; color: var(--fg); border-color: #cbbb9f; }
.results-count { color: var(--fg-2); font-size: 11px; text-align: right; }
.product-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.storefront-shell .product-card { min-width: 0; padding: 0; margin: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.product-link { display: flex; flex-direction: column; height: 100%; color: var(--fg); }
.product-cover { aspect-ratio: 16/10; background: #eeece6; overflow: hidden; display: grid; place-items: center; }
.product-cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: #878e81; }
.product-placeholder svg { width: 48px; height: 48px; stroke-width: 1; }
.product-details { display: flex; flex: 1; flex-direction: column; min-width: 0; padding: 18px; }
.product-card .name { font-size: 17px; font-weight: 550; line-height: 1.55; margin: 0 0 6px; overflow-wrap: anywhere; }
.product-availability { color: var(--fg-2); font-size: 11px; margin: 0 0 18px; }
.product-availability.available { color: var(--ok); }
.product-bottom { display: flex; align-items: end; margin-top: auto; }
.price-caption { display: block; color: var(--fg-2); font-size: 10px; }
.product-card .price { display: block; color: var(--fg); font-size: 25px; font-weight: 500; line-height: 1.4; letter-spacing: -.4px; overflow-wrap: anywhere; }
.product-go { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 46px; margin-top: 16px; padding: 10px 12px; border: 1px solid #cbbb9f; border-radius: 6px; background: linear-gradient(#fffdf8,#f3eee4); box-shadow: 0 2px 6px #22282308; font-size: 12px; font-weight: 500; }
.product-go svg { width: 16px; height: 16px; }
.product-link:hover .product-go { background: linear-gradient(#354035,#222823); border-color: #494b3c; color: #fbf8f0; }
.empty { text-align: center; padding: 36px 20px; color: var(--fg-2); }
.empty h3 { color: var(--fg); font-size: 18px; font-weight: 550; margin: 0 0 8px; }
.empty p { font-size: 14px; }
.how-section { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.how-section h2 { margin: 0 0 24px; font-size: 18px; font-weight: 550; }
.how-steps { list-style: none; display: grid; gap: 24px; margin: 0; padding: 0; }
.how-steps li { display: flex; align-items: baseline; gap: 16px; }
.step-number { color: var(--brass); font: 400 20px/1 Georgia,serif; }
.how-steps h3 { margin: 0; font-size: 14px; font-weight: 550; }
.how-steps p { color: var(--fg-2); margin: 4px 0 0; font-size: 12px; }
.storefront-shell .store-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; max-width: 1160px; padding: 24px 20px 32px; text-align: left; border-top: 1px solid var(--line); }
.store-footer strong { display: block; font-size: 11px; letter-spacing: 1px; font-weight: 550; color: var(--fg); }
.store-footer>div>span { display: block; font-size: 11px; margin-top: 5px; }
.footer-payments { display: flex; align-items: center; gap: 12px; }
.store-footer .footer-payments>span { margin: 0; }
.footer-payments img { object-fit: contain; }
.storefront-shell .store-footer .install-btn { min-height: 44px; width: auto; padding: 8px 12px; font-size: 12px; gap: 8px; border-radius: 6px; background: transparent; box-shadow: none; }
.store-footer .install-btn .ic { background: transparent; color: var(--fg); }
/* Native forms keep a clear sequence and one purchase action. */
.back-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg-2); font-size: 13px; margin-bottom: 20px; }
.purchase-page { display: grid; gap: 32px; min-width: 0; }
.product-overview { min-width: 0; }
.hero-banner { position: relative; aspect-ratio: 16/10; border-radius: 8px; overflow: hidden; background: #eeece6; margin-bottom: 24px; }
.hero-banner img,.hero-banner video { display: block; width: 100%; height: 100%; object-fit: contain; }
.product-overview h1 { font-size: clamp(26px,4vw,36px); font-weight: 550; line-height: 1.5; overflow-wrap: anywhere; }
.product-overview .product-description { margin: 12px 0 0; font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.sound-toggle { position: absolute; right: 12px; bottom: 12px; min-width: 44px; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 16px; }
.sound-toggle .sound-on,.sound-toggle.on .sound-off { display: none; }
.sound-toggle.on .sound-on { display: inline; }
.purchase-form { min-width: 0; }
.purchase-step { min-width: 0; border: 0; margin: 0 0 28px; padding: 0; }
.purchase-step-heading { width: 100%; display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; padding: 0; font-size: 17px; font-weight: 550; }
.section-number { color: var(--brass); font-size: 11px; letter-spacing: 1px; }
.plan-list,.payment-list { display: grid; gap: 10px; }
.storefront-shell .plan { display: flex; align-items: center; gap: 12px; min-height: 80px; margin: 0; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; box-shadow: none; }
.storefront-shell .plan:has(input:checked) { border-color: var(--fg); background: #f1f2ed; box-shadow: inset 3px 0 0 var(--fg); }
.storefront-shell .plan.out { opacity: 1; color: var(--fg-2); background: var(--surface-2); }
.storefront-shell .plan input { width: 20px; height: 20px; min-height: 20px; padding: 0; margin: 0; accent-color: var(--fg); flex: none; }
.plan-copy { min-width: 0; }
.plan-copy .title { display: block; overflow-wrap: anywhere; }
.storefront-shell .plan .title { font-size: 15px; font-weight: 550; line-height: 1.65; }
.plan-stock { display: block; font-size: 11px; margin-top: 4px; }
.plan-prices { display: flex; flex-direction: column; flex-shrink: 0; align-items: flex-end; line-height: 1.45; font-size: 20px; font-weight: 550; }
.plan-prices .was { font-size: 12px; }
.storefront-shell .payment-option { gap: 12px; }
.storefront-shell .payment-option .pay-logo { width: 42px; max-width: 42px; height: 28px; margin: 0; object-fit: contain; flex: none; }
.storefront-shell .payment-option .title { font-size: 13px; }
.storefront-shell .sticky-bar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 18; padding: 12px 0; margin: 0; background: var(--bg); border: 0; box-shadow: none; backdrop-filter: none; }
.purchase-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 12px; padding-bottom: 10px; }
.purchase-summary span { min-width: 0; overflow-wrap: anywhere; color: var(--fg-2); }
.purchase-summary strong { flex: none; font-size: 21px; font-weight: 550; font-variant-numeric: tabular-nums; }
.purchase-note { font-size: 11px; text-align: center; color: var(--fg-2); margin: 8px 0 0; }
.storefront-shell .rank-note { color: var(--ok); background: var(--ok-soft); border-radius: 6px; padding: 10px 12px; font-size: 12px; line-height: 1.8; margin: 0 0 14px; }
/* Account and payment pages inherit the same restrained surfaces. */
.storefront-shell .list-item { border-radius: 8px; box-shadow: none; }
.storefront-shell .list-item .title { overflow-wrap: anywhere; }
.storefront-shell .pay-hero { background: var(--surface); }
.storefront-shell .amount { font-weight: 500; }
.storefront-shell .bank-row { gap: 16px; }
.storefront-shell .bank-row .v { min-width: 0; }
.storefront-shell .keybox { overflow-wrap: anywhere; }
.storefront-shell .rank-card { background: var(--surface); }
.auth-page { max-width: 440px; margin: 12px auto 0; }
.auth-heading { margin-bottom: 28px; }
.auth-heading h1 { font-size: 30px; font-weight: 500; margin: 0 0 10px; }
.auth-heading p { color: var(--fg-2); font-size: 14px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--fg); font-size: 14px; }
.btn-google:hover { background: var(--surface-2); }
.btn-google span { min-width: 0; }
.auth-or { display: flex; align-items: center; gap: 16px; margin: 20px 0; color: var(--fg-2); font-size: 12px; }
.auth-or::before,.auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.storefront-shell .auth-form { padding: 24px; }
.auth-form .field { margin-bottom: 20px; }
.auth-form .field label { font-size: 13px; margin-bottom: 8px; }
.field-hint { color: var(--fg-2); font-size: 12px; margin-top: 7px; }
.password-wrap { position: relative; }
.storefront-shell .password-wrap input { padding-right: 74px; }
.password-toggle { position: absolute; right: 4px; top: 4px; min-height: 40px; min-width: 60px; padding: 8px; color: var(--fg-2); border: 0; border-radius: 4px; background: transparent; font: inherit; font-size: 12px; cursor: pointer; }
.auth-switch { color: var(--fg-2); margin-top: 24px; }
.auth-switch a { display: inline-flex; align-items: center; min-height: 44px; color: var(--fg); text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 599px) {
  .shop-intro { display: block; padding: 6px 0 24px; }
  .world-return { margin-top: 12px; }
  .product-grid { gap: 12px; }
  .product-details { padding: 14px 12px; }
  .product-card .name { font-size: 14px; }
  .product-card .price { font-size: 23px; }
  .product-go { font-size: 11px; padding: 10px 9px; margin-top: 12px; gap: 4px; }
  .store-footer .footer-payments { flex-wrap: wrap; }
  .storefront-shell .auth-form { padding: 20px; }
}
@media (max-width: 359px) {
  .storefront-shell main { padding-left: 16px; padding-right: 16px; }
  .product-grid { grid-template-columns: minmax(0,1fr); }
  .product-details { padding: 18px; }
  .product-card .name { font-size: 17px; }
  .section-heading { gap: 8px; }
  .section-heading h2 { font-size: 15px; }
  .text-link { font-size: 11px; }
  .storefront-shell .plan { padding: 12px; gap: 10px; }
  .plan-prices { font-size: 18px; }
}
@media (min-width: 700px) {
  .product-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
  .how-steps { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; }
}
@media (min-width: 900px) {
  body.storefront-shell { padding-bottom: 0; }
  .storefront-shell .topbar { padding-left: max(24px,calc((100vw - 1120px)/2)); padding-right: max(24px,calc((100vw - 1120px)/2)); gap: 20px; }
  .storefront-shell .topnav { display: flex; }
  .customer-actions { margin-left: 4px; }
  .storefront-shell .tabbar { display: none; }
  .purchase-page { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 48px; align-items: start; }
  .product-overview { position: sticky; top: 100px; }
  .storefront-shell .sticky-bar { bottom: 16px; }
  .storefront-shell main { padding-top: 40px; }
  .auth-page { margin-top: 24px; }
}
/* app.css hides mobile navigation at 760px; keep it until the full menu fits. */
@media (min-width: 760px) and (max-width: 899px) { .storefront-shell .tabbar { display: grid; } }
@media (prefers-reduced-motion: reduce) { .storefront-shell *, .storefront-shell *::before, .storefront-shell *::after { scroll-behavior: auto !important; } }

/* Rewards retain their wheel, modal, toast, and key layout contracts. */
.rw { --rw-ink: #f4f0e8; --rw-dim: #c8c1b5; --rw-line: #ffffff1f; display: grid; gap: 16px; }
.rw-main { display: grid; gap: 16px; }
.rw-col { display: grid; gap: 16px; align-content: start; }
.rw-arena-card { order: -1; }
.rw-dark { position: relative; overflow: hidden; border-radius: var(--radius-lg); color: var(--rw-ink);
  background: radial-gradient(120% 90% at 12% 0%, #3b4038 0%, #292e28 45%, #222823 100%);
  border: 1px solid #41483c; box-shadow: 0 18px 44px -22px #22282320; }
.rw-dark::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 40% at 80% 0%, #c4a97a12, transparent 70%); }

/* ---- hero ---- */
.rw-hero { padding: 22px 18px; }
.rw-kicker { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px;
  background: #ffffff14; border: 1px solid var(--rw-line); color: #e8dfcf;
  font-size: 10px; font-weight: 700; letter-spacing: .16em; }
.rw-hero h1 { margin: 14px 0 6px; font-size: clamp(26px, 7.4vw, 38px); font-weight: 800; letter-spacing: -.03em; line-height: 1.2; }
.rw-hero h1 span { background: linear-gradient(100deg, #c4a97a, #c4a97a 60%, #d4c3a4);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.rw-hero > p { margin: 0; color: var(--rw-dim); font-size: 13px; line-height: 1.75; }
.rw-stats { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin-top: 18px; }
.rw-stat { padding: 12px 10px; border-radius: 16px; background: #ffffff0f; border: 1px solid var(--rw-line); text-align: center; }
.rw-stat b { display: block; font-size: clamp(22px, 6.5vw, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.rw-stat span { display: block; margin-top: 4px; font-size: 10px; letter-spacing: .1em; color: var(--rw-dim); }
.rw-stat.hi b { color: #c4a97a; }
/* ช่องยศเป็นข้อความ ไม่ใช่ตัวเลข ชื่อยาว ๆ อย่าง PLATINUM ต้องไม่ล้นกล่องบนจอแคบ */
.rw-stat.txt b { font-size: clamp(11px, 3.4vw, 19px); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- วงล้อ ---- */
.rw-arena { display: grid; justify-items: center; gap: 18px; padding: 24px 16px 26px; }
.rw-wheel-wrap { position: relative; width: min(100%, 440px); max-width: 100%; aspect-ratio: 1; }
.rw-pointer { position: absolute; top: -6px; left: 50%; translate: -50% 0; z-index: 4;
  width: 34px; height: 40px; filter: drop-shadow(0 4px 8px #0008); }
.rw-rim { position: absolute; inset: 0; border-radius: 50%; z-index: 1;
  background: conic-gradient(from 0deg, #c4a97a, #c4a97a, #d4c3a4, #c4a97a);
  padding: 7px; box-shadow: 0 0 0 1px #ffffff26, 0 0 44px -6px #c4a97a5c, inset 0 0 24px #0006; }
.rw-wheel { position: absolute; inset: 7px; border-radius: 50%; overflow: hidden; z-index: 2;
  box-shadow: inset 0 0 0 2px #222823, inset 0 10px 34px #00000073;
  transition: transform 4.8s cubic-bezier(.12,.72,.12,1); transform: rotate(0deg); will-change: transform; }
.rw-seg { position: absolute; inset: 0; display: grid; place-items: start center; padding-top: 12px; }
.rw-seg-in { width: 84px; text-align: center; color: #fff; text-shadow: 0 1px 3px #0009; }
.rw-seg-ic { font-size: 19px; line-height: 1; }
.rw-seg-nm { display: block; margin-top: 3px; font-size: 10px; font-weight: 700; line-height: 1.25;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rw-seg-du { display: block; font-size: 9px; opacity: .85; }
.rw-seg.out .rw-seg-in { opacity: .38; }
.rw-hub { position: absolute; top: 50%; left: 50%; translate: -50% -50%; z-index: 3;
  width: 31%; aspect-ratio: 1; border-radius: 50%; border: 0; cursor: pointer; color: #fff;
  font-family: inherit; font-size: clamp(13px, 3.6vw, 17px); font-weight: 600; line-height: 1.15; letter-spacing: .04em;
  background: radial-gradient(circle at 30% 25%, #c4a97a, #a78a5b 62%, #866b45);
  box-shadow: 0 0 0 6px #222823cc, 0 0 0 7px #ffffff2e, 0 10px 26px -8px #a78a5bcc;
  transition: transform .16s ease, box-shadow .2s ease; }
.rw-hub small { display: block; font-size: 9px; font-weight: 600; opacity: .82; letter-spacing: .1em; }
.rw-hub:not(:disabled):hover { transform: scale(1.03); }
.rw-hub:not(:disabled):active { transform: scale(.97); }
.rw-hub:disabled { cursor: not-allowed; filter: grayscale(.55) brightness(.8); }
.rw-hub.ready { border: 1px solid #e8dfcf; }
@keyframes rw-pulse {
  0%,100% { box-shadow: 0 0 0 6px #222823cc, 0 0 0 7px #ffffff2e, 0 10px 26px -8px #a78a5bcc; }
  50%     { box-shadow: 0 0 0 6px #222823cc, 0 0 0 9px #c4a97a3d, 0 12px 34px -6px #c4a97ae6; }
}
.rw-note { margin: 0; color: var(--rw-dim); font-size: 12px; text-align: center; }
.rw-note b { color: #c4a97a; }
.rw-burst { position: absolute; inset: 0; border-radius: 50%; z-index: 1; opacity: 0;
  background: radial-gradient(circle, #c4a97a66, transparent 62%); }
.rw-burst.go { animation: rw-burst .9s ease-out; }
@keyframes rw-burst { 0% { opacity: .9; scale: .7 } 100% { opacity: 0; scale: 1.35 } }

/* ---- การ์ดของรางวัล / ผู้โชคดี / ของที่ได้รับ ---- */
.rw-sec { padding: 18px 16px; background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.rw-sec > h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
.rw-sec > p.sub { margin: 0 0 14px; color: var(--text-secondary); font-size: 12px; }
.rw-prizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.rw-prize { position: relative; padding: 14px 10px; border-radius: 16px; text-align: center;
  border: 1px solid var(--border-blue); background: linear-gradient(165deg, #f4f0e8, #fff 70%); }
.rw-prize.out { opacity: .62; background: var(--surface-soft); border-color: var(--border); }
.rw-prize-ic { font-size: 25px; line-height: 1; }
.rw-prize b { display: block; margin-top: 6px; font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.rw-prize span { display: block; font-size: 11px; color: var(--text-secondary); }
.rw-tag { display: inline-block; margin-top: 7px; white-space: nowrap; padding: 2px 9px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; background: var(--success-bg); color: #15803d; }
.rw-tag.out { background: #fee2e2; color: #b91c1c; }
.rw-winners { display: grid; gap: 8px; }
.rw-winner { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  background: var(--surface-soft); border: 1px solid var(--border); font-size: 13px; }
.rw-winner .ic { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 10px;
  background: var(--primary-light); }
.rw-winner .grow { flex: 1; min-width: 0; }
.rw-winner small { display: block; color: var(--text-muted); font-size: 11px; }
.rw-mine { display: grid; gap: 10px; }
.rw-mine-card { padding: 13px 14px; border-radius: 16px; border: 1px solid var(--border-blue);
  background: linear-gradient(160deg, #f7f5f0, #fff 60%); }
.rw-mine-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rw-mine-top b { font-size: 14px; }
.rw-mine-top small { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.rw-key { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.rw-key code { flex: 1; min-width: 0; overflow-x: auto; padding: 9px 11px; border-radius: 11px;
  background: #222823; color: #f4f0e8; font-size: 12px; white-space: nowrap; }
.rw-copy { flex: none; min-height: 40px; padding: 0 13px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border); background: #fff; font: 600 12px/1 inherit; color: var(--primary); }
.rw-copy.done { border-color: var(--success); color: #15803d; }
.rw-how { display: grid; gap: 10px; counter-reset: rw; }
.rw-how li { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; line-height: 1.7; }
.rw-how li::before { counter-increment: rw; content: counter(rw); display: grid; place-items: center;
  width: 25px; height: 25px; flex: none; border-radius: 9px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; }
.rw-empty { padding: 26px 14px; text-align: center; color: var(--text-secondary); font-size: 13px; }

/* ---- modal + toast ---- */
.rw-modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 18px;
  background: #222823cc; backdrop-filter: none; }
.rw-modal.open { display: grid; }
.rw-modal-card { width: min(100%, 380px); max-height: 90dvh; overflow-y: auto; padding: 26px 20px 20px;
  border-radius: 24px; text-align: center; color: var(--rw-ink);
  background: radial-gradient(120% 80% at 50% 0%, #3b4038, #292e28 60%, #222823);
  border: 1px solid #6c705d; box-shadow: 0 26px 60px -18px #000c; animation: rw-pop .3s cubic-bezier(.2,1.5,.4,1); }
@keyframes rw-pop { from { opacity: 0; scale: .88 } to { opacity: 1; scale: 1 } }
.rw-modal-card h2 { margin: 0 0 3px; font-size: 21px; font-weight: 800; }
.rw-modal-ic { font-size: 46px; line-height: 1; margin: 8px 0 4px; }
.rw-modal-prize { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.rw-modal-dur { color: #c4a97a; font-size: 13px; font-weight: 600; }
.rw-modal .rw-key code { background: #171b17; }
.rw-modal .rw-copy { background: #ffffff12; border-color: var(--rw-line); color: #f4f0e8; }
.rw-modal-act { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.rw-modal-act .btn, .rw-modal-act .ghost { min-height: 46px; display: grid; place-items: center; border-radius: 14px; font-size: 13px; font-weight: 650; }
.rw-modal-act .ghost { background: #ffffff12; border: 1px solid var(--rw-line); color: #f4f0e8; }
.rw-toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); translate: -50% 0;
  z-index: 95; max-width: min(92vw, 420px); padding: 12px 17px; border-radius: 14px;
  background: #222823; color: #f4f0e8; font-size: 13px; line-height: 1.6; box-shadow: 0 14px 34px -12px #000a;
  opacity: 0; pointer-events: none; transition: opacity .22s ease, translate .22s ease; }
.rw-toast.show { opacity: 1; translate: -50% -8px; }
.rw-toast.err { background: #7f1d1d; }
.rw-toast.ok { background: #14532d; }

@media (min-width: 600px) {
  .rw-hero { padding: 30px 28px; }
  .rw-sec { padding: 22px; }
}
@media (min-width: 1024px) {
  .rw-main { grid-template-columns: minmax(0,1fr) minmax(0,1.5fr) minmax(0,1fr); align-items: start; }
  .rw-arena-card { order: 0; }
  .rw-arena { padding: 30px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .rw-wheel { transition-duration: .6s; }
  .rw-hub.ready { animation: none; }
}


.rw,.rw-modal { --rw-ink: #f4f0e8; --rw-dim: #c8c1b5; --rw-line: #ffffff26; }
.rw-dark { background: #222823; border-color: #41483c; box-shadow: none; }
.rw-dark::after { content: none; }
.rw-hero h1 { font-weight: 550; }
.rw-hero h1 span { background: none; color: #e8dfcf; -webkit-text-fill-color: currentColor; }
.rw-rim { background: #c4a97a; box-shadow: none; }
.rw-hub { background: #866b45; box-shadow: 0 0 0 6px #222823cc,0 0 0 7px #ffffff2e; }
.rw-sec,.rw-prize,.rw-mine-card { background: var(--surface); border-color: var(--border); }
.rw-modal-card { background: #222823; border-color: #6c705d; box-shadow: none; }
.rw-modal .btn { background: #f4f0e8; color: #222823; }
.rw-modal-dur,.rw-note b,.rw-stat.hi b { color: #e8dfcf; }
.rw-copy { min-height: 44px; background: var(--surface); border-color: var(--border); color: var(--primary); }
@media (min-width: 900px) { .rw-toast { bottom: 24px; } }
