/* ═══════════════════════════════════════════════════════════════
   MineQuest Mini App — styles.css
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ───────────────────────────────────────────────────── */
/*
   ╔═════════════════════════════════════════════════════════════╗
   ║  BRAND PALETTE — HoneyMine                                   ║
   ║                                                              ║
   ║  Extraída del logo: minero dorado con casco ámbar,           ║
   ║  ojos de panal brillante y miel goteando                     ║
   ║                                                              ║
   ║  Primitive scale  (light → dark)                            ║
   ║    --brand-50  …  --brand-700   main brand ramp             ║
   ║    --accent-400 / 500 / 600     secondary accent             ║
   ║                                                              ║
   ║  Theme: Deep Honey Brown + Vibrant Gold + Amber Glow         ║
   ╚══════════════════════════════════════════════════════════════╝
*/
:root {
  /* ── SuiBlue Primitive brand scale ──────────────────── */
  --brand-50:  #0D1B2E;   /* lightest tint — cards, inputs (deep navy card)  */
  --brand-100: #071020;   /* page background (darkest navy)                  */
  --brand-200: #040C18;   /* deeper bg accent (abyss navy)                   */
  --brand-300: #4DA2FF;   /* Sui blue bright — primary accent / glow         */
  --brand-400: #82C3FF;   /* Sui blue light highlight                        */
  --brand-500: #2B8FEF;   /* Sui blue core                                   */
  --brand-600: #1A6FCC;   /* Sui blue deep                                   */
  --brand-700: #0F4F99;   /* Sui blue darkest (depth shadow)                 */

  /* ── Secondary accent ────────────────────────────────── */
  --accent-400: #93CFFF;
  --accent-500: #4DA2FF;
  --accent-600: #1A6FCC;

  /* ── Tertiary / energy accent ───────────────────────── */
  --energy-400: #C8E8FF;
  --energy-500: #82C3FF;
  --energy-600: #4DA2FF;

  /* ══════════════════════════════════════════════════════
     Semantic tokens
     ══════════════════════════════════════════════════════ */

  /* Backgrounds */
  --bg:        var(--brand-100);
  --bg2:       var(--brand-200);
  --card:      var(--brand-50);
  --surface:   rgba(13,27,46,0.95);
  --surface-h: rgba(20,40,70,0.99);

  /* Borders */
  --border:    rgba(77,162,255,0.18);
  --border-h:  rgba(77,162,255,0.42);

  /* Primary accent — Sui blue bright */
  --ton:      var(--brand-300);
  --ton-glow: rgba(77,162,255,0.45);
  --ton-dim:  rgba(77,162,255,0.10);

  /* Secondary accent */
  --power:      var(--accent-500);
  --power-glow: rgba(77,162,255,0.50);
  --power-dim:  rgba(77,162,255,0.15);

  /* Hash accent */
  --hash:      var(--energy-500);
  --hash-glow: rgba(130,195,255,0.45);
  --hash-dim:  rgba(130,195,255,0.14);

  /* Legacy aliases */
  --lime-bright: var(--brand-400);
  --lime-mid:    var(--brand-500);
  --lime-deep:   var(--brand-600);
  --lime-extra:  var(--brand-700);
  --lime-soft:   var(--brand-50);
  --lime-accent: var(--brand-300);
  --p-cyan:      var(--brand-300);

  /* Text — crisp white */
  --t1: #F0F8FF;
  --t2: rgba(220,240,255,0.80);
  --t3: rgba(160,210,255,0.55);
  --t4: rgba(100,170,255,0.28);

  /* Layout */
  --radius:    18px;
  --radius-sm: 10px;
  --tab-h:     72px;
  --header-h:  56px;
}

/* ── Reset ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  font-size: 16px; -webkit-text-size-adjust: 100%;
  min-height: 100%; overflow-y: auto;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--t1);
  min-height: var(--tg-viewport-stable-height, 100dvh);
  overflow-x: clip;
  overflow-y: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: auto;
}
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
input  { font: inherit; color: inherit; }

/* ── Lucide Icons ───────────────────────────────────────────────── */
i[data-lucide] { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
i[data-lucide] svg { display: block; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.ls-icon svg           { width: 38px; height: 38px; stroke: var(--ton); stroke-width: 1.5; }
.header-logo svg       { width: 20px; height: 20px; }
.claim-btn-icon svg    { width: 20px; height: 20px; stroke-width: 2; }
.card-header-icon svg  { width: 14px; height: 14px; stroke-width: 2; }
.pkg-icon svg          { width: 20px; height: 20px; stroke: var(--power); stroke-width: 2; }
.lb-hero-icon svg      { width: 42px; height: 42px; stroke: #4DA2FF; stroke-width: 1.5; }
.team-feed-empty svg   { width: 28px; height: 28px; stroke: var(--t4); stroke-width: 1.5; }
.tab-icon svg          { width: 23px; height: 23px; stroke: none; }
.tab-btn--main .tab-icon svg { width: 23px; height: 23px; stroke: none; }
.modal-close svg       { width: 14px; height: 14px; stroke-width: 2.5; }
.modal-title svg       { width: 18px; height: 18px; stroke-width: 2; vertical-align: middle; margin-right: 4px; }
.mine-hero-btn svg     { width: 15px; height: 15px; stroke-width: 2.5; }
.mine-hashes-header-icon svg { width: 14px; height: 14px; stroke: var(--p-cyan); stroke-width: 2; }

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 0; }

/* ════════════════════════════════════════════════════════════════
   LOADING SCREEN
   ════════════════════════════════════════════════════════════════ */
#loading-screen {
  position: fixed; inset: 0; z-index: 100;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .5s cubic-bezier(.4,0,.2,1);
}
#loading-screen.hidden { opacity: 0; pointer-events: none; }

.ls-inner {
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}

.ls-logo {
  width: 120px; height: 120px;
  object-fit: contain;
  border-radius: 28px;
  box-shadow:
    0 8px 24px rgba(0,0,0,.7),
    0 0 48px rgba(77,162,255,0.35),
    0 0 80px rgba(43,143,239,0.22);
}

.ls-power-counter {
  font-size: 42px; font-weight: 800; letter-spacing: -1px;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  min-width: 260px; text-align: center;
}

.ls-power-label {
  font-size: 13px; font-weight: 700; letter-spacing: 3px;
  color: var(--t3); text-transform: uppercase;
  margin-top: -14px;
}

.ls-bar {
  width: 160px; height: 3px;
  background: var(--surface);
  border-radius: 99px; overflow: hidden;
  margin-top: 4px;
}
.ls-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--ton), var(--lime-bright));
  border-radius: 99px;
  animation: loading-bar 1.8s ease-in-out infinite;
}
@keyframes loading-bar {
  0%   { width: 0%;   margin-left: 0; }
  50%  { width: 60%;  margin-left: 20%; }
  100% { width: 0%;   margin-left: 100%; }
}
@keyframes shimmer-slide {
  0%   { transform: translateX(-100%)  scaleX(.2); }
  40%  { transform: translateX(0%)     scaleX(.6); }
  70%  { transform: translateX(80%)    scaleX(.4); }
  100% { transform: translateX(200%)   scaleX(.2); }
}

/* ════════════════════════════════════════════════════════════════
   APP SHELL
   ════════════════════════════════════════════════════════════════ */
#app {
  display: flex; flex-direction: column;
  min-height: var(--tg-viewport-stable-height, 100dvh);
}

/* ── Header ─────────────────────────────────────────────────────── */
.header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); padding: 0 16px;
  background: rgba(4,12,24,0.98);
  backdrop-filter: blur(20px) saturate(200%);
  -webkit-backdrop-filter: blur(20px) saturate(200%);
  border-bottom: 1px solid rgba(77,162,255,0.22);
  box-shadow: 0 1px 8px rgba(0,0,0,0.60), 0 0 20px rgba(26,111,204,0.06);
}
/* Left side = user identity (avatar + name) */
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.header-user-photo {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}
.header-user-initials {
  display: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(77,162,255,0.12);
  border: 2px solid rgba(77,162,255,0.38);
  align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--ton);
  flex-shrink: 0;
}
.header-user-name {
  font-size: 15px; font-weight: 700; color: var(--t1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}

/* ── Language selector ───────────────────────────────────────────── */
.lang-selector { position: relative; }
.lang-selector-btn {
  display: flex; align-items: center; gap: 4px;
  background: rgba(4,12,24,0.92);
  border: 1px solid rgba(77,162,255,0.18);
  border-radius: 99px;
  padding: 5px 10px 5px 8px;
  cursor: pointer;
  color: var(--t2);
  transition: border-color .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.30);
}
.lang-selector-btn:hover { border-color: var(--ton); color: var(--ton); }
.lang-selector-btn svg { width: 10px; height: 10px; flex-shrink: 0; transition: transform .2s; }
.lang-selector-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
/* Flag emoji in the button */
#lang-selector-current { display: flex; align-items: center; line-height: 1; }
#lang-selector-current .lang-flag-img { width: 20px; height: 15px; object-fit: cover; border-radius: 3px; display: block; }
.lang-flag { display: flex; align-items: center; flex-shrink: 0; }
.lang-flag-img { width: 20px; height: 15px; object-fit: cover; border-radius: 3px; display: block; }
.lang-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 110px;
  background: #0A1525;
  border: 1px solid rgba(77,162,255,0.22);
  border-radius: 12px;
  padding: 4px;
  list-style: none; margin: 0;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.40), 0 2px 6px rgba(0,0,0,0.08);
  animation: langDropIn .15s ease;
}
@keyframes langDropIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lang-option {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.lang-option:hover { background: var(--surface); }
.lang-option.active { background: var(--ton-dim); }
.lang-flag { font-size: 18px; line-height: 1; flex-shrink: 0; }
.lang-code { font-size: 12px; font-weight: 700; color: var(--t2); }
.lang-option.active .lang-code { color: var(--ton); }
.lang-option:hover .lang-code { color: var(--t1); }

/* ── Pages ──────────────────────────────────────────────────────── */
.page {
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 16px);
}
.page.active {
  display: flex;
  animation: pageIn .25s ease both;
}

