/* Saturn Shop — design system */

:root {
  --bg: #0a0b10;
  --bg-elev: #0f1117;
  --surface: #13151d;
  --surface-2: #191c26;
  --surface-3: #222634;
  --line: rgba(255, 255, 255, 0.07);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #eef0f6;
  --text-2: #b4b9c9;
  --muted: #7d8398;
  --accent: #6d5efc;
  --accent-2: #8f7bff;
  --accent-ink: #ffffff;
  --accent-soft: rgba(109, 94, 252, 0.14);
  --accent-ring: rgba(109, 94, 252, 0.42);
  --success: #22c993;
  --success-soft: rgba(34, 201, 147, 0.13);
  --danger: #f2556b;
  --danger-soft: rgba(242, 85, 107, 0.13);
  --warning: #f5b544;
  --warning-soft: rgba(245, 181, 68, 0.14);

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 24px;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.22);
  --shadow-2: 0 18px 60px rgba(0, 0, 0, 0.5);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
  --press-scale: 0.96;

  --wrap: 640px;
  --pad: 16px;
  --dock-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  color-scheme: dark;
}

/* ——— Base ——— */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: var(--tg-viewport-stable-height, 100vh);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(109, 94, 252, 0.13), transparent 60%),
    radial-gradient(700px 420px at -10% 10%, rgba(34, 201, 147, 0.06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: not-allowed; }
code { font-family: var(--mono); font-size: 0.9em; }

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; }

::selection { background: var(--accent-soft); }

.hidden { display: none !important; }
.muted { color: var(--muted); }

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

/* ——— Motion helpers (JS adds is-pressed / is-released / sc-ripple) ——— */

.sc-motion {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s var(--ease-spring), background-color 0.16s ease,
    border-color 0.16s ease, color 0.16s ease, opacity 0.16s ease, box-shadow 0.18s ease;
  -webkit-user-select: none;
  user-select: none;
}
.sc-motion:active:not(:disabled),
.sc-motion.is-pressed:not(:disabled) { transform: scale(var(--press-scale)); }
.sc-motion.is-released:not(:disabled) { transition-duration: 0.24s; }

.sc-ripple {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  background: currentColor;
  opacity: 0.16;
  transform: scale(0);
  animation: ripple 0.55s var(--ease) forwards;
}
@keyframes ripple { to { transform: scale(2.4); opacity: 0; } }

/* ——— Buttons ——— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.94rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  white-space: normal;
}
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 6px 20px rgba(109, 94, 252, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 26px rgba(109, 94, 252, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.btn-ghost {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-strong); }
.btn:disabled { opacity: 0.5; box-shadow: none; }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 0.82rem; border-radius: var(--r-sm); }
.btn-lg { min-height: 52px; font-size: 1rem; }

.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border-radius: var(--r-sm);
  color: var(--accent-2);
  font-size: 0.88rem;
  font-weight: 500;
}
.link-btn:hover { background: var(--accent-soft); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  color: var(--text-2);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
.icon-btn--soft { background: var(--surface-2); border: 1px solid var(--line); }
.icon-btn--soft:hover { background: var(--surface-3); }

/* ——— Fields ——— */

.field {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field::placeholder { color: var(--muted); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.field { min-height: 116px; resize: vertical; line-height: 1.45; }
.field-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

/* ——— Layout ——— */

.app {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad) calc(var(--dock-h) + 32px + var(--safe-b));
  min-height: var(--tg-viewport-stable-height, 100vh);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: 0 calc(50% - 50vw);
  padding: 10px calc(50vw - 50%);
  background: rgba(10, 11, 16, 0.74);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none !important; }
.brand-logo { width: 36px; height: 36px; flex-shrink: 0; }
.brand-name { font-weight: 750; font-size: 1.02rem; letter-spacing: -0.015em; white-space: nowrap; }

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 6px 0 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 600;
  white-space: nowrap;
}
.balance-pill:hover { border-color: var(--accent-ring); }
.balance-icon { display: grid; place-items: center; color: var(--accent-2); }
.balance-icon svg { width: 18px; height: 18px; }
.balance-icon-lock { display: none; }
.balance-pill--guest .balance-icon-wallet { display: none; }
.balance-pill--guest .balance-icon-lock { display: block; }
.balance-pill--guest { padding-right: 14px; }
.balance-body { display: inline-flex; align-items: baseline; gap: 4px; }
.balance-value { font-variant-numeric: tabular-nums; font-size: 0.92rem; }
.balance-unit { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.balance-topup {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.balance-topup svg { width: 16px; height: 16px; stroke-width: 2.4; }

/* ——— Hero ——— */

.page-title {
  margin: 20px 0 14px;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

/* ——— Catalog ——— */

.categories { display: grid; grid-template-columns: 1fr; gap: 14px; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 40%), var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.25s var(--ease), box-shadow 0.25s ease;
}
@media (hover: hover) {
  .card--catalog:not(.card--skeleton):hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-2); }
}
.card--on-sale { border-color: rgba(245, 181, 68, 0.28); }
.card--on-sale::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, var(--warning), var(--accent-2));
}

