:root {
  --bg: var(--tg-theme-bg-color, #0b1120);
  --card: var(--tg-theme-secondary-bg-color, #162033);
  --text: var(--tg-theme-text-color, #f8fafc);
  --hint: var(--tg-theme-hint-color, #94a3b8);
  --accent: var(--tg-theme-button-color, #38bdf8);
  --accent-text: var(--tg-theme-button-text-color, #0b1120);
  --border: rgba(148, 163, 184, 0.16);
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(65% 45% at 18% 0%, rgba(56, 189, 248, 0.16), transparent 60%),
    radial-gradient(60% 42% at 88% 8%, rgba(139, 92, 246, 0.14), transparent 62%),
    radial-gradient(circle at 50% -10%, #172554 0%, var(--bg) 56%);
  color: var(--text);
  line-height: 1.4;
  padding-bottom: 42px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.tma-ambient-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.tma-star {
  position: absolute;
  color: rgba(186, 230, 253, 0.55);
  font-size: 13px;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.85);
  animation: tma-star-float 5.4s ease-in-out infinite;
}

.tma-star--1 { top: 6%; left: 10%; font-size: 12px; animation-delay: 0s; }
.tma-star--2 { top: 14%; right: 12%; font-size: 16px; color: rgba(254, 240, 138, 0.6); animation-delay: 1.1s; }
.tma-star--3 { top: 38%; left: 6%; font-size: 10px; animation-delay: 2.2s; }
.tma-star--4 { top: 54%; right: 8%; font-size: 14px; color: rgba(192, 132, 252, 0.58); animation-delay: 3.1s; }
.tma-star--5 { bottom: 12%; left: 14%; font-size: 13px; animation-delay: 4.0s; }

@keyframes tma-star-float {
  0%, 100% { opacity: 0.25; transform: translateY(0) scale(0.82) rotate(0deg); }
  50% { opacity: 0.92; transform: translateY(-6px) scale(1.18) rotate(16deg); }
}

.hidden { display: none !important; }

.app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 12px 14px; }

.welcome-card {
  position: relative;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.92));
  backdrop-filter: blur(18px);
  border: 1px solid transparent;
  background-image:
    linear-gradient(160deg, rgba(30, 41, 59, 0.82), rgba(11, 17, 32, 0.94)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(56, 189, 248, 0.22), rgba(148, 163, 184, 0.08));
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  border-radius: 24px;
  padding: 30px 22px;
  text-align: center;
  margin-top: 24px;
  box-shadow:
    0 24px 54px rgba(2, 6, 23, 0.56),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.welcome-emoji {
  font-size: 48px;
  margin-bottom: 12px;
  display: inline-block;
  filter: drop-shadow(0 6px 18px rgba(56, 189, 248, 0.45));
  animation: qb-icon-breathe 3.4s ease-in-out infinite;
}
.welcome-card h2 { font-size: 20px; margin-bottom: 10px; font-weight: 800; }

/* =========================================================
   Profile Deck Section (Telegram Mini App Glass + Gradient Rim)
   ========================================================= */
.profile-deck-section {
  position: relative;
  border: 1px solid transparent;
  background-image:
    linear-gradient(160deg, rgba(30, 41, 59, 0.76), rgba(11, 17, 32, 0.94)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(56, 189, 248, 0.2), rgba(139, 92, 246, 0.16));
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  backdrop-filter: blur(18px);
  border-radius: 24px;
  padding: 15px 14px 16px;
  margin-bottom: 14px;
  box-shadow:
    0 20px 44px rgba(2, 6, 23, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.hero-identity { min-width: 0; }
.user-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; }
.user-meta { font-size: 12px; color: var(--hint); margin-top: 2px; font-family: var(--font-mono); }

.badges-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.deck-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.deck-view-toggle {
  display: inline-flex;
  padding: 3px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.deck-mode-btn {
  border: none;
  background: transparent;
  color: var(--hint);
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s ease, color 0.18s ease;
}

.deck-mode-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

.btn-showcase-pill {
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.18s ease;
}

.btn-showcase-pill:hover {
  background: rgba(56, 189, 248, 0.22);
  transform: translateY(-1px);
}

.preview-mode-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.38);
  color: #fef3c7;
  border-radius: 12px;
  padding: 8px 11px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 600;
}

.btn-reset-preview {
  border: 1px solid rgba(254, 243, 199, 0.3);
  background: rgba(15, 23, 42, 0.45);
  color: #fef3c7;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.profile-cards-deck {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* =========================================================
   Collectible Rating Card — Form Factor (Img 3 & 7) + Fragment Textures (Img 1,2,4,5,6)
   ========================================================= */
.tg-collectible-card {
  --card-bg: linear-gradient(135deg, #141923 0%, #263042 50%, #475569 100%);
  --card-rim: linear-gradient(135deg, rgba(255, 255, 255, 0.52) 0%, rgba(148, 163, 184, 0.24) 48%, rgba(255, 255, 255, 0.42) 100%);
  --card-glow: rgba(148, 163, 184, 0.24);
  --card-ink: #f8fafc;
  --card-ink-muted: rgba(248, 250, 252, 0.72);
  --card-pill-bg: rgba(15, 23, 42, 0.45);
  --card-pill-border: rgba(255, 255, 255, 0.18);
  --chip-bg: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 52%, #94a3b8 100%);
  --chip-ink: rgba(15, 23, 42, 0.56);
  --pattern-color: #ffffff;
  --pattern-opacity: 0.085;
  --rx: 0deg;
  --ry: 0deg;
  --glare-x: 50%;
  --glare-y: 50%;
  --glare-opacity: 0;

  position: relative;
  width: 100%;
  aspect-ratio: 1.586 / 1;
  min-height: 212px;
  border-radius: 20px;
  padding: 15px 42px 14px 18px;
  color: var(--card-ink);
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  transform: perspective(950px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
  box-shadow:
    0 18px 34px -10px rgba(2, 6, 23, 0.72),
    0 14px 32px -12px var(--card-glow),
    inset 0 1px 1px rgba(255, 255, 255, 0.45),
    inset 0 -1px 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tg-collectible-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--card-rim);
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 9;
}

.tg-card__bg,
.tg-card__texture,
.tg-card__pattern,
.tg-card__fx,
.tg-card__glare,
.tg-card__glints {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.tg-card__bg {
  background: var(--card-bg);
  z-index: 1;
}

.tg-card__texture {
  z-index: 2;
  opacity: 0;
}

.tg-card__pattern {
  z-index: 3;
  color: var(--pattern-color);
  opacity: var(--pattern-opacity);
  mix-blend-mode: overlay;
}

.tg-card__pattern svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tg-card__fx {
  z-index: 4;
}

.tg-card__glare {
  z-index: 6;
  background:
    radial-gradient(
      circle 180px at var(--glare-x) var(--glare-y),
      rgba(255, 255, 255, 0.28) 0%,
      rgba(255, 255, 255, 0.08) 38%,
      transparent 72%
    );
  mix-blend-mode: screen;
  opacity: var(--glare-opacity);
  transition: opacity 0.25s ease;
}

.tg-card__glints {
  z-index: 7;
}

.tg-card__star {
  position: absolute;
  width: var(--sz, 22px);
  height: var(--sz, 22px);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.85));
  animation: tg-star-twinkle var(--dur, 3.6s) ease-in-out infinite;
  animation-delay: var(--del, 0s);
}

.tg-card__content {
  position: relative;
  z-index: 8;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.tg-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tg-card__top-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.tg-card__kind-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--card-ink);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.tg-card__rank-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--card-ink);
  background: rgba(2, 6, 23, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.tg-card__middle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.tg-card__metric-col {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.tg-card__emblem {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.45));
}

.tg-card__emblem svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tg-card__value-wrap {
  min-width: 0;
}

.tg-card__value {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  text-shadow: 0 2px 10px rgba(2, 6, 23, 0.65);
}

.tg-card__val-int {
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.tg-card__val-dec {
  font-size: 19px;
  font-weight: 600;
  opacity: 0.92;
}

.tg-card__val-unit {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.03em;
  margin-left: 6px;
  opacity: 0.72;
}

.tg-card__value--compact .tg-card__val-int {
  font-size: 21px;
}

.tg-card__value--compact .tg-card__val-dec,
.tg-card__value--compact .tg-card__val-unit {
  font-size: 14px;
}

.tg-card__sub {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--card-ink-muted);
  text-shadow: 0 1px 4px rgba(2, 6, 23, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-card__chip-wrap {
  flex-shrink: 0;
}

.tg-card__chip {
  width: 48px;
  height: 38px;
  border-radius: 10px;
  background: var(--chip-bg);
  color: var(--chip-ink);
  display: grid;
  place-items: center;
  box-shadow:
    0 4px 12px rgba(2, 6, 23, 0.38),
    inset 0 1px 1px rgba(255, 255, 255, 0.75),
    inset 0 -1px 2px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
  transition: transform 0.16s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.tg-card__chip:hover {
  transform: translateY(-1px) scale(1.04);
  filter: brightness(1.08);
  box-shadow:
    0 6px 16px rgba(2, 6, 23, 0.45),
    0 0 14px rgba(255, 255, 255, 0.35),
    inset 0 1px 1px rgba(255, 255, 255, 0.85);
}

.tg-card__chip:active {
  transform: scale(0.95);
}

.tg-card__chip svg {
  width: 24px;
  height: 24px;
  display: block;
}

.tg-card__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
}

.tg-card__holder-col {
  min-width: 0;
}

.tg-card__holder {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-shadow: 0 1px 4px rgba(2, 6, 23, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-card__tier-caption {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--card-ink-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-card__pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tg-card__pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--card-pill-bg);
  border: 1px solid var(--card-pill-border);
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

.tg-card__vertical-code {
  position: absolute;
  top: 14px;
  bottom: 14px;
  right: 11px;
  z-index: 8;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 8.2px;
  font-weight: 500;
  line-height: 1.32;
  letter-spacing: 0.08em;
  color: var(--card-ink);
  opacity: 0.56;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* =========================================================
   CATEGORY 1: 6 METAL / GEM CARDS (GRAM VALUE)
   ========================================================= */

/* 1. База (Обычный) — Brushed Gunmetal Steel (Image 7 left card) */
.tg-card--val-Обычный,
.tg-card--val-База {
  --card-bg:
    radial-gradient(125% 110% at 88% 12%, rgba(203, 213, 225, 0.42) 0%, rgba(71, 85, 105, 0.16) 42%, transparent 72%),
    linear-gradient(132deg, #0d1118 0%, #1c2432 38%, #344156 76%, #596981 100%);
  --card-rim: linear-gradient(135deg, rgba(226, 232, 240, 0.65) 0%, rgba(100, 116, 139, 0.28) 50%, rgba(203, 213, 225, 0.5) 100%);
  --card-glow: rgba(100, 116, 139, 0.34);
  --pattern-opacity: 0.08;
  --chip-bg: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 55%, #64748b 100%);
}
.tg-card--val-Обычный .tg-card__texture,
.tg-card--val-База .tg-card__texture {
  opacity: 0.52;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.07) 0px,
      rgba(255, 255, 255, 0.07) 1px,
      rgba(0, 0, 0, 0.12) 1px,
      rgba(0, 0, 0, 0.12) 2px
    ),
    linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.12) 48%, transparent 75%);
}
.tg-card--val-Обычный .tg-card__fx,
.tg-card--val-База .tg-card__fx {
  background: radial-gradient(70% 80% at 85% 20%, rgba(226, 232, 240, 0.16), transparent 65%);
}

/* 2. Бронза — Forged Copper-Bronze & Sapphire Core (Image 2 trophy) */
.tg-card--val-Бронза {
  --card-bg:
    radial-gradient(85% 95% at 78% 48%, rgba(37, 99, 235, 0.42) 0%, rgba(14, 165, 233, 0.14) 38%, transparent 70%),
    linear-gradient(134deg, #1b0a04 0%, #4b1d09 32%, #9a4518 68%, #e07a38 100%);
  --card-rim: linear-gradient(135deg, rgba(254, 215, 170, 0.72) 0%, rgba(56, 189, 248, 0.45) 52%, rgba(251, 146, 60, 0.65) 100%);
  --card-glow: rgba(234, 88, 12, 0.36);
  --pattern-opacity: 0.11;
  --chip-bg: linear-gradient(135deg, #fed7aa 0%, #38bdf8 55%, #b45309 100%);
  --chip-ink: rgba(15, 23, 42, 0.72);
}
.tg-card--val-Бронза .tg-card__texture {
  opacity: 0.48;
  background-image:
    repeating-linear-gradient(
      -12deg,
      rgba(255, 237, 213, 0.08) 0px,
      rgba(255, 237, 213, 0.08) 1px,
      transparent 1px,
      transparent 3px
    );
}
.tg-card--val-Бронза .tg-card__fx {
  background:
    radial-gradient(circle at 77% 50%, rgba(56, 189, 248, 0.42) 0%, rgba(29, 78, 216, 0.18) 28%, transparent 56%),
    conic-gradient(from 210deg at 78% 50%, rgba(251, 146, 60, 0.25), transparent 22%, rgba(56, 189, 248, 0.22) 45%, transparent 75%);
}

/* 3. Серебро — Sterling Mirror Chrome (Image 6 silver rim) */
.tg-card--val-Серебро {
  --card-bg:
    linear-gradient(
      118deg,
      #141c28 0%,
      #334155 24%,
      #64748b 46%,
      #cbd5e1 68%,
      #f8fafc 84%,
      #64748b 100%
    );
  --card-rim: linear-gradient(135deg, #ffffff 0%, #94a3b8 42%, #f1f5f9 75%, #ffffff 100%);
  --card-glow: rgba(203, 213, 225, 0.36);
  --pattern-opacity: 0.12;
  --chip-bg: linear-gradient(135deg, #ffffff 0%, #cbd5e1 48%, #64748b 100%);
}
.tg-card--val-Серебро .tg-card__texture {
  opacity: 0.44;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.06) 0px,
      rgba(255, 255, 255, 0.06) 1px,
      rgba(15, 23, 42, 0.07) 1px,
      rgba(15, 23, 42, 0.07) 2px
    );
}
.tg-card--val-Серебро .tg-card__fx {
  background:
    linear-gradient(112deg, transparent 22%, rgba(255, 255, 255, 0.32) 48%, rgba(255, 255, 255, 0.06) 58%, transparent 76%),
    radial-gradient(65% 95% at 15% 50%, rgba(15, 23, 42, 0.45), transparent 68%);
}

/* 4. Золото — Sovereign 24K Bullion (Images 1 & 5) */
.tg-card--val-Золото {
  --card-bg:
    radial-gradient(80% 90% at 75% 44%, rgba(254, 240, 138, 0.56) 0%, rgba(245, 158, 11, 0.25) 45%, transparent 78%),
    linear-gradient(135deg, #271002 0%, #6b3105 28%, #b45309 58%, #f59e0b 84%, #fde047 100%);
  --card-rim: linear-gradient(135deg, #fffbeb 0%, #f59e0b 45%, #38bdf8 72%, #fef08a 100%);
  --card-glow: rgba(245, 158, 11, 0.46);
  --pattern-opacity: 0.13;
  --chip-bg: linear-gradient(135deg, #fef9c3 0%, #f59e0b 54%, #92400e 100%);
  --chip-ink: rgba(69, 26, 3, 0.72);
}
.tg-card--val-Золото .tg-card__texture {
  opacity: 0.42;
  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(254, 249, 195, 0.08) 0px,
      rgba(254, 249, 195, 0.08) 1px,
      transparent 1px,
      transparent 2.5px
    );
}
.tg-card--val-Золото .tg-card__fx {
  background:
    conic-gradient(
      from 195deg at 64% 48%,
      rgba(254, 240, 138, 0.45) 0deg,
      transparent 55deg,
      rgba(14, 165, 233, 0.22) 125deg,
      transparent 180deg,
      rgba(251, 191, 36, 0.35) 260deg,
      rgba(254, 240, 138, 0.45) 360deg
    ),
    radial-gradient(65% 85% at 18% 55%, rgba(30, 12, 2, 0.56), transparent 72%);
}
.tg-card--val-Золото .tg-card__fx::after {
  content: "";
  position: absolute;
  inset: -25%;
  background: linear-gradient(108deg, transparent 36%, rgba(254, 249, 195, 0.32) 50%, transparent 64%);
  animation: tg-card-sweep 5.4s ease-in-out infinite;
}

/* 5. Платина — Iridium Pearl Platinum (Image 7 right pearlescent card) */
.tg-card--val-Платина {
  --card-bg:
    radial-gradient(95% 110% at 82% 24%, rgba(224, 242, 254, 0.48) 0%, rgba(186, 230, 253, 0.16) 44%, transparent 72%),
    linear-gradient(135deg, #0b1220 0%, #1e293b 35%, #475569 68%, #cbd5e1 100%);
  --card-rim: linear-gradient(135deg, #ffffff 0%, #bae6fd 38%, #ddd6fe 72%, #f8fafc 100%);
  --card-glow: rgba(186, 230, 253, 0.42);
  --pattern-opacity: 0.12;
  --chip-bg: linear-gradient(135deg, #ffffff 0%, #e0f2fe 45%, #94a3b8 100%);
}
.tg-card--val-Платина .tg-card__texture {
  opacity: 0.72;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.36) 0.75px, transparent 0.85px),
    radial-gradient(rgba(186, 230, 253, 0.32) 0.65px, transparent 0.8px),
    radial-gradient(rgba(221, 214, 254, 0.25) 0.65px, transparent 0.8px);
  background-size: 9px 9px, 13px 13px, 17px 17px;
  background-position: 0 0, 4px 5px, 7px 2px;
}
.tg-card--val-Платина .tg-card__fx {
  background:
    conic-gradient(
      from 45deg at 66% 52%,
      rgba(224, 242, 254, 0.28),
      rgba(221, 214, 254, 0.18) 95deg,
      transparent 175deg,
      rgba(248, 250, 252, 0.32) 255deg,
      rgba(224, 242, 254, 0.28) 360deg
    );
}

/* 6. Бриллиант (Алмаз) — Faceted Prismatic Diamond (Image 3 blue conic GRAM + Image 4 faceted crystal) */
.tg-card--val-Алмаз,
.tg-card--val-Бриллиант {
  --card-bg:
    conic-gradient(
      from 152deg at 60% 48%,
      #008cff 0deg,
      #38bdf8 34deg,
      #026be8 78deg,
      #0338a0 132deg,
      #1d4ed8 184deg,
      #00a6ff 240deg,
      #60a5fa 294deg,
      #008cff 360deg
    );
  --card-rim: linear-gradient(135deg, #ffffff 0%, #7dd3fc 30%, #e879f9 65%, #fb7185 84%, #e0f2fe 100%);
  --card-glow: rgba(0, 162, 255, 0.56);
  --pattern-opacity: 0.13;
  --chip-bg: linear-gradient(135deg, #f8fafc 0%, #bae6fd 52%, #e2e8f0 100%);
}
.tg-card--val-Алмаз .tg-card__texture,
.tg-card--val-Бриллиант .tg-card__texture {
  opacity: 0.38;
  background-image:
    linear-gradient(128deg, rgba(255, 255, 255, 0.28) 0%, transparent 28%, rgba(244, 63, 94, 0.16) 56%, transparent 72%),
    linear-gradient(38deg, transparent 28%, rgba(167, 139, 250, 0.24) 48%, transparent 66%);
}
.tg-card--val-Алмаз .tg-card__fx,
.tg-card--val-Бриллиант .tg-card__fx {
  background:
    linear-gradient(148deg, rgba(255, 255, 255, 0.18) 0%, transparent 40%, rgba(217, 70, 239, 0.16) 72%, rgba(244, 63, 94, 0.2) 100%),
    radial-gradient(60% 80% at 18% 50%, rgba(3, 37, 108, 0.45), transparent 72%);
}
.tg-card--val-Алмаз .tg-card__fx::after,
.tg-card--val-Бриллиант .tg-card__fx::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(110deg, transparent 34%, rgba(255, 255, 255, 0.38) 50%, rgba(224, 242, 254, 0.16) 56%, transparent 68%);
  animation: tg-card-sweep 4.2s ease-in-out infinite;
}

/* =========================================================
   CATEGORY 2: 6 COSMIC / PHYSICS CARDS (ACTIVITY)
   ========================================================= */

/* 1. Лунный свет (Искра) — Lunar Halo & Crater Glow */
.tg-card--act-Лунный-свет {
  --card-bg:
    radial-gradient(circle 120px at 80% 28%, rgba(241, 245, 249, 0.44) 0%, rgba(147, 197, 253, 0.2) 38%, rgba(30, 58, 138, 0.16) 68%, transparent 100%),
    linear-gradient(140deg, #050814 0%, #0f172a 48%, #1e293b 100%);
  --card-rim: linear-gradient(135deg, rgba(226, 232, 240, 0.62) 0%, rgba(96, 165, 250, 0.24) 54%, rgba(248, 250, 252, 0.45) 100%);
  --card-glow: rgba(147, 197, 253, 0.32);
  --pattern-opacity: 0.1;
  --chip-bg: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 52%, #64748b 100%);
}
.tg-card--act-Лунный-свет .tg-card__texture {
  opacity: 0.65;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.55) 0.8px, transparent 1px),
    radial-gradient(rgba(191, 219, 254, 0.38) 0.6px, transparent 0.9px);
  background-size: 32px 28px, 19px 23px;
  background-position: 6px 8px, 14px 3px;
}
.tg-card--act-Лунный-свет .tg-card__fx::before {
  content: "";
  position: absolute;
  width: 112px;
  height: 112px;
  right: 36px;
  top: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 36%, rgba(255, 255, 255, 0.42), rgba(203, 213, 225, 0.14) 55%, transparent 72%);
  box-shadow: 0 0 36px rgba(186, 230, 253, 0.25);
  border: 1px solid rgba(226, 232, 240, 0.2);
}

/* 2. Полярное сияние — Aurora Borealis Magnetosphere */
.tg-card--act-Полярное-сияние {
  --card-bg:
    radial-gradient(110% 80% at 72% 16%, rgba(45, 212, 191, 0.36) 0%, transparent 62%),
    radial-gradient(90% 80% at 32% 85%, rgba(168, 85, 247, 0.3) 0%, transparent 64%),
    linear-gradient(142deg, #020c14 0%, #042029 45%, #17153b 100%);
  --card-rim: linear-gradient(135deg, #5eead4 0%, #34d399 35%, #a78bfa 72%, #f472b6 100%);
  --card-glow: rgba(45, 212, 191, 0.4);
  --pattern-opacity: 0.11;
  --chip-bg: linear-gradient(135deg, #ccfbf1 0%, #2dd4bf 52%, #7c3aed 100%);
}
.tg-card--act-Полярное-сияние .tg-card__texture {
  opacity: 0.52;
  background-image:
    repeating-linear-gradient(
      98deg,
      rgba(94, 234, 212, 0.12) 0px,
      rgba(94, 234, 212, 0.12) 2px,
      transparent 2px,
      transparent 9px
    );
}
.tg-card--act-Полярное-сияние .tg-card__fx {
  background:
    linear-gradient(122deg, transparent 10%, rgba(16, 185, 129, 0.38) 36%, rgba(45, 212, 191, 0.34) 52%, rgba(168, 85, 247, 0.36) 72%, transparent 90%);
  filter: blur(8px);
  animation: tg-aurora-drift 6.5s ease-in-out infinite alternate;
}

/* 3. Солнечная — Solar Corona & Plasma Prominence */
.tg-card--act-Солнечная {
  --card-bg:
    radial-gradient(circle 140px at 84% 26%, #fffbeb 0%, #fde047 22%, #f97316 50%, #9a3412 78%, transparent 100%),
    linear-gradient(136deg, #160400 0%, #431002 44%, #7c2d12 80%, #c2410c 100%);
  --card-rim: linear-gradient(135deg, #fef08a 0%, #fb923c 44%, #f97316 74%, #fef9c3 100%);
  --card-glow: rgba(249, 115, 22, 0.5);
  --pattern-opacity: 0.12;
  --chip-bg: linear-gradient(135deg, #fef9c3 0%, #f59e0b 52%, #b45309 100%);
  --chip-ink: rgba(67, 20, 7, 0.72);
}
.tg-card--act-Солнечная .tg-card__fx::before {
  content: "";
  position: absolute;
  width: 146px;
  height: 146px;
  right: 12px;
  top: -22px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 249, 195, 0.75) 0%, rgba(251, 146, 60, 0.35) 54%, transparent 72%);
  box-shadow: 0 0 42px rgba(249, 115, 22, 0.65);
  animation: tg-solar-pulse 4.2s ease-in-out infinite;
}
.tg-card--act-Солнечная .tg-card__fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 90% at 15% 55%, rgba(20, 4, 0, 0.55), transparent 70%);
}

/* 4. Квантовый — Cherenkov Quantum Field & Pulsar */
.tg-card--act-Квантовый {
  --card-bg:
    radial-gradient(95% 95% at 74% 46%, rgba(34, 211, 238, 0.42) 0%, rgba(14, 116, 144, 0.25) 45%, transparent 75%),
    linear-gradient(136deg, #020b18 0%, #082f49 48%, #1e3a8a 100%);
  --card-rim: linear-gradient(135deg, #a5f3fc 0%, #06b6d4 44%, #3b82f6 76%, #e0f2fe 100%);
  --card-glow: rgba(6, 182, 212, 0.48);
  --pattern-opacity: 0.13;
  --chip-bg: linear-gradient(135deg, #ecfeff 0%, #22d3ee 52%, #0284c7 100%);
}
.tg-card--act-Квантовый .tg-card__texture {
  opacity: 0.44;
  background-image:
    radial-gradient(rgba(103, 232, 249, 0.45) 1px, transparent 1px),
    linear-gradient(to right, rgba(34, 211, 238, 0.1) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34, 211, 238, 0.1) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px, 24px 24px;
}
.tg-card--act-Квантовый .tg-card__fx::before,
.tg-card--act-Квантовый .tg-card__fx::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 70px;
  right: 16px;
  top: 50%;
  margin-top: -35px;
  border-radius: 50%;
  border: 1.5px solid rgba(103, 232, 249, 0.55);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.35), inset 0 0 14px rgba(34, 211, 238, 0.2);
}
.tg-card--act-Квантовый .tg-card__fx::before {
  transform: rotate(-32deg);
}
.tg-card--act-Квантовый .tg-card__fx::after {
  transform: rotate(32deg);
  border-color: rgba(147, 197, 253, 0.5);
}

/* 5. Сверхновая (Космический) — Supernova Hyper-Luminosity Shockwave («сверхяркая») */
.tg-card--act-Сверхновая {
  --card-bg:
    radial-gradient(circle 135px at 76% 42%, rgba(255, 255, 255, 0.96) 0%, rgba(165, 243, 252, 0.72) 16%, rgba(232, 121, 249, 0.55) 38%, rgba(124, 58, 237, 0.45) 62%, transparent 86%),
    linear-gradient(135deg, #0d031d 0%, #2e1065 44%, #701a75 82%, #be185d 100%);
  --card-rim: linear-gradient(135deg, #ffffff 0%, #67e8f9 28%, #f472b6 66%, #c084fc 100%);
  --card-glow: rgba(232, 121, 249, 0.58);
  --pattern-opacity: 0.14;
  --chip-bg: linear-gradient(135deg, #ffffff 0%, #e879f9 48%, #38bdf8 100%);
}
.tg-card--act-Сверхновая .tg-card__texture {
  opacity: 0.55;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.6) 0.9px, transparent 1px),
    radial-gradient(rgba(103, 232, 249, 0.45) 0.7px, transparent 0.9px);
  background-size: 26px 26px, 17px 19px;
}
.tg-card--act-Сверхновая .tg-card__fx::before {
  content: "";
  position: absolute;
  inset: 0;
  /* 4-axis JWST/Hubble diffraction spikes centered on supernova burst at 76% 42% */
  background:
    linear-gradient(90deg, transparent 36%, rgba(255, 255, 255, 0.85) 76%, transparent 98%),
    linear-gradient(0deg, transparent 12%, rgba(165, 243, 252, 0.82) 42%, transparent 84%),
    linear-gradient(45deg, transparent 42%, rgba(244, 114, 182, 0.5) 56%, transparent 72%),
    linear-gradient(-45deg, transparent 34%, rgba(165, 243, 252, 0.48) 52%, transparent 68%);
  background-size: 100% 2px, 2px 100%, 100% 100%, 100% 100%;
  background-position: 0 42%, 76% 0, 0 0, 0 0;
  background-repeat: no-repeat;
  animation: tg-supernova-pulse 3.8s ease-in-out infinite;
}
.tg-card--act-Сверхновая .tg-card__fx::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  right: 22px;
  top: 50%;
  margin-top: -82px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 0 32px rgba(232, 121, 249, 0.6), inset 0 0 24px rgba(103, 232, 249, 0.35);
}

/* 6. Чёрная дыра — Event Horizon & Relativistic Accretion Disk */
.tg-card--act-Чёрная-дыра {
  --card-bg:
    radial-gradient(circle 80px at 67% 41%, #000000 0%, #020105 34%, rgba(124, 58, 237, 0.48) 50%, rgba(236, 72, 153, 0.32) 66%, transparent 88%),
    linear-gradient(135deg, #020106 0%, #090517 48%, #1e0b36 82%, #2e1065 100%);
  --card-rim: linear-gradient(135deg, #c084fc 0%, #f97316 34%, #ec4899 68%, #38bdf8 100%);
  --card-glow: rgba(139, 92, 246, 0.6);
  --pattern-opacity: 0.11;
  --chip-bg: linear-gradient(135deg, #1e1b4b 0%, #7c3aed 48%, #f472b6 100%);
  --chip-ink: rgba(248, 250, 252, 0.86);
}
.tg-card--act-Чёрная-дыра .tg-card__texture {
  opacity: 0.35;
  background-image:
    conic-gradient(from 0deg at 67% 41%, rgba(249, 115, 22, 0.25), rgba(236, 72, 153, 0.22), rgba(56, 189, 248, 0.24), rgba(124, 58, 237, 0.25), rgba(249, 115, 22, 0.25));
  animation: tg-bh-spin 16s linear infinite;
}
.tg-card--act-Чёрная-дыра .tg-card__fx::before {
  /* Warped accretion disk ellipse positioned clear of both metric text and right chip */
  content: "";
  position: absolute;
  width: 132px;
  height: 32px;
  left: 67%;
  top: 41%;
  margin-left: -66px;
  margin-top: -16px;
  border-radius: 50%;
  border: 2.2px solid rgba(251, 146, 60, 0.75);
  box-shadow:
    0 0 20px rgba(249, 115, 22, 0.65),
    0 0 34px rgba(168, 85, 247, 0.52),
    inset 0 0 10px rgba(56, 189, 248, 0.48);
  transform: rotate(-16deg);
}
.tg-card--act-Чёрная-дыра .tg-card__fx::after {
  /* Pitch-black gravitational event horizon void + photon ring */
  content: "";
  position: absolute;
  width: 52px;
  height: 52px;
  left: 67%;
  top: 41%;
  margin-left: -26px;
  margin-top: -26px;
  border-radius: 50%;
  background: radial-gradient(circle, #000000 66%, #090314 86%, rgba(244, 114, 182, 0.75) 100%);
  box-shadow:
    0 0 0 1.5px rgba(253, 186, 116, 0.7),
    0 0 22px 4px rgba(139, 92, 246, 0.75),
    0 0 38px 7px rgba(236, 72, 153, 0.35);
}

/* =========================================================
   Animations
   ========================================================= */
@keyframes tg-star-twinkle {
  0%, 100% { transform: translate(-50%, -50%) scale(0.82) rotate(0deg); opacity: 0.72; }
  50% { transform: translate(-50%, -50%) scale(1.18) rotate(12deg); opacity: 1; }
}

@keyframes tg-card-sweep {
  0%, 35% { transform: translateX(-110%); }
  72%, 100% { transform: translateX(130%); }
}

@keyframes tg-aurora-drift {
  0% { transform: translate(-4%, 2%) scale(1); opacity: 0.85; }
  100% { transform: translate(4%, -3%) scale(1.06); opacity: 1; }
}

@keyframes tg-solar-pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}

@keyframes tg-supernova-pulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}

@keyframes tg-bh-spin {
  from { transform: rotate(0deg) scale(1.65); }
  to { transform: rotate(360deg) scale(1.65); }
}

/* =========================================================
   Showcase Tab Grid (12 Unique Collectible Cards)
   ========================================================= */
.showcase-header-card {
  margin-bottom: 2px;
}

.showcase-hint {
  margin-bottom: 12px;
}

.showcase-filter-group {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.showcase-filter-btn {
  border: none;
  background: transparent;
  color: var(--hint);
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.showcase-filter-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

.cards-showcase-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.showcase-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #e2e8f0;
  padding: 4px 2px 0;
}

.showcase-section-sub {
  font-size: 11px;
  font-weight: 600;
  color: var(--hint);
}

.showcase-item {
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 22px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.showcase-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.showcase-item-meta {
  min-width: 0;
}

.showcase-item-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}

.showcase-item-desc {
  font-size: 11.5px;
  color: var(--hint);
  margin-top: 2px;
}

.btn-try-card {
  flex-shrink: 0;
  border: 1px solid rgba(56, 189, 248, 0.36);
  background: rgba(56, 189, 248, 0.14);
  color: #e0f2fe;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s ease, transform 0.15s ease;
}

.btn-try-card:hover {
  background: rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

/* =========================================================
   Quality Badges — Telegram Collectible Pill System
   ========================================================= */
.tier-badge {
  --qb-bg: linear-gradient(180deg, rgba(148, 163, 184, 0.16), rgba(100, 116, 139, 0.1));
  --qb-border: linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(148, 163, 184, 0.14));
  --qb-color: var(--text, #f8fafc);
  --qb-inset: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.22);
  --qb-shadow: 0 2px 6px rgba(2, 6, 23, 0.25);
  --qb-text-shadow: none;
  --qb-shimmer-opacity: 0;
  --qb-shimmer-duration: 4.8s;

  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 7px;
  border-radius: 999px;
  border: 1px solid transparent;
  background-image: var(--qb-bg), var(--qb-border);
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  box-shadow: var(--qb-inset), var(--qb-shadow);
  color: var(--qb-color);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap;
  user-select: none;
  overflow: hidden;
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
}

.tier-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 75% at 18% 0%, rgba(255, 255, 255, 0.16), transparent 60%);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.tier-badge::after {
  content: "";
  position: absolute;
  top: -25%;
  bottom: -25%;
  left: 0;
  width: 46%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, var(--qb-shimmer-opacity)) 50%,
    transparent 100%
  );
  transform: translate3d(-160%, 0, 0) skewX(-22deg);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
}

.tier-badge__icon,
.tier-badge__label {
  position: relative;
  z-index: 1;
}

.tier-badge__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.tier-badge__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.tier-badge--sm {
  gap: 4px;
  padding: 2px 7px 2px 5px;
  font-size: 10.5px;
  font-weight: 600;
}

.tier-badge--sm .tier-badge__icon {
  width: 12px;
  height: 12px;
}

.tier-badge--sm,
.tier-badge--sm::after,
.tier-badge--sm .qb-svg--animated {
  animation: none !important;
}

.tier-badge--sm::after {
  display: none;
}

/* --- Плашки стоимости (value_tier: 6 металлов) --- */
.val-Обычный,
.val-База {
  --qb-bg: linear-gradient(135deg, #1e293b 0%, #334155 55%, #1e293b 100%);
  --qb-border: linear-gradient(135deg, rgba(203, 213, 225, 0.4), rgba(148, 163, 184, 0.16));
  --qb-color: #e2e8f0;
  --qb-inset: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --qb-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
}

.val-Бронза {
  --qb-bg: linear-gradient(135deg, #432110 0%, #85461e 50%, #592a11 100%);
  --qb-border: linear-gradient(135deg, rgba(254, 215, 170, 0.65), rgba(56, 189, 248, 0.35), rgba(234, 88, 12, 0.55));
  --qb-color: #ffedd5;
  --qb-inset: inset 0 1px 0 rgba(254, 215, 170, 0.34), inset 0 -1px 0 rgba(42, 18, 6, 0.65);
  --qb-shadow: 0 2px 10px rgba(180, 83, 9, 0.32);
  --qb-text-shadow: 0 1px 1px rgba(24, 10, 4, 0.5);
}
.val-Бронза::before { opacity: 0.55; }

.val-Серебро {
  --qb-bg: linear-gradient(135deg, #273244 0%, #4b5a70 46%, #313d4f 100%);
  --qb-border: linear-gradient(135deg, rgba(248, 250, 252, 0.72), rgba(148, 163, 184, 0.3), rgba(226, 232, 240, 0.58));
  --qb-color: #f8fafc;
  --qb-inset: inset 0 1px 0 rgba(255, 255, 255, 0.42), inset 0 -1px 0 rgba(15, 23, 42, 0.55);
  --qb-shadow: 0 2px 10px rgba(148, 163, 184, 0.24);
  --qb-text-shadow: 0 1px 1px rgba(15, 23, 42, 0.55);
}
.val-Серебро::before { opacity: 0.75; }

.val-Золото {
  --qb-bg: linear-gradient(135deg, #fef08a 0%, #fbbf24 46%, #d97706 100%);
  --qb-border: linear-gradient(135deg, #fffbeb 0%, #f59e0b 52%, #fef08a 100%);
  --qb-color: #271302;
  --qb-inset: inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 -1px 0 rgba(120, 53, 15, 0.32);
  --qb-shadow: 0 2px 14px rgba(245, 158, 11, 0.38);
  --qb-shimmer-opacity: 0.48;
  --qb-shimmer-duration: 5.2s;
}
.val-Золото::before { opacity: 0.9; }
.val-Золото::after { opacity: 1; animation: qb-shimmer var(--qb-shimmer-duration) ease-in-out infinite; }

.val-Платина {
  --qb-bg: linear-gradient(135deg, #ffffff 0%, #e2e8f0 42%, #cbd5e1 75%, #f1f5f9 100%);
  --qb-border: linear-gradient(135deg, #ffffff 0%, #bae6fd 50%, #e0e7ff 100%);
  --qb-color: #0f172a;
  --qb-inset: inset 0 1px 1px #ffffff, inset 0 -1px 1px rgba(30, 41, 59, 0.2);
  --qb-shadow: 0 2px 14px rgba(226, 232, 240, 0.28), 0 0 1px rgba(255, 255, 255, 0.65);
  --qb-shimmer-opacity: 0.65;
  --qb-shimmer-duration: 4.5s;
}
.val-Платина::before { opacity: 1; }
.val-Платина::after { opacity: 1; animation: qb-shimmer var(--qb-shimmer-duration) ease-in-out infinite; }

.val-Алмаз,
.val-Бриллиант {
  --qb-bg: linear-gradient(135deg, #082f49 0%, #0284c7 34%, #2563eb 68%, #6d28d9 100%);
  --qb-border: linear-gradient(135deg, #e0f2fe 0%, #38bdf8 34%, #c4b5fd 70%, #f0abfc 100%);
  --qb-color: #ffffff;
  --qb-inset: inset 0 1px 0 rgba(255, 255, 255, 0.62), inset 0 -1px 0 rgba(56, 189, 248, 0.45);
  --qb-shadow: 0 0 14px rgba(56, 189, 248, 0.42), 0 2px 18px rgba(124, 58, 237, 0.26);
  --qb-text-shadow: 0 1px 3px rgba(8, 47, 73, 0.7);
  --qb-shimmer-opacity: 0.42;
  --qb-shimmer-duration: 3.6s;
  animation: qb-diamond-aura 4s ease-in-out infinite;
}
.val-Алмаз::before,
.val-Бриллиант::before {
  opacity: 1;
  background:
    radial-gradient(90% 80% at 15% 15%, rgba(165, 243, 252, 0.34), transparent 55%),
    radial-gradient(85% 80% at 90% 85%, rgba(217, 70, 239, 0.24), transparent 60%);
}
.val-Алмаз::after,
.val-Бриллиант::after { opacity: 1; animation: qb-shimmer var(--qb-shimmer-duration) ease-in-out infinite; }

/* --- Плашки активности (activity_tier: 6 космических явлений + legacy aliases) --- */
.act-Лунный-свет,
.act-Искра {
  --qb-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #334155 100%);
  --qb-border: linear-gradient(135deg, rgba(226, 232, 240, 0.55), rgba(147, 197, 253, 0.25));
  --qb-color: #e2e8f0;
  --qb-inset: inset 0 1px 0 rgba(248, 250, 252, 0.24);
  --qb-shadow: 0 2px 10px rgba(147, 197, 253, 0.16);
}

.act-Полярное-сияние {
  --qb-bg: linear-gradient(135deg, #064e3b 0%, #0d9488 48%, #6d28d9 100%);
  --qb-border: linear-gradient(135deg, #5eead4 0%, #34d399 48%, #c084fc 100%);
  --qb-color: #ecfdf5;
  --qb-inset: inset 0 1px 0 rgba(167, 243, 208, 0.42), inset 0 -1px 0 rgba(6, 78, 59, 0.55);
  --qb-shadow: 0 2px 12px rgba(20, 184, 166, 0.35);
  --qb-text-shadow: 0 1px 2px rgba(4, 47, 46, 0.65);
  --qb-shimmer-opacity: 0.3;
  --qb-shimmer-duration: 5s;
}
.act-Полярное-сияние::after { opacity: 1; animation: qb-shimmer var(--qb-shimmer-duration) ease-in-out infinite; }

.act-Солнечная,
.act-Солнечный {
  --qb-bg: linear-gradient(135deg, #9a3412 0%, #ea580c 52%, #f59e0b 100%);
  --qb-border: linear-gradient(135deg, rgba(254, 240, 138, 0.78), rgba(251, 146, 60, 0.36), rgba(250, 204, 21, 0.68));
  --qb-color: #fffbeb;
  --qb-inset: inset 0 1px 0 rgba(254, 249, 195, 0.45), inset 0 -1px 0 rgba(124, 45, 18, 0.52);
  --qb-shadow: 0 2px 12px rgba(249, 115, 22, 0.38);
  --qb-text-shadow: 0 1px 2px rgba(124, 45, 18, 0.55);
}
.act-Солнечная::before,
.act-Солнечный::before { opacity: 0.75; }

.act-Квантовый {
  --qb-bg: linear-gradient(135deg, #083344 0%, #0e7490 46%, #1d4ed8 100%);
  --qb-border: linear-gradient(135deg, #a5f3fc 0%, #06b6d4 50%, #60a5fa 100%);
  --qb-color: #ecfeff;
  --qb-inset: inset 0 1px 0 rgba(165, 243, 252, 0.48), inset 0 -1px 0 rgba(8, 47, 73, 0.55);
  --qb-shadow: 0 2px 14px rgba(6, 182, 212, 0.36);
  --qb-text-shadow: 0 1px 2px rgba(8, 51, 68, 0.65);
  --qb-shimmer-opacity: 0.32;
  --qb-shimmer-duration: 4.8s;
}
.act-Квантовый::before { opacity: 0.85; }
.act-Квантовый::after { opacity: 1; animation: qb-shimmer var(--qb-shimmer-duration) ease-in-out infinite; }

.act-Сверхновая,
.act-Космический {
  --qb-bg: linear-gradient(135deg, #1e1b4b 0%, #6d28d9 40%, #db2777 78%, #0284c7 100%);
  --qb-border: linear-gradient(135deg, #ffffff 0%, #67e8f9 35%, #f472b6 70%, #c084fc 100%);
  --qb-color: #fdf4ff;
  --qb-inset: inset 0 1px 0 rgba(255, 255, 255, 0.52), inset 0 -1px 0 rgba(49, 46, 129, 0.65);
  --qb-shadow: 0 0 14px rgba(219, 39, 119, 0.44), 0 2px 18px rgba(103, 232, 249, 0.28);
  --qb-text-shadow: 0 1px 2px rgba(30, 27, 75, 0.7);
  --qb-shimmer-opacity: 0.38;
  --qb-shimmer-duration: 3.8s;
  animation: qb-cosmic-aura 4.2s ease-in-out infinite;
}
.act-Сверхновая::before,
.act-Космический::before {
  opacity: 1;
  background:
    radial-gradient(85% 75% at 15% 15%, rgba(103, 232, 249, 0.32), transparent 55%),
    radial-gradient(80% 75% at 88% 82%, rgba(244, 114, 182, 0.32), transparent 60%);
}
.act-Сверхновая::after,
.act-Космический::after { opacity: 1; animation: qb-shimmer var(--qb-shimmer-duration) ease-in-out infinite; }

.act-Чёрная-дыра {
  --qb-bg: radial-gradient(circle at 18% 50%, #020205 0%, #090614 44%, #1e103b 80%, #3b0764 100%);
  --qb-border: linear-gradient(135deg, #c084fc 0%, #f97316 36%, #ec4899 72%, #38bdf8 100%);
  --qb-color: #f5f3ff;
  --qb-inset: inset 0 1px 0 rgba(216, 180, 254, 0.52), inset 0 0 12px rgba(124, 58, 237, 0.42);
  --qb-shadow: 0 0 15px rgba(139, 92, 246, 0.52), 0 0 26px rgba(249, 115, 22, 0.24);
  --qb-text-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
  --qb-shimmer-opacity: 0.28;
  --qb-shimmer-duration: 4.2s;
  animation: qb-singularity-aura 3.6s ease-in-out infinite;
}
.act-Чёрная-дыра::before {
  opacity: 1;
  background: radial-gradient(75% 85% at 88% 50%, rgba(56, 189, 248, 0.16), transparent 62%);
}
.act-Чёрная-дыра::after { opacity: 1; animation: qb-shimmer var(--qb-shimmer-duration) ease-in-out infinite; }

.tier-badge__label {
  text-shadow: var(--qb-text-shadow);
}

.qb-svg--pulse {
  transform-origin: center;
  animation: qb-icon-breathe 3.2s ease-in-out infinite;
}

@keyframes qb-shimmer {
  0%, 42% { transform: translate3d(-160%, 0, 0) skewX(-22deg); }
  72%, 100% { transform: translate3d(320%, 0, 0) skewX(-22deg); }
}

@keyframes qb-diamond-aura {
  0%, 100% {
    box-shadow: var(--qb-inset), 0 0 12px rgba(56, 189, 248, 0.36), 0 2px 16px rgba(124, 58, 237, 0.22);
  }
  50% {
    box-shadow: var(--qb-inset), 0 0 18px rgba(56, 189, 248, 0.58), 0 2px 24px rgba(167, 139, 250, 0.38);
  }
}

@keyframes qb-cosmic-aura {
  0%, 100% {
    box-shadow: var(--qb-inset), 0 0 12px rgba(147, 51, 234, 0.34), 0 2px 16px rgba(219, 39, 119, 0.18);
  }
  50% {
    box-shadow: var(--qb-inset), 0 0 18px rgba(232, 121, 249, 0.58), 0 2px 22px rgba(103, 232, 249, 0.36);
  }
}

@keyframes qb-singularity-aura {
  0%, 100% {
    box-shadow: var(--qb-inset), 0 0 14px rgba(139, 92, 246, 0.45), 0 0 24px rgba(249, 115, 22, 0.2);
  }
  50% {
    box-shadow: var(--qb-inset), 0 0 20px rgba(192, 132, 252, 0.68), 0 0 30px rgba(56, 189, 248, 0.34);
  }
}

@keyframes qb-icon-breathe {
  0%, 100% { transform: scale(1); opacity: 0.92; }
  50% { transform: scale(1.08); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .tier-badge,
  .tier-badge::after,
  .qb-svg--pulse,
  .tg-collectible-card *,
  .tg-collectible-card *::before,
  .tg-collectible-card *::after {
    animation: none !important;
  }
  .tier-badge::after {
    display: none;
  }
}

/* =========================================================
   App Navigation, Cards, Lists & Controls (Telegram Mini App Polish)
   ========================================================= */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tabs--3 {
  grid-template-columns: repeat(3, 1fr);
}

.btn-story-pill {
  border: 1px solid rgba(192, 132, 252, 0.42);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(168, 85, 247, 0.22));
  color: #f5d0fe;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.15s ease, filter 0.18s ease;
}

.btn-story-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.tab {
  padding: 10px 6px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--hint);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.tab:active { transform: scale(0.97); }

.tab.active {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.38);
}

.panel { display: none; flex-direction: column; gap: 12px; }
.panel.active { display: flex; }

.card {
  position: relative;
  border: 1px solid transparent;
  background-image:
    linear-gradient(165deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.88)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(56, 189, 248, 0.14), rgba(148, 163, 184, 0.08));
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  backdrop-filter: blur(16px);
  border-radius: 20px;
  padding: 15px;
  box-shadow:
    0 12px 28px rgba(2, 6, 23, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.card-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-header h3 { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }

.pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.muted { font-size: 12.5px; color: var(--hint); margin-bottom: 10px; }

.wallet-manual { display: flex; gap: 8px; margin-top: 8px; }

input[type="text"] {
  flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(11, 17, 32, 0.65);
  color: var(--text); font-size: 13px; font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.btn-primary, .btn-secondary {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-primary:active, .btn-secondary:active { transform: scale(0.98); }

.btn-primary {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(135deg, #38bdf8 0%, #3b82f6 52%, #7c3aed 100%);
  color: #ffffff;
  box-shadow:
    0 8px 20px rgba(56, 189, 248, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.btn-primary::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -40%;
  width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.36), transparent);
  transform: skewX(-22deg);
  animation: qb-shimmer 4.8s ease-in-out infinite;
  pointer-events: none;
}

.btn-secondary {
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: linear-gradient(160deg, rgba(51, 65, 85, 0.55), rgba(30, 41, 59, 0.72));
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-secondary:hover {
  border-color: rgba(56, 189, 248, 0.42);
}

.donate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-color: rgba(251, 191, 36, 0.34);
  background: linear-gradient(145deg, rgba(120, 53, 15, 0.28), rgba(30, 41, 59, 0.85));
  color: #fef3c7;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12), inset 0 1px 0 rgba(254, 240, 138, 0.22);
}

.donate-btn:hover {
  border-color: rgba(253, 224, 71, 0.65);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.28), inset 0 1px 0 rgba(254, 240, 138, 0.36);
}

.donate-star {
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.78);
  animation: qb-icon-breathe 2.6s ease-in-out infinite;
}

.item-list, .leaderboard-list { display: flex; flex-direction: column; gap: 8px; }

.list-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 11px 13px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.55), rgba(15, 23, 42, 0.38));
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  gap: 10px;
}

.list-row-title { font-size: 14px; font-weight: 700; }
.list-row-sub { font-size: 12px; color: var(--hint); }
.list-row-val { font-size: 13.5px; font-weight: 700; color: var(--accent); white-space: nowrap; text-align: right; }

.lb-controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.seg-group {
  display: flex;
  gap: 4px;
  background: rgba(11, 17, 32, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
  padding: 4px;
  border-radius: 12px;
  width: fit-content;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.seg-group-sort { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
.seg-btn, .limit-btn {
  border: none; background: transparent; color: var(--hint);
  padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer;
  text-align: center; font-family: inherit;
  transition: background 0.18s ease, color 0.18s ease;
}
.seg-btn.active, .limit-btn.active {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.28);
}

.my-rank-banner {
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
}

.progress-wrap {
  width: 100%; height: 10px; border-radius: 999px;
  background: rgba(15, 23, 42, 0.6); overflow: hidden; margin-bottom: 10px;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #38bdf8, #8b5cf6);
  transition: width 0.3s ease;
}

.donate-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.empty-state { font-size: 13px; color: var(--hint); text-align: center; padding: 14px 0; }

/* =========================================================
   SERIES II — 6 NEW METALS & CRYSTALS (GRAM VALUE)
   ========================================================= */

/* II-1. Дамаск / Метеор — Damascus Folded Carbon Steel */
.tg-card--val-Дамаск,
.tg-card--act-Метеор {
  --card-bg:
    radial-gradient(100% 100% at 80% 25%, rgba(203, 213, 225, 0.34) 0%, transparent 65%),
    linear-gradient(135deg, #090d14 0%, #1a222f 42%, #334155 78%, #64748b 100%);
  --card-rim: linear-gradient(135deg, #e2e8f0 0%, #64748b 45%, #38bdf8 76%, #cbd5e1 100%);
  --card-glow: rgba(148, 163, 184, 0.38);
  --pattern-opacity: 0.09;
  --chip-bg: linear-gradient(135deg, #f1f5f9 0%, #94a3b8 54%, #334155 100%);
}
.tg-card--val-Дамаск .tg-card__texture,
.tg-card--act-Метеор .tg-card__texture {
  opacity: 0.56;
  background-image:
    repeating-radial-gradient(
      circle at 72% 48%,
      rgba(255, 255, 255, 0.14) 0px,
      rgba(255, 255, 255, 0.14) 2px,
      rgba(15, 23, 42, 0.34) 2px,
      rgba(15, 23, 42, 0.34) 6px,
      rgba(148, 163, 184, 0.1) 6px,
      rgba(148, 163, 184, 0.1) 9px
    ),
    repeating-radial-gradient(
      circle at 22% 85%,
      rgba(226, 232, 240, 0.08) 0px,
      transparent 4px,
      rgba(2, 6, 23, 0.2) 8px
    );
}
.tg-card--val-Дамаск .tg-card__fx,
.tg-card--act-Метеор .tg-card__fx {
  background: linear-gradient(118deg, transparent 22%, rgba(226, 232, 240, 0.24) 48%, rgba(56, 189, 248, 0.1) 54%, transparent 74%);
}

/* II-2. Розовое золото / Гелиосфера — 18K Rose & Heliosphere Flare */
.tg-card--val-Розовое-золото,
.tg-card--act-Гелиосфера {
  --card-bg:
    radial-gradient(95% 95% at 72% 38%, rgba(254, 205, 211, 0.52) 0%, rgba(244, 114, 182, 0.22) 45%, transparent 76%),
    linear-gradient(134deg, #1d080f 0%, #58182a 32%, #9d3a51 66%, #e69aa9 100%);
  --card-rim: linear-gradient(135deg, #fff1f2 0%, #fda4af 40%, #fbbf24 72%, #ffe4e6 100%);
  --card-glow: rgba(244, 114, 182, 0.42);
  --pattern-opacity: 0.11;
  --chip-bg: linear-gradient(135deg, #ffe4e6 0%, #f472b6 48%, #9f1239 100%);
  --chip-ink: rgba(76, 5, 25, 0.72);
}
.tg-card--val-Розовое-золото .tg-card__texture,
.tg-card--act-Гелиосфера .tg-card__texture {
  opacity: 0.44;
  background-image:
    repeating-linear-gradient(
      -8deg,
      rgba(255, 228, 230, 0.09) 0px,
      rgba(255, 228, 230, 0.09) 1px,
      transparent 1px,
      transparent 3px
    );
}
.tg-card--val-Розовое-золото .tg-card__fx,
.tg-card--act-Гелиосфера .tg-card__fx {
  background:
    conic-gradient(from 205deg at 64% 48%, rgba(255, 228, 230, 0.42), transparent 60deg, rgba(251, 191, 36, 0.22) 140deg, transparent 220deg, rgba(255, 228, 230, 0.42)),
    radial-gradient(60% 85% at 18% 50%, rgba(29, 8, 15, 0.54), transparent 72%);
}
.tg-card--val-Розовое-золото .tg-card__fx::after,
.tg-card--act-Гелиосфера .tg-card__fx::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(110deg, transparent 36%, rgba(255, 241, 242, 0.34) 50%, transparent 64%);
  animation: tg-card-sweep 5.2s ease-in-out infinite;
}

/* II-3. Рубин / Красный гигант — Barbed Crimson Ruby / Red Supergiant */
.tg-card--val-Рубин,
.tg-card--act-Красный-гигант {
  --card-bg:
    radial-gradient(90% 95% at 72% 45%, rgba(244, 63, 94, 0.56) 0%, rgba(190, 18, 60, 0.34) 45%, transparent 78%),
    linear-gradient(135deg, #100105 0%, #3d0413 38%, #880929 74%, #e11d48 100%);
  --card-rim: linear-gradient(135deg, #fecdd3 0%, #f43f5e 42%, #94a3b8 72%, #fda4af 100%);
  --card-glow: rgba(225, 29, 72, 0.54);
  --pattern-opacity: 0.13;
  --chip-bg: linear-gradient(135deg, #ffe4e6 0%, #fb7185 48%, #4c0519 100%);
  --chip-ink: rgba(255, 255, 255, 0.85);
}
.tg-card--val-Рубин .tg-card__texture,
.tg-card--act-Красный-гигант .tg-card__texture {
  opacity: 0.55;
  background-image:
    linear-gradient(125deg, rgba(255, 255, 255, 0.16) 0%, transparent 32%, rgba(253, 164, 175, 0.22) 52%, transparent 66%),
    linear-gradient(35deg, transparent 28%, rgba(15, 23, 42, 0.55) 48%, rgba(225, 29, 72, 0.26) 64%, transparent 80%);
}
.tg-card--val-Рубин .tg-card__fx::before,
.tg-card--act-Красный-гигант .tg-card__fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(155deg, transparent 42%, rgba(255, 255, 255, 0.18) 42.6%, rgba(253, 164, 175, 0.08) 54%, transparent 64%),
    linear-gradient(25deg, transparent 54%, rgba(255, 255, 255, 0.16) 54.6%, transparent 66%);
}

/* II-4. Изумруд / Комета — Emerald Coma & Gold Filigree */
.tg-card--val-Изумруд,
.tg-card--act-Комета {
  --card-bg:
    radial-gradient(90% 95% at 72% 46%, rgba(52, 211, 153, 0.52) 0%, rgba(5, 150, 105, 0.26) 46%, transparent 78%),
    linear-gradient(135deg, #02140d 0%, #063927 38%, #047857 74%, #34d399 100%);
  --card-rim: linear-gradient(135deg, #fde047 0%, #6ee7b7 38%, #10b981 68%, #fef08a 100%);
  --card-glow: rgba(16, 185, 129, 0.48);
  --pattern-opacity: 0.12;
  --chip-bg: linear-gradient(135deg, #fef08a 0%, #34d399 54%, #065f46 100%);
  --chip-ink: rgba(6, 78, 59, 0.78);
}
.tg-card--val-Изумруд .tg-card__texture,
.tg-card--act-Комета .tg-card__texture {
  opacity: 0.42;
  background-image:
    linear-gradient(135deg, rgba(167, 243, 208, 0.16) 0%, transparent 30%, rgba(253, 224, 71, 0.12) 55%, transparent 72%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 1px, transparent 1px, transparent 14px);
}
.tg-card--val-Изумруд .tg-card__fx,
.tg-card--act-Комета .tg-card__fx {
  background: conic-gradient(from 140deg at 64% 48%, rgba(167, 243, 208, 0.34), transparent 55deg, rgba(250, 204, 21, 0.18) 125deg, transparent 210deg, rgba(52, 211, 153, 0.28) 300deg, rgba(167, 243, 208, 0.34));
}

/* II-5. Обсидиан / Экзопланета — Volcanic Glass & Obsidian Exoplanet */
.tg-card--val-Обсидиан,
.tg-card--act-Экзопланета {
  --card-bg:
    linear-gradient(124deg, #020306 0%, #090d16 42%, #1e293b 62%, #05070c 78%, #020306 100%);
  --card-rim: linear-gradient(135deg, #f8fafc 0%, #475569 32%, #a855f7 68%, #38bdf8 100%);
  --card-glow: rgba(148, 163, 184, 0.36);
  --pattern-opacity: 0.09;
  --chip-bg: linear-gradient(135deg, #ffffff 0%, #94a3b8 48%, #0f172a 100%);
  --chip-ink: rgba(15, 23, 42, 0.8);
}
.tg-card--val-Обсидиан .tg-card__texture,
.tg-card--act-Экзопланета .tg-card__texture {
  opacity: 0.65;
  background-image:
    linear-gradient(118deg, transparent 32%, rgba(255, 255, 255, 0.28) 48%, rgba(56, 189, 248, 0.18) 52%, rgba(168, 85, 247, 0.2) 56%, transparent 66%),
    radial-gradient(circle at 75% 42%, rgba(226, 232, 240, 0.24), transparent 52%);
}
.tg-card--val-Обсидиан .tg-card__fx::after,
.tg-card--act-Экзопланета .tg-card__fx::after {
  content: "";
  position: absolute;
  inset: -25%;
  background: linear-gradient(115deg, transparent 40%, rgba(255, 255, 255, 0.36) 50%, rgba(192, 132, 252, 0.22) 54%, transparent 64%);
  animation: tg-card-sweep 4.6s ease-in-out infinite;
}

/* II-6. Калифорний / Гамма-всплеск — Prismatic Bismuth / Gamma Burst */
.tg-card--val-Калифорний,
.tg-card--act-Гамма-всплеск {
  --card-bg:
    conic-gradient(
      from 165deg at 62% 48%,
      #06b6d4 0deg,
      #34d399 54deg,
      #facc15 108deg,
      #f43f5e 162deg,
      #a855f7 224deg,
      #3b82f6 290deg,
      #06b6d4 360deg
    );
  --card-rim: linear-gradient(135deg, #ffffff 0%, #2dd4bf 26%, #facc15 52%, #f43f5e 76%, #c084fc 100%);
  --card-glow: rgba(168, 85, 247, 0.56);
  --pattern-opacity: 0.13;
  --chip-bg: linear-gradient(135deg, #ffffff 0%, #67e8f9 35%, #f472b6 70%, #facc15 100%);
}
.tg-card--val-Калифорний .tg-card__texture,
.tg-card--act-Гамма-всплеск .tg-card__texture {
  opacity: 0.45;
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.22) 0px,
      rgba(15, 23, 42, 0.22) 2px,
      transparent 2px,
      transparent 16px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.14) 0px,
      rgba(255, 255, 255, 0.14) 2px,
      transparent 2px,
      transparent 16px
    );
}
.tg-card--val-Калифорний .tg-card__fx,
.tg-card--act-Гамма-всплеск .tg-card__fx {
  background: radial-gradient(70% 90% at 18% 50%, rgba(15, 23, 42, 0.62), transparent 76%);
}

/* =========================================================
   SERIES II — 6 NEW COSMIC & EXTREME PHYSICS CARDS (ACTIVITY)
   ========================================================= */

/* II-1. Затмение — Total Solar Eclipse & Diamond Ring */
.tg-card--act-Затмение {
  --card-bg:
    radial-gradient(circle 92px at 66% 42%, #000000 0%, #010104 38%, rgba(254, 240, 138, 0.58) 48%, rgba(234, 88, 12, 0.28) 64%, transparent 88%),
    linear-gradient(136deg, #03040a 0%, #0b1022 52%, #1e1b2e 100%);
  --card-rim: linear-gradient(135deg, #fef9c3 0%, #f59e0b 45%, #475569 78%, #fef08a 100%);
  --card-glow: rgba(250, 204, 21, 0.44);
  --pattern-opacity: 0.1;
  --chip-bg: linear-gradient(135deg, #fef9c3 0%, #f59e0b 45%, #1e293b 100%);
  --chip-ink: rgba(15, 23, 42, 0.78);
}
.tg-card--act-Затмение .tg-card__fx::before {
  content: "";
  position: absolute;
  width: 68px;
  height: 68px;
  left: 66%;
  top: 42%;
  margin-left: -34px;
  margin-top: -34px;
  border-radius: 50%;
  background: #010103;
  box-shadow:
    0 0 0 2px rgba(254, 249, 195, 0.88),
    0 0 26px 6px rgba(251, 146, 60, 0.62),
    0 0 54px 12px rgba(254, 240, 138, 0.26);
}
.tg-card--act-Затмение .tg-card__fx::after {
  /* Diamond Ring Baily's bead flare */
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  left: calc(66% + 22px);
  top: calc(42% - 24px);
  margin-left: -7px;
  margin-top: -7px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #fef08a 45%, transparent 80%);
  box-shadow: 0 0 22px 8px rgba(255, 255, 255, 0.9);
}

/* II-2. Туманность — Pillars of Creation & Ionized Nebula */
.tg-card--act-Туманность {
  --card-bg:
    radial-gradient(90% 80% at 75% 32%, rgba(45, 212, 191, 0.38) 0%, transparent 58%),
    radial-gradient(85% 85% at 52% 68%, rgba(244, 63, 94, 0.42) 0%, transparent 62%),
    radial-gradient(75% 75% at 88% 72%, rgba(251, 146, 60, 0.36) 0%, transparent 56%),
    linear-gradient(138deg, #090214 0%, #2e1065 48%, #701a75 100%);
  --card-rim: linear-gradient(135deg, #2dd4bf 0%, #f472b6 48%, #fb923c 82%, #c084fc 100%);
  --card-glow: rgba(236, 72, 153, 0.46);
  --pattern-opacity: 0.12;
  --chip-bg: linear-gradient(135deg, #a7f3d0 0%, #f472b6 50%, #fb923c 100%);
}
.tg-card--act-Туманность .tg-card__texture {
  opacity: 0.58;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.55) 0.8px, transparent 1px),
    radial-gradient(rgba(94, 234, 212, 0.45) 0.7px, transparent 0.9px);
  background-size: 28px 24px, 19px 21px;
}
.tg-card--act-Туманность .tg-card__fx {
  background:
    radial-gradient(60% 90% at 62% 45%, rgba(244, 114, 182, 0.28), transparent 65%),
    radial-gradient(50% 70% at 82% 28%, rgba(45, 212, 191, 0.34), transparent 62%);
  filter: blur(10px);
}

/* II-3. Пульсар — Relativistic Neutron Star & Synchrotron Lighthouse */
.tg-card--act-Пульсар {
  --card-bg:
    radial-gradient(circle 85px at 66% 44%, #ffffff 0%, #67e8f9 18%, #0284c7 46%, transparent 78%),
    linear-gradient(136deg, #020817 0%, #082f49 48%, #1e1b4b 100%);
  --card-rim: linear-gradient(135deg, #ffffff 0%, #38bdf8 40%, #818cf8 74%, #a5f3fc 100%);
  --card-glow: rgba(56, 189, 248, 0.55);
  --pattern-opacity: 0.12;
  --chip-bg: linear-gradient(135deg, #ffffff 0%, #38bdf8 52%, #1d4ed8 100%);
}
.tg-card--act-Пульсар .tg-card__fx::before {
  /* Twin opposing synchrotron jets */
  content: "";
  position: absolute;
  width: 240px;
  height: 16px;
  left: 66%;
  top: 44%;
  margin-left: -120px;
  margin-top: -8px;
  background: linear-gradient(90deg, transparent 0%, rgba(103, 232, 249, 0.55) 28%, rgba(255, 255, 255, 0.95) 50%, rgba(103, 232, 249, 0.55) 72%, transparent 100%);
  filter: blur(2.5px);
  transform: rotate(-28deg);
}
.tg-card--act-Пульсар .tg-card__fx::after {
  content: "";
  position: absolute;
  width: 96px;
  height: 54px;
  left: 66%;
  top: 44%;
  margin-left: -48px;
  margin-top: -27px;
  border-radius: 50%;
  border: 1.4px solid rgba(165, 243, 252, 0.55);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.45);
  transform: rotate(62deg);
}

/* II-4. Плазма — High-Voltage Tesla Magnetohydrodynamic Arc */
.tg-card--act-Плазма {
  --card-bg:
    radial-gradient(circle 95px at 68% 45%, rgba(232, 121, 249, 0.6) 0%, rgba(99, 102, 241, 0.36) 44%, transparent 78%),
    linear-gradient(135deg, #050214 0%, #1e1b4b 48%, #4c1d95 100%);
  --card-rim: linear-gradient(135deg, #e879f9 0%, #38bdf8 46%, #818cf8 78%, #f0abfc 100%);
  --card-glow: rgba(192, 132, 252, 0.52);
  --pattern-opacity: 0.13;
  --chip-bg: linear-gradient(135deg, #f5d0fe 0%, #a855f7 50%, #38bdf8 100%);
}
.tg-card--act-Плазма .tg-card__texture {
  opacity: 0.48;
  background-image:
    repeating-linear-gradient(62deg, rgba(103, 232, 249, 0.18) 0px, transparent 2px, transparent 18px),
    repeating-linear-gradient(-58deg, rgba(232, 121, 249, 0.18) 0px, transparent 2px, transparent 22px);
}
.tg-card--act-Плазма .tg-card__fx::before {
  content: "";
  position: absolute;
  width: 68px;
  height: 68px;
  left: 68%;
  top: 45%;
  margin-left: -34px;
  margin-top: -34px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #e879f9 35%, rgba(56, 189, 248, 0.45) 68%, transparent 100%);
  box-shadow: 0 0 36px rgba(232, 121, 249, 0.8), 0 0 60px rgba(56, 189, 248, 0.45);
  animation: tg-solar-pulse 2.8s ease-in-out infinite;
}

/* II-5. Кротовая нора — Einstein-Rosen Wormhole & Hyperspace Tunnel */
.tg-card--act-Кротовая-нора {
  --card-bg:
    radial-gradient(circle 115px at 67% 45%, #011419 0%, #0d9488 26%, #6366f1 52%, #050816 86%),
    linear-gradient(135deg, #030712 0%, #0f172a 100%);
  --card-rim: linear-gradient(135deg, #2dd4bf 0%, #38bdf8 40%, #a78bfa 76%, #fde047 100%);
  --card-glow: rgba(45, 212, 191, 0.5);
  --pattern-opacity: 0.11;
  --chip-bg: linear-gradient(135deg, #99f6e4 0%, #38bdf8 50%, #6366f1 100%);
}
.tg-card--act-Кротовая-нора .tg-card__texture {
  opacity: 0.54;
  background-image:
    repeating-radial-gradient(
      circle at 67% 45%,
      rgba(94, 234, 212, 0.24) 0px,
      rgba(94, 234, 212, 0.24) 1px,
      transparent 1px,
      transparent 11px
    );
}
.tg-card--act-Кротовая-нора .tg-card__fx::before {
  content: "";
  position: absolute;
  width: 58px;
  height: 58px;
  left: 67%;
  top: 45%;
  margin-left: -29px;
  margin-top: -29px;
  border-radius: 50%;
  background: radial-gradient(circle, #fef08a 0%, #2dd4bf 32%, #042f2e 78%, transparent 100%);
  box-shadow: 0 0 0 2px rgba(94, 234, 212, 0.65), 0 0 28px rgba(45, 212, 191, 0.72);
}

/* II-6. Квазар — Relativistic Blazar & Primordial Accretion Jet */
.tg-card--act-Квазар {
  --card-bg:
    radial-gradient(circle 96px at 67% 45%, #ffffff 0%, #fef08a 18%, #e879f9 44%, #581c87 72%, transparent 94%),
    linear-gradient(135deg, #05010d 0%, #2e1065 46%, #701a75 84%, #a16207 100%);
  --card-rim: linear-gradient(135deg, #fef08a 0%, #f472b6 36%, #38bdf8 72%, #ffffff 100%);
  --card-glow: rgba(250, 204, 21, 0.58);
  --pattern-opacity: 0.13;
  --chip-bg: linear-gradient(135deg, #fef9c3 0%, #f472b6 48%, #7c3aed 100%);
}
.tg-card--act-Квазар .tg-card__fx::before {
  /* Vertical relativistic blazar jet */
  content: "";
  position: absolute;
  width: 14px;
  height: 210px;
  left: 67%;
  top: 45%;
  margin-left: -7px;
  margin-top: -105px;
  background: linear-gradient(180deg, transparent 0%, rgba(165, 243, 252, 0.55) 25%, #ffffff 50%, rgba(250, 204, 21, 0.6) 75%, transparent 100%);
  filter: blur(2px);
  transform: rotate(18deg);
}
.tg-card--act-Квазар .tg-card__fx::after {
  /* Tilted golden accretion torus */
  content: "";
  position: absolute;
  width: 148px;
  height: 36px;
  left: 67%;
  top: 45%;
  margin-left: -74px;
  margin-top: -18px;
  border-radius: 50%;
  border: 2.4px solid rgba(254, 240, 138, 0.86);
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.72), 0 0 40px rgba(232, 121, 249, 0.58);
  transform: rotate(18deg);
}

/* --- Series II Badge Styles --- */
.val-Дамаск,
.act-Метеор {
  --qb-bg: linear-gradient(135deg, #0f172a 0%, #334155 55%, #1e293b 100%);
  --qb-border: linear-gradient(135deg, #e2e8f0, #38bdf8);
  --qb-color: #f8fafc;
}
.val-Розовое-золото,
.act-Гелиосфера {
  --qb-bg: linear-gradient(135deg, #58182a 0%, #be4d67 52%, #e69aa9 100%);
  --qb-border: linear-gradient(135deg, #ffe4e6, #fbbf24);
  --qb-color: #fff1f2;
}
.val-Рубин,
.act-Красный-гигант {
  --qb-bg: linear-gradient(135deg, #4c0519 0%, #be123c 55%, #e11d48 100%);
  --qb-border: linear-gradient(135deg, #fecdd3, #f43f5e);
  --qb-color: #fff1f2;
}
.val-Изумруд,
.act-Комета {
  --qb-bg: linear-gradient(135deg, #064e3b 0%, #059669 52%, #10b981 100%);
  --qb-border: linear-gradient(135deg, #fde047, #6ee7b7);
  --qb-color: #ecfdf5;
}
.val-Обсидиан,
.act-Экзопланета {
  --qb-bg: linear-gradient(135deg, #020306 0%, #1e293b 55%, #090d16 100%);
  --qb-border: linear-gradient(135deg, #f8fafc, #a855f7, #38bdf8);
  --qb-color: #f8fafc;
}
.val-Калифорний,
.act-Гамма-всплеск {
  --qb-bg: linear-gradient(135deg, #0e7490 0%, #7c3aed 50%, #e11d48 100%);
  --qb-border: linear-gradient(135deg, #2dd4bf, #facc15, #f43f5e);
  --qb-color: #ffffff;
}
.act-Затмение {
  --qb-bg: linear-gradient(135deg, #03040a 0%, #1e1b2e 65%, #78350f 100%);
  --qb-border: linear-gradient(135deg, #fef08a, #f59e0b);
  --qb-color: #fef9c3;
}
.act-Туманность {
  --qb-bg: linear-gradient(135deg, #2e1065 0%, #be185d 55%, #0d9488 100%);
  --qb-border: linear-gradient(135deg, #2dd4bf, #f472b6);
  --qb-color: #fdf4ff;
}
.act-Пульсар {
  --qb-bg: linear-gradient(135deg, #082f49 0%, #0284c7 55%, #3730a3 100%);
  --qb-border: linear-gradient(135deg, #a5f3fc, #818cf8);
  --qb-color: #ecfeff;
}
.act-Плазма {
  --qb-bg: linear-gradient(135deg, #1e1b4b 0%, #6d28d9 55%, #c026d3 100%);
  --qb-border: linear-gradient(135deg, #e879f9, #38bdf8);
  --qb-color: #fdf4ff;
}
.act-Кротовая-нора {
  --qb-bg: linear-gradient(135deg, #042f2e 0%, #0d9488 52%, #4338ca 100%);
  --qb-border: linear-gradient(135deg, #5eead4, #a78bfa);
  --qb-color: #f0fdfa;
}
.act-Квазар {
  --qb-bg: linear-gradient(135deg, #2e1065 0%, #9333ea 48%, #ca8a04 100%);
  --qb-border: linear-gradient(135deg, #fef08a, #f472b6, #38bdf8);
  --qb-color: #fffbeb;
}

/* =========================================================
   Standalone Card Preview Studio (/preview.html)
   ========================================================= */
.studio-body {
  background: radial-gradient(circle at 50% -15%, #1e1b4b 0%, #070b14 48%, #03050a 100%);
  min-height: 100vh;
}

.preview-studio {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.studio-brand h1 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.studio-brand p {
  font-size: 12.5px;
  color: var(--hint);
  margin-top: 2px;
}

.studio-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 8px 13px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: #bae6fd;
  font-size: 12.5px;
  font-weight: 700;
}

.studio-spotlight-panel {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 24px 54px rgba(2, 6, 23, 0.62);
}

.studio-spotlight-stage {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.card-auto-orbit [data-tilt-card] {
  animation: studio-card-orbit 6.4s ease-in-out infinite;
}

@keyframes studio-card-orbit {
  0%, 100% { transform: perspective(950px) rotateX(4deg) rotateY(-6deg); }
  25% { transform: perspective(950px) rotateX(-3deg) rotateY(5deg); }
  50% { transform: perspective(950px) rotateX(-5deg) rotateY(7deg); }
  75% { transform: perspective(950px) rotateX(3deg) rotateY(-4deg); }
}

.studio-inspector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.studio-inspector-title {
  font-size: 18px;
  font-weight: 800;
}

.studio-inspector-desc {
  font-size: 13px;
  color: var(--hint);
  line-height: 1.5;
}

.studio-inputs-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.studio-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
  margin-bottom: 4px;
}

.studio-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.studio-btn {
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.studio-btn.active {
  background: var(--accent);
  color: var(--accent-text);
  border-color: transparent;
}

.studio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.studio-filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.studio-gallery {
  display: grid;
  gap: 16px;
}

.studio-gallery--2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.studio-gallery--1col {
  grid-template-columns: minmax(0, 520px);
  justify-content: center;
}

.studio-gallery .showcase-section-title {
  grid-column: 1 / -1;
}

.showcase-item--selected {
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.showcase-filter-group--4 {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 820px) {
  .studio-spotlight-panel {
    grid-template-columns: 1fr;
  }
  .studio-gallery--2col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 440px) {
  .tg-collectible-card { padding: 14px 36px 13px 15px; min-height: 196px; }
  .tg-card__val-int { font-size: 21px; }
  .tg-card__val-dec, .tg-card__val-unit { font-size: 15px; }
  .tg-card__value--compact .tg-card__val-int { font-size: 17px; }
  .tg-card__value--compact .tg-card__val-dec,
  .tg-card__value--compact .tg-card__val-unit { font-size: 12.5px; }
  .tg-card__emblem { width: 38px; height: 38px; }
  .tg-card__chip { width: 42px; height: 34px; }
  .tg-card__tier-caption { font-size: 10px; white-space: nowrap; }
  .studio-inputs-row { grid-template-columns: 1fr; }
}

/* =========================================================
   Wallet Number Status Card (Hides TON Connect Raw Prefix)
   ========================================================= */
.wallet-status-box {
  margin-bottom: 0;
}

.wallet-status-box--connected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(14, 116, 144, 0.18), rgba(15, 23, 42, 0.76));
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin-bottom: 4px;
}

.wallet-number-meta {
  min-width: 0;
}

.wallet-number-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7dd3fc;
}

.wallet-number-value {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 2px;
  word-break: break-all;
}

.wallet-number-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.wallet-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  background: rgba(15, 23, 42, 0.7);
  color: #bae6fd;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.18s ease, color 0.18s ease;
}

.wallet-icon-btn:hover {
  background: rgba(56, 189, 248, 0.24);
  color: #ffffff;
  transform: translateY(-1px);
}

.wallet-icon-btn:active {
  transform: scale(0.94);
}

/* =========================================================
   TON Wallet QR Modal (On Chip Click — Screenshot #7 Style)
   ========================================================= */
.qr-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(10px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.qr-modal-card {
  width: 100%;
  max-width: 360px;
  border-radius: 24px;
  padding: 18px;
  border: 1px solid transparent;
  background-image:
    linear-gradient(165deg, rgba(22, 32, 51, 0.96), rgba(9, 14, 28, 0.98)),
    linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(56, 189, 248, 0.35), rgba(168, 85, 247, 0.28));
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.78), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.qr-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.qr-modal-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #38bdf8;
}

.qr-modal-head h3 {
  font-size: 16px;
  font-weight: 800;
  margin-top: 2px;
}

.qr-modal-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.wallet-qr-shell {
  position: relative;
  width: 100%;
  max-width: 356px;
  border-radius: 28px;
  padding: 20px 18px 22px;
  background: linear-gradient(155deg, #1ea7ff 0%, #0088ee 52%, #006ce0 100%);
  box-shadow:
    0 28px 64px rgba(0, 110, 224, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  overflow: hidden;
  animation: reward-pop-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.wallet-qr-close {
  position: relative;
  z-index: 4;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  display: grid;
  place-items: center;
  cursor: pointer;
  margin-bottom: 4px;
  transition: background 0.16s ease, transform 0.14s ease;
}

.wallet-qr-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.wallet-qr-close:active {
  transform: scale(0.92);
}

.wallet-qr-modal-body {
  width: 100%;
}

.wallet-qr-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  padding: 34px;
}

.wallet-qr-perimeter-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.wallet-qr-perimeter-text {
  font-family: var(--font-mono);
  font-size: 10.6px;
  font-weight: 600;
  letter-spacing: 0.08em;
  fill: rgba(2, 34, 82, 0.44);
}

.wallet-qr-card {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 26px;
  padding: 16px 16px 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 14px 32px rgba(0, 48, 120, 0.22);
}

.wallet-qr-code {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.wallet-qr-code svg {
  width: 100%;
  height: 100%;
  max-width: 196px;
  max-height: 196px;
  display: block;
}

.wallet-qr-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  background: #eaf4fc;
  color: #0077cc;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.wallet-qr-copy-btn:hover {
  background: #d8ecfc;
}

.wallet-qr-copy-btn:active {
  transform: scale(0.96);
}

.wallet-qr-copy-btn.copied {
  background: #dcfce7;
  color: #15803d;
}

.wallet-qr-empty {
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  border-radius: 24px;
  padding: 24px 18px;
  text-align: center;
  margin-top: 8px;
  box-shadow: 0 14px 32px rgba(0, 48, 120, 0.22);
}

.wallet-qr-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: linear-gradient(135deg, #e0f2fe, #bae6fd);
  display: grid;
  place-items: center;
}

.wallet-qr-empty h3 {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
}

.wallet-qr-empty p {
  font-size: 13px;
  color: #475569;
  margin-bottom: 16px;
  line-height: 1.45;
}

.wallet-qr-connect-btn {
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0098ea, #0077cc);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 152, 234, 0.35);
}

/* =========================================================
   Live Market Rates & Redesigned Monthly Cycle
   ========================================================= */
.rates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.rate-tile {
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(14, 116, 144, 0.2), rgba(15, 23, 42, 0.72));
  border: 1px solid rgba(56, 189, 248, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.rate-tile--star {
  background: linear-gradient(155deg, rgba(180, 83, 9, 0.22), rgba(15, 23, 42, 0.72));
  border-color: rgba(250, 204, 21, 0.34);
}

.rate-tile__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
}

.rate-tile__val {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
  margin-top: 2px;
}

.rate-tile--star .rate-tile__val {
  color: #fde047;
}

.rate-tile__sub {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #7dd3fc;
  margin-top: 2px;
}

.rate-tile--star .rate-tile__sub {
  color: #fef08a;
}

.pill--star {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.38);
  color: #fde047;
}

.cycle-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.cycle-stat-box {
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.62), rgba(15, 23, 42, 0.85));
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cycle-stat-box--r {
  border-color: rgba(56, 189, 248, 0.34);
  background: linear-gradient(155deg, rgba(8, 47, 73, 0.44), rgba(30, 27, 75, 0.65));
}

.cycle-stat-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--hint);
}

.cycle-stat-value {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: #f8fafc;
  margin-top: 3px;
}

.cycle-stat-box--r .cycle-stat-value {
  color: #7dd3fc;
}

.progress-wrap--glow {
  height: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
  margin-bottom: 6px;
}

.cycle-milestones {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--hint);
  margin-bottom: 10px;
}

.cycle-milestones span.reached {
  color: #38bdf8;
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* =========================================================
   3D Rarity-Colored Gift Plaques + Wrapping Orbital Light
   ========================================================= */
.gift-plaque {
  --gp-bg: linear-gradient(145deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.92));
  --gp-orbit: conic-gradient(from 0deg, transparent 0deg, rgba(148, 163, 184, 0.7) 55deg, rgba(255, 255, 255, 0.9) 85deg, transparent 140deg, transparent 360deg);
  --gp-glow: rgba(148, 163, 184, 0.22);
  --gp-tag-bg: rgba(148, 163, 184, 0.16);
  --gp-tag-color: #cbd5e1;
  --rx: 0deg;
  --ry: 0deg;

  position: relative;
  border-radius: 16px;
  padding: 2px;
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  transform: perspective(760px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease;
  box-shadow: 0 10px 24px -8px rgba(2, 6, 23, 0.65), 0 6px 20px -8px var(--gp-glow);
}

/* 3D orbital light wrapping around the entire plaque perimeter */
.gift-plaque::before {
  content: "";
  position: absolute;
  inset: -70%;
  background: var(--gp-orbit);
  animation: gift-orbit-spin 4.4s linear infinite;
  z-index: 0;
  pointer-events: none;
}

.gift-plaque__inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 14px;
  background: var(--gp-bg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.gift-plaque__inner::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -40%;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
  transform: skewX(-22deg);
  animation: gift-sheen-sweep 5.2s ease-in-out infinite;
  pointer-events: none;
}

.gift-plaque__left {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.gift-plaque__title {
  font-size: 14px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gift-plaque__rarity-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.gift-rarity-chip {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--gp-tag-bg);
  color: var(--gp-tag-color);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.gift-stars-price {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 11px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: #fef3c7;
  background: linear-gradient(145deg, rgba(120, 53, 15, 0.42), rgba(30, 41, 59, 0.88));
  border: 1px solid rgba(251, 191, 36, 0.45);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.18), inset 0 1px 0 rgba(254, 240, 138, 0.25);
  white-space: nowrap;
}

.gift-stars-price__star {
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.85);
}

/* Rarity color palettes */
.gift-plaque--mythic {
  --gp-bg: radial-gradient(circle at 85% 20%, rgba(244, 63, 94, 0.34), transparent 55%), linear-gradient(135deg, #2a0726 0%, #581c87 52%, #180624 100%);
  --gp-orbit: conic-gradient(from 0deg, transparent 0deg, #f43f5e 45deg, #facc15 80deg, #e879f9 120deg, transparent 175deg, #38bdf8 260deg, transparent 360deg);
  --gp-glow: rgba(232, 121, 249, 0.48);
  --gp-tag-bg: rgba(244, 63, 94, 0.24);
  --gp-tag-color: #fecdd3;
}

.gift-plaque--gold {
  --gp-bg: radial-gradient(circle at 85% 20%, rgba(250, 204, 21, 0.28), transparent 55%), linear-gradient(135deg, #2a1403 0%, #78350f 52%, #1f1004 100%);
  --gp-orbit: conic-gradient(from 0deg, transparent 0deg, #f59e0b 45deg, #fef08a 90deg, #fbbf24 130deg, transparent 190deg, transparent 360deg);
  --gp-glow: rgba(245, 158, 11, 0.44);
  --gp-tag-bg: rgba(245, 158, 11, 0.22);
  --gp-tag-color: #fde68a;
}

.gift-plaque--rare {
  --gp-bg: radial-gradient(circle at 85% 20%, rgba(56, 189, 248, 0.28), transparent 55%), linear-gradient(135deg, #071e3d 0%, #1e3a8a 52%, #0c1730 100%);
  --gp-orbit: conic-gradient(from 0deg, transparent 0deg, #38bdf8 50deg, #ffffff 85deg, #818cf8 125deg, transparent 185deg, transparent 360deg);
  --gp-glow: rgba(56, 189, 248, 0.42);
  --gp-tag-bg: rgba(56, 189, 248, 0.2);
  --gp-tag-color: #bae6fd;
}

.gift-plaque--uncommon {
  --gp-bg: radial-gradient(circle at 85% 20%, rgba(16, 185, 129, 0.26), transparent 55%), linear-gradient(135deg, #042419 0%, #065f46 52%, #081c16 100%);
  --gp-orbit: conic-gradient(from 0deg, transparent 0deg, #10b981 50deg, #a7f3d0 88deg, #2dd4bf 130deg, transparent 185deg, transparent 360deg);
  --gp-glow: rgba(16, 185, 129, 0.36);
  --gp-tag-bg: rgba(16, 185, 129, 0.2);
  --gp-tag-color: #a7f3d0;
}

.gift-plaque--standard {
  --gp-bg: linear-gradient(135deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.94));
  --gp-orbit: conic-gradient(from 0deg, transparent 0deg, rgba(148, 163, 184, 0.65) 55deg, rgba(226, 232, 240, 0.85) 85deg, transparent 145deg, transparent 360deg);
  --gp-glow: rgba(148, 163, 184, 0.2);
  --gp-tag-bg: rgba(148, 163, 184, 0.16);
  --gp-tag-color: #cbd5e1;
}

@keyframes gift-orbit-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes gift-sheen-sweep {
  0%, 40% { transform: translateX(-110%) skewX(-22deg); }
  72%, 100% { transform: translateX(460%) skewX(-22deg); }
}

/* =========================================================
   Story Share Modal (#story-share-modal)
   ========================================================= */
.story-modal-card {
  max-width: 390px;
}

.story-canvas-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

#story-canvas {
  width: 100%;
  max-width: 245px;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.75);
  background: #070b18;
}

.story-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* =========================================================
   Reward & Action Notification Modal (#reward-notify-modal)
   ========================================================= */
.reward-modal-card {
  position: relative;
  width: 100%;
  max-width: 342px;
  border-radius: 26px;
  padding: 26px 20px 20px;
  text-align: center;
  border: 1px solid transparent;
  background-image:
    linear-gradient(165deg, rgba(22, 32, 56, 0.97), rgba(8, 12, 26, 0.99)),
    linear-gradient(135deg, rgba(56, 189, 248, 0.55), rgba(168, 85, 247, 0.5), rgba(250, 204, 21, 0.45));
  background-origin: padding-box, border-box;
  background-clip: padding-box, border-box;
  box-shadow:
    0 28px 64px rgba(2, 6, 23, 0.85),
    0 0 42px rgba(56, 189, 248, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  overflow: hidden;
  animation: reward-pop-in 0.28s cubic-bezier(0.22, 1.25, 0.36, 1);
}

.reward-modal-card--info {
  background-image:
    linear-gradient(165deg, rgba(18, 30, 52, 0.97), rgba(8, 13, 28, 0.99)),
    linear-gradient(135deg, rgba(56, 189, 248, 0.52), rgba(99, 102, 241, 0.45), rgba(148, 163, 184, 0.28));
}

.reward-modal-card--stars,
.reward-modal-card--trophy {
  background-image:
    linear-gradient(165deg, rgba(36, 22, 12, 0.97), rgba(12, 10, 24, 0.99)),
    linear-gradient(135deg, rgba(250, 204, 21, 0.65), rgba(249, 115, 22, 0.5), rgba(168, 85, 247, 0.45));
  box-shadow:
    0 28px 64px rgba(2, 6, 23, 0.85),
    0 0 42px rgba(245, 158, 11, 0.25),
    inset 0 1px 0 rgba(254, 240, 138, 0.28);
}

.reward-modal-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rm-spark {
  position: absolute;
  color: #fde047;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.85);
  animation: reward-sparkle-float 2.6s ease-in-out infinite;
}

.rm-spark--1 { top: 18px; left: 26px; font-size: 13px; color: #38bdf8; animation-delay: 0s; }
.rm-spark--2 { top: 26px; right: 28px; font-size: 14px; animation-delay: 0.4s; }
.rm-spark--3 { top: 82px; left: 20px; font-size: 11px; color: #e879f9; animation-delay: 0.8s; }
.rm-spark--4 { top: 76px; right: 22px; font-size: 12px; color: #7dd3fc; animation-delay: 1.2s; }
.rm-spark--5 { bottom: 72px; left: 32px; font-size: 10px; animation-delay: 1.5s; }
.rm-spark--6 { bottom: 68px; right: 32px; font-size: 11px; color: #c084fc; animation-delay: 1.9s; }

.reward-modal-icon-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
}

.reward-modal-icon-halo {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(56, 189, 248, 0.65), rgba(168, 85, 247, 0.55), rgba(250, 204, 21, 0.65), rgba(56, 189, 248, 0.65));
  filter: blur(10px);
  opacity: 0.72;
  animation: gift-orbit-spin 4.2s linear infinite;
}

.reward-modal-icon {
  position: relative;
  z-index: 1;
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.24);
  display: grid;
  place-items: center;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: reward-icon-bounce 2.2s ease-in-out infinite;
}

.reward-modal-icon svg {
  width: 48px;
  height: 48px;
  display: block;
}

.reward-modal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(168, 85, 247, 0.28));
  border: 1px solid rgba(125, 211, 252, 0.48);
  color: #e0f2fe;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.2);
}

.reward-modal-card--stars .reward-modal-badge,
.reward-modal-card--trophy .reward-modal-badge {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.24), rgba(249, 115, 22, 0.28));
  border-color: rgba(253, 224, 71, 0.55);
  color: #fef08a;
}

.reward-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.reward-modal-text {
  font-size: 13.5px;
  color: #cbd5e1;
  line-height: 1.48;
  margin-bottom: 18px;
}

.reward-modal-ok {
  margin-top: 2px;
}

.mini-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 80;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #e0f2fe;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
  pointer-events: none;
  animation: reward-pop-in 0.2s ease-out;
}

@keyframes reward-pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes reward-icon-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.05); }
}

@keyframes reward-sparkle-float {
  0%, 100% { opacity: 0.35; transform: translateY(0) scale(0.85) rotate(0deg); }
  50% { opacity: 1; transform: translateY(-5px) scale(1.2) rotate(18deg); }
}

@media (prefers-reduced-motion: reduce) {
  .reward-modal-card,
  .reward-modal-icon-halo,
  .reward-modal-icon,
  .rm-spark,
  .wallet-qr-shell {
    animation: none !important;
  }
}

/* =========================================================
   Collectible Gift Showcase Cards (Profile & Top-4 Modal)
   ========================================================= */
.gifts-showcase-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gifts-showcase-grid .empty-state {
  grid-column: 1 / -1;
}

.tg-gift-card {
  --gift-center: #8b5cf6;
  --gift-edge: #2e1065;
  --rx: 0deg;
  --ry: 0deg;

  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(165deg, rgba(22, 32, 52, 0.94), rgba(11, 17, 32, 0.98));
  border: 1px solid rgba(148, 163, 184, 0.22);
  overflow: hidden;
  isolation: isolate;
  transform-style: preserve-3d;
  transform: perspective(760px) rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, box-shadow 0.22s ease;
  box-shadow:
    0 12px 26px -10px rgba(2, 6, 23, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

.tg-gift-card:hover {
  border-color: rgba(125, 211, 252, 0.45);
  box-shadow:
    0 16px 32px -10px rgba(2, 6, 23, 0.84),
    0 0 20px -6px var(--gift-center);
}

.tg-gift-card__stage {
  position: relative;
  height: 118px;
  background: radial-gradient(circle at 50% 44%, var(--gift-center) 0%, var(--gift-edge) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
}

.tg-gift-card__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.18) 1px, transparent 1.2px),
    radial-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1.2px);
  background-size: 24px 24px, 18px 18px;
  background-position: 0 0, 11px 11px;
  pointer-events: none;
}

.tg-gift-card__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.05) 0%, rgba(11, 17, 32, 0.42) 100%);
  pointer-events: none;
}

.tg-gift-card__backdrop-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  max-width: 54%;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  color: rgba(248, 250, 252, 0.92);
  font-size: 9.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-gift-card__code-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(125, 211, 252, 0.48);
  backdrop-filter: blur(8px);
  color: #7dd3fc;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(2, 6, 23, 0.4);
  transition: background 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.tg-gift-card__code-btn:hover {
  background: #38bdf8;
  color: #0b1120;
  transform: scale(1.05);
}

.tg-gift-card__code-btn:active {
  transform: scale(0.95);
}

.tg-gift-card__art {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 8px 16px rgba(2, 6, 23, 0.55));
}

.tg-gift-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.tg-gift-card__emoji {
  font-size: 44px;
  line-height: 1;
}

.tg-gift-card__body {
  padding: 10px 11px 11px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
  gap: 7px;
}

.tg-gift-card__title {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-gift-card__model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  margin-top: 2px;
}

.tg-gift-card__model-name {
  font-size: 11px;
  font-weight: 600;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-gift-card__pct {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.tg-gift-card__traits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tg-gift-card__trait-chip {
  font-size: 9.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #94a3b8;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-gift-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.tg-gift-card__gram {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: #38bdf8;
  white-space: nowrap;
}

.tg-gift-card__usd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: #94a3b8;
  white-space: nowrap;
}

/* =========================================================
   Leaderboard Interactive Rows & Add-User Toolbar
   ========================================================= */
.lb-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-add-top-pill {
  border: 1px solid rgba(56, 189, 248, 0.42);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(99, 102, 241, 0.22));
  color: #e0f2fe;
  padding: 7px 11px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.14s ease, filter 0.16s ease;
}

.btn-add-top-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.12);
}

.lb-click-hint {
  font-size: 11.5px;
  color: var(--hint);
  margin-bottom: 8px;
}

.list-row--clickable {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.18s ease, background 0.18s ease;
}

.list-row--clickable:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.78), rgba(15, 23, 42, 0.62));
  transform: translateY(-1px);
}

.list-row--clickable:active {
  transform: scale(0.985);
}

/* =========================================================
   Player Profile Modal from Leaderboard (#user-profile-modal)
   ========================================================= */
.user-profile-modal-card {
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 16px;
}

.upm-head {
  margin-bottom: 10px;
}

.upm-username {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--hint);
  margin-top: 2px;
}

.upm-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.upm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 12px 0 8px;
  font-size: 13px;
  font-weight: 800;
  color: #e2e8f0;
}

.upm-card-toggle {
  padding: 2px;
}

.upm-deck-btn {
  border: none;
  background: transparent;
  color: var(--hint);
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.upm-deck-btn.active {
  background: var(--accent);
  color: var(--accent-text);
}

.upm-cards-deck {
  margin-bottom: 10px;
}

/* =========================================================
   Telegram Collectible Gift Inspector Sheet (#gift-detail-modal)
   ========================================================= */
.gift-inspect-sheet {
  width: 100%;
  max-width: 370px;
  border-radius: 26px;
  background: #131c2e;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 64px rgba(2, 6, 23, 0.85);
  overflow: hidden;
  animation: reward-pop-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.gift-inspect-stage {
  position: relative;
  padding: 22px 18px 18px;
  text-align: center;
  background: radial-gradient(circle at 50% 42%, #9b59b6 0%, #4a235a 100%);
  overflow: hidden;
}

.gift-inspect-close {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
}

.gift-inspect-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.2) 1.2px, transparent 1.4px),
    radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1.2px);
  background-size: 28px 28px, 20px 20px;
  background-position: 0 0, 14px 14px;
  pointer-events: none;
}

.gift-inspect-figure {
  position: relative;
  z-index: 1;
  width: 116px;
  height: 116px;
  margin: 4px auto 10px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 12px 24px rgba(2, 6, 23, 0.55));
}

.gift-inspect-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gift-inspect-figure .gift-inspect-emoji {
  font-size: 68px;
}

.gift-inspect-title {
  position: relative;
  z-index: 1;
  font-size: 19px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.gift-inspect-subtitle {
  position: relative;
  z-index: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 2px;
}

.gift-inspect-body {
  padding: 14px 16px 16px;
}

.gift-inspect-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(15, 23, 42, 0.72);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.16);
  margin-bottom: 14px;
}

.gift-inspect-table tr + tr {
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.gift-inspect-table th {
  text-align: left;
  padding: 9px 12px;
  width: 36%;
  font-size: 12.5px;
  font-weight: 600;
  color: #94a3b8;
  border-right: 1px solid rgba(148, 163, 184, 0.14);
}

.gift-inspect-table td {
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.gift-inspect-pct {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

/* =========================================================
   Add User to Leaderboard Modal (#add-top-user-modal)
   ========================================================= */
.add-user-modal-card {
  max-width: 390px;
}

.add-user-hint {
  line-height: 1.48;
  margin-bottom: 12px;
}

.add-user-hint code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #7dd3fc;
  background: rgba(15, 23, 42, 0.7);
  padding: 1px 5px;
  border-radius: 5px;
}

.add-user-textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(11, 17, 32, 0.75);
  color: var(--text);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  resize: vertical;
  margin-bottom: 8px;
}

.add-user-textarea:focus {
  outline: none;
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.add-user-wallet-input {
  width: 100%;
  margin-bottom: 12px;
}

@media (max-width: 380px) {
  .gifts-showcase-grid {
    grid-template-columns: 1fr;
  }
}