/* ── Glass Card ─────────────────────────────────────────────────── */
.glass-card {
  background: #0D1B2E;
  border: 1px solid rgba(77,162,255,0.14);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow:
    0 2px 0 rgba(77,162,255,0.12),
    0 4px 16px rgba(0,0,0,0.50),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.card-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.card-header-icon { display: flex; align-items: center; }
.card-header-title {
  font-size: 12px; font-weight: 700;
  color: var(--t3); letter-spacing: 1px;
  text-transform: uppercase;
}

/* ════════════════════════════════════════════════════════════════
   MINE PAGE
   ════════════════════════════════════════════════════════════════ */

/* POWER hero card */
.mine-power-card {
  border-radius: var(--radius);
  padding: 24px 20px 18px;
  text-align: center;
  background: linear-gradient(160deg, #2B8FEF 0%, #1A6FCC 50%, #040C18 100%);
  border: 1px solid rgba(77,162,255,0.30);
  box-shadow:
    0 2px 0 rgba(77,162,255,0.35),            /* top highlight — 3D lift */
    0 8px 40px rgba(0,0,0,0.65),             /* depth shadow */
    inset 0 1px 0 rgba(255,255,255,0.18),    /* inner top sheen */
    inset 0 -1px 0 rgba(0,0,0,0.20);
}
.mine-power-label {
  font-size: 11px; color: rgba(255,255,255,0.65);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 8px;
}
.mine-power-amount {
  font-size: 58px; font-weight: 900; letter-spacing: -2px; line-height: 1;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.20);
}
.mine-power-unit {
  font-size: 16px; font-weight: 700; color: #82C3FF;
  letter-spacing: 1px; margin: 6px 0 16px;
}

/* HONEY card */
.mine-hashes-card {
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  background: linear-gradient(160deg, #040C18 0%, #0D1B2E 100%);
  border: 1px solid rgba(77,162,255,0.16);
  box-shadow:
    0 2px 0 rgba(77,162,255,0.14),
    0 6px 28px rgba(43,143,239,0.08),
    inset 0 1px 0 rgba(255,255,255,0.03),
    inset 0 -1px 0 rgba(77,162,255,0.06);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.mine-hashes-header {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin-bottom: 8px;
}
.mine-hashes-header-icon { display: flex; align-items: center; }
.mine-hashes-header-icon { display: inline-flex; align-items: center; }
.mine-hashes-header-title {
  font-size: 11px; font-weight: 700; color: rgba(160,210,255,0.70);
  letter-spacing: 1.5px; text-transform: uppercase;
}
.mine-hashes-val {
  font-size: 34px; font-weight: 800; color: var(--p-cyan);
  letter-spacing: -0.5px; line-height: 1;
}
.mine-hashes-sub {
  font-size: 13px; color: rgba(160,210,255,0.55); margin-bottom: 16px;
}

/* Claim / Swap button */
.claim-btn {
  position: relative; overflow: hidden;
  width: 100%; padding: 15px;
  background: linear-gradient(160deg, #2B8FEF 0%, #1A6FCC 55%, #040C18 100%);
  border-radius: 12px;
  font-size: 15px; font-weight: 700; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow:
    0 2px 0 rgba(77,162,255,0.32),
    0 6px 24px rgba(0,0,0,0.60),
    inset 0 1px 0 rgba(255,255,255,0.28),
    inset 0 -2px 0 rgba(0,0,0,0.18);
  transition: transform .12s, box-shadow .12s, opacity .12s;
}
.claim-btn:active  { transform: scale(.97); box-shadow: 0 2px 10px rgba(0,0,0,0.50); }
.claim-btn:disabled{ opacity: .6; }
.claim-btn--secondary {
  background: rgba(77,162,255,0.08);
  color: var(--ton);
  border: 2px solid rgba(77,162,255,0.42);
  box-shadow: 0 0 14px rgba(77,162,255,0.10);
}
.claim-btn--secondary:active {
  box-shadow: none;
  background: var(--ton-dim);
}
.claim-btn-shine {
  position: absolute; top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.15), transparent);
  animation: shine 3s ease-in-out infinite;
}
.claim-btn-icon { display: flex; align-items: center; }

/* Stats row */
.stats-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.stat-pill {
  background: #0D1B2E;
  border: 1px solid rgba(77,162,255,0.14);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 2px 0 rgba(77,162,255,0.10), 0 2px 8px rgba(0,0,0,0.45),
              inset 0 1px 0 rgba(36,22,8,0.90);
}
.stat-pill-icon  { display: flex; align-items: center; flex-shrink: 0; }
.stat-pill-val   {
  font-size: 12px; font-weight: 700; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat-pill-label {
  font-size: 9px; color: var(--t3); font-weight: 600;
  letter-spacing: .5px; margin-top: 2px; text-transform: uppercase;
}

/* Rate grid */
.rate-grid {
  display: grid; grid-template-columns: 1fr auto 1fr auto 1fr;
  background: rgba(0,0,0,0.25);
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}
.rate-cell        { padding: 14px 6px; text-align: center; }
.rate-cell-val    { font-size: 14px; font-weight: 700; color: #fff; }
.rate-cell-label  {
  font-size: 9px; color: rgba(255,255,255,0.60); margin-top: 3px;
  letter-spacing: .5px; text-transform: uppercase;
}
.rate-divider     { width: 1px; background: rgba(255,255,255,0.15); margin: 10px 0; }

/* Info rows */
.info-rows { display: flex; flex-direction: column; gap: 10px; }
.info-row  { display: flex; align-items: center; gap: 10px; }
.info-row-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.accent-power { background: var(--power); box-shadow: 0 0 8px var(--power-glow); }
.accent-ton   { background: var(--ton);   box-shadow: 0 0 8px var(--ton-glow);   }
.accent-hash  { background: var(--hash);  box-shadow: 0 0 8px var(--hash-glow);  }

.info-row-text  { font-size: 13px; color: var(--t2); line-height: 1.4; }
.info-row-label { font-size: 13px; color: var(--t3); flex: 1; }
.info-row-val   { font-size: 13px; font-weight: 700; color: var(--t1); }

.accent-power-text { color: var(--power); }
.accent-ton-text   { color: var(--ton);   }
.stat-usd { color: var(--hash); }
.stat-ton { color: var(--ton);  }


/* ════════════════════════════════════════════════════════════════
   SHOP PAGE — Tinder stack swipe
   ════════════════════════════════════════════════════════════════ */

.page--shop {
  overflow: hidden;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  gap: 0 !important;
}
/* .page base already sets display:none; .page.active sets display:flex —
   override only what's needed to make the fixed layout work */
.page--shop.active {
  animation: pageIn .25s ease both;
}

/* ── Stack deck ───────────────────────────────────────────────── */
.shop-deck {
  position: relative;
  --cq: 100px; /* overridden by JS immediately after mount */
  /* 90% of parent height (parent = fixed box between header and navbar) */
  height: 90%;
  /* portrait ratio ~0.65 of deck height, never wider than 92vw */
  width: min(92vw, calc((100dvh - var(--header-h) - var(--tab-h) - env(safe-area-inset-bottom,0px)) * 0.90 * 0.65));
  overflow: hidden;
}

/* ── Each card — absolutely stacked ──────────────────────────── */
.pkg-card {
  position: absolute;
  inset: 0;
  border-radius: calc(var(--cq) * 0.06);
  padding: calc(var(--cq) * 0.05) calc(var(--cq) * 0.06);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  will-change: transform, opacity;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
}
.pkg-card:active { cursor: grabbing; }

/* ── Per-tier gradients (index 0→4 = 10K→10M) ────────────────── */
/* Light theme progression: blanco puro → lima suave → lima medio → lima brillante → lima eléctrico */

/* Tier 0 — 10K : lima suave, entrada */
.pkg-card[data-tier="0"] {
  background: linear-gradient(155deg, var(--card) 0%, var(--bg) 50%, var(--bg2) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 2px 0 rgba(77,162,255,0.18), 0 8px 32px rgba(0,0,0,0.30),
              inset 0 1px 0 rgba(255,255,255,0.05), inset 0 -1px 0 rgba(0,0,0,0.06);
}
.pkg-card[data-tier="0"] .pkg-name { color: var(--t1); }
.pkg-card[data-tier="0"]::before {
  background: linear-gradient(90deg, transparent, rgba(13,32,64,0.80), transparent);
}
.pkg-card[data-tier="0"] .pkg-icon {
  background: rgba(13,32,64,0.85); border-color: rgba(255,255,255,0.05);
}
.pkg-card[data-tier="0"] .pkg-icon svg { stroke: var(--brand-600); }
.pkg-card[data-tier="0"] .pkg-name-unit { color: var(--brand-600); }
.pkg-card[data-tier="0"] .pkg-est-val   { color: var(--brand-700); }
.pkg-card[data-tier="0"] .pkg-btn {
  background: linear-gradient(155deg, var(--brand-500) 0%, var(--brand-600) 100%);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 6px 18px rgba(0,0,0,0.45),
              inset 0 1px 0 rgba(255,255,255,0.30), inset 0 -1px 0 rgba(0,0,0,0.12);
}

/* Tier 1 — 500K : lima claro */
.pkg-card[data-tier="1"] {
  background: linear-gradient(155deg, var(--bg) 0%, var(--bg2) 50%, #93CFFF 100%);
  border: 1px solid var(--ton-glow);
  box-shadow: 0 2px 0 rgba(77,162,255,0.15), 0 8px 34px rgba(0,0,0,0.09),
              inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.05);
}
.pkg-card[data-tier="1"] .pkg-name { color: var(--t1); }
.pkg-card[data-tier="1"]::before {
  background: linear-gradient(90deg, transparent, rgba(13,32,64,0.85), transparent);
}
.pkg-card[data-tier="1"] .pkg-icon {
  background: rgba(13,32,64,0.80); border-color: rgba(255,255,255,0.04);
}
.pkg-card[data-tier="1"] .pkg-icon svg { stroke: var(--brand-700); }
.pkg-card[data-tier="1"] .pkg-name-unit { color: var(--brand-700); }
.pkg-card[data-tier="1"] .pkg-est-val   { color: var(--brand-700); }
.pkg-card[data-tier="1"] .pkg-btn {
  background: linear-gradient(155deg, var(--brand-400) 0%, var(--brand-500) 100%);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 6px 20px rgba(0,0,0,0.50),
              inset 0 1px 0 rgba(255,255,255,0.32), inset 0 -1px 0 rgba(0,0,0,0.12);
}

/* Tier 2 — 1M : lima medio, FEATURED */
.pkg-card[data-tier="2"] {
  background: linear-gradient(155deg, var(--bg) 0%, var(--bg2) 45%, #93CFFF 100%);
  border: 1px solid var(--border-h);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 12px 48px rgba(0,0,0,0.40),
              0 0 0 1px rgba(77,162,255,0.10),
              inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.pkg-card[data-tier="2"] .pkg-name { color: var(--t1); }
.pkg-card[data-tier="2"]::before {
  background: linear-gradient(90deg, transparent, rgba(77,162,255,0.85), transparent);
}
.pkg-card[data-tier="2"] .pkg-icon {
  background: rgba(13,32,64,0.85); border-color: rgba(77,162,255,0.40);
}
.pkg-card[data-tier="2"] .pkg-icon svg { stroke: var(--brand-600); }
.pkg-card[data-tier="2"] .pkg-name-unit { color: var(--brand-600); }
.pkg-card[data-tier="2"] .pkg-est-val   { color: var(--brand-700); }
.pkg-card[data-tier="2"] .pkg-btn {
  background: linear-gradient(155deg, var(--brand-500) 0%, var(--brand-600) 100%);
  box-shadow: 0 2px 0 rgba(77,162,255,0.35), 0 6px 24px var(--hash-glow),
              inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -2px 0 rgba(0,0,0,0.12);
}

/* Tier 3 — 5M */
.pkg-card[data-tier="3"] {
  background: linear-gradient(155deg, var(--card) 0%, var(--bg) 50%, var(--bg2) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 2px 0 rgba(77,162,255,0.18), 0 8px 32px rgba(0,0,0,0.30),
              inset 0 1px 0 rgba(255,255,255,0.05), inset 0 -1px 0 rgba(0,0,0,0.06);
}
.pkg-card[data-tier="3"] .pkg-name { color: var(--t1); }
.pkg-card[data-tier="3"]::before {
  background: linear-gradient(90deg, transparent, rgba(13,32,64,0.80), transparent);
}
.pkg-card[data-tier="3"] .pkg-icon {
  background: rgba(13,32,64,0.85); border-color: rgba(255,255,255,0.05);
}
.pkg-card[data-tier="3"] .pkg-icon svg { stroke: var(--brand-600); }
.pkg-card[data-tier="3"] .pkg-name-unit { color: var(--brand-600); }
.pkg-card[data-tier="3"] .pkg-est-val   { color: var(--brand-700); }
.pkg-card[data-tier="3"] .pkg-btn {
  background: linear-gradient(155deg, var(--brand-500) 0%, var(--brand-600) 100%);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 6px 18px rgba(0,0,0,0.45),
              inset 0 1px 0 rgba(255,255,255,0.30), inset 0 -1px 0 rgba(0,0,0,0.12);
}

/* Tier 4 — 10M */
.pkg-card[data-tier="4"] {
  background: linear-gradient(155deg, var(--bg) 0%, var(--bg2) 50%, #93CFFF 100%);
  border: 1px solid var(--ton-glow);
  box-shadow: 0 2px 0 rgba(77,162,255,0.15), 0 8px 34px rgba(0,0,0,0.09),
              inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.05);
}
.pkg-card[data-tier="4"] .pkg-name { color: var(--t1); }
.pkg-card[data-tier="4"]::before {
  background: linear-gradient(90deg, transparent, rgba(13,32,64,0.85), transparent);
}
.pkg-card[data-tier="4"] .pkg-icon {
  background: rgba(13,32,64,0.80); border-color: rgba(255,255,255,0.04);
}
.pkg-card[data-tier="4"] .pkg-icon svg { stroke: var(--brand-700); }
.pkg-card[data-tier="4"] .pkg-name-unit { color: var(--brand-700); }
.pkg-card[data-tier="4"] .pkg-est-val   { color: var(--brand-700); }
.pkg-card[data-tier="4"] .pkg-btn {
  background: linear-gradient(155deg, var(--brand-400) 0%, var(--brand-500) 100%);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 6px 20px rgba(0,0,0,0.50),
              inset 0 1px 0 rgba(255,255,255,0.32), inset 0 -1px 0 rgba(0,0,0,0.12);
}

/* Tier 5 — 25M */
.pkg-card[data-tier="5"] {
  background: linear-gradient(155deg, var(--bg) 0%, var(--bg2) 45%, #93CFFF 100%);
  border: 1px solid var(--border-h);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 12px 48px rgba(0,0,0,0.40),
              0 0 0 1px rgba(77,162,255,0.10),
              inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.pkg-card[data-tier="5"] .pkg-name { color: var(--t1); }
.pkg-card[data-tier="5"]::before {
  background: linear-gradient(90deg, transparent, rgba(77,162,255,0.85), transparent);
}
.pkg-card[data-tier="5"] .pkg-icon {
  background: rgba(13,32,64,0.85); border-color: rgba(77,162,255,0.40);
}
.pkg-card[data-tier="5"] .pkg-icon svg { stroke: var(--brand-600); }
.pkg-card[data-tier="5"] .pkg-name-unit { color: var(--brand-600); }
.pkg-card[data-tier="5"] .pkg-est-val   { color: var(--brand-700); }
.pkg-card[data-tier="5"] .pkg-btn {
  background: linear-gradient(155deg, var(--brand-500) 0%, var(--brand-600) 100%);
  box-shadow: 0 2px 0 rgba(77,162,255,0.35), 0 6px 24px var(--hash-glow),
              inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -2px 0 rgba(0,0,0,0.12);
}

/* Tier 6 — 50M */
.pkg-card[data-tier="6"] {
  background: linear-gradient(155deg, var(--card) 0%, var(--bg) 50%, var(--bg2) 100%);
  border: 1px solid var(--border);
  box-shadow: 0 2px 0 rgba(77,162,255,0.18), 0 8px 32px rgba(0,0,0,0.30),
              inset 0 1px 0 rgba(255,255,255,0.05), inset 0 -1px 0 rgba(0,0,0,0.06);
}
.pkg-card[data-tier="6"] .pkg-name { color: var(--t1); }
.pkg-card[data-tier="6"]::before {
  background: linear-gradient(90deg, transparent, rgba(13,32,64,0.80), transparent);
}
.pkg-card[data-tier="6"] .pkg-icon {
  background: rgba(13,32,64,0.85); border-color: rgba(255,255,255,0.05);
}
.pkg-card[data-tier="6"] .pkg-icon svg { stroke: var(--brand-600); }
.pkg-card[data-tier="6"] .pkg-name-unit { color: var(--brand-600); }
.pkg-card[data-tier="6"] .pkg-est-val   { color: var(--brand-700); }
.pkg-card[data-tier="6"] .pkg-btn {
  background: linear-gradient(155deg, var(--brand-500) 0%, var(--brand-600) 100%);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 6px 18px rgba(0,0,0,0.45),
              inset 0 1px 0 rgba(255,255,255,0.30), inset 0 -1px 0 rgba(0,0,0,0.12);
}

/* Tier 7 — 50M */
.pkg-card[data-tier="7"] {
  background: linear-gradient(155deg, var(--bg) 0%, var(--bg2) 45%, #93CFFF 100%);
  border: 1px solid var(--border-h);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 12px 48px rgba(0,0,0,0.40),
              0 0 0 1px rgba(77,162,255,0.10),
              inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.pkg-card[data-tier="7"] .pkg-name { color: var(--t1); }
.pkg-card[data-tier="7"]::before {
  background: linear-gradient(90deg, transparent, rgba(77,162,255,0.85), transparent);
}
.pkg-card[data-tier="7"] .pkg-icon {
  background: rgba(13,32,64,0.85); border-color: rgba(77,162,255,0.40);
}
.pkg-card[data-tier="7"] .pkg-icon svg { stroke: var(--brand-600); }
.pkg-card[data-tier="7"] .pkg-name-unit { color: var(--brand-600); }
.pkg-card[data-tier="7"] .pkg-est-val   { color: var(--brand-700); }
.pkg-card[data-tier="7"] .pkg-btn {
  background: linear-gradient(155deg, var(--brand-500) 0%, var(--brand-600) 100%);
  box-shadow: 0 2px 0 rgba(77,162,255,0.35), 0 6px 24px var(--hash-glow),
              inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -2px 0 rgba(0,0,0,0.12);
}

/* Tier 8 — 100M */
.pkg-card[data-tier="8"] {
  background: linear-gradient(155deg, var(--bg) 0%, var(--bg2) 45%, #93CFFF 100%);
  border: 1px solid var(--border-h);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 12px 48px rgba(0,0,0,0.40),
              0 0 0 1px rgba(77,162,255,0.10),
              inset 0 1px 0 rgba(255,255,255,0.04), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.pkg-card[data-tier="8"] .pkg-name { color: var(--t1); }
.pkg-card[data-tier="8"]::before {
  background: linear-gradient(90deg, transparent, rgba(77,162,255,0.85), transparent);
}
.pkg-card[data-tier="8"] .pkg-icon {
  background: rgba(13,32,64,0.85); border-color: rgba(77,162,255,0.40);
}
.pkg-card[data-tier="8"] .pkg-icon svg { stroke: var(--brand-600); }
.pkg-card[data-tier="8"] .pkg-name-unit { color: var(--brand-600); }
.pkg-card[data-tier="8"] .pkg-est-val   { color: var(--brand-700); }
.pkg-card[data-tier="8"] .pkg-btn {
  background: linear-gradient(155deg, var(--brand-500) 0%, var(--brand-600) 100%);
  box-shadow: 0 2px 0 rgba(77,162,255,0.35), 0 6px 24px var(--hash-glow),
              inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -2px 0 rgba(0,0,0,0.12);
}

/* ── Tap-zone hint overlays ───────────────────────────────────── */
.pkg-tap-hint {
  position: absolute; top: 0; bottom: 0; width: 52%;
  display: flex; align-items: center;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
  z-index: 40;
}
.pkg-tap-hint.left  { left: 0;  justify-content: flex-start; padding-left: calc(var(--cq) * 0.06);
                      background: linear-gradient(90deg, rgba(0,0,0,0.18), transparent); }
.pkg-tap-hint.right { right: 0; justify-content: flex-end;   padding-right: calc(var(--cq) * 0.06);
                      background: linear-gradient(270deg, rgba(0,0,0,0.18), transparent); }
.pkg-tap-hint svg {
  width: calc(var(--cq) * 0.18); height: calc(var(--cq) * 0.18);
  stroke: rgba(255,255,255,0.95); stroke-width: 2;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45));
}
.pkg-tap-hint.visible { opacity: 1; }

/* top shimmer line — shared pseudo */
.pkg-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  pointer-events: none;
}

/* flying-off animation */
.pkg-card.swipe-left {
  transition: transform 0.32s ease, opacity 0.32s ease !important;
  transform: translateX(-130%) rotate(-18deg) !important;
  opacity: 0 !important;
}
.pkg-card.swipe-right {
  transition: transform 0.32s ease, opacity 0.32s ease !important;
  transform: translateX(130%) rotate(18deg) !important;
  opacity: 0 !important;
}


/* ── Card inner layout — all units = calc(var(--cq) * factor) ── */
/* --cq is set by JS to min(deckWidth, deckHeight), updated on resize */

.pkg-card-header {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: calc(var(--cq) * 0.03); width: 100%;
  position: relative;
}
.pkg-icon {
  width:  calc(var(--cq) * 0.13);
  height: calc(var(--cq) * 0.13);
  border-radius: calc(var(--cq) * 0.03);
  display: flex; align-items: center; justify-content: center;
}
.pkg-icon svg { width: 55%; height: 55%; stroke-width: 2; }

.pkg-badge {
  position: absolute; right: 0;
  font-size: calc(var(--cq) * 0.04); font-weight: 800;
  background: linear-gradient(135deg, var(--brand-600), var(--brand-700));
  color: #fff; border-radius: 99px;
  padding: calc(var(--cq) * 0.012) calc(var(--cq) * 0.04);
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.55);
}

.pkg-name {
  font-size: calc(var(--cq) * 0.22); font-weight: 900;
  letter-spacing: -0.04em; line-height: 1;
  margin-bottom: calc(var(--cq) * 0.01);
}
.pkg-name-unit {
  font-size: calc(var(--cq) * 0.055); font-weight: 700;
  letter-spacing: 0.15em; text-transform: uppercase;
  margin-bottom: calc(var(--cq) * 0.04);
}

/* ── Earnings table ───────────────────────────────────────────── */
.pkg-estimates {
  background: rgba(13,32,64,0.80);
  border-radius: calc(var(--cq) * 0.035);
  overflow: hidden;
  width: 100%;
  display: flex; flex-direction: column;
  flex: 1;
  margin-bottom: calc(var(--cq) * 0.04);
  justify-content: center;
}
.pkg-est-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(var(--cq) * 0.05);
  flex: 1;
}
.pkg-est-row + .pkg-est-row {
  border-top: 1px solid rgba(0,0,0,0.06);
}
.pkg-est-label {
  font-size: calc(var(--cq) * 0.045);
  color: var(--t3); letter-spacing: 0.08em; text-transform: uppercase;
}
.pkg-est-val {
  font-size: calc(var(--cq) * 0.056); font-weight: 700; text-align: right;
}
.pkg-est-val-sub {
  font-size: calc(var(--cq) * 0.038);
  color: var(--t3); text-align: right; margin-top: calc(var(--cq) * 0.005);
}

/* ── Buy button ───────────────────────────────────────────────── */
.pkg-btn {
  width: 100%;
  padding: calc(var(--cq) * 0.05) calc(var(--cq) * 0.06);
  border-radius: calc(var(--cq) * 0.04);
  font-size: calc(var(--cq) * 0.07); font-weight: 800; color: #fff;
  transition: opacity .15s, transform .1s;
  display: flex; align-items: center; justify-content: center;
  gap: calc(var(--cq) * 0.03);
  flex-shrink: 0;
}
.pkg-btn:active { opacity: .85; transform: scale(.98); }
.ton-btn-icon {
  width:  calc(var(--cq) * 0.09);
  height: calc(var(--cq) * 0.09);
  flex-shrink: 0; vertical-align: middle;
}

/* ════════════════════════════════════════════════════════════════
   WALLET PAGE
   ════════════════════════════════════════════════════════════════ */
.wallet-hero {
  text-align: center; padding: 28px 16px;
  background: linear-gradient(135deg, rgba(77,162,255,0.10), rgba(43,143,239,0.05));
  border-color: rgba(77,162,255,0.20);
  box-shadow: 0 0 60px rgba(26,111,204,0.12), 0 0 120px rgba(184,105,10,0.06);
}
.wallet-hero-label  {
  font-size: 11px; color: var(--t3); letter-spacing: 1.5px;
  text-transform: uppercase; margin-bottom: 10px;
}
.wallet-hero-amount {
  font-size: 52px; font-weight: 900; letter-spacing: -2px; line-height: 1;
}
.wallet-hero-unit  { font-size: 18px; font-weight: 700; color: var(--ton); margin: 4px 0 12px; }
.wallet-hero-sub   { font-size: 12px; color: var(--t3); }

.mine-hero-rates {
  display: flex; align-items: center; justify-content: center;
  gap: 0; margin-top: 0; width: 100%;
  background: rgba(255,255,255,0.30); border-radius: 10px; padding: 10px 0;
  border: 1px solid rgba(13,32,64,0.80);
  box-shadow: inset 0 1px 0 rgba(13,32,64,0.85), inset 0 -1px 0 rgba(0,0,0,0.06);
}
.mine-hero-rate-item {
  display: flex; flex-direction: column; align-items: center; flex: 1;
}
.mine-hero-rate-label {
  font-size: 10px; color: rgba(255,255,255,0.62); letter-spacing: 1.2px;
  text-transform: uppercase; margin-bottom: 4px;
}
.mine-hero-rate-val {
  font-size: 13px; font-weight: 700; color: #FFFFFF;
  text-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.mine-hero-rate-div {
  width: 1px; height: 28px; background: rgba(255,255,255,0.30); flex-shrink: 0;
}

.hashes-bal-row  { padding: 4px 0; }
.hashes-bal-row--centered { text-align: center; }
.hashes-bal-val  { font-size: 30px; font-weight: 800; color: var(--hash); margin-bottom: 4px; }
.hashes-bal-sub  { font-size: 13px; color: var(--t3); }

/* Mine hero action buttons */
.mine-hero-actions {
  display: flex; gap: 10px; margin-top: 14px; width: 100%;
}
.mine-hero-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 0; border-radius: 12px; font-size: 13px; font-weight: 700;
  cursor: pointer; border: none; transition: opacity 0.15s;
}
.mine-hero-btn svg { width: 15px; height: 15px; stroke-width: 2.5; }
.mine-hero-btn:active { opacity: 0.75; }
.mine-hero-btn--primary {
  background: linear-gradient(155deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: #fff;
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 4px 14px rgba(0,0,0,0.50),
              inset 0 1px 0 rgba(255,255,255,0.28), inset 0 -1px 0 rgba(0,0,0,0.12);
}
.mine-hero-btn--primary svg { stroke: #fff; }
.mine-hero-btn--secondary {
  background: rgba(0,0,0,0.25); color: rgba(255,255,255,0.80);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.mine-hero-btn--secondary svg { stroke: rgba(255,255,255,0.05); }

.wallet-btns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.wallet-btn {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s;
}
.wallet-btn:active { background: var(--surface-h); }
.wallet-btn.primary {
  background: rgba(77,162,255,0.12);
  border-color: rgba(77,162,255,0.35); color: var(--ton);
}

/* ════════════════════════════════════════════════════════════════
   LEADERBOARD PAGE  (gamified rewrite)
   ════════════════════════════════════════════════════════════════ */

/* Page layout */
.page--lb { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 16px); }

/* ── Banner ──────────────────────────────────────────────────────── */
.lb-banner {
  position: relative; overflow: hidden;
  margin: 0 -16px; padding: 28px 24px 22px;
  background: linear-gradient(150deg, #2B8FEF 0%, #0F4F99 100%);
  border-bottom: 1px solid rgba(77,162,255,0.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 4px 24px rgba(0,0,0,0.50);
}
.lb-banner-glow {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  width: 260px; height: 120px;
  background: radial-gradient(ellipse, rgba(255,215,0,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.lb-banner-content { position: relative; display: flex; align-items: center; gap: 14px; }
.lb-banner-icon {
  display: flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,215,0,0.18) 0%, rgba(255,215,0,0.04) 100%);
  border: 1.5px solid rgba(255,215,0,0.35);
  flex-shrink: 0;
  filter: drop-shadow(0 0 14px rgba(255,215,0,0.4));
}
.lb-banner-icon svg { width: 26px; height: 26px; stroke: #4DA2FF; stroke-width: 1.8; }
.lb-banner-title { font-size: 22px; font-weight: 900; letter-spacing: -0.3px; color: #fff; }
.lb-banner-sub   { font-size: 12px; color: rgba(255,255,255,0.72); margin-top: 2px; }

/* ── Podium ──────────────────────────────────────────────────────── */
.lb-podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 10px;
  padding: 24px 8px 8px;
  min-height: 190px;
}

/* podium slot */
.lb-pod {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; max-width: 110px;
  position: relative;
}

/* crown — in normal flow above the avatar-wrap, no absolute needed */
.lb-pod-crown {
  font-size: 20px; line-height: 1;
  text-align: center;
  margin-bottom: 2px;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.7));
}

/* wrapper: gives the medal a relative anchor WITHOUT overflow:hidden */
.lb-pod-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 8px;
  width: 56px; height: 56px;
}
.lb-pod--1st .lb-pod-avatar-wrap { width: 68px; height: 68px; }

/* avatar circle — overflow:hidden stays here, no positioned children inside */
.lb-pod-avatar {
  width: 100%; height: 100%; border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid rgba(255,255,255,0.1);
}
.lb-pod-avatar img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.lb-pod-avatar-initials {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
}
.lb-pod--1st .lb-pod-avatar-initials { font-size: 22px; }

/* medal badge — anchored to wrapper, fully visible outside the clipped circle */
.lb-pod-medal {
  position: absolute; bottom: -4px; right: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
  border: 2px solid var(--bg);
  z-index: 1;
}

/* name + username */
.lb-pod-name {
  font-size: 12px; font-weight: 700;
  text-align: center; max-width: 100px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--t1);
}
.lb-pod--1st .lb-pod-name { font-size: 13px; }
.lb-pod-user {
  font-size: 10px; color: var(--t3);
  text-align: center; max-width: 100px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 1px; margin-bottom: 6px;
}

/* power value */
.lb-pod-power {
  font-size: 11px; font-weight: 800;
  color: var(--lime-extra); letter-spacing: 0.2px;
  margin-bottom: 6px;
}

/* pedestal */
.lb-pod-pedestal {
  width: 100%; border-radius: 10px 10px 0 0;
  display: flex; align-items: center; justify-content: center;
  padding-top: 8px;
  font-size: 22px; font-weight: 900;
}
.lb-pod--1st .lb-pod-pedestal { height: 64px; }
.lb-pod--2nd .lb-pod-pedestal { height: 48px; }
.lb-pod--3rd .lb-pod-pedestal { height: 36px; }

/* pedestal colors */
.lb-pod--1st .lb-pod-avatar   { border-color: #4DA2FF; box-shadow: 0 0 18px rgba(255,215,0,0.5); }
.lb-pod--1st .lb-pod-pedestal { background: linear-gradient(180deg, #e6ac00 0%, #b8860b 100%); color: rgba(255,255,255,0.90); }
.lb-pod--1st .lb-pod-medal    { background: #4DA2FF; }

.lb-pod--2nd .lb-pod-avatar   { border-color: #9e9e9e; box-shadow: 0 0 12px rgba(120,120,120,0.35); }
.lb-pod--2nd .lb-pod-pedestal { background: linear-gradient(180deg, #757575 0%, #4a4a4a 100%); color: rgba(255,255,255,0.90); }
.lb-pod--2nd .lb-pod-medal    { background: #9e9e9e; }

.lb-pod--3rd .lb-pod-avatar   { border-color: #a0522d; box-shadow: 0 0 10px rgba(160,82,45,0.35); }
.lb-pod--3rd .lb-pod-pedestal { background: linear-gradient(180deg, #a0522d 0%, #7a3b1e 100%); color: rgba(255,255,255,0.90); }
.lb-pod--3rd .lb-pod-medal    { background: #cd7f32; }

/* self highlight */
.lb-pod--self .lb-pod-avatar { box-shadow: 0 0 0 3px rgba(77,162,255,0.60); }

/* ── User rank badge ─────────────────────────────────────────────── */
.lb-user-rank {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin: 10px 0 4px;
  background: rgba(77,162,255,0.10);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
}
.lb-user-rank-label {
  font-size: 11px; font-weight: 600; color: var(--t3); text-transform: uppercase; letter-spacing: 0.5px;
}
.lb-user-rank-val {
  font-size: 15px; font-weight: 800; color: var(--ton);
}
.lb-user-rank-total {
  font-size: 11px; font-weight: 500; color: var(--t3);
}

/* ── Pagination ──────────────────────────────────────────────────── */
.lb-pagination {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 0 4px;
}
.lb-page-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--ton-dim);
  border: 1px solid var(--border);
  color: var(--ton); font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.lb-page-btn:disabled { opacity: 0.3; pointer-events: none; }
.lb-page-btn:active { opacity: .7; }
.lb-page-info {
  font-size: 13px; font-weight: 600; color: var(--t2); min-width: 48px; text-align: center;
}

/* ── Rest of the list ────────────────────────────────────────────── */
.lb-rest-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 4px 8px;
}
.lb-rest-header-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--t3);
}

.lb-loading { text-align: center; padding: 32px; color: var(--t3); }

/* list rows */
.lb-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.20);
  transition: background 0.15s;
}
.lb-row.lb-self {
  background: rgba(77,162,255,0.10);
  border-color: var(--ton-glow);
}

/* rank number */
.lb-row-rank {
  font-size: 13px; font-weight: 800;
  min-width: 28px; text-align: center;
  color: var(--t3); flex-shrink: 0;
}

/* avatar circle */
.lb-row-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0;
  border: 1.5px solid rgba(77,162,255,0.14);
}
.lb-row-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-row-avatar-initials {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff;
}
.lb-self .lb-row-avatar { border-color: rgba(77,162,255,0.50); }

/* name + user */
.lb-row-info { flex: 1; min-width: 0; }
.lb-row-name {
  font-size: 13px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--t1);
}
.lb-row-user {
  font-size: 11px; color: var(--t3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* power + bar */
.lb-row-right { flex-shrink: 0; text-align: right; min-width: 72px; }
.lb-row-power {
  font-size: 15px; font-weight: 900;
  color: var(--lime-extra);
  letter-spacing: -0.3px;
}
.lb-row-bar-wrap {
  height: 3px; background: rgba(77,162,255,0.15);
  border-radius: 2px; margin-top: 4px; overflow: hidden;
}
.lb-row-bar {
  height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--ton) 0%, var(--brand-300) 100%);
  transition: width 0.5s ease;
}

/* self badge */
.lb-self-badge {
  font-size: 9px; font-weight: 700; letter-spacing: 0.5px;
  background: rgba(77,162,255,0.15); color: var(--ton);
  border: 1px solid rgba(77,162,255,0.28);
  border-radius: 4px; padding: 1px 4px;
  margin-left: 4px; vertical-align: middle;
}

/* ════════════════════════════════════════════════════════════════
   TEAM PAGE
   ════════════════════════════════════════════════════════════════ */

/* ── Rewards Hero ─────────────────────────────────────────────── */
.team-rewards-hero {
  border-radius: var(--radius);
  padding: 24px 20px 20px;
  background: linear-gradient(160deg, #2B8FEF 0%, #1A6FCC 55%, #040C18 100%);
  border: 1px solid rgba(77,162,255,0.30);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 8px 40px rgba(0,0,0,0.65),
              inset 0 1px 0 rgba(255,255,255,0.10), inset 0 -1px 0 rgba(0,0,0,0.18);
}
.team-rewards-label {
  font-size: 11px; color: rgba(255,255,255,0.65);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px;
}
.team-rewards-title {
  font-size: 30px; font-weight: 900; letter-spacing: -1px; line-height: 1.1;
  margin-bottom: 18px; color: #FFFFFF;
}
.team-rewards-pills {
  display: flex; gap: 8px;
}
.team-reward-pill {
  flex: 1;
  border-radius: 14px;
  padding: 12px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-align: center;
  border: 1px solid rgba(77,162,255,0.18);
}
/* pills contrastan sobre el fondo verde medio del hero */
.team-reward-pill:nth-child(1) {
  background: rgba(255,255,255,0.22);
  border-color: rgba(13,32,64,0.80);
}
.team-reward-pill:nth-child(2) {
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.30);
}
.team-reward-pill:nth-child(3) {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.20);
}
.trp-icon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.30);
  margin-bottom: 2px;
}
.team-reward-pill:nth-child(2) .trp-icon { background: rgba(255,255,255,0.22); }
.team-reward-pill:nth-child(3) .trp-icon { background: rgba(255,255,255,0.16); }
.trp-icon svg { stroke: var(--t1); width: 15px; height: 15px; stroke-width: 2.5; }
.team-reward-pill:nth-child(2) .trp-icon svg { stroke: var(--t1); }
.team-reward-pill:nth-child(3) .trp-icon svg { stroke: var(--t1); }
.trp-body { display: flex; flex-direction: column; align-items: center; gap: 0; }
.trp-val {
  font-size: 18px; font-weight: 900; letter-spacing: -0.5px; line-height: 1;
  color: #fff;
}
.team-reward-pill:nth-child(2) .trp-val { color: #fff; }
.team-reward-pill:nth-child(3) .trp-val { color: rgba(255,255,255,0.55); }
.trp-unit {
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  color: rgba(255,255,255,0.60); text-transform: uppercase;
}
.trp-desc {
  font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 2px;
}

/* ── Invite Card ──────────────────────────────────────────────── */
.team-hero-actions {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 16px;
}
.team-share-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(155deg, #2B8FEF 0%, #1A6FCC 100%);
  border-radius: 12px;
  padding: 13px 16px;
  font-size: 14px; font-weight: 700; color: #fff;
  border: 1px solid rgba(77,162,255,0.38);
  box-shadow: 0 2px 0 rgba(77,162,255,0.28), 0 6px 24px rgba(0,0,0,0.55),
              inset 0 1px 0 rgba(255,255,255,0.14), inset 0 -2px 0 rgba(0,0,0,0.18);
  transition: opacity .15s, transform .1s;
}
.team-share-btn svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 2.5; }
.team-share-btn:active { opacity: .85; transform: scale(.98); }

.team-copy-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: transparent;
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13px; font-weight: 600; color: var(--ton);
  border: 1px solid rgba(77,162,255,0.35);
  transition: opacity .15s, transform .1s;
}
.team-copy-btn svg { width: 15px; height: 15px; stroke: var(--ton); stroke-width: 2; }
.team-copy-btn:active { opacity: .75; transform: scale(.98); }

.team-ref-link-wrap {
  margin-top: 12px;
  text-align: center;
}
.team-ref-link-text {
  font-size: 10px; font-weight: 500;
  color: rgba(160,210,255,0.55);
  word-break: break-all;
  letter-spacing: 0.2px;
}

/* ── Stats Row ────────────────────────────────────────────────── */
/* ── Hero Divider ─────────────────────────────────────────────── */
.team-hero-divider {
  height: 1px;
  background: rgba(255,255,255,0.25);
  margin: 16px 0 0;
}

/* ── Hero Stats (inside hero card) ───────────────────────────── */
.team-hero-stats {
  display: flex; align-items: center;
  padding: 14px 0 0;
  gap: 0;
}
.ths-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-align: center;
}
.ths-val {
  font-size: 16px; font-weight: 900; line-height: 1; color: var(--t1);
}
.ths-val--valid   { color: var(--brand-300); }
.ths-val--invalid { color: rgba(160,210,255,0.45); }
.ths-val--power   { color: var(--brand-300); }
.ths-label {
  font-size: 9px; color: rgba(255,255,255,0.55);
  text-transform: uppercase; letter-spacing: .4px;
}
.ths-sep {
  width: 1px; height: 28px;
  background: rgba(255,255,255,0.22);
  flex-shrink: 0;
}

/* ── Team Section ─────────────────────────────────────────────── */
.team-section {
  display: flex; flex-direction: column; gap: 10px;
}
.team-section-header {
  display: flex; align-items: center; justify-content: space-between; padding: 0 2px;
}
.team-section-title {
  font-size: 13px; font-weight: 700; color: var(--t2);
  text-transform: uppercase; letter-spacing: 1px;
}
.team-section-badge {
  font-size: 11px; color: var(--t3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px 10px;
}

/* ── Tabs ─────────────────────────────────────────────────────── */
.team-tabs {
  display: flex; gap: 6px;
  background: var(--bg);
  border: 1px solid rgba(77,162,255,0.18);
  border-radius: 12px;
  padding: 4px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.team-tab {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 13px; font-weight: 600; color: var(--t3);
  transition: background .15s, color .15s;
}
.team-tab svg { width: 14px; height: 14px; stroke-width: 2; stroke: currentColor; }
.team-tab.active {
  background: rgba(77,162,255,0.15);
  color: var(--ton);
  border: 1px solid rgba(77,162,255,0.28);
}

/* ── Tab Panels ───────────────────────────────────────────────── */
.team-tab-panel { display: none; flex-direction: column; gap: 6px; }
.team-tab-panel.active { display: flex; }

/* ── List ─────────────────────────────────────────────────────── */
.team-list { display: flex; flex-direction: column; gap: 6px; }
.team-list-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 32px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--t3); font-size: 13px; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.20);
}
.team-list-empty svg { width: 28px; height: 28px; stroke: var(--t4); stroke-width: 1.5; }

/* ── Member Row ───────────────────────────────────────────────── */
.team-member-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.20);
}
.team-member-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: rgba(77,162,255,0.13);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--ton);
}
.team-member-avatar--photo {
  object-fit: cover; display: block;
  background: rgba(77,162,255,0.08);
}
.team-member-info { flex: 1; min-width: 0; }
.team-member-name {
  font-size: 14px; font-weight: 600; color: var(--t1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-member-meta { font-size: 11px; color: var(--t3); margin-top: 1px; }
.team-member-badge {
  font-size: 11px; font-weight: 700; flex-shrink: 0;
  padding: 3px 9px; border-radius: 8px;
}
.team-member-badge--valid {
  color: var(--ton); background: rgba(77,162,255,0.12); border: 1px solid var(--border);
}
.team-member-badge--pending {
  color: var(--t3); background: rgba(0,0,0,0.04); border: 1px solid rgba(0,0,0,0.08);
}
.team-member-badge--premium {
  color: var(--ton); background: var(--ton-dim); border: 1px solid rgba(77,162,255,0.30);
}

/* ── Log Row ──────────────────────────────────────────────────── */
.team-log-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.20);
}
.team-log-icon {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: rgba(77,162,255,0.12);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.team-log-icon svg { width: 14px; height: 14px; stroke: var(--ton); stroke-width: 2.5; }
.team-log-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: rgba(77,162,255,0.13);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--ton);
}
.team-log-avatar--photo {
  object-fit: cover; display: block;
  background: rgba(77,162,255,0.08);
}
.team-log-body { flex: 1; min-width: 0; }
.team-log-desc {
  font-size: 13px; font-weight: 500; color: var(--t1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.team-log-date { font-size: 11px; color: var(--t3); margin-top: 1px; }
.team-log-amount {
  font-size: 13px; font-weight: 800; color: var(--ton); flex-shrink: 0;
  display: flex; align-items: center; gap: 3px;
}
.team-log-amount svg { width: 12px; height: 12px; stroke: var(--ton); stroke-width: 2.5; }

/* ── Pagination ───────────────────────────────────────────────── */
.team-pagination {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 4px 0;
}
.team-pager-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--t2); font-size: 16px;
  transition: background .12s, color .12s;
}
.team-pager-btn:disabled { opacity: .3; pointer-events: none; }
.team-pager-btn:not(:disabled):active { background: rgba(77,162,255,0.12); }
.team-pager-info {
  font-size: 12px; color: var(--t3); min-width: 60px; text-align: center;
}

/* ════════════════════════════════════════════════════════════════
   SETTINGS PAGE
   ════════════════════════════════════════════════════════════════ */
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0;
}
.setting-info  { flex: 1; min-width: 0; }
.setting-label { font-size: 15px; font-weight: 600; }
.setting-sub   { font-size: 12px; color: var(--t3); margin-top: 2px; }
.setting-divider { height: 1px; background: var(--border); margin: 8px 0; }

.lang-toggle { display: flex; gap: 6px; flex-shrink: 0; }
.lang-btn {
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px; font-weight: 600; color: var(--t3);
  transition: all .15s;
}
.lang-btn.active {
  background: rgba(77,162,255,0.13);
  border-color: var(--ton-glow); color: var(--ton);
}

.setting-badge {
  font-size: 12px; font-weight: 700; border-radius: 99px; padding: 4px 12px; white-space: nowrap;
}
.hash-badge { background: var(--hash-dim); color: var(--hash); }
.ton-badge  { background: var(--ton-dim);  color: var(--ton);  }

.about-text { font-size: 13px; color: var(--t2); line-height: 1.6; }

/* ════════════════════════════════════════════════════════════════
   TASKS PAGE
   ════════════════════════════════════════════════════════════════ */
.tasks-hero { text-align: center; padding: 24px 0 8px; }
.tasks-hero-icon {
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 0 18px rgba(77,162,255,0.40));
}
.tasks-hero-icon svg    { width: 42px; height: 42px; stroke: var(--hash); stroke-width: 1.5; }
.tasks-hero-title { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.tasks-hero-sub   { font-size: 13px; color: var(--t3); margin-bottom: 12px; }

.tasks-referrals-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(77,162,255,0.10);
  border: 1px solid var(--border);
  border-radius: 99px; padding: 5px 14px;
  font-size: 13px; font-weight: 700; color: var(--hash);
}
.tasks-referrals-badge svg { width: 13px; height: 13px; stroke: var(--hash); }

/* ── Overall progress bar ── */
.tasks-overall-progress {
  margin: 4px 0 18px;
}
.tasks-overall-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--t3); margin-bottom: 6px;
}
.tasks-overall-label strong { color: var(--hash); font-weight: 800; }
.tasks-overall-bar {
  height: 6px; border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}