.card-enter { animation: cardIn 0.5s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.card-image-wrap { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-image { width: 100%; height: 100%; object-fit: cover; }
.card--soldout .card-image { filter: grayscale(0.7) brightness(0.7); }

.card-cover {
  position: relative;
  display: flex;
  align-items: center;
  height: 104px;
  padding: 0 18px;
  overflow: hidden;
  border-bottom: 1px solid color-mix(in srgb, var(--c1) 16%, var(--line));
  background:
    radial-gradient(120% 160% at 100% 0%, color-mix(in srgb, var(--c2) 55%, transparent), transparent 62%),
    radial-gradient(80% 120% at 0% 100%, color-mix(in srgb, var(--c1) 14%, transparent), transparent 60%),
    #08080d;
}
.cover-orbits { position: absolute; inset: 0; width: 100%; height: 100%; }
.cover-orbits ellipse { fill: none; stroke: var(--c1); stroke-opacity: 0.22; stroke-width: 1.4; }
.cover-planet { stroke: var(--c1); stroke-opacity: 0.35; stroke-width: 1; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c1) 45%, transparent)); }
.cover-orbits .cover-ring { stroke: var(--c1); stroke-opacity: 0.55; stroke-width: 1.6; }
.cover-moon { fill: var(--c1); opacity: 0.85; filter: drop-shadow(0 0 4px var(--c1)); }
.cover-star { fill: #fff; opacity: 0.5; }
.cover-star--twinkle { animation: twinkle 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 0.9; } }
.cover-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 17px;
  background: rgba(5, 5, 8, 0.72);
  border: 1px solid color-mix(in srgb, var(--c1) 38%, transparent);
  box-shadow: 0 0 34px color-mix(in srgb, var(--c1) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: var(--c1);
}
.cover-tile svg { width: 30px; height: 30px; stroke-width: 1.8; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--c1) 55%, transparent)); }
.cover-emoji { font-size: 30px; line-height: 1; }
.card--soldout .card-cover { filter: saturate(0.25) brightness(0.75); }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -2px; }

.card-badge,
.stock-badge,
.price-sale-note {
  --t: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--t) 14%, transparent), color-mix(in srgb, var(--t) 6%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 22%, transparent);
  color: var(--t);
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.015em;
  line-height: 1;
  white-space: nowrap;
}
.card-badge > span { overflow: hidden; text-overflow: ellipsis; }
.card-badge svg {
  flex-shrink: 0;
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card-body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 16px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-head-main { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; min-width: 0; }
.card-title { font-size: 1.04rem; font-weight: 700; letter-spacing: -0.015em; line-height: 1.25; overflow-wrap: anywhere; }

.stock-badge { --t: var(--success); gap: 6px; font-variant-numeric: tabular-nums; }
.stock-badge::before {
  content: "";
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--t) 60%, transparent);
  animation: stockPulse 2.4s ease-out infinite;
}
.stock-badge--oos { --t: var(--danger); }
.stock-badge--oos::before { animation: none; }
@keyframes stockPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--t) 55%, transparent); }
  70%, 100% { box-shadow: 0 0 0 5px transparent; }
}
@media (prefers-reduced-motion: reduce) { .stock-badge::before { animation: none; } }

