/* GenSyx — shared design system: tokens, header, account, wallet. Loaded first by every page.
   Legacy page styles are imported into the `legacy` layer, so these unlayered rules always win over them. */
@layer base, legacy;
:root {
  color-scheme: dark;
  --bg: #080a20;
  --bg-2: #0d1030;
  --surface: #12163a;
  --raised: #1b2048;
  --line: #2d2b5a;
  --line-soft: #ffffff14;
  --text: #fbf8ff;
  --muted: #b3aed3;
  --dim: #8781ad;
  --accent: #f15bda;
  --accent-hover: #ff7ce8;
  --accent-2: #8b5cff;
  --accent-3: #43d9ff;
  --accent-text: #170b24;
  --accent-dim: #3c1a51;
  --success: #6ee7b7;
  --danger: #ff8fa3;
  --radius: 18px;
  --radius-sm: 12px;
  --header-h: 60px;
  --gutter: 16px;
  --shadow: 0 18px 50px #02021a99;
  --glow: 0 0 0 1px #f15bda55, 0 10px 34px #f15bda40;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
@layer base {
* { box-sizing: border-box; }
html { overflow-x: hidden; background: var(--bg); scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(60rem 28rem at 110% -10%, #3a1460 0, transparent 60%),
    radial-gradient(40rem 26rem at -20% 10%, #12235c 0, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
[hidden] { display: none !important; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
}
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- shared header (site_header.js) */
.fx-header {
  position: sticky; top: 0; z-index: 50;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand tabs actions"; align-items: center; column-gap: 14px;
  min-height: calc(var(--header-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
  background: #080a20eb;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line-soft);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 15px; line-height: 1.45; color: var(--text);
  height: auto; margin: 0; gap: 0 14px; box-sizing: border-box; width: 100%;
}
.fx-brand { grid-area: brand; display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; flex-shrink: 0; }
.fx-brand img { width: 30px; height: 30px; }
.fx-brand span { font-size: 21px; font-weight: 800; letter-spacing: -.04em; }
.fx-tabs { grid-area: tabs; display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.fx-tabs::-webkit-scrollbar { display: none; }
.fx-tabs a { position: relative; display: flex; flex: none; align-items: center; gap: 6px; min-height: 38px; padding: 6px 14px; border-radius: 999px; color: var(--muted); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background .2s, color .2s; }
.fx-tabs a:hover { color: var(--text); background: #ffffff0d; }
.fx-tabs a.active { color: var(--accent-text); background: linear-gradient(135deg, var(--accent), #ff9bf0); box-shadow: 0 4px 16px #f15bda55; }
.fx-tabs svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fx-tab-sep { flex: none; width: 1px; height: 22px; margin: 0 6px; background: var(--line); }
.fx-admin-tab, .fx-tab-sep { display: none !important; }
html.is-admin .fx-admin-tab { display: flex !important; }
html.is-admin .fx-tab-sep { display: block !important; }
.fx-admin-tab:not(.active) { color: #c9b8ff; }
#admin-link { display: none !important; }
.fx-tab-short { display: none; }
.fx-tab-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent-3); color: #04122a; font-size: 11px; font-weight: 800; animation: fx-pulse 1.6s ease-in-out infinite; }
.header-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.fx-jobs-pill { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 12px; border: 1px solid #43d9ff55; border-radius: 999px; background: #0d2a46; color: #c9f3ff; font-size: 13px; font-weight: 700; white-space: nowrap; }
#account-history, #account-billing { display: none !important; }

/* account bar injected by account.js */
.header-account { display: flex; align-items: center; gap: 8px; }
.credit-balance { display: flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border: 1px solid #f15bda66; border-radius: 999px; background: #2a1240; color: #ffe1fa; font-weight: 800; font-size: 13px; white-space: nowrap; }
.credit-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.credit-balance .credit-icon { color: var(--accent); }
.account-menu { position: relative; }
.account-menu > summary { list-style: none; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 800; }
.account-menu #account-name, .account-chevron { display: none; }
.account-menu-content { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; display: grid; gap: 4px; width: 240px; padding: 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
.account-menu-content button, .account-menu-content a { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 10px 12px; border: 0; border-radius: 10px; background: transparent; text-align: left; text-decoration: none; font-size: 14px; }
.account-menu-content button:hover, .account-menu-content a:hover { background: var(--raised); }
.account-menu-content .account-primary { background: var(--accent); color: var(--accent-text); font-weight: 800; }
.account-menu-content .account-primary:disabled { opacity: .5; }
.recharge-arrow { margin-left: auto; }
.header-guest { display: flex; gap: 6px; }
.header-guest button { min-height: 36px; padding: 7px 14px !important; border-radius: 999px !important; border: 1px solid var(--line) !important; background: transparent !important; font-weight: 700; font-size: 13px; color: var(--text); }
.header-guest .account-primary { background: var(--accent) !important; border-color: var(--accent) !important; color: var(--accent-text) !important; }
.language-menu { position: relative; }
.language-menu > summary { list-style: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-soft); background: #ffffff0a; cursor: pointer; }
.language-menu > summary::-webkit-details-marker { display: none; }
.language-menu #language-current { display: flex; align-items: center; font-size: 0; }
.language-menu #language-current img { width: 20px; height: 14px; border-radius: 2px; object-fit: cover; }
.language-menu .menu-content { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
.language-menu:not([open]) .menu-content { display: none; }
.language-options { display: grid; gap: 2px; }
.language-options button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; }
.language-options button:hover { background: var(--raised); }
.language-options button[aria-pressed=true] { color: var(--accent); background: var(--accent-dim); }
.language-options img { width: 22px; height: 15px; border-radius: 2px; }
.language-check { margin-left: auto; visibility: hidden; }
.language-options button[aria-pressed=true] .language-check { visibility: visible; }
.account-notice:empty { display: none; }
.account-notice { position: fixed; top: calc(var(--header-h) + env(safe-area-inset-top) + 10px); bottom: auto; left: 50%; transform: translateX(-50%); z-index: 70; width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-size: 14px; }

/* ---------------------------------------------------------------- toast */
.fx-toast {
  position: fixed; z-index: 70; left: 50%; top: calc(var(--header-h) + env(safe-area-inset-top) + 10px);
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 24px);
  padding: 10px 10px 10px 16px; border: 1px solid #f15bda66; border-radius: 999px;
  background: #1d1040f2; box-shadow: var(--shadow), 0 0 30px #f15bda33; font-size: 14px; font-weight: 600;
  transform: translateX(-50%); animation: fx-drop .35s cubic-bezier(.2, .9, .3, 1.3);
}
.fx-toast.is-leaving { opacity: 0; transform: translate(-50%, -10px); transition: .25s; }
.fx-toast button { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-weight: 800; }
.fx-toast span:only-child { padding-right: 6px; }

/* ---------------------------------------------------------------- components */
.fx-spinner { display: inline-block; width: 16px; height: 16px; flex-shrink: 0; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: fx-spin .8s linear infinite; }
.fx-gem { display: inline-flex; width: 14px; height: 14px; }
.fx-gem svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linejoin: round; }
.fx-cost { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; font-size: 13px; color: #ffd6f7; white-space: nowrap; }
.fx-cost small { font-weight: 600; color: var(--muted); font-size: 11px; }
.fx-cost .fx-gem { color: var(--accent); }
.fx-primary, .fx-secondary, .fx-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 20px;
  border-radius: 999px; font-weight: 800; font-size: 15px; text-decoration: none; text-align: center; border: 1px solid transparent; transition: transform .15s, filter .15s;
}
.fx-primary { background: linear-gradient(135deg, var(--accent), #ff8af0); color: var(--accent-text); box-shadow: 0 8px 24px #f15bda44; }
.fx-secondary { background: #ffffff0d; border-color: var(--line); color: var(--text); }
.fx-secondary-video { border-color: #43d9ff66; color: #c9f3ff; background: #0d2a46; }
.fx-ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.fx-primary:active, .fx-secondary:active, .fx-ghost:active, .fx-card:active, .fx-mini:active { transform: scale(.97); }
.fx-ghost:disabled { opacity: .6; }
.fx-muted { color: var(--muted); font-size: 14px; margin: 0; }
.fx-empty { margin: 24px 0; color: var(--muted); text-align: center; display: grid; gap: 14px; justify-items: center; }
.fx-empty:empty { display: none; }
.fx-badge { position: absolute; top: 10px; left: 10px; z-index: 3; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #080a20b3; backdrop-filter: blur(6px); }
.fx-badge svg { width: 14px; height: 14px; fill: #fff; }
.fx-filters { display: flex; gap: 8px; margin: 18px 0 14px; overflow-x: auto; scrollbar-width: none; }
.fx-filters::-webkit-scrollbar { display: none; }
.fx-filters button { min-height: 38px; padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.fx-filters button[aria-pressed=true] { background: var(--text); border-color: var(--text); color: var(--bg); }

/* ---------------------------------------------------------------- account dialogs */
/* ---------------------------------------------------------------- account dialogs (neon palette) */
.account-dialog { border-color: var(--line) !important; background: var(--surface) !important; color: var(--text); font-family: inherit !important; }
.account-dialog::backdrop { background: #04051add; backdrop-filter: blur(8px); }
.account-dialog .account-muted, .account-muted { color: var(--muted) !important; }
.account-form input { background: #080a20 !important; border-color: var(--line) !important; font-size: 16px !important; }
.account-dialog button { border-color: var(--line); background: var(--raised); border-radius: 999px; min-height: 44px; }
.account-dialog .account-primary { background: linear-gradient(135deg, var(--accent), #ff8af0) !important; border: 0 !important; color: var(--accent-text) !important; font-weight: 800 !important; }
.account-dialog .account-text-button, .account-dialog .account-close, .password-input button { min-height: 0; border-radius: 0; }
.recharge-choices span { background: var(--raised) !important; border-color: var(--line) !important; }
.recharge-choices input:checked + span { border-color: var(--accent) !important; background: var(--accent-dim) !important; }

/* ---------------------------------------------------------------- header responsive */
@media (max-width: 899px) {
  :root { --header-h: 100px; }
  .fx-header { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "brand actions" "tabs tabs"; row-gap: 0; }
  .fx-brand, .header-actions { height: 54px; }
  .fx-tabs { height: 46px; margin: 0 calc(-1 * max(var(--gutter), env(safe-area-inset-left))); padding: 0 max(var(--gutter), env(safe-area-inset-left)) 6px; }
  html:not(.is-admin) .fx-tabs a { flex: 1; justify-content: center; }
  .fx-tab-long { display: none; }
  .fx-tab-short { display: inline; }
  .fx-jobs-pill { display: none !important; }
}
@media (max-width: 420px) {
  .fx-brand img { width: 28px; height: 28px; }
  .fx-brand span { font-size: 19px; }
  .fx-tabs a { padding: 6px 11px; font-size: 13px; min-height: 36px; }
  .credit-balance { min-height: 34px; padding: 5px 9px; }
  .account-avatar, .language-menu > summary { width: 34px; height: 34px; }
  .header-actions { gap: 6px; }
  .header-guest #guest-register { display: none; }
}
@media (min-width: 900px) { :root { --header-h: 68px; --gutter: 24px; } }

/* ---------------------------------------------------------------- motion */
@keyframes fx-spin { to { transform: rotate(360deg); } }
@keyframes fx-enter { from { opacity: 0; } }
@keyframes fx-drop { from { opacity: 0; transform: translate(-50%, -14px) scale(.96); } }
@keyframes fx-pulse { 50% { transform: scale(1.08); filter: brightness(1.2); } }
@keyframes fx-shimmer { from { background-position: 200% 0; } to { background-position: -100% 0; } }
@keyframes fx-shine { 50% { background-position: 100% 0; } }
@keyframes fx-scan { from { background-position: 0 120%; } to { background-position: 0 -120%; } }
@keyframes fx-indeterminate { from { transform: translateX(-110%); } to { transform: translateX(310%); } }
@keyframes fx-pop { from { opacity: 0; transform: scale(.94); filter: blur(10px) brightness(1.6); } }
@keyframes fx-burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))) scale(.4); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .fx-sweep { --sweep: 50%; }
}

/* ---------------------------------------------------------------- wallet sheet */
.fx-sheet { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 94dvh; margin: 0; padding: 0; overflow: auto; border: 1px solid #f15bda44; border-bottom: 0; border-radius: 28px 28px 0 0; background: radial-gradient(30rem 18rem at 50% -10%, #5b1f7a 0, transparent 70%), var(--surface); color: var(--text); box-shadow: 0 -20px 60px #000a; overscroll-behavior: contain; }
.fx-sheet[open] { animation: fx-sheet-up .38s cubic-bezier(.2, .9, .3, 1.05); }
.fx-sheet.is-closing { animation: fx-sheet-down .22s ease-in forwards; }
.fx-sheet::backdrop { background: #04051acc; backdrop-filter: blur(6px); animation: fx-fade .3s; }
.fx-wallet { position: relative; display: grid; gap: 20px; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); }
.fx-wallet::before { content: ""; justify-self: center; width: 44px; height: 5px; border-radius: 999px; background: #ffffff30; }
.fx-sheet-close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #ffffff12; font-size: 24px; line-height: 1; }
.fx-wallet-head { display: grid; justify-items: center; gap: 2px; text-align: center; }
.fx-wallet-orb { position: relative; display: grid; place-items: center; width: 76px; height: 76px; margin-bottom: 8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9bf0, var(--accent) 45%, var(--accent-2)); box-shadow: 0 10px 40px #f15bda88, inset 0 -8px 20px #4a1a8a99; animation: fx-float 3.2s ease-in-out infinite; }
.fx-wallet-orb .fx-gem { position: relative; z-index: 1; width: 36px; height: 36px; color: #fff; filter: drop-shadow(0 2px 6px #6a1a7a); }
.fx-wallet-orb-glow { position: absolute; inset: -14px; border-radius: 50%; background: conic-gradient(from 0deg, transparent, #43d9ff99, transparent 30%, #f15bdaaa, transparent 60%, #8b5cff99, transparent); filter: blur(8px); animation: fx-spin 4s linear infinite; }
.fx-wallet-label { margin: 0; color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.fx-wallet-balance { display: flex; align-items: baseline; gap: 8px; margin: 0; }
.fx-wallet-amount { font-size: 56px; line-height: 1; font-weight: 900; letter-spacing: -.04em; font-variant-numeric: tabular-nums; background: linear-gradient(100deg, #fff, #ffc4f6 60%, #b8a6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fx-wallet-balance span { color: var(--muted); font-size: 18px; font-weight: 800; }
.fx-wallet-worth { margin: 0; color: var(--dim); font-size: 14px; }
.fx-wallet-missing { margin: 10px 0 0; padding: 8px 14px; border: 1px solid #ffd28f55; border-radius: 999px; background: #3a2a12; color: #ffd28f; font-size: 13px; font-weight: 700; }
.fx-wallet-form { display: grid; gap: 14px; }
.fx-wallet-section-head h3 { margin: 0; font-size: 20px; font-weight: 850; letter-spacing: -.02em; }
.fx-wallet-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.fx-packs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.fx-pack { position: relative; display: grid; justify-items: start; gap: 2px; min-height: 104px; padding: 16px 14px 12px; border: 1.5px solid var(--line); border-radius: 18px; background: linear-gradient(160deg, #1d2254, #12163a); text-align: left; transition: transform .18s, border-color .18s, box-shadow .18s, background .18s; animation: fx-pack-in .45s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i) * 55ms); }
.fx-pack:last-child:nth-child(odd) { grid-column: 1 / -1; }
.fx-pack:active { transform: scale(.97); }
.fx-pack.is-selected { border-color: var(--accent); background: linear-gradient(160deg, #4a1d63, #1d1648); box-shadow: 0 0 0 4px #f15bda2e, 0 12px 30px #f15bda44; transform: translateY(-2px); }
.fx-pack.is-selected::after { content: "✓"; position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 900; animation: fx-pop .3s; }
.fx-pack-tag { position: absolute; top: -10px; left: 12px; padding: 3px 10px; border-radius: 999px; background: linear-gradient(90deg, var(--accent-3), #8bf0ff); color: #04122a; font-size: 11px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; box-shadow: 0 4px 14px #43d9ff55; }
.fx-pack-credits { display: flex; align-items: center; gap: 6px; }
.fx-pack-credits strong { font-size: 30px; line-height: 1.1; font-weight: 900; letter-spacing: -.03em; }
.fx-pack-credits .fx-gem { width: 20px; height: 20px; color: var(--accent); }
.fx-pack-price { font-size: 17px; font-weight: 800; color: #ffe1fa; }
.fx-pack-unit { color: var(--dim); font-size: 12px; }
.fx-wallet-pay { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); display: grid; gap: 8px; margin: 0 -18px; padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, var(--surface) 70%, transparent); }
.fx-pay { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 60px; overflow: hidden; border: 0; border-radius: 999px; background: linear-gradient(135deg, var(--accent), #ff8af0 55%, #c09bff); background-size: 200% 100%; color: var(--accent-text); font-weight: 900; box-shadow: 0 12px 34px #f15bda66; animation: fx-shine 4s ease-in-out infinite; }
.fx-pay::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, #ffffff66 50%, transparent 65%); background-size: 250% 100%; animation: fx-shimmer 2.6s ease-in-out infinite; }
.fx-pay:disabled { filter: grayscale(.7) brightness(.6); box-shadow: none; animation: none; }
.fx-pay:disabled::after { display: none; }
.fx-pay-main { font-size: 19px; }
.fx-pay-gain { padding: 4px 10px; border-radius: 999px; background: #170b2422; font-size: 14px; }
.fx-wallet-trust { margin: 0; color: var(--dim); font-size: 12px; text-align: center; }
.fx-wallet-note { display: grid; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 14px; background: #ffffff0d; color: var(--muted); font-size: 14px; }
.fx-wallet-error { margin: 0; color: var(--danger); font-size: 14px; }
.fx-wallet-error:empty { display: none; }
.fx-wallet-loading { display: grid; place-items: center; min-height: 120px; color: var(--accent); }
.fx-wallet-links { display: flex; justify-content: center; gap: 18px; }
.fx-wallet-links button { min-height: 40px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
#payment-dialog.is-paid .payment-symbol { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; animation: fx-pop .6s cubic-bezier(.2, .9, .3, 1.4); box-shadow: 0 10px 34px #f15bda88; }
#payment-dialog { overflow: visible; }
@media (min-width: 700px) {
  .fx-sheet { inset: 0; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; border-bottom: 1px solid #f15bda44; border-radius: 28px; }
  .fx-sheet[open] { animation: fx-pop .35s cubic-bezier(.2, .9, .3, 1.15); }
  .fx-wallet::before { display: none; }
  .fx-wallet { padding-top: 28px; }
  .fx-packs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fx-pack:last-child:nth-child(odd) { grid-column: auto; }
}
@keyframes fx-sheet-up { from { transform: translateY(100%); } }
@keyframes fx-sheet-down { to { transform: translateY(100%); } }
@keyframes fx-fade { from { opacity: 0; } }
@keyframes fx-float { 50% { transform: translateY(-6px); } }
@keyframes fx-pack-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.fx-pack-bonus { padding: 2px 8px; border-radius: 999px; background: #10372e; color: var(--success); font-size: 12px; font-weight: 800; }
.fx-custom { display: grid; gap: 10px; padding: 14px; border: 1.5px dashed var(--line); border-radius: 18px; background: #0d1030; cursor: pointer; transition: border-color .18s, box-shadow .18s, background .18s; animation: fx-pack-in .45s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: calc(var(--i) * 55ms); }
.fx-custom.is-selected { border-style: solid; border-color: var(--accent); background: linear-gradient(160deg, #3a1a55, #15123d); box-shadow: 0 0 0 4px #f15bda2e, 0 12px 30px #f15bda33; }
.fx-custom-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fx-custom-title { font-weight: 800; font-size: 15px; }
.fx-custom-result { display: inline-flex; align-items: center; gap: 6px; }
.fx-custom-credits { font-size: 24px; font-weight: 900; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fx-custom-result .fx-gem { width: 18px; height: 18px; color: var(--accent); }
.fx-custom-row { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; align-items: center; }
.fx-custom-step { height: 48px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); font-size: 22px; font-weight: 800; }
.fx-custom-step:active { transform: scale(.94); }
.fx-custom-field { display: flex; align-items: center; justify-content: center; gap: 6px; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: #080a20; cursor: text; }
.fx-custom-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #f15bda33; }
.fx-custom-input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 22px; font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
.fx-custom-field span { font-size: 20px; font-weight: 800; color: var(--muted); }
.fx-custom-hint { color: var(--dim); font-size: 12px; }
.fx-custom-hint.is-error { color: var(--danger); font-weight: 700; }
.fx-pay-gain[hidden] { display: none; }


/* keep the header controls immune to page-level element styles */
.fx-header details, .fx-header summary { margin: 0; padding: 0; border: 0; background: none; min-height: 0; }
.fx-header .language-menu > summary { border: 1px solid var(--line-soft); background: #ffffff0a; }
.fx-header .language-menu, .fx-header .account-menu { display: block; line-height: 1; }
.fx-header a { text-decoration: none; }