.tasks-overall-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-300));
  transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ── All-done state ── */
.tasks-all-done {
  text-align: center; padding: 32px 0 16px;
}
.tasks-all-done-icon {
  font-size: 44px; line-height: 1; margin-bottom: 10px;
}
.tasks-all-done-title {
  font-size: 18px; font-weight: 800; color: var(--hash); margin-bottom: 6px;
}
.tasks-all-done-sub { font-size: 13px; color: var(--t3); }

/* ── Task cards ── */
.task-card {
  background: #0D1B2E;
  border: 1px solid rgba(77,162,255,0.14);
  border-radius: var(--radius);
  padding: 16px;
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.45);
  transition: border-color .2s, opacity .3s, transform .3s;
}
.task-card.completed {
  opacity: .5;
  border-color: rgba(77,162,255,0.16);
}
.task-card.eligible:not(.completed) {
  border-color: rgba(77,162,255,0.40);
  background: linear-gradient(135deg, rgba(77,162,255,0.08), rgba(43,143,239,0.04));
  box-shadow: 0 2px 22px rgba(77,162,255,0.10);
}
/* pulse on eligible cards */
@keyframes task-eligible-pulse {
  0%, 100% { box-shadow: 0 2px 18px rgba(77,162,255,0.10); }
  50%       { box-shadow: 0 2px 22px rgba(77,162,255,0.22); }
}
.task-card.eligible:not(.completed) {
  animation: task-eligible-pulse 2.4s ease-in-out infinite;
}