.card-price-wrap { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex-shrink: 0; }
.price-now { font-size: 1.16rem; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-old { font-size: 0.8rem; color: var(--muted); text-decoration: line-through; white-space: nowrap; }
.price-row { display: inline-flex; align-items: center; gap: 6px; }
.card-price-wrap--sale { gap: 4px; }
.card-price-wrap--sale .price-old { font-size: 0.76rem; }
.price-now--sale { color: var(--warning); line-height: 1.1; }
.price-sale-note {
  --t: var(--warning);
  display: inline-block;
  max-width: 110px;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 0.66rem;
  font-weight: 750;
  line-height: 18px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}
.money-amount { white-space: nowrap; }

.card-desc {
  color: var(--text-2);
  font-size: 0.86rem;
  line-height: 1.5;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-bottom { display: flex; flex-direction: column; gap: 12px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.card-purchase-block { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sub-btn--block { width: 100%; }
.card--soldout .card-desc { opacity: 0.7; }
.qty-block { display: flex; flex-direction: column; gap: 6px; }
.qty-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.qty-controls {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 12px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.qty-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  touch-action: none;
}
.qty-btn:hover:not(:disabled) { background: var(--surface-3); }
.qty-btn:disabled { opacity: 0.35; }
.qty-btn.holding { background: var(--accent-soft); color: var(--accent-2); }
.qty-input {
  width: 52px;
  height: 34px;
  border: 0;
  background: transparent;
  text-align: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.total-stack, .totals-wrap { display: flex; flex-direction: column; align-items: flex-end; text-align: right; line-height: 1.2; }
.total-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
.total-amount { font-size: 1.08rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.total-amount--promo { color: var(--success); }
.total-struck { font-size: 0.78rem; color: var(--muted); text-decoration: line-through; }
.total-saved { font-size: 0.72rem; color: var(--success); margin-top: 2px; }
.total-bump { animation: bump 0.32s var(--ease-spring); }
@keyframes bump { 40% { transform: scale(1.08); } }

.card-actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.sub-btn {
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 600;
}
.sub-btn:hover { color: var(--text); border-color: var(--line-strong); }
.sub-btn.is-on { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent-2); }
.buy-btn {
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: 0 6px 20px rgba(109, 94, 252, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.buy-btn:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; border: 1px solid var(--line); cursor: pointer; }

/* skeleton */
.card--skeleton { pointer-events: none; }
.skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton-title { height: 20px; width: 62%; }
.skeleton-line { height: 12px; width: 100%; }
.skeleton-line.short { width: 45%; }
.skeleton-btn { height: 44px; width: 100%; margin-top: 10px; border-radius: var(--r-md); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 20px;
  border-radius: var(--r-lg);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  text-align: center;
}
.empty-icon { width: 44px; height: 44px; color: var(--accent-2); opacity: 0.8; }

/* ——— Dock ——— */

.dock {
  position: fixed;
  left: 50%;
  bottom: calc(10px + var(--safe-b));
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(calc(var(--wrap) - 2 * var(--pad)), calc(100% - 20px));
  height: var(--dock-h);
  padding: 6px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: rgba(19, 21, 29, 0.86);
  border: 1px solid var(--line-strong);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  min-width: 0;
}
.dock-btn span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-btn svg { width: 22px; height: 22px; }
.dock-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.dock-btn.is-active { color: var(--accent-2); }
.dock-btn.is-active svg { filter: drop-shadow(0 0 8px rgba(143, 123, 255, 0.5)); }
.app.hidden + .dock { display: none; }

/* ——— Site footer / SEO ——— */

.site-footer-wrap { margin-top: 40px; display: flex; flex-direction: column; gap: 16px; }
.site-community { display: flex; flex-wrap: wrap; gap: 8px; }
.site-community-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none !important;
}
.site-community-link:hover { border-color: var(--accent-ring); }
.site-seo-bar { color: var(--muted); font-size: 0.8rem; line-height: 1.7; text-align: center; padding-top: 16px; border-top: 1px solid var(--line); }
.site-seo-bar a { color: var(--text-2); }
.site-seo-bar strong { color: var(--text-2); }
.seo-crawl-block { margin-top: 36px; display: grid; gap: 18px; color: var(--muted); font-size: 0.86rem; line-height: 1.6; }
.seo-crawl-block h2 { color: var(--text-2); font-size: 0.98rem; margin-bottom: 6px; }
.seo-catalog-list { display: grid; gap: 8px; }

/* ——— Doc pages (FAQ, landings, privacy) ——— */

body.doc-mode { --wrap: 780px; }
.doc-app { padding-bottom: calc(32px + var(--safe-b)); }
.doc-main { padding-top: 18px; }
.doc-main .page-title { margin-top: 6px; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.doc-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.doc-nav a:hover { color: var(--text); border-color: var(--line-strong); }
.doc-nav a[aria-current="page"] { color: var(--accent-2); background: var(--accent-soft); border-color: var(--accent-ring); }

.doc { display: grid; gap: 12px; color: var(--text-2); font-size: 0.93rem; line-height: 1.6; }
.doc-lead { color: var(--text-2); font-size: 1rem; margin-bottom: 4px; }
.doc > section,
.doc > article {
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.doc h2 { color: var(--text); font-size: 1.04rem; font-weight: 700; margin: 0 0 8px; }
.doc h3 { color: var(--text); font-size: 0.95rem; font-weight: 650; margin: 16px 0 6px; }
.doc article h2:not(:first-child) { margin-top: 22px; }
.doc p + p { margin-top: 8px; }
.doc ul { list-style: none; display: grid; gap: 6px; margin: 10px 0; }
.doc ul li { position: relative; padding-left: 18px; }
.doc ul li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
}
.doc strong { color: var(--text); }
.doc dt { color: var(--text); font-weight: 650; margin-top: 12px; }
.doc dd { margin: 4px 0 0; }
.doc .meta { color: var(--muted); font-size: 0.85rem; margin-bottom: 14px; }

.faq-item {
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease;
}
.faq-item[open] { border-color: var(--line-strong); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  flex-shrink: 0;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.2s var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); color: var(--accent-2); }
.faq-item summary h2 { margin: 0; font-size: 0.96rem; font-weight: 650; }
.faq-item p { padding: 0 16px 16px; }

.doc-cta { display: flex; width: 100%; margin-top: 20px; }
.doc-footer {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.doc-footer a { color: var(--text-2); }

/* ——— Backdrop + sheets ——— */

.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 5, 10, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.panel-backdrop.active { opacity: 1; visibility: visible; transition: opacity 0.25s ease; }

.sheet-panel {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 210;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(88vh, calc(var(--tg-viewport-stable-height, 100vh) - 24px));
  padding: 8px 20px calc(20px + var(--safe-b));
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-bottom: 0;
  box-shadow: var(--shadow-2);
  transform: translate(-50%, 104%);
  visibility: hidden;
  transition: transform 0.34s var(--ease), visibility 0s linear 0.34s;
}
.sheet-panel::before {
  content: "";
  align-self: center;
  flex-shrink: 0;
  width: 38px;
  height: 4px;
  margin-bottom: 10px;
  border-radius: 4px;
  background: var(--line-strong);
}
.sheet-panel.active { transform: translate(-50%, 0); visibility: visible; transition: transform 0.34s var(--ease); }
.sheet-panel--tall { height: min(88vh, calc(var(--tg-viewport-stable-height, 100vh) - 24px)); }

.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-shrink: 0; }
.sheet-head h4 { font-size: 1.08rem; font-weight: 700; letter-spacing: -0.01em; }
.sheet-close { margin-right: -8px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; margin: 0 -20px; padding: 0 20px; min-height: 0; }
.sheet-hint { color: var(--muted); font-size: 0.86rem; margin-bottom: 14px; }

.chip-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.chip-grid--5 { grid-template-columns: repeat(5, 1fr); }
.icon-chip {
  min-height: 50px;
  padding: 0 8px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.9rem;
}
.icon-chip:hover, .icon-chip.is-hover { border-color: var(--line-strong); background: var(--surface-2); }
.icon-chip.is-selected { background: var(--accent-soft); border-color: var(--accent); color: #fff; }

/* history */
.hist-row {
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  line-height: 1.5;
}
.hist-row small { color: var(--muted); font-size: 0.76rem; }
.hist-redeliver { margin-top: 8px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.hist-redeliver:hover:not(:disabled) { border-color: var(--accent-ring); }

/* faq */
.faq-panel-body { color: var(--text-2); font-size: 0.9rem; line-height: 1.6; }
.faq-panel-body b, .faq-panel-body strong { color: var(--text); }
.faq-panel-body p + p { margin-top: 10px; }

/* promo */
.promo-row { display: flex; gap: 8px; }
.promo-row .field { flex: 1; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.promo-row .field::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* referral */
.referral-link-block .field-label { margin-top: 0; }
.copy-field { display: flex; gap: 8px; }
.copy-field .field { flex: 1; min-width: 0; font-family: var(--mono); font-size: 0.82rem; }
.referral-copy-btn { flex-shrink: 0; white-space: nowrap; }
.referral-copy-btn.copied { background: var(--success); box-shadow: none; }
.referral-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
.referral-stats > p { grid-column: 1 / -1; }
.referral-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}
.referral-stat span { font-size: 0.76rem; color: var(--muted); }
.referral-stat b { font-size: 1.12rem; font-variant-numeric: tabular-nums; }
.referral-usdt-tag { align-self: flex-start; padding: 2px 6px; border-radius: 6px; background: var(--success-soft); color: var(--success); font-size: 0.68rem !important; font-weight: 600; }
.referral-list-wrap, .referral-periods-wrap { margin-bottom: 14px; }
.referral-list-wrap h5, .referral-periods-wrap h5 { font-size: 0.82rem; color: var(--text-2); margin: 0 0 8px; }
.referral-list-empty { color: var(--muted); font-size: 0.86rem; }
.referral-list-table, .referral-daily-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.referral-list-table th, .referral-daily-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.72rem; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.referral-list-table td, .referral-daily-table td { padding: 8px; border-bottom: 1px solid var(--line); }
.ref-name { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.referral-periods-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.88rem;
}
.rp-chevron { width: 18px; height: 18px; color: var(--muted); transition: transform 0.2s ease; }
.referral-periods-btn[aria-expanded="true"] .rp-chevron { transform: rotate(180deg); }
.referral-periods-panel { margin-top: 10px; }
.referral-period-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.referral-period-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line); font-size: 0.82rem; }
.rp-label { color: var(--muted); font-size: 0.72rem; font-weight: 600; }

/* ——— Support ——— */

.sup-views { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#supportListView, #supportCreateView { overflow-y: auto; flex: 1; min-height: 0; }
#supportChatView { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sup-intro { color: var(--muted); font-size: 0.88rem; }
.sup-actions { margin: 14px 0; }
.sup-actions .btn { width: 100%; }
.sup-ticket-list { display: flex; flex-direction: column; gap: 8px; }
.sup-ticket-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
}
.sup-ticket-row:hover { border-color: var(--line-strong); }
.sup-ticket-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; font-size: 0.92rem; }
.sup-ticket-meta { color: var(--muted); font-size: 0.74rem; }
.sup-preview { color: var(--text-2); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-status, .sup-meta-status {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.sup-status--open, .sup-meta-status--open { background: var(--success-soft); color: var(--success); }
.sup-badge {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
}

.sup-back-btn { margin-left: -8px; }
.sup-form { display: flex; flex-direction: column; }
.sup-form .btn { margin-top: 16px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-top: 4px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.sup-kind-btn { padding: 10px 8px; border-radius: var(--r-sm); color: var(--muted); font-weight: 600; font-size: 0.86rem; transition: background-color 0.15s ease, color 0.15s ease; }
.sup-kind-btn.active { background: var(--surface-3); color: var(--text); }
.sup-kind-btn.active.idea { background: var(--warning-soft); color: var(--warning); }

.sup-chat-head { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.sup-chat-title-wrap { min-width: 0; }
.sup-chat-title-wrap h4 { font-size: 0.98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-chat-meta { color: var(--muted); font-size: 0.74rem; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sup-close-btn { align-self: flex-start; margin: 8px 0 0; }
.sup-messages {
  flex: 1;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px -20px 0;
  padding: 10px 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sup-chat-empty { text-align: center; margin: auto 0; }
.sup-msg { max-width: 84%; padding: 9px 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); font-size: 0.9rem; }
.sup-msg--user { align-self: flex-end; background: var(--accent-soft); border-color: rgba(109, 94, 252, 0.3); border-bottom-right-radius: 6px; }
.sup-msg--other { align-self: flex-start; border-bottom-left-radius: 6px; }
.sup-msg-head { font-size: 0.7rem; color: var(--muted); margin-bottom: 3px; }
.sup-msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.sup-msg-img-link { display: block; margin: 4px 0; }
.sup-msg-img { max-width: 100%; max-height: 260px; border-radius: 10px; }
.sup-msg-file { display: inline-block; margin: 4px 0; font-size: 0.86rem; }
.sup-composer { display: flex; align-items: flex-end; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); flex-shrink: 0; }
.sup-composer textarea {
  flex: 1;
  min-height: 44px;
  max-height: 140px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  resize: none;
  outline: none;
  line-height: 1.4;
}
.sup-composer textarea:focus { border-color: var(--accent); }
.sup-composer-btn { width: 44px; height: 44px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); }
.sup-composer-btn.primary { background: var(--accent); border-color: transparent; color: #fff; }

/* ——— Dialog overlays ——— */

.modal-overlay, .deposit-flow-screen, .promo-celebration, .purchase-celebration, .oos-modal, .entry-choice-modal, .loader-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 10, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.24s ease, visibility 0s linear 0.24s;
}
.modal-overlay.active, .deposit-flow-screen.active, .promo-celebration.active, .purchase-celebration.active,
.oos-modal.active, .entry-choice-modal.active, .loader-screen.active {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.24s ease;
}
.entry-choice-modal[hidden] { display: none; }
.modal-overlay { z-index: 300; }
.deposit-flow-screen { z-index: 320; }
.loader-screen { z-index: 400; flex-direction: column; gap: 16px; }
.promo-celebration, .purchase-celebration { z-index: 450; }
.oos-modal { z-index: 460; }
.entry-choice-modal { z-index: 470; }

.dialog-card {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 26px 22px 20px;
  border-radius: var(--r-xl);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  text-align: center;
  transform: translateY(12px) scale(0.97);
  transition: transform 0.32s var(--ease);
}
.active > .dialog-card { transform: none; }

.dialog-icon {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.dialog-icon svg { width: 28px; height: 28px; }
.dialog-icon--accent { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent-2); }
.dialog-icon--success { background: var(--success-soft); border-color: rgba(34, 201, 147, 0.4); color: var(--success); }

.spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent-2);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: var(--text-2); font-weight: 600; }

/* deposit modal */
.modal { text-align: left; }
.modal h3 { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }
.modal-sub { margin-top: 6px; color: var(--muted); font-size: 0.88rem; }
.modal-actions { margin-top: 14px; }
.modal-overlay.waiting-payment .modal-btn.ghost { display: none; }

.deposit-phase { display: none; }
.deposit-phase.active { display: block; }
.deposit-phase.deposit-wait.active, .deposit-phase.deposit-success-panel.active { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 12px 0 4px; }
.deposit-step { display: none; margin-top: 16px; }
.deposit-step.active { display: block; }
.deposit-step-amount.active { display: flex; flex-direction: column; gap: 12px; }

.deposit-pay-error { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--danger-soft); color: var(--danger); font-size: 0.86rem; }
.deposit-pay-list { display: flex; flex-direction: column; gap: 8px; }
.deposit-pay-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
}
.deposit-pay-btn:hover:not(:disabled) { border-color: var(--accent-ring); background: var(--surface-2); }
.deposit-pay-btn:disabled { opacity: 0.5; }
.deposit-pay-list--solo .deposit-pay-btn { padding: 18px; border-color: var(--accent-ring); }
.pay-title { font-weight: 650; font-size: 0.95rem; }
.pay-sub { color: var(--muted); font-size: 0.78rem; }

.deposit-pick { display: flex; flex-direction: column; gap: 8px; }
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preset-btn, .deposit-custom-toggle {
  min-height: 46px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.preset-btn:hover:not(:disabled), .deposit-custom-toggle:hover:not(:disabled) { border-color: var(--line-strong); }
.preset-btn.active, .deposit-custom-toggle.active { background: var(--accent-soft); border-color: var(--accent); color: #fff; }
.deposit-custom-toggle { font-weight: 600; color: var(--text-2); }
.deposit-amount-label { margin-top: 0; }
.deposit-amount-field {
  display: flex;
  align-items: center;
  border-radius: var(--r-md);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.deposit-amount-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.deposit-input { flex: 1; min-width: 0; height: 52px; padding: 0 14px; border: 0; background: transparent; outline: none; font-size: 1.2rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.deposit-amount-cur { padding: 0 16px; color: var(--muted); font-weight: 700; }
.deposit-usdt-hint { min-height: 1.2em; color: var(--muted); font-size: 0.82rem; }
.deposit-usdt-hint:empty { display: none; }
.deposit-amount-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.deposit-wait-title, .deposit-flow-title, .deposit-success-title { font-size: 1.15rem; font-weight: 700; }
.deposit-wait-hint, .deposit-flow-hint, .deposit-success-sub { color: var(--muted); font-size: 0.88rem; white-space: pre-line; }

.deposit-flow-close { position: absolute; top: 12px; right: 12px; z-index: 1; }
.deposit-flow-panel { display: none; flex-direction: column; align-items: center; gap: 12px; }
.deposit-flow-panel.active { display: flex; }
.deposit-flow-actions { display: flex; flex-direction: column; gap: 8px; width: 100%; margin-top: 6px; }

.check-ring {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--success-soft);
  box-shadow: 0 0 0 1px rgba(34, 201, 147, 0.4), 0 0 40px rgba(34, 201, 147, 0.25);
  color: var(--success);
}
.check-ring svg { width: 36px; height: 36px; stroke-width: 2.6; }
.check-path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.active .check-path { animation: draw 0.5s 0.15s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* promo / purchase celebrations */
.promo-celebration-title, .purchase-celebration-title { font-size: 1.25rem; font-weight: 750; letter-spacing: -0.01em; }
.promo-celebration-code {
  display: inline-block;
  margin: 12px 0 8px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1px dashed var(--accent-ring);
  background: var(--accent-soft);
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.08em;
}
.promo-celebration-desc, .purchase-celebration-sub { color: var(--text-2); font-size: 0.9rem; margin: 6px 0 18px; white-space: pre-line; }
.purchase-celebration { overflow: hidden; }
.purchase-confetti-host { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute;
  top: -20px;
  border-radius: 2px;
  opacity: 0.95;
  animation: confetti 1.6s ease-in forwards;
}
@keyframes confetti {
  to { transform: translateY(110vh) rotate(720deg); opacity: 0.6; }
}
.purchase-ring {
  position: absolute;
  top: 26px;
  left: 50%;
  width: 60px;
  height: 60px;
  margin-left: -30px;
  border-radius: 18px;
  pointer-events: none;
}
.purchase-celebration.active .purchase-ring { animation: ringPulse 1.4s var(--ease) infinite; }
@keyframes ringPulse {
  from { box-shadow: 0 0 0 0 rgba(34, 201, 147, 0.45); }
  to { box-shadow: 0 0 0 22px rgba(34, 201, 147, 0); }
}
.purchase-celebration.active .purchase-icon-burst { animation: pop 0.5s var(--ease-spring); }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } }

/* out of stock */
.oos-modal { overflow: hidden; }
.oos-modal-stars { position: absolute; inset: 0; pointer-events: none; }
.oos-modal-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(185, 179, 255, 0.8);
  animation: starRise linear infinite;
}
@keyframes starRise { from { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } to { transform: translateY(-105vh); opacity: 0; } }
.oos-modal-icon-wrap { color: var(--warning); background: var(--warning-soft); border-color: rgba(245, 181, 68, 0.35); }
.oos-modal-title, .entry-choice-title { font-size: 1.3rem; font-weight: 750; letter-spacing: -0.01em; }
.oos-modal-body, .entry-choice-body { margin-top: 8px; color: var(--text-2); font-size: 0.92rem; }
.oos-modal-hint { margin-top: 8px; color: var(--muted); font-size: 0.84rem; }
.oos-modal-actions, .entry-choice-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
body.oos-modal-open, body.entry-choice-open { overflow: hidden; }

.entry-choice-close { position: absolute; top: 10px; right: 10px; }

/* ——— Splash, maintenance, login ——— */

.saturn-splash {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
.saturn-splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.saturn-splash-logo { width: 72px; height: 72px; border-radius: 19px; box-shadow: 0 0 60px rgba(109, 94, 252, 0.35); animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.saturn-splash-text { color: var(--muted); font-size: 0.88rem; font-weight: 600; }
.splash-bar { position: relative; width: 120px; height: 3px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.splash-bar::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: inherit; background: var(--accent-2); animation: slide 1.1s var(--ease) infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

.maintenance-screen {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: var(--bg);
}
.maintenance-screen.active { display: flex; }
.maintenance-logo { margin-bottom: 8px; opacity: 0.9; }
.maintenance-screen h2 { font-size: 1.35rem; }
.maintenance-screen p { color: var(--muted); max-width: 340px; }

.web-login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(4, 5, 10, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-y: auto;
}
.web-login-card {
  position: relative;
  width: min(400px, 100%);
  padding: 28px 22px 22px;
  border-radius: var(--r-xl);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  text-align: center;
  animation: cardIn 0.35s var(--ease);
}
.web-login-close { position: absolute; top: 10px; right: 10px; }
.web-login-logo-wrap { display: grid; place-items: center; margin-bottom: 12px; }
.web-login-logo { width: 48px; height: 48px; border-radius: 13px; box-shadow: 0 0 32px rgba(109, 94, 252, 0.3); }
.web-login-card h2 { font-size: 1.2rem; font-weight: 750; letter-spacing: -0.015em; }
.web-login-card > p { margin: 6px 0 20px; color: var(--muted); font-size: 0.86rem; }
.web-login-bot { display: flex; flex-direction: column; gap: 14px; }
.web-login-code-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.web-login-code-label { font-size: 0.72rem; color: var(--muted); font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em; }
.web-login-code { display: flex; justify-content: center; gap: 6px; padding: 0; border-radius: 12px; }
.web-login-code span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 52px;
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(143, 123, 255, 0.12), rgba(143, 123, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(143, 123, 255, 0.28);
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  transition: box-shadow 0.2s ease, background 0.2s ease;
}
.web-login-code span:nth-child(3) { margin-right: 8px; }
.web-login-code:hover span { box-shadow: inset 0 0 0 1px rgba(143, 123, 255, 0.5); }
.web-login-code.is-copied span { background: var(--success-soft); box-shadow: inset 0 0 0 1px rgba(34, 201, 147, 0.45); }
.web-login-code-hint { color: var(--muted); font-size: 0.76rem; }
.web-login-code.is-copied + .web-login-code-hint { color: var(--success); }

.web-login-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.web-login-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
  counter-increment: step;
}
.web-login-steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(143, 123, 255, 0.16);
  color: var(--accent-2);
  font-size: 0.72rem;
  font-weight: 750;
}

.web-login-bot-btn { gap: 9px; }
.web-login-bot-btn svg { width: 19px; height: 19px; fill: currentColor; flex-shrink: 0; }

.web-login-bot-status, .web-login-foot { color: var(--muted); font-size: 0.8rem; }
.web-login-bot-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: -4px; }
.web-login-bot-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-2);
  animation: loginPulse 1.4s ease-in-out infinite;
}
.web-login-bot-status.is-error { color: var(--danger); }
.web-login-bot-status.is-error::before { background: var(--danger); animation: none; }
@keyframes loginPulse { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1); } }

.web-login-finish-btn { display: none; color: var(--muted); font-size: 0.78rem; text-decoration: underline; text-underline-offset: 3px; }
.web-login-finish-btn.visible { display: block; }
.web-login-finish-btn:hover { color: var(--text-2); }
.web-login-code-warn { display: flex; align-items: center; justify-content: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.74rem; }
.web-login-widget { display: flex; justify-content: center; min-height: 48px; margin-bottom: 10px; }

/* ——— Toasts ——— */

.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 22px + var(--safe-b));
  z-index: 700;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.toast {
  max-width: 100%;
  padding: 11px 16px;
  border-radius: var(--r-md);
  background: rgba(34, 38, 52, 0.96);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-2);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  transition: opacity 0.25s ease, transform 0.3s var(--ease);
}
.toast.show { opacity: 1; transform: none; }