/* claim pop animation */
@keyframes task-claim-pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.03); }
  100% { transform: scale(1); opacity: .5; }
}
.task-card.claiming {
  animation: task-claim-pop .4s ease forwards;
  pointer-events: none;
}

.task-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(77,162,255,0.10);
}
.task-icon svg          { width: 22px; height: 22px; stroke-width: 2.5; }
.task-card.completed .task-icon { background: var(--hash-dim); }
.task-card.completed .task-icon svg { stroke: var(--hash); }
.task-card:not(.completed) .task-icon.icon-channel svg { stroke: var(--ton); }
.task-card:not(.completed) .task-icon.icon-referral svg { stroke: var(--ton); }

/* ── CSS-drawn task icon: Dice (sponsor) ── */
.icon-sponsor { background: rgba(77,162,255,0.12); }
.icon-sponsor .ti-shape {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #4DA2FF, #d97706);
  border-radius: 7px;
  box-shadow: 0 4px 10px rgba(77,162,255,.4), inset 0 -2px 0 rgba(0,0,0,.15);
  display: grid;
  grid-template-areas:
    "a . c"
    ". g ."
    "d . b";
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  padding: 5px;
  box-sizing: border-box;
}
.icon-sponsor .ti-shape span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #fff;
  justify-self: center; align-self: center;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.2);
}
.icon-sponsor .ti-shape span:nth-child(1) { grid-area: a; }
.icon-sponsor .ti-shape span:nth-child(2) { grid-area: c; }
.icon-sponsor .ti-shape span:nth-child(3) { grid-area: g; }
.icon-sponsor .ti-shape span:nth-child(4) { grid-area: d; }
.icon-sponsor .ti-shape span:nth-child(5) { grid-area: b; }
.task-card.completed .icon-sponsor .ti-shape {
  background: var(--hash-dim);
  box-shadow: none;
}
.task-card.completed .icon-sponsor .ti-shape span { background: var(--hash); }

.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.task-reward {
  font-size: 12px; font-weight: 700; color: var(--ton);
  display: flex; align-items: center; gap: 4px;
}
.task-reward svg { width: 11px; height: 11px; stroke: var(--ton); stroke-width: 2.5; }

/* ── Referral progress bar inside card ── */
.task-progress-bar-wrap {
  margin-top: 7px;
}
.task-progress-bar-track {
  height: 4px; border-radius: 99px;
  background: var(--border); overflow: hidden; margin-bottom: 4px;
}
.task-progress-bar-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--ton), var(--brand-300));
  transition: width .5s ease;
}
.task-progress-text {
  font-size: 11px; color: var(--t3);
  display: flex; justify-content: space-between;
}
.task-progress-text .needed { color: var(--t4); }

.task-action { flex-shrink: 0; }
.task-btn {
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
  transition: opacity .15s, transform .1s;
}
.task-btn:active { transform: scale(.96); opacity: .85; }
.task-btn.claim  {
  background: linear-gradient(155deg, var(--brand-600), var(--brand-700));
  color: #fff;
  box-shadow: 0 2px 0 rgba(61,122,98,0.4), 0 4px 14px rgba(42,92,71,0.45),
              inset 0 1px 0 rgba(255,255,255,0.12);
}
.task-btn.join   {
  background: var(--ton-dim);
  border: 1px solid rgba(77,162,255,0.28); color: var(--ton);
}
.task-btn.locked {
  background: var(--surface); color: var(--t4);
  border: 1px solid var(--border); cursor: default;
  font-size: 11px;
}
.task-done-icon {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--hash-dim);
  display: flex; align-items: center; justify-content: center;
}
.task-done-icon svg { width: 16px; height: 16px; stroke: var(--hash); stroke-width: 2.5; }