/* ——— Responsive ——— */

@media (max-width: 460px) {
  .brand { gap: 8px; }
  .brand-logo { width: 34px; height: 34px; }
  .brand-name { font-size: 0.96rem; }
  .topbar-inner { gap: 8px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-btn { width: 36px; height: 36px; }
  .balance-pill { height: 36px; gap: 6px; padding-left: 10px; }
  .balance-pill:not(.balance-pill--guest) .balance-icon { display: none; }
  .balance-topup { width: 26px; height: 26px; }
}

@media (max-width: 380px) {
  :root { --pad: 12px; }
  .chip-grid--5 { grid-template-columns: repeat(3, 1fr); }
  .preset-grid { grid-template-columns: repeat(2, 1fr); }
  .card-actions { grid-template-columns: 1fr; }
}

@media (max-width: 330px) {
  .brand-name { display: none; }
}

@media (min-width: 720px) {
  .sheet-panel {
    top: 50%;
    bottom: auto;
    max-height: min(80vh, 760px);
    padding: 20px 24px 24px;
    border-radius: var(--r-xl);
    border-bottom: 1px solid var(--line-strong);
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.97);
    transition: transform 0.3s var(--ease), opacity 0.2s ease, visibility 0s linear 0.3s;
  }
  .sheet-panel::before { display: none; }
  .sheet-panel.active { opacity: 1; transform: translate(-50%, -50%); transition: transform 0.3s var(--ease), opacity 0.2s ease; }
  .sheet-panel--tall { height: min(80vh, 760px); }
  .sheet-body { margin: 0 -24px; padding: 0 24px; }
  .sup-messages { margin: 10px -24px 0; padding: 10px 24px; }
  .dialog-card { padding: 30px 28px 24px; }
}