/* ── Ad/Dice task card ── */
.task-card.type-sponsor:not(.sponsor-cooldown) {
  border-color: rgba(77,162,255,0.4);
  background: linear-gradient(135deg, rgba(77,162,255,0.08), rgba(77,162,255,0.02));
}
.task-icon.icon-sponsor svg { stroke: #4DA2FF; }
.task-card.type-sponsor .task-reward svg { stroke: #4DA2FF; }
.task-card.type-sponsor .task-reward { color: #4DA2FF; }
.task-btn.roll {
  background: linear-gradient(135deg, #4DA2FF, #d97706);
  color: #fff;
  box-shadow: 0 3px 14px rgba(77,162,255,.35);
}
.task-btn.sponsor-cooldown-btn {
  background: var(--surface); color: var(--t4);
  border: 1px solid var(--border); cursor: default;
  font-size: 10px; white-space: normal; text-align: center;
  max-width: 82px; line-height: 1.3; padding: 6px 10px;
}

/* ── Ad2/Dice2 task card (6h, purple accent) ── */
.task-card.type-sponsor2:not(.sponsor-cooldown) {
  border-color: rgba(139,92,246,0.4);
  background: linear-gradient(135deg, rgba(139,92,246,0.08), rgba(139,92,246,0.02));
}
.task-icon.icon-sponsor2 { background: rgba(139,92,246,0.12); }
.task-icon.icon-sponsor2 .ti-shape {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  border-radius: 7px;
  box-shadow: 0 4px 10px rgba(139,92,246,.4), inset 0 -2px 0 rgba(0,0,0,.15);
  display: grid;
  grid-template-areas:
    "a . c"
    ". g ."
    "d . b";
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  padding: 5px;
  box-sizing: border-box;
}
.task-icon.icon-sponsor2 .ti-shape span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #fff;
  justify-self: center; align-self: center;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.2);
  display: block;
}
.task-icon.icon-sponsor2 .ti-shape span:nth-child(1) { grid-area: a; }
.task-icon.icon-sponsor2 .ti-shape span:nth-child(2) { grid-area: c; }
.task-icon.icon-sponsor2 .ti-shape span:nth-child(3) { grid-area: g; }
.task-icon.icon-sponsor2 .ti-shape span:nth-child(4) { grid-area: d; }
.task-icon.icon-sponsor2 .ti-shape span:nth-child(5) { grid-area: b; }
.task-card.type-sponsor2 .task-reward svg { stroke: #8b5cf6; }
.task-card.type-sponsor2 .task-reward { color: #8b5cf6; }
.task-btn.roll2 {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  color: #fff;
  box-shadow: 0 3px 14px rgba(139,92,246,.35);
}
.dice2-overlay .dice-roll-btn {
  background: linear-gradient(135deg, #8b5cf6, #6d28d9);
  box-shadow: 0 3px 14px rgba(139,92,246,.35);
}

/* ══════════════════════════════════════════════════════════════
   AD VIEW MODAL (step 1)
   ══════════════════════════════════════════════════════════════ */
.sponsor-view-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: #000;
  display: flex; flex-direction: column;
}
.sponsor-view-sheet {
  display: flex; flex-direction: column;
  width: 100%; height: 100%;
}
.sponsor-view-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px;
  background: var(--surface);
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sponsor-view-title {
  font-size: 13px; font-weight: 700; color: var(--t3);
  letter-spacing: .06em; text-transform: uppercase;
}
.sponsor-view-countdown {
  font-size: 13px; font-weight: 800; color: #4DA2FF;
  background: rgba(77,162,255,.12);
  padding: 3px 10px; border-radius: 20px;
  min-width: 44px; text-align: center;
}
.sponsor-iframe-wrap {
  flex: 1; position: relative; overflow: hidden;
}
#ad-iframe {
  width: 100%; height: 100%; border: none; display: block;
  background: #fff;
}
.sponsor-iframe-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px; padding: 32px;
  background: var(--surface);
}
.sponsor-fallback-icon { font-size: 48px; }
.sponsor-fallback-text {
  font-size: 15px; color: var(--t2); text-align: center; line-height: 1.5;
}
.sponsor-fallback-btn {
  display: inline-block;
  padding: 14px 32px;
  background: linear-gradient(135deg, #4DA2FF, #d97706);
  color: #fff; font-size: 15px; font-weight: 800;
  border-radius: 14px; text-decoration: none;
  box-shadow: 0 4px 18px rgba(77,162,255,.4);
}
.sponsor-view-close-btn {
  flex-shrink: 0;
  width: 100%; padding: 18px 16px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--surface);
  border-top: 1px solid rgba(255,255,255,.08);
  color: #fff; font-size: 16px; font-weight: 800;
  border-radius: 0;
  transition: background .2s, opacity .2s;
}
.sponsor-view-close-btn:not(:disabled) {
  background: linear-gradient(135deg, #4DA2FF, #d97706);
  box-shadow: 0 -4px 24px rgba(77,162,255,.25);
}
.sponsor-view-close-btn:disabled { opacity: .55; cursor: default; }

/* ══════════════════════════════════════════════════════════════
   DICE MODAL
   ══════════════════════════════════════════════════════════════ */
.dice-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.65);
  display: none; align-items: center; justify-content: center;
  padding: 20px 16px;
}
.dice-sheet {
  position: relative; width: 100%; max-width: 400px;
  background: var(--card);
  border: 1px solid rgba(77,162,255,0.30);
  border-radius: 28px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 12px 64px rgba(0,0,0,0.45), 0 2px 0 rgba(77,162,255,0.22);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.dice-header {
  position: relative; text-align: center;
  width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin-bottom: 2px;
}
.dice-title { font-size: 24px; font-weight: 900; line-height: 1.1; color: var(--text1); text-align: center; width: 100%; }
.dice-close {
  position: absolute; top: -16px; right: -12px;
  background: rgba(0,0,0,0.05); border: none; width: 32px; height: 32px; border-radius: 50%;
  color: var(--t3); font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; z-index: 10;
}
.dice-close:active { background: rgba(0,0,0,0.1); }
.dice-sub { font-size: 14px; color: var(--t2); margin-bottom: 24px; font-weight: 500; text-align: center; width: 100%; }

/* ── The dice ── */
.dice-wrap {
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px; height: 100px;
}
.dice {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, #4DA2FF, #d97706);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(77,162,255,.4), inset 0 -4px 0 rgba(0,0,0,.15);
  position: relative;
  transition: transform .1s;
}
.dice-face {
  position: absolute; inset: 0;
  display: none; padding: 14px; box-sizing: border-box;
  grid-template-areas:
    "a . c"
    "e g f"
    "d . b";
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
}
.dice-face.active { display: grid; }
.dice-face span {
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  justify-self: center; align-self: center;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,0.15), 0 2px 4px rgba(0,0,0,0.3);
}

.dice-face.face-1 span:nth-child(1) { grid-area: g; width: 18px; height: 18px; }

.dice-face.face-2 span:nth-child(1) { grid-area: a; }
.dice-face.face-2 span:nth-child(2) { grid-area: b; }

.dice-face.face-3 span:nth-child(1) { grid-area: a; }
.dice-face.face-3 span:nth-child(2) { grid-area: g; }
.dice-face.face-3 span:nth-child(3) { grid-area: b; }

.dice-face.face-4 span:nth-child(1) { grid-area: a; }
.dice-face.face-4 span:nth-child(2) { grid-area: c; }
.dice-face.face-4 span:nth-child(3) { grid-area: d; }
.dice-face.face-4 span:nth-child(4) { grid-area: b; }

.dice-face.face-5 span:nth-child(1) { grid-area: a; }
.dice-face.face-5 span:nth-child(2) { grid-area: c; }
.dice-face.face-5 span:nth-child(3) { grid-area: g; }
.dice-face.face-5 span:nth-child(4) { grid-area: d; }
.dice-face.face-5 span:nth-child(5) { grid-area: b; }

.dice-face.face-6 span:nth-child(1) { grid-area: a; }
.dice-face.face-6 span:nth-child(2) { grid-area: c; }
.dice-face.face-6 span:nth-child(3) { grid-area: e; }
.dice-face.face-6 span:nth-child(4) { grid-area: f; }
.dice-face.face-6 span:nth-child(5) { grid-area: d; }
.dice-face.face-6 span:nth-child(6) { grid-area: b; }

@keyframes dice-shake {
  0%   { transform: rotate(0deg) scale(1); }
  15%  { transform: rotate(-18deg) scale(1.08); }
  30%  { transform: rotate(14deg) scale(1.12); }
  45%  { transform: rotate(-10deg) scale(1.1); }
  60%  { transform: rotate(8deg) scale(1.06); }
  75%  { transform: rotate(-5deg) scale(1.03); }
  90%  { transform: rotate(3deg) scale(1.01); }
  100% { transform: rotate(0deg) scale(1); }
}
.dice.rolling { animation: dice-shake .7s ease-in-out forwards; }

.dice-reward-text {
  font-size: 28px; font-weight: 900; color: #4DA2FF;
  min-height: 36px; margin-bottom: 8px;
  opacity: 0; transform: scale(.7);
  transition: opacity .3s ease, transform .3s ease;
  line-height: 1;
}
.dice-reward-text.show { opacity: 1; transform: scale(1); min-height: 36px; margin-bottom: 8px; }

.dice-prize-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  width: 100%; margin-bottom: 24px; margin-top: 10px;
  background: rgba(255,255,255,0.35); padding: 10px; border-radius: 20px;
}
.dice-prize-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; padding: 8px 4px; border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.20); border: 1px solid var(--ton-dim);
}
.dice-prize-item .face { font-size: 13px; font-weight: 800; color: var(--t2); margin-bottom: 2px; display:flex; align-items: center; gap: 4px; }
.dice-prize-item .face span { font-size: 15px; }
.dice-prize-item .reward { font-size: 15px; font-weight: 900; color: #4DA2FF; }

.dice-roll-btn {
  width: 100%; padding: 18px;
  background: linear-gradient(135deg, #4DA2FF, #d97706);
  color: #fff; font-size: 18px; font-weight: 900;
  border-radius: 16px; border: none;
  box-shadow: 0 6px 20px rgba(77,162,255,.35), inset 0 -3px 0 rgba(0,0,0,.15);
  transition: opacity .15s, transform .1s; cursor: pointer;
}
.dice-roll-btn:active { transform: scale(.97); opacity: .9; box-shadow: 0 2px 10px rgba(77,162,255,.35), inset 0 -1px 0 rgba(0,0,0,.15); }
.dice-roll-btn:disabled { opacity: .6; pointer-events: none; filter: grayscale(50%); }

/* ════════════════════════════════════════════════════════════════
   FRUIT SLOT MACHINE MODAL  —  mirrors dice-overlay / dice-sheet
   ════════════════════════════════════════════════════════════════ */
.slot-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.65);
  display: none; align-items: center; justify-content: center;
  padding: 20px 16px;
}
.slot-overlay.open { display: flex; }

.slot-sheet {
  position: relative; width: 100%; max-width: 400px;
  background: var(--card);
  border: 1px solid rgba(77,162,255,0.30);
  border-radius: 28px;
  padding: 32px 24px 28px;
  text-align: center;
  box-shadow: 0 12px 64px rgba(0,0,0,0.45), 0 2px 0 rgba(77,162,255,0.22);
  display: flex; flex-direction: column; align-items: center; gap: 0;
}

.slot-header {
  position: relative; width: 100%;
  display: flex; flex-direction: column; align-items: center;
  margin-bottom: 2px;
}
.slot-title {
  font-size: 24px; font-weight: 900; line-height: 1.1;
  color: var(--t1); text-align: center; width: 100%;
}
.slot-close {
  position: absolute; top: -16px; right: -12px;
  background: rgba(0,0,0,0.05); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  color: var(--t3); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s; z-index: 10;
}
.slot-close:active { background: rgba(0,0,0,0.1); }

.slot-sub {
  font-size: 14px; color: var(--t2); font-weight: 500;
  text-align: center; width: 100%; margin-bottom: 18px;
}

/* ── Prize grid — mirrors dice-prize-grid ── */
.slot-prize-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  width: 100%; margin-bottom: 20px;
  background: rgba(255,255,255,0.35); padding: 10px; border-radius: 20px;
}
.slot-prize-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: #fff; padding: 8px 4px; border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.20);
  border: 1px solid var(--ton-dim);
}
.slot-prize-item.slot-prize--star {
  border-color: rgba(77,162,255,0.4);
  background: linear-gradient(135deg,#fffbeb,#fef3c7);
}
.slot-prize-symbols {
  font-size: 14px; letter-spacing: -1px; margin-bottom: 3px; line-height: 1;
}
.slot-prize-symbols--small {
  font-size: 11px; font-weight: 800; color: var(--t2); letter-spacing: 0;
}
.slot-prize-reward { font-size: 13px; font-weight: 900; color: #4DA2FF; }

/* ── Reel area — mirrors dice-wrap ── */
.slot-wrap {
  position: relative; width: 100%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
}
.slot-machine-body {
  display: flex; align-items: center; justify-content: center; gap: 0;
  background: linear-gradient(145deg, #0F2040, var(--brand-700));
  border-radius: 20px; padding: 16px 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.06);
  width: 100%;
}
.slot-reel-box {
  flex: 1; height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 42px; line-height: 1;
  background: rgba(255,255,255,.07); border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  user-select: none; overflow: hidden;
}
.slot-reel-box span { display: block; transition: transform .08s; }
.slot-reel-box.spinning span { animation: reelSpin .09s linear infinite; }
.slot-reel-box.landed span  { animation: reelLand .35s cubic-bezier(.17,.67,.3,1.4) forwards; }
@keyframes reelSpin {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  40%  { transform: translateY(-8px) scale(.85); opacity: .5; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes reelLand {
  0%   { transform: scale(.6) translateY(-10px); }
  65%  { transform: scale(1.18) translateY(3px); }
  100% { transform: scale(1) translateY(0); }
}
.slot-reel-divider {
  width: 2px; height: 50px; margin: 0 4px;
  background: rgba(255,255,255,.10); border-radius: 2px; flex-shrink: 0;
}
.slot-payline {
  position: absolute; left: 14px; right: 14px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(77,162,255,.6), transparent);
  border-radius: 2px; pointer-events: none;
}

/* ── Result texts — same as dice ── */
.slot-result-text {
  font-size: 16px; font-weight: 700; color: var(--t2);
  text-align: center; min-height: 22px; margin-bottom: 2px;
}
.slot-result-text.win  { color: var(--lime-deep); }
.slot-result-text.lose { color: var(--t3); }

.slot-reward-text {
  font-size: 28px; font-weight: 900; color: #4DA2FF;
  min-height: 36px; margin-bottom: 8px;
  opacity: 0; transform: scale(.7);
  transition: opacity .3s ease, transform .3s ease; line-height: 1;
}
.slot-reward-text.show { opacity: 1; transform: scale(1); }

/* ── Task card ── */
.icon-slot { background: var(--ton-dim); }
.slot-card-emoji { font-size: 22px; }
.type-slot { border-left: 3px solid var(--brand-500); }

/* ── Result modal ── */
.slot-result-sheet {
  gap: 10px;
}
.slot-result-reels {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(145deg, #0F2040, var(--brand-700));
  border-radius: 20px; padding: 18px 20px;
  width: 100%;
  box-shadow: 0 8px 28px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.06);
  margin-bottom: 4px;
}
.slot-result-reels span {
  font-size: 48px; line-height: 1;
  background: rgba(255,255,255,.07); border-radius: 12px;
  width: 76px; height: 76px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.08);
}
.slot-result-badge {
  font-size: 32px; font-weight: 900; line-height: 1.1;
  text-align: center;
}
.slot-result-badge.win  { color: var(--lime-deep); }
.slot-result-badge.lose { color: var(--t2); font-size: 24px; }
.slot-result-power {
  font-size: 36px; font-weight: 900; color: #4DA2FF;
  text-align: center; line-height: 1;
  opacity: 0; transform: scale(.7);
  transition: opacity .35s ease, transform .35s ease;
  min-height: 0;
}
.slot-result-power.show { opacity: 1; transform: scale(1); min-height: 44px; }
.slot-result-msg {
  font-size: 14px; color: var(--t2); text-align: center;
  font-weight: 500; padding: 0 8px; line-height: 1.4;
}
.slot-result-timer-label {
  font-size: 11px; color: var(--t3); text-align: center;
  text-transform: uppercase; letter-spacing: .06em; margin-top: 6px;
}
.slot-result-timer {
  font-size: 28px; font-weight: 900; color: var(--t1);
  text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.slot-result-close-btn { margin-top: 6px; }

/* ════════════════════════════════════════════════════════════════
   TAB BAR
   ════════════════════════════════════════════════════════════════ */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex; align-items: stretch;
  background: rgba(4,12,24,0.98);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-top: 1px solid rgba(77,162,255,0.25);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.40);
  overflow: visible;
}
.tab-main-spacer { flex: 1; }
.tab-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 4px 2px 8px;
  color: var(--t2);
  transition: color .2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}
.tab-btn::before {
  content: '';
  position: absolute; top: 0; left: 25%; right: 25%;
  height: 2px; border-radius: 0 0 3px 3px;
  background: var(--ton);
  transform: scaleX(0);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1);
}
.tab-btn.active        { color: var(--ton); }
.tab-btn.active::before{ transform: scaleX(1); }
.tab-icon  { display: flex; align-items: center; justify-content: center; line-height: 1; }
.tab-label { font-size: 10px; font-weight: 600; letter-spacing: .3px; }