body.site-mode { --wrap: 1240px; --pad: 24px; }
.card--soon { display: none; }
@media (min-width: 640px) {
  body.site-mode .categories {
    grid-template-columns: repeat(auto-fit, minmax(280px, 340px));
    justify-content: center;
    gap: 18px;
  }
  body.site-mode .page-title { text-align: center; }
}
@media (min-width: 1000px) {
  body.site-mode .card--soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 200px;
    background: transparent;
    border: 1px dashed var(--line-strong);
    box-shadow: none;
    color: var(--muted);
    font-size: 0.9rem;
  }
  body.site-mode .card--soon .empty-icon { opacity: 0.5; }
}
@media (min-width: 1000px) {
  body.site-mode .page-title { margin: 32px 0 20px; font-size: 1.75rem; }
  body.site-mode .dock { width: 520px; }
  body.site-mode .page-title { letter-spacing: -0.025em; }
}
@media (min-width: 1400px) {
  body.site-mode { --wrap: 1400px; }
}
@media (max-width: 640px) {
  body.site-mode { --pad: 16px; }
}

body.twa-mode { background-attachment: scroll; }

body.site-mode::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, rgba(255, 255, 255, 0.55), transparent 60%),
    radial-gradient(1px 1px at 78% 12%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(1.4px 1.4px at 64% 44%, rgba(196, 186, 255, 0.5), transparent 60%),
    radial-gradient(1px 1px at 32% 66%, rgba(255, 255, 255, 0.35), transparent 60%),
    radial-gradient(1.2px 1.2px at 88% 78%, rgba(255, 255, 255, 0.4), transparent 60%),
    radial-gradient(1px 1px at 46% 92%, rgba(170, 240, 225, 0.4), transparent 60%),
    radial-gradient(0.8px 0.8px at 22% 42%, rgba(255, 255, 255, 0.3), transparent 60%),
    radial-gradient(0.8px 0.8px at 56% 24%, rgba(255, 255, 255, 0.3), transparent 60%);
  background-size: 520px 520px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.25) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.25) 100%);
  opacity: 0.7;
}
body.site-mode::after {
  content: "";
  position: fixed;
  left: 50%;
  top: -260px;
  z-index: 0;
  width: min(1100px, 120vw);
  height: 560px;
  transform: translateX(-50%);
  pointer-events: none;
  background:
    radial-gradient(closest-side at 50% 50%, rgba(109, 94, 252, 0.16), transparent),
    radial-gradient(closest-side at 72% 60%, rgba(45, 212, 191, 0.07), transparent);
  filter: blur(10px);
}

body.site-mode .app { display: flex; flex-direction: column; }
body.site-mode .main { flex: 1 0 auto; }
body.site-mode .site-footer-wrap { margin-top: 56px; }

@media (min-width: 1180px) {
  body.site-mode .app { padding-bottom: calc(28px + var(--safe-b)); }
  body.site-mode .dock {
    top: 9px;
    bottom: auto;
    display: flex;
    gap: 2px;
    width: auto;
    height: 40px;
    padding: 4px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--line);
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body.site-mode .dock-btn {
    flex-direction: row;
    gap: 7px;
    padding: 0 13px;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 600;
  }
  body.site-mode .dock-btn svg { width: 17px; height: 17px; }
  body.site-mode .dock-btn.is-active { color: var(--text); background: rgba(143, 123, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(143, 123, 255, 0.28); }
  body.site-mode .dock-btn.is-active svg { color: var(--accent-2); filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ——— Profile ——— */
.profile-panel .sheet-body { display: flex; flex-direction: column; gap: 12px; padding-bottom: 4px; }
.profile-panel .sheet-body > * { flex-shrink: 0; }
.profile-panel { --lv: #8f7bff; }
.profile-loading { display: grid; place-items: center; min-height: 220px; }
.profile-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--lv) 26%, transparent), transparent 60%),
    radial-gradient(80% 120% at 100% 100%, rgba(34, 211, 238, 0.10), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}
.profile-hero::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--lv) 30%, transparent);
  box-shadow: 0 0 0 18px color-mix(in srgb, var(--lv) 6%, transparent);
  pointer-events: none;
}
.lvl-dust { --lv: #a5b4fc; }
.lvl-meteor { --lv: #fb923c; }
.lvl-satellite { --lv: #94a3b8; }
.lvl-moon { --lv: #e2e8f0; }
.lvl-planet { --lv: #34d399; }
.lvl-saturn { --lv: #8f7bff; }
.lvl-star { --lv: #facc15; }
.lvl-supernova { --lv: #f97316; }
.lvl-nebula { --lv: #f472b6; }
.lvl-galaxy { --lv: #22d3ee; }
.lvl-blackhole { --lv: #c084fc; }
.lvl-universe { --lv: #fbbf24; }
.profile-ladder { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; }
.profile-ladder span { height: 4px; border-radius: 99px; background: var(--surface-3); }
.profile-ladder span.is-done { background: color-mix(in srgb, var(--lv) 55%, var(--surface-3)); }
.profile-ladder span.is-now { background: var(--lv); box-shadow: 0 0 8px color-mix(in srgb, var(--lv) 70%, transparent); }
.profile-avatar {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 1.5rem;
  font-weight: 750;
  color: #fff;
  background: linear-gradient(135deg, var(--lv), var(--accent));
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px color-mix(in srgb, var(--lv) 60%, transparent);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-id { min-width: 0; display: grid; gap: 4px; position: relative; z-index: 1; }
.profile-name { font-size: 1.12rem; font-weight: 750; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.78rem; color: var(--muted); }
.profile-since { display: flex; align-items: flex-start; gap: 6px; font-size: 0.8rem; line-height: 1.35; color: var(--text-2); }
.profile-since svg { flex: none; margin-top: 1px; }
.profile-since svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; color: var(--lv); }

.profile-level {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  gap: 8px;
}
.profile-level-head { display: flex; align-items: center; justify-content: space-between; }
.profile-level-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 8px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--lv) 85%, #fff);
  background: color-mix(in srgb, var(--lv) 14%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--lv) 35%, transparent);
}
.profile-level-badge svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.profile-level-pct { font-size: 0.78rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.profile-level-bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.profile-level-bar i {
  display: block;
  height: 100%;
  min-width: 6px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--lv));
  box-shadow: 0 0 12px color-mix(in srgb, var(--lv) 60%, transparent);
  animation: profileBar 0.9s var(--ease) both;
}
@keyframes profileBar { from { width: 0; } }
.profile-level-hint { font-size: 0.78rem; color: var(--text-2); }

.profile-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
  border: 1px solid var(--accent-ring);
}
.profile-balance > div { display: grid; gap: 2px; }
.profile-balance-value { font-size: 1.35rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.profile-topup { min-height: 38px; padding: 0 16px; }

.profile-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.profile-stat {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 0;
}
.profile-stat-label { font-size: 0.74rem; color: var(--muted); font-weight: 600; }
.profile-stat-value { font-size: 1.02rem; color: var(--text); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-stat-sub { font-size: 0.72rem; color: var(--text-2); }

.profile-promo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--success);
  background: var(--success-soft);
}
.profile-promo svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.profile-section { display: grid; gap: 8px; }
.profile-section-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.86rem; font-weight: 700; color: var(--text); }
.profile-link { background: none; border: 0; padding: 4px 0; color: var(--accent-2); font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.profile-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.profile-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 0.86rem;
}
.profile-row-main { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-row-main em { font-style: normal; color: var(--muted); font-weight: 500; }
.profile-row-side { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.profile-row-date { grid-column: 1 / -1; font-size: 0.74rem; color: var(--muted); }
.profile-empty { margin: 0; padding: 14px; text-align: center; border-radius: var(--r-sm); border: 1px dashed var(--line-strong); color: var(--muted); font-size: 0.84rem; }
.profile-ref-btn { gap: 8px; }
.profile-ref-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* profile + balance as one capsule */
.account-cluster {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 2px;
  gap: 2px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.15s ease;
}
.account-cluster:hover { border-color: var(--line-strong); }
.account-cluster .profile-btn {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-2);
  background: var(--surface-3);
  transition: background 0.15s ease, color 0.15s ease;
}
.account-cluster .profile-btn:hover { color: #fff; background: var(--accent-soft); }
.account-cluster .profile-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.account-cluster .balance-pill {
  height: 34px;
  border: 0;
  background: transparent;
  padding-left: 8px;
  position: relative;
}
.account-cluster .balance-pill::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: var(--line-strong);
}
.account-cluster .balance-pill:hover { border-color: transparent; background: rgba(255, 255, 255, 0.03); }

/* narrow screens: currency lives inside the language sheet */
.lang-cur-extra { display: none; }
.lang-cur-title { margin: 18px 0 10px; font-size: 1rem; font-weight: 700; }
@media (max-width: 480px) {
  #btnCurrency { display: none; }
  .lang-cur-extra { display: block; }
  .brand-name { font-size: 0.95rem; }
  .account-cluster .balance-pill { padding-left: 6px; padding-right: 3px; gap: 5px; }
  .account-cluster .balance-pill .balance-unit { font-size: 0.7rem; }
}
@media (max-width: 340px) {
  .brand-name { display: none; }
}