/* ── Power (main) floating button ─────────────────────────────── */
@keyframes pickaxe-swing {
  from { transform: rotate(-45deg); }
  to   { transform: rotate(0deg); }
}
.tab-btn--main {
  position: absolute;
  left: 50%;
  bottom: env(safe-area-inset-bottom, 0px);
  transform: translateX(-50%);
  flex: unset;
  width: 56px;
  display: flex; flex-direction: column; align-items: center;
  gap: 0; padding: 0 0 6px;
  color: var(--ton);
}
.tab-btn--main::before { display: none; }
.tab-main-circle {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, #4DA2FF, #2B8FEF);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 3px rgba(77,162,255,0.22), 0 2px 0 rgba(77,162,255,0.45),
              0 0 28px var(--ton-glow), 0 6px 18px rgba(0,0,0,0.30),
              inset 0 1px 0 rgba(255,255,255,0.40);
  transform: translateY(-14px);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
}
.tab-main-circle svg { width: 24px; height: 24px; stroke: none; fill: #fff; }
.tab-btn--main .tab-icon {
  animation: pickaxe-swing .5s cubic-bezier(.34,1.56,.64,1) both;
}
.tab-btn--main .tab-label {
  margin-top: -8px;
  color: var(--t2);
  transition: color .2s;
}
.tab-btn--main.active .tab-main-circle {
  box-shadow: 0 0 0 3px rgba(77,162,255,0.25), 0 0 28px var(--border-h), 0 6px 16px rgba(0,0,0,0.12);
  transform: translateY(-16px) scale(1.05);
}
.tab-btn--main.active .tab-label { color: var(--ton); }

/* ════════════════════════════════════════════════════════════════
   WITHDRAW MODAL
   ════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px 16px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-overlay.open .modal-sheet { transform: scale(1); }

.modal-sheet {
  position: relative; width: 100%; max-width: 420px;
  background: var(--card);
  border: 1px solid rgba(77,162,255,0.30);
  border-radius: 24px;
  padding: 20px 20px 24px;
  transform: scale(0.94);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.45), 0 2px 0 rgba(77,162,255,0.22);
}
.modal-handle { display: none; }
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(13,32,64,0.85); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--t2);
}
.modal-title { font-size: 20px; font-weight: 800; }
.modal-sub   { font-size: 13px; color: var(--t3); margin-top: -8px; }

.form-group  { display: flex; flex-direction: column; gap: 6px; }
.form-label  {
  font-size: 11px; font-weight: 700; letter-spacing: .8px;
  color: var(--t3); text-transform: uppercase;
}
.form-optional { font-weight: 400; color: var(--t4); }
.form-input {
  background: #0A1525;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 14px; font-size: 15px;
  outline: none; width: 100%;
  transition: border-color .2s;
}
.form-input:focus { border-color: var(--border-h); }
.form-hint  { font-size: 12px; color: var(--ton); min-height: 16px; }
.form-hint--error { color: #f87171; }
.form-input--error { border-color: rgba(248,113,113,0.6) !important; }

/* ── Payment Modal ─────────────────────────────────────────── */
.pay-sheet {
  gap: clamp(6px, 2vh, 12px);
  max-height: 92dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Hero — icon + package + amount */
.pay-hero {
  display: flex; flex-direction: column; align-items: center; gap: clamp(1px, 0.5vh, 4px);
  padding-bottom: 0;
}
.pay-hero-icon {
  width: clamp(36px, 8vw, 48px); height: clamp(36px, 8vw, 48px);
  border-radius: 14px; margin-bottom: clamp(2px, 0.8vh, 6px);
  background: linear-gradient(135deg, rgba(77,162,255,0.15), rgba(0,0,0,0.25));
  border: 1px solid rgba(77,162,255,0.35);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 20px rgba(77,162,255,0.18);
}
.pay-hero-icon svg { width: clamp(18px, 4vw, 24px); height: clamp(18px, 4vw, 24px); stroke: var(--ton); stroke-width: 2; }
.pay-hero-title  { font-size: clamp(14px, 4vw, 18px); font-weight: 800; color: var(--t1); letter-spacing: -.3px; }
.pay-hero-amount { font-size: clamp(20px, 6vw, 28px); font-weight: 900; color: var(--ton); letter-spacing: -.5px; }

/* TON Connect — secondary footer */
.pay-tonconnect-btn {
  width: 100%; padding: clamp(9px, 2vh, 13px) 16px;
  background: rgba(77,162,255,0.10);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600; color: var(--brand-600);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .15s, transform .1s, background .15s;
}
.pay-tonconnect-btn:active { opacity: .8; transform: scale(.98); background: rgba(77,162,255,0.15); }
.pay-tonconnect-btn svg { flex-shrink: 0; }


/* QR centered */
.pay-qr-center {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pay-qr-img {
  width: clamp(72px, 22vw, 104px); height: clamp(72px, 22vw, 104px);
  border-radius: 10px; background: #fff; object-fit: contain;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border: 3px solid #fff; padding: 2px;
}

/* Field rows */
.pay-field {
  width: 100%; display: flex; flex-direction: column; gap: 5px;
}
.pay-field-label {
  font-size: 10px; font-weight: 700; color: var(--t3);
  letter-spacing: 1px; text-transform: uppercase;
  display: flex; align-items: center; gap: 5px;
}
.pay-field-label svg { width: 12px; height: 12px; stroke: #fbbf24; stroke-width: 2.5; flex-shrink: 0; }
.pay-field-row {
  display: flex; align-items: center; gap: 8px;
  background: rgba(13,32,64,0.85);
  border: 1px solid var(--border);
  border-radius: 12px; padding: clamp(6px, 1.5vh, 10px) 12px;
}
.pay-field--memo .pay-field-row {
  background: rgba(251,191,36,0.10);
  border-color: rgba(251,191,36,0.35);
}
.pay-field-val {
  flex: 1; font-size: 12px; font-weight: 600; color: var(--t1);
  word-break: break-all; line-height: 1.4;
}
.pay-field-val--memo {
  font-size: clamp(16px, 5vw, 22px); font-weight: 900; color: #fbbf24;
  letter-spacing: 2px; word-break: normal;
}
.pay-field-copy {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: rgba(77,162,255,0.12); border: 1px solid rgba(77,162,255,0.22);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s, transform .1s;
}
.pay-field-copy svg { width: 15px; height: 15px; stroke: var(--ton); stroke-width: 2.2; }
.pay-field-copy:active { opacity: .7; transform: scale(.92); }
.pay-field-copy--memo {
  background: rgba(251,191,36,0.1);
  border-color: rgba(251,191,36,0.3);
}
.pay-field-copy--memo svg { stroke: #fbbf24; }
.pay-memo-warning {
  font-size: 11px; font-weight: 600;
  color: #fbbf24;
  background: rgba(251,191,36,0.12);
  border: 1px solid rgba(251,191,36,0.40);
  border-radius: 8px;
  padding: 6px 10px;
  line-height: 1.4;
}

.pay-footer-note {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 11px; color: var(--t4); text-align: center;
}
.pay-footer-note svg { width: 13px; height: 13px; stroke: var(--t4); flex-shrink: 0; }

.submit-btn {
  width: 100%; padding: 16px;
  background: linear-gradient(155deg, var(--brand-500) 0%, var(--brand-600) 100%);
  border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 700; color: #fff;
  box-shadow: 0 2px 0 rgba(77,162,255,0.35), 0 6px 22px rgba(0,0,0,0.50),
              inset 0 1px 0 rgba(255,255,255,0.30), inset 0 -2px 0 rgba(0,0,0,0.12);
  transition: opacity .15s, transform .1s;
}
.submit-btn:active   { transform: scale(.98); opacity: .9; }
.submit-btn:disabled { opacity: .55; }

/* ── Withdraw multi-step modal ──────────────────────────────── */
.wd-overlay {
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wd-overlay .wd-sheet {
  transform: scale(.88) translateY(0);
  transition: transform .35s cubic-bezier(0.22,1,0.36,1), opacity .3s ease;
  opacity: 0;
  border-radius: 24px;
  width: 100%; max-width: 380px;
  padding: 20px 20px 24px;
  gap: 0;
}
.wd-overlay.open .wd-sheet {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.wd-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; width: 100%; text-align: center;
}

/* Icon */
.wd-icon-wrap { margin-bottom: 4px; }
.wd-icon {
  width: 64px; height: 64px; border-radius: 20px;
  background: linear-gradient(135deg, rgba(77,162,255,0.15), rgba(0,0,0,0.20));
  border: 1px solid rgba(77,162,255,0.30);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(77,162,255,0.15);
}
.wd-icon svg { width: 28px; height: 28px; stroke: var(--ton); stroke-width: 2; }
.wd-icon--ton { background: transparent; border-color: transparent; box-shadow: none; }
.wd-icon--ton svg { width: 56px; height: 56px; stroke: none; }
.wd-icon--progress svg { animation: wd-spin 1s linear infinite; }
@keyframes wd-spin { to { transform: rotate(360deg); } }

/* Titles */
.wd-title { font-size: 20px; font-weight: 800; color: var(--t1); }
.wd-step-header {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
}
.wd-step-header .wd-title { flex: 1; }
.wd-back-btn {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--t2);
}
.wd-back-btn svg { width: 15px; height: 15px; stroke-width: 2.5; }
.wd-step-sub { font-size: 13px; color: var(--t3); line-height: 1.5; text-align: left; width: 100%; }

/* Rate info box */
.wd-rate-box {
  width: 100%;
  background: rgba(77,162,255,0.08);
  border: 1px solid rgba(77,162,255,0.15);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.wd-rate-row {
  display: flex; align-items: center; justify-content: space-between;
}
.wd-rate-label { font-size: 12px; color: var(--t3); }
.wd-rate-val   { font-size: 13px; font-weight: 700; color: var(--t1); }
.wd-receive-val { font-size: 16px; color: var(--ton); }
.wd-rate-divider { height: 1px; background: rgba(77,162,255,0.15); }
.wd-min-label { font-size: 11px; }
.wd-min-val   { font-size: 12px; color: var(--t3); }

/* Notice */
.wd-notice {
  font-size: 11px; color: rgba(251,191,36,0.7);
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.18);
  border-radius: 10px; padding: 8px 12px;
  line-height: 1.4; width: 100%; text-align: left;
}

/* Progress bar */
.wd-progress-bar-wrap {
  width: 100%; height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 99px; overflow: hidden;
}
.wd-progress-bar {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-300));
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}
.wd-progress-sub { font-size: 13px; color: var(--t3); line-height: 1.5; }

/* form-group inside steps needs left alignment */
.wd-step .form-group { width: 100%; text-align: left; }

/* ════════════════════════════════════════════════════════════════
   TOAST
   ════════════════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: calc(var(--tab-h) + 16px);
  left: 50%; transform: translateX(-50%) translateY(10px);
  z-index: 300;
  background: rgba(20,12,3,0.97);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 10px 20px;
  font-size: 14px; font-weight: 600; color: var(--t1);
  white-space: nowrap;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  box-shadow: 0 8px 36px rgba(0,0,0,0.60), 0 0 0 1px rgba(77,162,255,0.08);
}
.toast.show    { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--ton-glow);  color: var(--brand-400); }
.toast.error   { border-color: rgba(248,113,113,0.35); color: #ef5350; }

/* ════════════════════════════════════════════════════════════════
   ALERT MODAL  —  mirrors slot-overlay / slot-sheet / dice-roll-btn
   ════════════════════════════════════════════════════════════════ */
.alert-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.65);
  display: none; align-items: center; justify-content: center;
  padding: 20px 16px;
}
.alert-overlay.open { display: flex; }

.alert-sheet {
  position: relative; width: 100%; max-width: 400px;
  background: var(--card);
  border: 1px solid rgba(77,162,255,0.30);
  border-radius: 28px;
  padding: 24px 24px 28px;
  text-align: center;
  box-shadow: 0 12px 64px rgba(0,0,0,0.45), 0 2px 0 rgba(77,162,255,0.22);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}

/* ── Dark display section at top — same dark green as slot-result-reels ── */
.alert-display {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: linear-gradient(145deg, #0F2040, var(--brand-700));
  border-radius: 20px; padding: 22px 20px;
  width: 100%;
  box-shadow: 0 8px 28px rgba(0,0,0,.35), inset 0 2px 0 rgba(255,255,255,.06);
  margin-bottom: 2px;
}
.alert-overlay.type-error .alert-display { background: linear-gradient(145deg, #0a0e2e, #121a4a); }
.alert-overlay.type-info  .alert-display { background: linear-gradient(145deg, #0F2040, #4a2e0c); }

.alert-display-icon { font-size: 52px; line-height: 1; }

.alert-display-power {
  font-size: 36px; font-weight: 900; color: #4DA2FF;
  line-height: 1;
}
.alert-display-power:empty { display: none; }

/* ── Text below display box ── */
.alert-badge {
  font-size: 20px; font-weight: 900; color: var(--t1);
  line-height: 1.2; padding: 0 4px;
}
.alert-badge:empty { display: none; }

.alert-msg {
  font-size: 14px; color: var(--t2); font-weight: 500;
  text-align: center; padding: 0 8px; line-height: 1.4;
}
.alert-msg:empty { display: none; }

/* ── CTA — full-width golden dice button ── */
.alert-ok-btn { width: 100%; margin-top: 4px; }

/* ── Input modal ── */
.input-modal-input {
  width: 100%; box-sizing: border-box;
  background: var(--bg2); border: 1.5px solid var(--border-h);
  border-radius: 14px; padding: 12px 14px;
  font-size: 13px; color: var(--t1); font-family: inherit;
  outline: none; transition: border-color .2s;
}
.input-modal-input:focus { border-color: var(--lime-mid); }
.input-modal-input::placeholder { color: var(--t3); }
.input-modal-error {
  font-size: 12px; color: #e05252; font-weight: 600;
  min-height: 16px; text-align: center;
}

/* ════════════════════════════════════════════════════════════════
   KEYFRAMES
   ════════════════════════════════════════════════════════════════ */
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1);    opacity: 1;   }
  50%       { transform: scale(1.08); opacity: .85; }
}
@keyframes shine {
  0%   { left: -100%; }
  45%  { left: 130%;  }
  100% { left: 130%;  }
}
@keyframes loading-bar {
  0%   { width: 0%;   margin-left: 0%;   }
  50%  { width: 70%;  margin-left: 15%;  }
  100% { width: 0%;   margin-left: 100%; }
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0);    }
}
@keyframes ps-ring-pulse {
  0%   { transform: scale(1);    opacity: .6; }
  60%  { transform: scale(1.55); opacity: 0;  }
  100% { transform: scale(1.55); opacity: 0;  }
}
@keyframes ps-icon-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  65%  { transform: scale(1.2); opacity: 1; }
  80%  { transform: scale(0.9); }
  100% { transform: scale(1);   }
}
@keyframes ps-burst-dot {
  0%   { transform: translate(-50%,-50%) scale(0) rotate(var(--a)); opacity: 1; }
  70%  { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1) rotate(var(--a)); opacity: 0; }
}
@keyframes ps-slide-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes ps-stats-in {
  from { opacity: 0; transform: scale(.93) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ════════════════════════════════════════════════════════════════
   POWER SUCCESS MODAL
   ════════════════════════════════════════════════════════════════ */

/* Override overlay to center instead of footer-align */
#power-success-modal {
  align-items: center;
  justify-content: center;
  padding: 20px;
}
/* Reset the base bottom-sheet slide and use scale-in instead */
#power-success-modal .ps-sheet {
  transform: scale(.88) translateY(0);
  transition: transform .35s cubic-bezier(0.22,1,0.36,1), opacity .3s ease;
  opacity: 0;
  border-radius: 24px;
}
#power-success-modal.open .ps-sheet {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.ps-sheet {
  display: flex; flex-direction:
