/* ═══════════════════════════════════════════════════════════════
   72Hashes Mini App — styles.css
   Design system: glossy blue × white
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. CSS Variables ──────────────────────────────────────────── */
:root {
  --bg:        #F0F6FF;
  --surface:   #FFFFFF;
  --card:      #FFFFFF;
  --card-h:    #E8F2FF;
  --primary:   #0066FF;
  --primary-l: #00D4FF;
  --primary-d: rgba(0,102,255,0.10);
  --accent:    #0088FF;
  --accent-l:  #4DC4FF;
  --accent-d:  rgba(0,136,255,0.10);
  --success:   #10B981;
  --danger:    #EF4444;
  /* shared accent tones (also overridden per-page for tinted variants) */
  --tone-g:    #0066FF;
  --tone-o: var(--tone-o);
  --tone-v:    #5B8DEF;
  --tone-b:    #0066FF;
  --t1:        #0A1628;
  --t2:        rgba(10,22,40,0.65);
  --t3:        rgba(10,22,40,0.35);
  --t4:        rgba(10,22,40,0.12);
  --border:    rgba(0,102,255,0.12);
  --border-a:  rgba(0,102,255,0.35);
  --radius:    10px;
  --radius-sm: 7px;
  --nav-h:     54px;
  --hdr-h:     52px;
}

/* ── 2. Reset ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 45%, var(--card-h) 100%);
  color: var(--t1);
  overflow: hidden;
  height: 100svh;
  -webkit-font-smoothing: antialiased;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
}

input {
  font: inherit;
  color: inherit;
}

::-webkit-scrollbar { width: 0; }

/* ── 3. App layout ─────────────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  height: 100svh;
  overflow: hidden;
  position: relative;
}

.page {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  /* clear the nav (content row + safe-area) so the last items aren't hidden */
  padding: 16px 16px calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 20px);
  -webkit-overflow-scrolling: touch;
}

.page.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

/* ── 4. Floating lang selector (no header bar) ─────────────────── */
.float-lang {
  position: fixed;
  top: 12px;
  right: 14px;
  z-index: 300;
}

/* ── 4b. Floating Add Task button — only visible on Earn tab ───── */
.float-add-task {
  position: fixed;
  top: 52px;
  right: 14px;
  z-index: 300;
  display: none;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  border: none;
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
  transition: transform 0.12s, box-shadow 0.18s;
}
.page-earn-active .float-add-task { display: flex; }
.float-add-task:active { transform: scale(0.95); }
.float-add-task svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
}

/* ── 5. Nav ────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  /* 54px content row + the device's bottom safe-area (home indicator).
     Adding the inset to height — not as inner padding — keeps the icons/
     labels fully visible above the iPhone home bar. */
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 200;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: none;
  background: none;
  color: var(--t3);
  cursor: pointer;
  padding: 0 4px 4px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.18s;
  position: relative;
}

/* Top indicator bar — only visible on active */
.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 28%;
  right: 28%;
  height: 2px;
  background: transparent;
  border-radius: 0 0 3px 3px;
  transition: background 0.18s;
}

.nav-item.active {
  color: var(--primary-l);
}

.nav-item.active::before {
  background: var(--primary);
}

.nav-icon svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: block;
  transition: filter 0.18s;
}

.nav-item.active .nav-icon svg {
  filter: drop-shadow(0 0 5px var(--primary-d));
}

/* Label always visible */
.nav-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: inherit;
}

/* ═══════════════════════════════════════════════════════════════
   6. Mine / Home page — redesigned (mining ring · contracts)
   ═══════════════════════════════════════════════════════════════ */
.mn-page, #loading-screen { --ring: var(--primary-l); --ring-glow: var(--primary-d); }

/* ── Mining ring ── */
.mn-ring-section {
  display: flex;
  justify-content: center;
  padding: 18px 0 6px;
}
.mn-ring {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* outer rotating conic arc */
.mn-ring-spin {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0deg,
    var(--primary-d) 200deg,
    var(--ring) 320deg,
    color-mix(in srgb, var(--ring), transparent 10%) 350deg,
    transparent 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 5px));
  filter: drop-shadow(0 0 10px var(--ring-glow));
  animation: mnSpin 3.2s linear infinite;
}
@keyframes mnSpin { to { transform: rotate(360deg); } }
/* static inner ring */
.mn-ring-track {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--primary-d);
  box-shadow: 0 0 40px var(--primary-d) inset;
}
.mn-ring-core {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(circle, var(--primary-d), color-mix(in srgb, var(--card) 60%, transparent) 70%);
  overflow: hidden;
}
/* Logo del bot dentro del anillo del splash (skin clásico). Se muestra solo
   cuando app.js confirma que la foto cargó (.has-logo); el spinner exterior
   sigue girando alrededor. Si el bot no tiene foto, no hay .has-logo y queda
   el rayo + nombre por defecto. */
.ls-bot-logo {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.mn-ring-core.has-logo .ls-bot-logo { display: block; }
.mn-ring-core.has-logo .mn-ring-bolt,
.mn-ring-core.has-logo .mn-ring-label { display: none; }
.mn-ring-bolt {
  width: 64px;
  height: 64px;
  color: var(--ring);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 14px var(--ring-glow));
  animation: mnPulse 2.4s ease-in-out infinite;
}
@keyframes mnPulse {
  0%, 100% { opacity: 0.9; filter: drop-shadow(0 0 10px var(--ring-glow)); }
  50%      { opacity: 1;   filter: drop-shadow(0 0 22px var(--ring-glow)); }
}
.mn-ring-label {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: var(--ring);
}
/* Contador de sesión de producción dentro del anillo (reemplaza al título) */
.mn-ring-label.is-timer {
  letter-spacing: 0.06em;
  text-indent: 0.06em;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

/* ── HASHES balance ── */
.mn-hashes {
  text-align: center;
  padding: 6px 0 18px;
}
.pay-hero-modern {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Glowing zap icon (matches Swap modal's green icon treatment) */
.pay-mod-icon {
  position: relative;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 22%, transparent), color-mix(in srgb, var(--primary) 4%, transparent) 70%);
  margin-bottom: 12px;
}
.pay-mod-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--primary) 50%, transparent),
    0 0 0 7px color-mix(in srgb, var(--primary) 10%, transparent),
    0 0 32px color-mix(in srgb, var(--primary) 45%, transparent);
  animation: wdRingPulse 2.6s ease-in-out infinite;
}
.pay-mod-icon svg {
  position: relative;
  width: 32px;
  height: 32px;
  color: var(--primary-l);
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--primary) 55%, transparent));
}
.pay-mod-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--t2);
  letter-spacing: 0.02em;
}

.pay-modern-power {
  font-size: 40px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -1px;
  line-height: 1.1;
  margin-top: 4px;
}
.pay-modern-power span {
  font-size: 18px;
  color: var(--t2);
}
.pay-modern-bonus {
  font-size: 13px;
  font-weight: 800;
  color: var(--tone-v);
  margin-top: 8px;
  min-height: 20px;
}
.pay-modern-bonus:not(:empty) {
  padding: 5px 12px;
  border-radius: 20px;
  background: rgba(185,107,255,0.12);
  border: 1px solid rgba(185,107,255,0.3);
  margin-top: 10px;
}
.pay-modern-grid {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}
.pay-mod-stat {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  background: color-mix(in srgb, var(--primary) 4%, transparent);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 14px;
}
.pay-mod-stat .pm-ic {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--primary-l);
  margin-bottom: 9px;
}
.pay-mod-stat .pm-ic svg { width: 15px; height: 15px; }
.pay-mod-stat .pm-ic--gram {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
}
.pay-mod-stat .pm-ic--gram .gram-logo {
  width: 14px;
  height: 14px;
}
.pay-mod-stat .pm-label {
  font-size: 11.5px;
  color: var(--t2);
  font-weight: 600;
  margin-bottom: 3px;
}
.pay-mod-stat .pm-val {
  font-size: 15px;
  color: var(--t1);
  font-weight: 800;
}
.tone-g-text {
  color: var(--tone-g) !important;
}

.mn-hashes-value {
  font-size: 40px;
  font-weight: 800;
  color: var(--t1);
  line-height: 1.05;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.mn-hashes-label {
  font-size: 14px;
  color: var(--t2);
  margin-top: 6px;
}
.mn-hashes-ton {
  font-size: 13px;
  color: var(--t3);
  margin-top: 4px;
}
.mn-hashes-ton span { color: var(--t3); }

/* ── Stats strip ── */
.mn-stats {
  display: flex;
  align-items: center;
  padding: 16px 8px;
  margin-bottom: 22px;
  background: linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 10%, transparent), 0 2px 6px rgba(0,0,0,0.05);
}
.mn-stat {
  flex: 1;
  text-align: center;
  min-width: 0;
}
.mn-stat-div {
  width: 1px;
  align-self: stretch;
  margin: 2px 0;
  background: var(--border);
}
.mn-stat-val {
  font-size: 13px;
  color: var(--t3);
  font-weight: 500;
}
.mn-stat-val strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.3px;
}
.mn-stat-lbl {
  font-size: 11.5px;
  color: var(--t2);
  margin-top: 3px;
}

/* ── Section title ── */
.mn-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--t3);
  margin-bottom: 12px;
}

/* ── Contracts ── */
.mn-contracts { margin-bottom: 20px; }
.mn-contracts-empty {
  text-align: center;
  padding: 22px;
  color: var(--t3);
  font-size: 13px;
}
.mn-contract {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
}
.mn-contract-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-d);
  border: 1px solid color-mix(in srgb, var(--primary-l) 28%, transparent);
  color: var(--primary-l);
}
.mn-contract-icon svg { width: 24px; height: 24px; stroke-width: 1.9; }
.mn-contract-main { flex: 1; min-width: 0; }
.mn-contract-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.mn-contract-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--t1);
}
.mn-contract-rate {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--primary-l);
}
.mn-contract-rate strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-l);
}
.mn-contract-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--success);
  margin-top: 5px;
}
.mn-contract-meta svg { width: 14px; height: 14px; }
.mn-contract.is-urgent .mn-contract-meta { color: var(--accent-l); }
.mn-contract-meta--perm { color: var(--primary-l); }
.mn-contract-meta--perm svg { width: 16px; height: 16px; }

/* expiry progress bar */
.mn-contract-bar {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  margin-top: 10px;
  overflow: visible;
}
.mn-contract-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.mn-contract.is-urgent .mn-contract-bar-fill {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.mn-contract-pct {
  position: absolute;
  right: 0;
  top: -18px;
  font-size: 12px;
  font-weight: 800;
  color: var(--success);
}
.mn-contract.is-urgent .mn-contract-pct { color: var(--accent-l); }

/* permanent contract — violet "task reward" accent */
.mn-contract--perm .mn-contract-top { align-items: flex-start; }
.mn-contract-badge {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 7px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #C79BFF;
  background: rgba(185,107,255,0.14);
  border: 1px solid rgba(185,107,255,0.3);
}
.mn-contract--perm {
  background:
    radial-gradient(120% 160% at 100% 50%, rgba(185,107,255,0.08), transparent 55%),
    var(--card);
}

/* ── Swap banner ── */
.mn-swap-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 16px;
  margin-bottom: 14px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  background:
    radial-gradient(120% 180% at 0% 0%, color-mix(in srgb, var(--primary-l) 28%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--primary-l) 22%, transparent), color-mix(in srgb, var(--primary) 12%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary-l) 35%, transparent);
  box-shadow: 0 8px 26px color-mix(in srgb, var(--primary-l) 18%, transparent);
  transition: transform 0.1s, filter 0.15s;
}
.mn-swap-banner:active { transform: scale(0.99); filter: brightness(1.06); }
.mn-swap-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary-l) 18%, transparent);
  color: var(--primary-l);
}
.mn-swap-icon svg { width: 24px; height: 24px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--primary-l) 60%, transparent)); }
.mn-swap-text { flex: 1; min-width: 0; }
.mn-swap-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.2px;
}
.mn-swap-sub {
  font-size: 12.5px;
  color: var(--t2);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mn-swap-arrow { flex-shrink: 0; width: 22px; height: 22px; color: var(--primary-l); }

/* ── Quick actions ── */
.mn-actions {
  display: flex;
  gap: 10px;
}
.mn-action {
  flex: 1;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--primary-l) 8%, transparent);
  border: 1px solid var(--border-a);
  color: var(--primary-l);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s;
}
.mn-action svg { width: 18px; height: 18px; }
.mn-action:active { transform: scale(0.97); }
.mn-action--ghost {
  background: color-mix(in srgb, var(--primary) 4%, transparent);
  border: 1px solid var(--border);
  color: var(--t2);
}
.mn-action--ghost svg { color: var(--t2); }

/* production button (visible cuando la sesión terminó) */
.btn-produce {
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  border: none;
  border-radius: 14px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--primary-l) 30%, transparent);
  margin-bottom: 14px;
  transition: opacity 0.15s, transform 0.1s;
}
.btn-produce:disabled { opacity: 0.45; }
.btn-produce:active { transform: scale(0.98); }

/* ═══════════════════════════════════════════════════════════════
   7. Shop — redesigned (hero · rate card · TON+bonus packages)
   ═══════════════════════════════════════════════════════════════ */
.sh-page {
  --tone-g: var(--primary-l); --tone-g-d: color-mix(in srgb, var(--primary-l) 12%, transparent);
  --tone-b: #4F8EF7; --tone-b-d: rgba(79,142,247,0.14);
  --tone-v: #B96BFF; --tone-v-d: rgba(185,107,255,0.14);
  --tone-o: var(--tone-o); --tone-o-d: color-mix(in srgb, var(--primary-l) 14%, transparent);
}

/* ── Hero ── */
.sh-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px 10px;
}
.sh-hero-text { min-width: 0; }
.sh-hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.05;
  color: var(--t1);
}
.sh-hero-sub { font-size: 13.5px; color: var(--t2); margin-top: 6px; }
.sh-hero-art {
  position: relative;
  flex-shrink: 0;
  width: 104px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-l);
}
.sh-hero-art svg { position: relative; width: 60px; height: 60px; filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--primary-l) 40%, transparent)); }
.sh-hero-art-glow {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary-l) 36%, transparent), transparent 68%);
  filter: blur(9px);
}

/* ── Tab bar ── */
.sh-tabbar {
  display: flex;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.sh-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 2px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--t3);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.sh-tab svg { width: 16px; height: 16px; }
.sh-tab.active { color: var(--primary-l); border-bottom-color: var(--primary); }

/* ── Rate card ── */
.sh-rate {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 16px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid var(--border);
  border-radius: 16px;
}
.sh-rate-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-a);
  color: var(--primary-l);
}
.sh-rate-icon svg { width: 20px; height: 20px; }
.sh-rate-title { font-size: 16px; font-weight: 700; color: var(--t1); }
.sh-rate-sub { font-size: 12.5px; color: var(--t2); margin-top: 3px; line-height: 1.4; }

/* ── Packages ── */
.sh-list { display: flex; flex-direction: column; gap: 12px; }
.sh-pkg {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  transition: border-color 0.2s, transform 0.1s;
}
.sh-pkg:active { transform: scale(0.995); }
/* tone wiring for bonus chips */
.sh-pkg.tone-g { --tone: var(--tone-g); --tone-d: var(--tone-g-d); }
.sh-pkg.tone-b { --tone: var(--tone-b); --tone-d: var(--tone-b-d); }
.sh-pkg.tone-v { --tone: var(--tone-v); --tone-d: var(--tone-v-d); }
.sh-pkg.tone-o { --tone: var(--tone-o); --tone-d: var(--tone-o-d); }

.sh-pkg-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tone-g-d);
  border: 1px solid color-mix(in srgb, var(--primary-l) 28%, transparent);
  color: var(--primary-l);
}
.sh-pkg-icon svg { width: 24px; height: 24px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--primary-l) 50%, transparent)); }

.sh-pkg-main { flex: 1; min-width: 0; }
.sh-pkg-power {
  font-size: 24px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.4px;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-pkg-power span { font-size: 14px; font-weight: 700; color: var(--t2); }
.sh-pkg-return {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--t3);
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sh-pkg-return svg { width: 14px; height: 14px; flex-shrink: 0; }

.sh-pkg-bonus {
  flex-shrink: 0;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--tone, var(--primary-l));
  background: var(--tone-d, var(--primary-d));
  border: 1px solid color-mix(in srgb, var(--tone, var(--primary)) 32%, transparent);
}
.sh-pkg-bonus small { font-size: 9px; font-weight: 700; opacity: 0.7; }

.sh-pkg-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-shrink: 0;
  min-width: 70px;
  padding: 11px 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
  color: #ffffff;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 28%, transparent), inset 0 1px 0 rgba(255,255,255,0.25);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.sh-pkg-buy strong { font-size: 18px; font-weight: 800; color: #ffffff; }
.sh-pkg-buy .gram-logo { width: 18px; height: 18px; margin-top: -1px; }
.sh-footer-right {
  display: flex;
  align-items: center;
  gap: 6px;
}
.sh-footer-right .gram-logo { flex-shrink: 0; }
.sh-pkg-buy:active { background: linear-gradient(135deg, var(--primary-l), var(--primary)); transform: scale(0.96); box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 22%, transparent); }

/* ── Footer note ── */
.sh-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 4px 2px;
}
.sh-footer-left, .sh-footer-right {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
}
.sh-footer-left { color: var(--t3); }
.sh-footer-left svg { width: 14px; height: 14px; }
.sh-footer-right { color: var(--primary-l); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   8. Leaderboard / Trophy — redesigned (hero · podium · rows)
   ═══════════════════════════════════════════════════════════════ */
.lb-page {
  --gold:   #F5A623;  --gold-d:   rgba(245,166,35,0.14);
  --silver: #AEB4C2;  --silver-d: rgba(174,180,194,0.12);
  --bronze: #C8895A;  --bronze-d: rgba(200,137,90,0.12);
}

/* ── Hero ── */
.lb-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 2px 14px;
}
.lb-hero-text { min-width: 0; }
.lb-hero-eyebrow { margin-bottom: 8px; }
.lb-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--primary-l) 18%, transparent), color-mix(in srgb, var(--primary-l) 4%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary-l) 22%, transparent);
  color: var(--primary-l);
  box-shadow: 0 0 26px color-mix(in srgb, var(--primary-l) 18%, transparent) inset;
}
.lb-hero-icon svg { width: 24px; height: 24px; }
.lb-hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.05;
  color: var(--t1);
}
.lb-hero-sub {
  font-size: 13.5px;
  color: var(--t2);
  margin-top: 6px;
  line-height: 1.4;
  max-width: 240px;
}
.lb-hero-art {
  position: relative;
  flex-shrink: 0;
  width: 104px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-l);
}
.lb-hero-art svg { position: relative; width: 64px; height: 64px; filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--primary-l) 40%, transparent)); }
.lb-hero-art-glow {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary-l) 38%, transparent), transparent 68%);
  filter: blur(9px);
}

/* ── Season pill ── */
.lb-season {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  padding: 8px 13px;
  border-radius: 11px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--t2);
}
.lb-season svg { width: 15px; height: 15px; color: var(--primary-l); }
.lb-season strong { color: var(--t1); font-weight: 700; }
.lb-season-time { color: var(--primary-l); font-weight: 700; }

/* ── Podium ── */
.lb-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 18px;
}
.lb-pod {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 8px 0;
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
}
/* order in DOM: 2nd, 1st, 3rd */
.lb-pod--2nd { background: linear-gradient(180deg, var(--silver-d), transparent 60%); border-color: rgba(174,180,194,0.25); }
.lb-pod--1st {
  background: linear-gradient(180deg, var(--gold-d), transparent 55%);
  border-color: rgba(245,166,35,0.4);
  padding-top: 24px;
  margin-bottom: 22px;          /* lifts the winner */
  box-shadow: 0 -4px 30px rgba(245,166,35,0.12);
}
.lb-pod--3rd { background: linear-gradient(180deg, var(--bronze-d), transparent 60%); border-color: rgba(200,137,90,0.3); }
.lb-pod--self { outline: 1px solid var(--primary); }

/* rank badge */
.lb-pod-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #0a0a0a;
  z-index: 3;
}
.lb-pod--1st .lb-pod-badge { background: linear-gradient(160deg, #FFD680, var(--gold)); box-shadow: 0 4px 12px rgba(245,166,35,0.5); }
.lb-pod--2nd .lb-pod-badge { background: linear-gradient(160deg, #E4E8F0, var(--silver)); }
.lb-pod--3rd .lb-pod-badge { background: linear-gradient(160deg, #E0A878, var(--bronze)); }

/* laurels around winner */
.lb-pod-laurel {
  position: absolute;
  top: 30px;
  color: var(--gold);
  opacity: 0.5;
  pointer-events: none;
}
.lb-pod-laurel svg { width: 30px; height: 54px; }
.lb-pod-laurel--l { left: 4px; transform: scaleX(-1); }
.lb-pod-laurel--r { right: 4px; }

.lb-pod-avatar {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-l);
  background: var(--card-h);
  overflow: hidden;
  z-index: 2;
}
.lb-pod-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-pod-avatar-initials, .lb-row-avatar-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
}
.lb-pod--1st .lb-pod-avatar { width: 72px; height: 72px; border: 2px solid var(--gold); box-shadow: 0 0 18px rgba(245,166,35,0.4); }
.lb-pod--2nd .lb-pod-avatar { border: 2px solid var(--silver); }
.lb-pod--3rd .lb-pod-avatar { border: 2px solid var(--bronze); }

.lb-pod-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
  margin-top: 10px;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.lb-pod--1st .lb-pod-name { font-size: 15px; }
.lb-pod-power {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.4px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.lb-pod--1st .lb-pod-power { font-size: 22px; color: var(--gold); }
.lb-pod--2nd .lb-pod-power { color: var(--primary-l); }
.lb-pod--3rd .lb-pod-power { color: var(--bronze); }
.lb-pod-unit {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--t3);
  margin-top: 2px;
}

/* pedestal base */
.lb-pod-base {
  width: calc(100% + 2px);
  margin-top: 14px;
  border-radius: 6px 6px 0 0;
}
.lb-pod--1st .lb-pod-base { height: 26px; background: linear-gradient(180deg, var(--gold), rgba(245,166,35,0.35)); box-shadow: 0 0 24px rgba(245,166,35,0.3); }
.lb-pod--2nd .lb-pod-base { height: 16px; background: linear-gradient(180deg, var(--silver), rgba(174,180,194,0.3)); }
.lb-pod--3rd .lb-pod-base { height: 12px; background: linear-gradient(180deg, var(--bronze), rgba(200,137,90,0.3)); }

/* ── Your-rank badge ── */
.lb-user-rank {
  background: var(--primary-d);
  border: 1px solid var(--border-a);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.lb-user-rank-label { font-size: 12.5px; color: var(--t2); }
.lb-user-rank-val { font-size: 16px; font-weight: 800; color: var(--primary-l); margin-left: auto; }

/* ── Rest list ── */
.lb-rest {
  background: linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 10%, transparent), 0 2px 6px rgba(0,0,0,0.05);
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  border-left: 2px solid transparent;
}
.lb-row:last-child { border-bottom: none; }
.lb-row.lb-self { border-left-color: var(--primary); background: var(--primary-d); }

.lb-row-rank {
  font-size: 15px;
  font-weight: 700;
  color: var(--t2);
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}
.lb-row-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-h);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--t2);
  overflow: hidden;
  flex-shrink: 0;
}
.lb-row-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }

.lb-row-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-self-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--primary);
  color: #FFFFFF;
  padding: 2px 6px;
  border-radius: 5px;
  margin-left: 8px;
  vertical-align: middle;
}
.lb-row-right { flex-shrink: 0; text-align: right; }
.lb-row-power {
  font-size: 17px;
  font-weight: 800;
  color: var(--primary-l);
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.lb-row-unit {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--t3);
}

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

.lb-loading { text-align: center; padding: 20px; color: var(--t3); font-size: 13px; }

/* ── Promo banner ── */
.lb-promo {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  background:
    radial-gradient(120% 160% at 8% 0%, color-mix(in srgb, var(--primary-l) 14%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary-l) 20%, transparent);
  transition: transform 0.1s, filter 0.15s;
}
.lb-promo:active { transform: scale(0.99); filter: brightness(1.05); }
.lb-promo-art {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary-l) 28%, transparent), color-mix(in srgb, var(--primary-l) 5%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary-l) 30%, transparent);
  color: var(--primary-l);
  box-shadow: 0 0 22px color-mix(in srgb, var(--primary-l) 22%, transparent);
}
.lb-promo-art svg { width: 26px; height: 26px; filter: drop-shadow(0 0 8px color-mix(in srgb, var(--primary-l) 60%, transparent)); }
.lb-promo-text { flex: 1; min-width: 0; }
.lb-promo-title { font-size: 15px; font-weight: 800; color: var(--t1); }
.lb-promo-sub { font-size: 12.5px; color: var(--t2); margin-top: 4px; line-height: 1.4; }
.lb-promo-arrow { flex-shrink: 0; width: 20px; height: 20px; color: var(--primary-l); }

/* ── 9. Team ────────────────────────────────────────────────────── */

/* Team page — no side padding, sections handle their own.
   Shares the Tasks design system (tones, gradient tiles, glow). */
.tn-page {
  padding: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 20px);
  --tone-g: var(--primary-l);  --tone-g-d:  color-mix(in srgb, var(--primary-l) 12%, transparent);
  --tone-o: var(--tone-o);  --tone-o-d:  color-mix(in srgb, var(--primary-l) 12%, transparent);
}

/* ── Hero ── */
.tn-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 12px;
  overflow: hidden;
}

.tn-hero-left {
  flex: 1;
  min-width: 0;
}

.tn-hero-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  margin-bottom: 10px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--primary-l) 18%, transparent), color-mix(in srgb, var(--primary-l) 4%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary-l) 22%, transparent);
  color: var(--primary-l);
  box-shadow: 0 0 26px color-mix(in srgb, var(--primary-l) 18%, transparent) inset;
}
.tn-hero-tag svg { width: 24px; height: 24px; }

.tn-hero-title {
  font-size: 34px;
  font-weight: 800;
  color: var(--t1);
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.tn-hero-sub {
  font-size: 13.5px;
  color: var(--t2);
  line-height: 1.4;
}

/* Hero art — glowing 3D-style group icon (matches Tasks hero art) */
.tn-hero-art {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-l);
}
.tn-hero-art svg {
  position: relative;
  width: 72px;
  height: 72px;
  opacity: 0.95;
  filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--primary-l) 40%, transparent));
}
.tn-hero-art-glow {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary-l) 40%, transparent), transparent 68%);
  filter: blur(10px);
}

/* placeholder for future image */
.tn-hero-img { width: 110px; height: 110px; object-fit: contain; }

/* ── Reward rows ── */
.tn-rewards {
  background: linear-gradient(180deg, var(--card-h), var(--card));
  border-radius: 16px;
  margin: 8px 16px 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 10%, transparent), 0 2px 6px rgba(0,0,0,0.05);
}

.tn-reward-row {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  border-bottom: 1px solid var(--border);
}

.tn-reward-row--last { border-bottom: none; }

.tn-reward-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tn-reward-icon svg { width: 22px; height: 22px; stroke-width: 1.9; }

.tn-reward-icon--ref  {
  background: var(--tone-g-d); color: var(--tone-g);
  border: 1px solid color-mix(in srgb, var(--primary-l) 28%, transparent);
}
.tn-reward-icon--prem {
  background: var(--tone-o-d); color: var(--tone-o);
  border: 1px solid rgba(245,166,35,0.28);
}
.tn-reward-icon--comm {
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 6%, transparent); color: var(--t2);
  border: 1px solid var(--border);
}

.tn-reward-info { flex: 1; min-width: 0; }

.tn-reward-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
}

.tn-reward-desc {
  font-size: 12px;
  color: var(--t2);
  margin-top: 2px;
}

.tn-reward-val {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.tn-reward-num {
  font-size: 19px;
  font-weight: 800;
  color: var(--t1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  line-height: 1;
}

.tn-reward-num--g { color: var(--tone-g); }
.tn-reward-num--o { color: var(--tone-o); }

.tn-reward-unit {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t3);
}

/* ── Stats with icons ── */
.tn-stats {
  background: linear-gradient(180deg, var(--card-h), var(--card));
  border-radius: 16px;
  margin: 0 16px 14px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 10%, transparent), 0 2px 6px rgba(0,0,0,0.05);
}

.tn-stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}

.tn-stat-row:last-child { border-bottom: none; }

.tn-stat-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-right: 1px solid var(--border);
}

.tn-stat-cell:last-child { border-right: none; }

.tn-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tn-stat-icon svg { width: 20px; height: 20px; stroke-width: 1.9; }

.tn-stat-icon--g { background: var(--tone-g-d); color: var(--tone-g); border: 1px solid color-mix(in srgb, var(--primary-l) 24%, transparent); }
.tn-stat-icon--o { background: var(--tone-o-d); color: var(--tone-o); border: 1px solid rgba(245,166,35,0.24); }

.tn-stat-body { min-width: 0; }

.tn-stat-num {
  font-size: 21px;
  font-weight: 800;
  color: var(--t1);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  line-height: 1;
}

.tn-stat-num--g { color: var(--tone-g); }
.tn-stat-num--o { color: var(--tone-o); }

.tn-stat-lbl {
  font-size: 11.5px;
  color: var(--t2);
  margin-top: 4px;
}

/* ── Action buttons ── */
.tn-actions {
  display: flex;
  gap: 10px;
  margin: 0 16px 14px;
}

.tn-btn-share {
  flex: 1;
  height: 52px;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  border: none;
  border-radius: 14px;
  color: #FFFFFF;
  font-size: 14.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--primary-l) 30%, transparent);
  transition: opacity 0.15s, transform 0.1s, filter 0.15s;
}
.tn-btn-share svg { width: 18px; height: 18px; stroke-width: 2.2; }
.tn-btn-share:active { transform: scale(0.97); filter: brightness(1.08); }

.tn-btn-copy {
  flex: 1;
  height: 52px;
  background: color-mix(in srgb, var(--primary) 5%, transparent);
  border: 1px solid var(--border-a);
  border-radius: 14px;
  color: var(--t1);
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.tn-btn-copy svg { width: 17px; height: 17px; stroke-width: 2; color: var(--primary-l); }
.tn-btn-copy:active { transform: scale(0.97); }

/* ── Members card ── */
.tn-members-card {
  background: linear-gradient(180deg, var(--card-h), var(--card));
  border-radius: 16px;
  margin: 0 16px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 10%, transparent), 0 2px 6px rgba(0,0,0,0.05);
}

.tn-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.team-tab {
  flex: 1;
  height: 44px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--t3);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.team-tab.active {
  color: var(--primary-l);
  border-bottom-color: var(--primary);
}

.team-tab-panel { display: none; }
.team-tab-panel.active { display: block; }

.team-list { display: flex; flex-direction: column; }

/* Empty state */
.tn-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 36px 20px;
  gap: 12px;
}

.tn-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin-bottom: 4px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary-l) 22%, transparent), color-mix(in srgb, var(--primary-l) 4%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary-l) 20%, transparent);
  color: var(--primary-l);
  box-shadow: 0 0 28px color-mix(in srgb, var(--primary-l) 20%, transparent);
}
.tn-empty-icon svg { width: 30px; height: 30px; stroke-width: 1.6; }

.tn-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--t1);
}

.tn-empty-sub {
  font-size: 13px;
  color: var(--t3);
  text-align: center;
  line-height: 1.5;
}

/* Keep old .team-list-empty for JS-generated states */
.team-list-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px;
  color: var(--t3);
  font-size: 13px;
}

/* Member rows */
.team-member-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 6%, transparent);
}

.team-member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-l);
  flex-shrink: 0;
  overflow: hidden;
}

.team-member-avatar--photo { object-fit: cover; display: block; }
.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: 2px;
}

.team-member-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 20px;
  flex-shrink: 0;
}

.team-member-badge--valid   { background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary-l); }
.team-member-badge--pending { background: rgba(245,166,35,0.14); color: var(--accent); }
.team-member-badge--premium { background: color-mix(in srgb, var(--primary) 22%, transparent); color: #fff; }

/* Log rows */
.team-log-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 6%, transparent);
}

.team-log-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--t2);
  flex-shrink: 0;
  overflow: hidden;
}

.team-log-avatar--photo { object-fit: cover; display: block; }
.team-log-body { flex: 1; min-width: 0; }

.team-log-desc {
  font-size: 12px;
  color: var(--t2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-log-date {
  font-size: 10px;
  color: var(--t3);
  margin-top: 2px;
}

.team-log-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-l);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.team-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
}

.team-pager-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--t1);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
}

.team-pager-btn:disabled { opacity: 0.25; pointer-events: none; }

.team-pager-info {
  font-size: 12px;
  color: var(--t3);
  min-width: 60px;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   10. TASKS — redesigned (stat cards · invite tiers · daily)
   ═══════════════════════════════════════════════════════════════ */
.tk-page {
  --tone-g: var(--primary-l);  --tone-g-d:  color-mix(in srgb, var(--primary-l) 12%, transparent);
  --tone-o: var(--tone-o);  --tone-o-d:  color-mix(in srgb, var(--primary-l) 12%, transparent);
  --tone-v:  #B96BFF;  --tone-v-d:  rgba(185,107,255,0.12);
  --tone-y:  #F2D24B;  --tone-y-d:  rgba(242,210,75,0.12);
}

/* ── Hero ── */
.tk-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 2px 8px;
}
.tk-hero-text { min-width: 0; }
.tk-hero-eyebrow { margin-bottom: 8px; }
.tk-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--primary-l) 18%, transparent), color-mix(in srgb, var(--primary-l) 4%, transparent));
  border: 1px solid color-mix(in srgb, var(--primary-l) 22%, transparent);
  color: var(--primary-l);
  box-shadow: 0 0 26px color-mix(in srgb, var(--primary-l) 18%, transparent) inset;
}
.tk-hero-icon svg { width: 24px; height: 24px; }
.tk-hero-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.05;
  color: var(--t1);
}
.tk-hero-sub {
  font-size: 13.5px;
  color: var(--t2);
  margin-top: 6px;
  line-height: 1.4;
}
.tk-hero-art {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-l);
}
.tk-hero-art svg { width: 60px; height: 60px; opacity: 0.92; filter: drop-shadow(0 6px 16px color-mix(in srgb, var(--primary-l) 35%, transparent)); }
.tk-hero-art-glow {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary-l) 35%, transparent), transparent 70%);
  filter: blur(8px);
}

/* ── Stat cards ── */
.tk-stats {
  display: flex;
  align-items: stretch;
  gap: 4px;
  padding: 16px 14px;
  margin: 8px 0 22px;
  background: linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 10%, transparent), 0 2px 6px rgba(0,0,0,0.05);
}
.tk-stat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.tk-stat-div {
  width: 1px;
  align-self: stretch;
  margin: 4px 6px;
  background: var(--border);
}
.tk-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tk-stat-icon svg { width: 21px; height: 21px; }
.tk-stat-icon--earned { background: var(--tone-g-d); color: var(--tone-g); }
.tk-stat-icon--avail  { background: var(--tone-o-d); color: var(--tone-o); }
.tk-stat-body { min-width: 0; }
.tk-stat-label {
  font-size: 11.5px;
  color: var(--t2);
  font-weight: 500;
  margin-bottom: 2px;
}
.tk-stat-row { display: flex; align-items: baseline; gap: 5px; }
.tk-stat-num {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1;
}
.tk-stat-num--earned { color: var(--tone-g); }
.tk-stat-num--avail  { color: var(--tone-o); }
.tk-stat-unit {
  font-size: 10px;
  font-weight: 700;
  color: var(--t3);
  letter-spacing: 0.5px;
}

/* ── Section header ── */
.tk-section { margin-bottom: 26px; }
.tk-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--t3);
}
.tk-empty [data-lucide] { width: 40px; height: 40px; margin-bottom: 12px; opacity: 0.4; }
.tk-empty p { font-size: 0.85rem; }
.tk-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.tk-section-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.3px;
}
.tk-section-sub {
  font-size: 12.5px;
  color: var(--t2);
  margin-top: 3px;
}
.tk-section-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--primary-d);
  border: 1px solid var(--border-a);
  color: var(--primary-l);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* ── Invite tier card ── */
.tk-invite-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 14px;
  margin-bottom: 11px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 15px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.12s, box-shadow 0.2s;
}
.tk-invite-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120% 140% at 0% 0%, var(--tone-card, transparent), transparent 55%);
  opacity: 0.5;
  pointer-events: none;
}
.tk-invite-card:active { transform: scale(0.992); }
.tk-invite-card.is-done { opacity: 0.72; }
.tk-invite-card.is-done .tk-invite-bar-fill { width: 100% !important; }
.tk-invite-card.is-eligible {
  border-color: var(--tone, var(--primary));
  box-shadow: 0 0 0 1px var(--tone, var(--primary)), 0 6px 22px color-mix(in srgb, var(--primary) 12%, transparent);
}
/* tone wiring */
.tk-invite-card.tone-g { --tone: var(--tone-g); --tone-d: var(--tone-g-d); --tone-card: color-mix(in srgb, var(--primary-l) 6%, transparent); }
.tk-invite-card.tone-o { --tone: var(--tone-o); --tone-d: var(--tone-o-d); --tone-card: rgba(245,166,35,0.06); }
.tk-invite-card.tone-v { --tone: var(--tone-v); --tone-d: var(--tone-v-d); --tone-card: rgba(185,107,255,0.06); }
.tk-invite-card.tone-y { --tone: var(--tone-y); --tone-d: var(--tone-y-d); --tone-card: rgba(242,210,75,0.06); }

.tk-invite-tile {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tone-d);
  border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
  color: var(--tone);
}
.tk-invite-tile svg { width: 21px; height: 21px; stroke-width: 1.9; opacity: 0.9; }
.tk-invite-tile-num {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  color: #0a0a0a;
  background: var(--tone);
  box-shadow: 0 0 10px var(--tone);
}

.tk-invite-main { flex: 1; min-width: 0; }
.tk-invite-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
}
.tk-invite-desc {
  font-size: 11.5px;
  color: var(--t2);
  margin: 2px 0 9px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tk-invite-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tk-invite-bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  overflow: hidden;
}
.tk-invite-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--tone);
  box-shadow: 0 0 8px var(--tone);
  transition: width 0.5s cubic-bezier(.4,0,.2,1);
}
.tk-invite-count {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--tone);
  white-space: nowrap;
}

.tk-invite-action { flex-shrink: 0; }
.tk-invite-reward {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 9px 10px;
  border-radius: 11px;
  background: var(--tone-d);
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent);
}
.tk-invite-reward-num {
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  color: var(--tone);
}
.tk-invite-reward-unit {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: color-mix(in srgb, var(--tone) 70%, var(--t2));
  margin-top: 3px;
}
.tk-invite-claim {
  height: 38px;
  padding: 0 18px;
}
.tk-invite-claimed {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary-l) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-l) 40%, transparent);
  color: var(--tone-g);
}
.tk-invite-claimed svg { width: 18px; height: 18px; }

/* claim-in-flight feedback */
.tk-invite-card.claiming, .task-card.claiming {
  pointer-events: none;
  animation: tkClaimPulse 0.7s ease-in-out infinite;
}
@keyframes tkClaimPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ── Promo banner ── */
.tk-promo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding: 16px 16px;
  border-radius: 16px;
  background:
    radial-gradient(120% 160% at 12% 0%, color-mix(in srgb, var(--primary-l) 16%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary-l) 20%, transparent);
}
.tk-promo-art {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary-l) 30%, transparent), color-mix(in srgb, var(--primary-l) 5%, transparent));
  color: var(--primary-l);
  box-shadow: 0 0 22px color-mix(in srgb, var(--primary-l) 25%, transparent);
}
.tk-promo-art svg { width: 26px; height: 26px; }
.tk-promo-text { flex: 1; min-width: 0; }
.tk-promo-title {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--t1);
  line-height: 1.25;
}
.tk-promo-sub {
  font-size: 12px;
  color: var(--t2);
  margin-top: 4px;
  line-height: 1.4;
}
.tk-promo-chevron {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-a);
  color: var(--primary-l);
}
.tk-promo-chevron svg { width: 18px; height: 18px; }

/* ── Daily / generic task card ── */
.task-card {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px;
  background: var(--card);
  border-radius: 15px;
  border: 1px solid var(--border);
  margin-bottom: 11px;
  transition: border-color 0.2s, opacity 0.2s, box-shadow 0.2s;
}
.task-card.eligible {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 6px 20px color-mix(in srgb, var(--primary) 12%, transparent);
}
.task-card.completed { opacity: 0.5; }

.task-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--primary-d);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary-l);
}
.task-icon svg { width: 22px; height: 22px; stroke-width: 1.9; }
.icon-channel  { background: var(--accent-d); color: var(--accent-l); }
.icon-referral { background: var(--primary-d); color: var(--primary-l); }
.icon-slot     { background: rgba(185,107,255,0.12); color: #B96BFF; }
.icon-sponsor  { background: var(--accent-d); color: var(--accent-l); }
.icon-sponsor2 { background: rgba(185,107,255,0.12); color: #B96BFF; }

.task-body { flex: 1; min-width: 0; }
.task-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
}
.task-reward {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-l);
  margin-top: 4px;
}
.task-reward svg { width: 14px; height: 14px; }

.task-action { flex-shrink: 0; }
.task-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.task-btn {
  height: 36px;
  padding: 0 16px;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s, filter 0.15s;
}
.task-btn:active { transform: scale(0.95); filter: brightness(1.1); }
.task-btn.join {
  background: color-mix(in srgb, var(--primary) 7%, transparent);
  color: var(--t1);
  border: 1px solid var(--border);
}
.task-btn.roll, .task-btn.roll2 {
  background: linear-gradient(135deg, var(--accent), var(--accent-l));
  color: #1a1207;
}
.task-btn.locked, .task-btn:disabled,
.task-btn.sponsor-cooldown-btn {
  background: var(--card-h);
  color: var(--t3);
  border: 1px solid var(--border);
  cursor: default;
}
.task-btn.locked:active, .task-btn:disabled:active { transform: none; filter: none; }

.task-done-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary-l) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary-l) 40%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--success);
}
.task-done-icon svg { width: 17px; height: 17px; }

.task-card.completed .task-reward { color: var(--t3); }
.sponsor-cooldown, .slot-cooldown { opacity: 0.7; }

.tasks-all-done {
  text-align: center;
  padding: 24px;
  color: var(--t3);
}
.tasks-all-done-icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
  line-height: 1;
}
.tasks-all-done-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--t1);
}
.tasks-all-done-sub {
  font-size: 13px;
  color: var(--t3);
  margin-top: 6px;
}

/* ── 11. Modals — shared base ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-overlay.open .modal-sheet {
  transform: scale(1);
  opacity: 1;
}

.modal-sheet {
  width: 100%;
  max-width: 400px;
  margin: auto 0;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 24px;
  padding: 24px 20px 32px;
  max-height: 92svh;
  overflow-y: auto;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--primary) 15%, transparent), 0 8px 24px rgba(0,0,0,0.08);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}

.modal-handle {
  display: none;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-h);
  border: 1px solid var(--border);
  color: var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

/* ── Dice modal ── */
.dice-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.dice-overlay.open {
  display: flex;
}

.dice-overlay.open .dice-sheet {
  transform: scale(1);
  opacity: 1;
}

.dice-sheet {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: auto 0;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--primary) 15%, transparent), 0 8px 24px rgba(0,0,0,0.08);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}

.dice-header {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
}

.dice-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--t1);
  text-align: center;
  width: 100%;
}

.dice-close {
  position: absolute;
  top: -16px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-h);
  border: 1px solid var(--border);
  color: var(--t3);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

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

.dice-prize-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  margin: 10px 0 24px;
  background: var(--card-h);
  padding: 10px;
  border-radius: var(--radius);
}

.dice-prize-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.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 .reward {
  font-size: 15px;
  font-weight: 900;
  color: var(--accent);
}

.dice-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  height: 100px;
}

.dice {
  width: 80px;
  height: 80px;
  background: var(--primary-d);
  border: 2px solid var(--primary);
  border-radius: 18px;
  position: relative;
  transition: transform 0.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: var(--primary-l);
  justify-self: center;
  align-self: center;
}

.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 0.7s ease-in-out forwards;
}

.dice-roll-btn {
  width: 100%;
  height: 48px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  transition: opacity 0.15s, transform 0.1s;
}

.dice-roll-btn:active {
  opacity: 0.85;
  transform: scale(0.97);
}

.dice-roll-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.dice-result-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--t2);
  text-align: center;
  min-height: 22px;
  margin-bottom: 2px;
}

.dice-reward-text {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  min-height: 36px;
  margin-bottom: 8px;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s ease, transform 0.3s ease;
  line-height: 1;
}

.dice-reward-text.show {
  opacity: 1;
  transform: scale(1);
}

/* ── Slot modal ── */
.slot-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.slot-overlay.open {
  display: flex;
}

.slot-overlay.open .slot-sheet {
  transform: scale(1);
  opacity: 1;
}

.slot-sheet {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: auto 0;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 24px;
  padding: 32px 24px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--primary) 15%, transparent), 0 8px 24px rgba(0,0,0,0.08);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}

.slot-header {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 4px;
}

.slot-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--t1);
  text-align: center;
  width: 100%;
}

.slot-close {
  position: absolute;
  top: -16px;
  right: -12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--card-h);
  border: 1px solid var(--border);
  color: var(--t3);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

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

.slot-prize-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 100%;
  margin-bottom: 20px;
  background: var(--card-h);
  padding: 10px;
  border-radius: var(--radius);
}

.slot-prize-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.slot-prize-item.slot-prize--star {
  border-color: rgba(245,158,11,0.4);
  background: rgba(245,158,11,0.06);
}

.slot-prize-symbols {
  font-size: 14px;
  letter-spacing: -1px;
  margin-bottom: 3px;
  line-height: 1;
}

.slot-prize-reward {
  font-size: 13px;
  font-weight: 900;
  color: var(--accent);
}

.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: var(--bg);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 10%, transparent), 0 2px 6px rgba(0,0,0,0.05);
  width: 100%;
}

.slot-reel-box {
  flex: 1;
  height: 64px;
  width: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  line-height: 1;
  background: var(--card-h);
  border: 2px solid var(--border-a);
  border-radius: 10px;
  user-select: none;
  overflow: hidden;
}

.slot-reel-box span {
  display: block;
  transition: transform 0.08s;
}

.slot-reel-box.spinning span {
  animation: reelSpin 0.09s linear infinite;
}

.slot-reel-box.landed span {
  animation: reelLand 0.35s cubic-bezier(0.17,0.67,0.3,1.4) forwards;
}

@keyframes reelSpin {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  40%  { transform: translateY(-8px) scale(0.85); opacity: 0.5; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes reelLand {
  0%   { transform: scale(0.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: var(--border-a);
  border-radius: 2px;
  flex-shrink: 0;
}

.slot-payline {
  position: absolute;
  left: 14px;
  right: 14px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(124,58,237,0.6), transparent);
  border-radius: 2px;
  pointer-events: none;
}

.slot-result-sheet {
  gap: 10px;
}

.slot-result-reels {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg);
  border-radius: var(--radius);
  padding: 18px 20px;
  width: 100%;
  box-shadow: 0 8px 28px color-mix(in srgb, var(--primary) 10%, transparent), 0 2px 6px rgba(0,0,0,0.05);
  margin-bottom: 4px;
}

.slot-result-reels span {
  font-size: 48px;
  line-height: 1;
  background: var(--card-h);
  border-radius: var(--radius-sm);
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.slot-result-badge {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.1;
  text-align: center;
}

.slot-result-power {
  font-size: 36px;
  font-weight: 900;
  color: var(--accent);
  text-align: center;
  line-height: 1;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.35s ease, transform 0.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: 0.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: 0.02em;
}

.slot-result-close-btn {
  width: 100%;
  height: 48px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
}

/* ── Withdraw modal ── */
#withdraw-modal {
  display: none;
}

#withdraw-modal.open {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
}

/* ── Swap (withdraw) modal — Green accent, centered ── */
.wd-overlay {
  --ton: var(--primary);
  --ton-glow: color-mix(in srgb, var(--primary) 55%, transparent);
  align-items: center;          /* true vertical centering */
  justify-content: center;
  padding: 20px;
}

.wd-sheet {
  width: 100%;
  max-width: 400px;
  margin: auto 0;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: 24px;
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--primary) 15%, transparent), 0 8px 24px rgba(0,0,0,0.08);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}
.wd-overlay.open .wd-sheet { transform: scale(1); opacity: 1; }

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

.wd-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--t1);
  letter-spacing: -0.3px;
}
.wd-subtitle {
  font-size: 13px;
  color: var(--t2);
  margin-top: -6px;
  line-height: 1.4;
}

/* GRAM currency icon */
.gram-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}
.gram-logo--xs { width: 16px; height: 16px; }
.gram-logo--sm { width: 18px; height: 18px; }
.gram-logo--md { width: 20px; height: 20px; }
.gram-logo--lg { width: 32px; height: 32px; }

/* GRAM icon with concentric glow rings (withdraw modal) */
.wd-icon-wrap { margin-bottom: 2px; }
.wd-icon {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wd-icon-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--primary) 50%, transparent),
    0 0 0 8px color-mix(in srgb, var(--primary) 12%, transparent),
    0 0 0 15px color-mix(in srgb, var(--primary) 5%, transparent),
    0 0 36px var(--ton-glow);
  animation: wdRingPulse 2.6s ease-in-out infinite;
}
@keyframes wdRingPulse {
  0%, 100% { box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 50%, transparent), 0 0 0 8px color-mix(in srgb, var(--primary) 12%, transparent), 0 0 0 15px color-mix(in srgb, var(--primary) 5%, transparent), 0 0 30px var(--ton-glow); }
  50%      { box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 60%, transparent), 0 0 0 9px color-mix(in srgb, var(--primary) 16%, transparent), 0 0 0 17px color-mix(in srgb, var(--primary) 7%, transparent), 0 0 44px var(--ton-glow); }
}
.wd-icon .gram-logo--lg { position: relative; filter: drop-shadow(0 0 12px var(--ton-glow)); }
.wd-icon--progress {
  width: 64px; height: 64px;
  border-radius: 20px;
  background: var(--primary-d);
  border: 1px solid var(--border-a);
  box-shadow: 0 0 24px color-mix(in srgb, var(--primary-l) 20%, transparent);
}
.wd-icon--progress svg { width: 28px; height: 28px; stroke: var(--primary-l); stroke-width: 2; fill: none; filter: none; }

/* You'll receive — hero box */
.wd-receive-box {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  background:
    radial-gradient(120% 200% at 100% 50%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 60%),
    color-mix(in srgb, var(--primary) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
}
.wd-receive-label {
  font-size: 13px;
  color: var(--ton);
  font-weight: 600;
  margin-bottom: 2px;
}
.wd-receive-val {
  font-size: clamp(20px, 6.5vw, 30px);
  font-weight: 800;
  color: var(--ton);
  letter-spacing: -0.5px;
  line-height: 1.05;
  text-shadow: 0 0 18px color-mix(in srgb, var(--primary) 40%, transparent);
  word-wrap: break-word;
}

/* Rate rows */
.wd-rate-box {
  width: 100%;
  background: color-mix(in srgb, var(--primary) 4%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px 16px;
  display: flex;
  flex-direction: column;
}
.wd-rate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
}
.wd-rate-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--t2);
}
.wd-rate-ic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--ton);
  flex-shrink: 0;
}
.wd-rate-ic svg { width: 16px; height: 16px; }
.wd-rate-val {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--t1);
  text-align: right;
}
.accent-ton-text { color: var(--ton); }
.wd-rate-divider { height: 1px; background: var(--border); }

/* Amber warning */
.wd-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--accent-l);
  background: var(--accent-d);
  border: 1px solid rgba(245,166,35,0.3);
  border-radius: 12px;
  padding: 8px 12px;
  line-height: 1.4;
  width: 100%;
  text-align: left;
}
.wd-notice svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent); }

/* Continue button — primary gradient */
.wd-sheet .submit-btn.wd-continue-btn {
  height: 48px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  color: #fff;
  box-shadow: 0 8px 26px var(--primary-d);
}
.wd-sheet .submit-btn.wd-continue-btn:active { filter: brightness(1.08); }

.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(--card-h);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t2);
  cursor: pointer;
}

.wd-step-sub {
  font-size: 13px;
  color: var(--t3);
  line-height: 1.5;
  text-align: left;
  width: 100%;
}

.wd-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: var(--card-h);
  border-radius: 99px;
  overflow: hidden;
}

.wd-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--primary);
  transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* ── Form elements ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--t3);
  text-transform: uppercase;
}

.form-optional {
  font-weight: 400;
  color: var(--t4);
}

.form-input {
  background: var(--card-h);
  border: 1px solid var(--border-a);
  border-radius: var(--radius-sm);
  color: var(--t1);
  font-size: 14px;
  height: 46px;
  padding: 0 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
}

.form-hint--error {
  font-size: 12px;
  color: var(--danger);
  min-height: 16px;
}

/* ── Payment modal ── */
/* Payment modal — centered, green glow (matches Swap modal) */
#pay-modal {
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pay-sheet {
  width: 100%;
  max-width: 400px;
  margin: auto 0;
  border-radius: 24px;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--primary) 10%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  box-shadow: 0 24px 70px color-mix(in srgb, var(--primary) 15%, transparent), 0 8px 24px rgba(0,0,0,0.08);
  padding: 22px 20px 24px;
  gap: clamp(6px, 2vh, 12px);
  max-height: 92svh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pay-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(2px, 0.5vh, 6px);
}

.pay-hero-icon {
  width: clamp(36px, 8vw, 48px);
  height: clamp(36px, 8vw, 48px);
  border-radius: 14px;
  margin-bottom: clamp(2px, 0.8vh, 6px);
  background: var(--primary-d);
  border: 1px solid var(--border-a);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pay-hero-icon svg {
  width: clamp(18px, 4vw, 24px);
  height: clamp(18px, 4vw, 24px);
  stroke: var(--primary-l);
  stroke-width: 2;
  fill: none;
}

.pay-hero-title {
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 800;
  color: var(--t1);
}

.pay-hero-amount {
  font-size: clamp(20px, 6vw, 28px);
  font-weight: 900;
  color: var(--accent);
}

.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 color-mix(in srgb, var(--primary) 12%, transparent);
  border: 3px solid #fff;
  padding: 2px;
}

.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: 0.1em;
  text-transform: uppercase;
}

.pay-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-h);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: clamp(6px, 1.5vh, 10px) 12px;
}

.pay-field--memo .pay-field-row {
  background: rgba(245,158,11,0.06);
  border-color: rgba(245,158,11,0.3);
}

.pay-field-val {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--t1);
  word-break: break-all;
  line-height: 1.4;
}

.pay-field-copy {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--primary-d);
  border: 1px solid var(--border-a);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.pay-field-copy:active {
  opacity: 0.7;
  transform: scale(0.92);
}

.pay-memo-warning {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-l);
  background: var(--accent-d);
  border: 1px solid rgba(245,158,11,0.35);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  line-height: 1.4;
}

/* La dirección y el memo de una factura, a la vista y copiables. Sin el memo
   un pago hecho a mano llega sin poder atribuirse a nadie. */
/* ── La FACTURA de una tarea: dirección y memo ────────────────────────────
   APILADO, no en fila. Lo tenía como `label | valor | copiar` en un flex y una
   dirección de 48 caracteres no cabe en ese hueco: se salía del modal por la
   derecha, junto con el aviso. Con la etiqueta ENCIMA, el valor dispone del
   ancho entero y puede partir — que es lo que hay que poder leer y comprobar
   antes de mandar dinero. */
.pay-manual { margin: 14px 0 6px; display: grid; gap: 10px; }
.pay-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 4px 10px;
  background: var(--card-2, rgba(255,255,255,.05));
  border: 1px solid var(--border, rgba(255,255,255,.08));
  border-radius: 12px; padding: 10px 12px;
}
.pay-row-k {
  grid-column: 1 / -1;
  font-size: .62rem; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; color: var(--muted, #8b8ba0);
}
.pay-row-v {
  min-width: 0; font-size: .8rem; line-height: 1.4; font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  /* `anywhere` y no `break-all`: parte la dirección donde haga falta pero sin
     dejar una línea final de dos caracteres. */
  overflow-wrap: anywhere;
}
.pay-row-c {
  flex: none; width: 32px; height: 32px; border-radius: 9px;
  background: var(--primary-dim, rgba(0,152,234,.12));
  border: none; color: var(--primary, #0098EA);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  align-self: end;
}
.pay-row-c:active { transform: scale(.94); }
.pay-row-c svg { width: 16px; height: 16px; }
/* El memo es el dato que, si se omite, hace que el pago no se pueda acreditar:
   se marca para que no se lea como una fila más. */
.pay-row--key { border-color: rgba(240,84,106,.35); }
.pay-row--key .pay-row-k { color: #ff8fa3; }
.pay-row-warn {
  display: flex; gap: 7px; align-items: flex-start;
  font-size: .7rem; line-height: 1.45; color: #ff8fa3;
  background: rgba(240,84,106,.12); border-radius: 10px; padding: 9px 11px;
}
.pay-row-warn svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }

.pay-tonconnect-btn {
  width: 100%;
  height: 54px;
  margin-top: 8px;
  padding: 0 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-l));
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  box-shadow: 0 8px 26px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: filter 0.15s, transform 0.1s;
}
.pay-tonconnect-btn .gram-logo { filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2)); }

.pay-tonconnect-btn:active {
  filter: brightness(1.08);
  transform: scale(0.98);
}

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

.submit-btn {
  width: 100%;
  height: 48px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  transition: opacity 0.15s, transform 0.1s;
}

.submit-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

.submit-btn:disabled {
  opacity: 0.45;
}

/* ── Power Success modal ── */
#power-success-modal {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#power-success-modal .ps-sheet {
  width: 100%;
  max-width: 360px;
  margin: auto 0;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 24px;
  padding: 28px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--primary) 15%, transparent), 0 8px 24px rgba(0,0,0,0.08);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}

#power-success-modal.open .ps-sheet {
  transform: scale(1);
  opacity: 1;
}

.ps-burst {
  position: absolute;
  top: 90px;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
}

.ps-icon-wrap {
  position: relative;
  margin: 8px 0;
}

.ps-icon-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0.4;
  animation: pulse 2s ease infinite;
}

.ps-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
}

.ps-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--t1);
}

.ps-package {
  font-size: 18px;
  font-weight: 800;
  color: var(--accent);
}

.ps-stats {
  display: flex;
  align-items: center;
  background: var(--card-h);
  border-radius: var(--radius);
  padding: 16px 0;
  width: 100%;
}

.ps-stat {
  flex: 1;
  text-align: center;
}

.ps-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--t3);
}

.ps-stat-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--t1);
  margin-top: 4px;
}

.ps-stat-div {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
}

.ps-close-btn {
  width: 100%;
  height: 48px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.15s, transform 0.1s;
}

.ps-close-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* ── Alert / Input modal ── */
.alert-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 1010;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.alert-overlay.open {
  display: flex;
}
/* El modal de verificación (pegar un enlace, Referral Task) puede medir más
   que una pantalla baja: la capa hace scroll y el verify-sheet, con su
   `margin: auto 0`, queda centrado cuando cabe y desplazable cuando no. */
#input-modal { overflow-y: auto; }

.alert-overlay.open .alert-sheet {
  transform: scale(1);
  opacity: 1;
}

.alert-sheet {
  width: 100%;
  max-width: 360px;
  margin: auto 0;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 24px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--primary) 15%, transparent), 0 8px 24px rgba(0,0,0,0.08);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}

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

.alert-display-power {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary-l);
}

.alert-badge {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
}

.alert-msg {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
}

.alert-ok-btn {
  width: 100%;
  height: 48px;
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 16px;
}

/* ── Verify (bot task) modal ─────────────────────────────────── */
.verify-sheet {
  width: 100%;
  max-width: 360px;
  margin: auto 0;
  background:
    radial-gradient(120% 80% at 50% -10%, color-mix(in srgb, var(--primary) 8%, transparent), transparent 55%),
    linear-gradient(180deg, var(--card-h), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 15%, transparent);
  border-radius: 24px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: 0 24px 70px color-mix(in srgb, var(--primary) 15%, transparent), 0 8px 24px rgba(0,0,0,0.08);
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.22,1,0.36,1), opacity 0.3s ease;
}

.alert-overlay.open .verify-sheet {
  transform: scale(1);
  opacity: 1;
}

.verify-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  color: var(--primary);
}

.verify-icon [data-lucide] {
  width: 26px;
  height: 26px;
}

.verify-badge {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
}

.verify-msg {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  margin-bottom: 4px;
}

.verify-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card-h);
  border: 1px solid var(--border-a);
  border-radius: var(--radius);
  padding: 12px 14px;
  text-align: left;
}

.verify-step {
  display: flex;
  align-items: center;
  gap: 10px;
}

.verify-step-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.verify-step-text {
  flex: 1;
  font-size: 12.5px;
  color: var(--t1);
  line-height: 1.4;
}

.verify-step-action {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.verify-step-action [data-lucide] {
  width: 14px;
  height: 14px;
}

.verify-input-wrap {
  width: 100%;
  display: flex;
  align-items: center;
  background: var(--card-h);
  border: 1px solid var(--border-a);
  border-radius: var(--radius-sm);
  margin-top: 6px;
  transition: border-color 0.2s;
}

.verify-input-wrap:focus-within {
  border-color: var(--primary);
}

.verify-input-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-left: 12px;
  color: var(--t3);
}

.verify-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--t1);
  font-size: 13.5px;
  height: 46px;
  padding: 0 10px;
  outline: none;
  font-family: inherit;
}

.verify-input::placeholder {
  color: var(--t3);
}

.verify-paste-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  margin-right: 4px;
  border: none;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.verify-paste-btn [data-lucide] {
  width: 16px;
  height: 16px;
}

.verify-error {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--danger);
  min-height: 16px;
  text-align: left;
  width: 100%;
}

.verify-error:empty {
  min-height: 0;
}

.verify-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  margin-top: 10px;
}

.verify-btn-cancel,
.verify-btn-confirm {
  flex: 1;
  height: 48px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: none;
}

.verify-btn-cancel {
  background: var(--card-h);
  color: var(--t2);
}

.verify-btn-confirm {
  flex: 1.4;
  background: var(--primary);
  color: #fff;
}

.verify-icon-danger {
  background: color-mix(in srgb, var(--danger) 14%, transparent);
  color: var(--danger);
}

.verify-btn-danger {
  background: var(--danger);
}

/* ── My Tasks (tasks created by the user) ─────────────────────── */
.my-task-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: var(--card);
  border-radius: 15px;
  border: 1px solid var(--border);
  margin-bottom: 11px;
}

.my-task-card.is-inactive { opacity: 0.6; }

.my-task-top {
  display: flex;
  align-items: center;
  gap: 13px;
}

.my-task-body { flex: 1; min-width: 0; }

.my-task-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--t1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.my-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--t3);
  background: var(--card-h);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 7px;
  margin-top: 4px;
}

.my-task-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.my-task-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--card-h);
  border: 1px solid var(--border);
  color: var(--t2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.my-task-icon-btn [data-lucide] { width: 15px; height: 15px; }
.my-task-icon-btn:active { transform: scale(0.94); }
.my-task-icon-btn.danger:active { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

.my-task-stats {
  display: flex;
  align-items: center;
  gap: 12px;
}

.my-task-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--card-h);
  border-radius: 3px;
  overflow: hidden;
}

.my-task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-l));
  border-radius: 3px;
}

.my-task-progress-label {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--t2);
  white-space: nowrap;
}

.my-task-spent {
  font-size: 11.5px;
  color: var(--t3);
}

/* ── 12. Loading screen ────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s cubic-bezier(0.4,0,0.2,1);
}

#loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Arranque en frío (sin marca cacheada de ESTE bot): spinner neutro, sin nombre
   ni rayo, para que el splash del hijo no muestre por defecto los datos de la
   madre. Se limpia (data-splash) en cuanto /config o /auth traen la marca real.
   La variante html[...] la pone el script inline del <head> (index.html) ANTES
   del primer paint — app.js llega tarde para el frame cero en redes lentas. */
body[data-splash="cold"] #loading-screen,
html[data-splash="cold"] #loading-screen {
  --primary:   #8b8b96;
  --primary-l: #a0a0ab;
  --primary-d: rgba(140,140,150,0.10);
  --ring:      #9a9aa6;
  --ring-glow: rgba(140,140,150,0.28);
}
body[data-splash="cold"] #loading-screen .mn-ring-label,
body[data-splash="cold"] #loading-screen .mn-ring-bolt,
html[data-splash="cold"] #loading-screen .mn-ring-label,
html[data-splash="cold"] #loading-screen .mn-ring-bolt {
  display: none;
}

/* Pre-boot de skins con capa JS (coop, etc.): reconstruyen la UI y traen su
   propio splash, así que ni #app ni el ring genérico de la madre deben
   pintarse NI UN FRAME. El atributo lo pone el script inline del <head> desde
   la caché por-tenant; app.js lo mantiene (applySkin) y lo quita si el JS del
   skin falla en cargar (fallback a la UI por defecto). */
html[data-skin-js] #app,
html[data-skin-js] #loading-screen .mn-ring {
  display: none;
}

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

.ls-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 8px 32px color-mix(in srgb, var(--primary) 20%, transparent);
}

.ls-power-counter {
  font-size: 52px;
  font-weight: 900;
  color: var(--t1);
  font-variant-numeric: tabular-nums;
  min-width: 200px;
  text-align: center;
}

.ls-power-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-top: -8px;
}

.ls-bar {
  width: 200px;
  height: 4px;
  background: var(--card-h);
  border-radius: 2px;
  overflow: hidden;
}

.ls-bar-fill {
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
  animation: barFill 2.5s ease-out forwards;
}

/* ── 13. Toast ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border-a);
  border-radius: var(--radius-sm);
  color: var(--t1);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 18px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 9000;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.toast.show {
  opacity: 1;
}

.toast.error {
  border-color: rgba(239,68,68,0.5);
  color: var(--danger);
}

.toast.success {
  border-color: rgba(16,185,129,0.4);
  color: var(--success);
}

/* ── 14. Utilities ─────────────────────────────────────────────── */
.accent-ton-text {
  color: var(--primary);
}

/* Lang selector */
.lang-selector {
  position: relative;
}

.lang-selector-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--t2);
  font-size: 13px;
  transition: border-color 0.15s, color 0.15s;
}

.lang-selector-btn:hover {
  border-color: var(--primary);
  color: var(--t1);
}

.lang-selector-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  transition: transform 0.2s;
}

.lang-selector-btn[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border-a);
  border-radius: var(--radius);
  padding: 6px;
  min-width: 120px;
  list-style: none;
  z-index: 500;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 12%, transparent), 0 2px 6px rgba(0,0,0,0.06);
}

.lang-dropdown li {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--t2);
  transition: background 0.12s, color 0.12s;
}

.lang-dropdown li:hover {
  background: var(--card-h);
  color: var(--t1);
}

/* Lucide icon helpers */
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;
}

[data-lucide="loader"] {
  animation: spin 1s linear infinite;
}

/* ── 15. Animations ────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50%       { transform: scale(1.12); opacity: 0.7; }
}

@keyframes barFill {
  from { width: 0%; }
  to   { width: 100%; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { left: -100%; }
  100% { left: 130%; }
}

/* ═══════════════════════════════════════════════════════════════
   16. Withdrawals live feed (wf-)
   ═══════════════════════════════════════════════════════════════ */
.wf-page { --ring: var(--primary-l); --ring-glow: color-mix(in srgb, var(--primary-l) 50%, transparent); }

/* ── Hero: big TOTAL ── */
.wf-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px 16px 18px;
  margin-bottom: 8px;
  border-radius: 20px;
  background:
    radial-gradient(120% 80% at 50% -20%, color-mix(in srgb, var(--primary-l) 22%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--card-h) 88%, var(--primary) 12%), var(--card));
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
  box-shadow: 0 14px 40px color-mix(in srgb, var(--primary) 22%, transparent), 0 2px 8px rgba(0,0,0,0.04);
  overflow: hidden;
}

/* LIVE pill (tap to refresh) */
.wf-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px 5px 9px;
  border-radius: 20px;
  background: rgba(16,185,129,0.10);
  border: 1px solid rgba(16,185,129,0.30);
  color: var(--success);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, background 0.18s;
}
.wf-live:active { transform: scale(0.94); background: rgba(16,185,129,0.18); }
.wf-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(16,185,129,0.6);
  animation: wfLivePulse 1.6s ease-out infinite;
}
@keyframes wfLivePulse {
  0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(16,185,129,0); }
  100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

/* The giant number */
.wf-total {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--t1);
}
.wf-total-gram {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 14px color-mix(in srgb, var(--primary-l) 45%, transparent));
}
.wf-total-stack {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1;
}
.wf-total-val {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -1.2px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--t1) 0%, var(--primary) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.wf-total-unit {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--primary);
}

.wf-subtitle {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--t3);
}
.wf-count {
  margin-top: 4px;
  font-size: 12px;
  color: var(--t3);
  min-height: 14px;
}

/* ── Section label ── */
.wf-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--t3);
  margin: 6px 2px 10px;
  text-transform: uppercase;
}

/* ── List ── */
.wf-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 22px color-mix(in srgb, var(--primary) 6%, transparent);
}

.wf-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 6%, transparent);
  animation: fadeIn 0.25s ease;
}
.wf-row:last-child { border-bottom: none; }

.wf-row-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.wf-row-avatar--photo { object-fit: cover; }

.wf-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wf-row-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--t1);
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wf-row-handle {
  font-size: 12px;
  font-weight: 500;
  color: var(--t3);
  flex-shrink: 0;
}
.wf-row-amount {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.wf-row-amount span { font-size: 11px; font-weight: 700; color: var(--t3); margin-left: 2px; }
.wf-row-wallet {
  font-size: 11.5px;
  color: var(--t2);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 3px;
}
.wf-row-wallet svg { width: 12px; height: 12px; color: var(--success); }
.wf-row-time {
  font-size: 10.5px;
  color: var(--t3);
  margin-top: 1px;
}

/* Verify button → opens tx on tonviewer */
.wf-verify-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 11px;
  border-radius: 20px;
  border: 1px solid var(--border-a);
  background: var(--card-h);
  color: var(--primary);
  font-size: 11.5px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, background 0.18s, box-shadow 0.18s;
}
.wf-verify-btn svg { width: 13px; height: 13px; }
.wf-verify-btn:active {
  transform: scale(0.94);
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 30%, transparent);
}

/* ── States ── */
.wf-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 32px 16px;
  font-size: 13px;
  color: var(--t3);
}
.wf-loading svg { width: 16px; height: 16px; animation: spin 1s linear infinite; }
.wf-loading--err { color: var(--danger); }

.wf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 20px;
  gap: 6px;
}
.wf-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--card-h);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-l);
  margin-bottom: 6px;
}
.wf-empty-icon svg { width: 26px; height: 26px; }
.wf-empty-title { font-size: 15px; font-weight: 700; color: var(--t1); }
.wf-empty-sub { font-size: 13px; color: var(--t2); line-height: 1.45; max-width: 240px; }

.wf-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px 4px;
}

/* ═══════════════════════════════════════════════════════════════
   Earn page — Create Task button + modal
   ═══════════════════════════════════════════════════════════════ */
.earn-create-btn {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: 1.5px dashed var(--border-a);
  background: var(--primary-d);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.12s, background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.earn-create-btn:active { transform: scale(0.97); }
.earn-create-btn [data-lucide] { width: 20px; height: 20px; }

/* Create task modal — centered */
#create-task-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.create-task-modal {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.create-task-modal .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 8px;
}
.create-task-modal .modal-head h3 { font-size: 1rem; font-weight: 800; color: var(--t1); }
.modal-x { background: none; border: none; color: var(--t3); padding: 4px; cursor: pointer; }
.modal-x [data-lucide] { width: 20px; height: 20px; }
.create-task-modal .modal-body { padding: 2px 18px 4px; }
.create-task-modal .modal-foot { padding: 8px 18px 16px; display: flex; gap: 10px; }

.form-group { margin-bottom: 12px; }
.form-label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--t2); margin-bottom: 5px; }
.form-input {
  width: 100%; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; color: var(--t1); font-size: 0.85rem; outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--primary); }
.form-hint { font-size: 0.7rem; color: var(--t3); margin-top: 4px; }

.seg-control { display: flex; gap: 4px; background: var(--primary-d); padding: 3px; border-radius: 10px; }
.seg-btn {
  flex: 1; padding: 8px; border: none; border-radius: 7px;
  background: transparent; color: var(--t2); font-size: 0.74rem; font-weight: 700;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.seg-btn.active { background: var(--card); color: var(--primary); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }

.create-task-cost {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border-radius: 11px;
  background: var(--primary-d); color: var(--primary);
  font-size: 0.76rem; font-weight: 600; line-height: 1.4;
}
.create-task-cost [data-lucide] { width: 16px; height: 16px; flex-shrink: 0; }

.modal-btn-cancel, .modal-btn-primary {
  flex: 1; padding: 11px; border-radius: 10px; font-size: 0.85rem; font-weight: 700;
  cursor: pointer; border: none; transition: transform 0.12s, opacity 0.15s;
}
.modal-btn-cancel:active, .modal-btn-primary:active { transform: scale(0.97); }
.modal-btn-cancel {
  background: var(--surface); border: 1px solid var(--border); color: var(--t2);
}
.modal-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-l)); color: #fff;
}
.modal-btn-primary:disabled { opacity: 0.5; }

/* ── Pantalla de "no registrado" ──────────────────────────────────────────────
   Estos son los estilos de MINERÍA (la plantilla base). Cada skin la reescribe
   en su propio CSS: no basta con cambiar el texto, porque lo que la gente ve de
   una pantalla es su forma, no su párrafo. */
#nr-card { text-align: center; align-items: center; gap: 20px; padding: 32px 24px 28px; }
#nr-icon { font-size: 52px; line-height: 1; }
#nr-title { margin: 0 0 10px; font-size: 20px; font-weight: 700; color: var(--primary-l); }
#nr-body { margin: 0; font-size: 14px; color: var(--t2); line-height: 1.5; }
#nr-btn { width: 100%; margin-top: 4px; }
/* Los dos secundarios se pintan con el color de texto que ya tiene la tarjeta,
   así que ninguna plantilla necesita declararlos para que se vean; las que
   quieran afinar el tono sobrescriben el color y ya. */
#nr-verify, #nr-close {
  width: 100%; background: none; border: none; font: inherit; cursor: pointer;
  padding: 10px 4px; font-size: 13px; font-weight: 600; color: var(--t2);
}
/* Márgenes negativos contra el `gap` de #nr-card: los tres botones tienen que
   leerse como UN bloque de acciones con tres pesos, no como tres cosas sueltas
   repartidas por la tarjeta. */
#nr-verify { text-decoration: underline; text-underline-offset: 3px; margin-top: -8px; }
#nr-verify:disabled { opacity: .6; cursor: wait; text-decoration: none; }
#nr-close { font-size: 12px; font-weight: 500; opacity: .7; padding-top: 0; margin-top: -18px; }
/* Vacío hasta que una verificación falla: sin min-height ni margen propio, la
   tarjeta no reserva un hueco para un aviso que casi nunca aparece. */
#nr-hint:empty { display: none; }
#nr-hint { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--danger); }

/* ── Auto-alta: selector de idioma + recordatorio de /start ─────────────────
   Reusan #nr-card (centrado, mismos paddings) vía las mismas tarjetas. */
#sr-card, #sn-card { text-align: center; align-items: center; gap: 18px; padding: 30px 24px 26px; }
#sr-icon, #sn-icon { font-size: 48px; line-height: 1; }
#sr-title, #sn-title { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: var(--primary-l); }
#sr-sub, #sn-body { margin: 0; font-size: 14px; color: var(--t2); line-height: 1.5; }
#sn-continue { width: 100%; margin-top: 4px; }
.sr-lang-list { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.sr-lang {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 14px; cursor: pointer;
  background: var(--card, rgba(255,255,255,.04)); border: 1px solid var(--border);
  transition: border-color .15s, background .15s;
}
.sr-lang:active { transform: scale(.99); }
.sr-lang:hover { border-color: var(--accent); }
.sr-lang .lang-flag { display: inline-flex; flex-shrink: 0; }
.sr-lang .lang-flag-img { border-radius: 3px; }
.sr-lang-label { flex: 1; text-align: left; font-size: 15px; font-weight: 600; color: var(--t1, var(--primary-l)); }
.sr-lang-go { width: 18px; height: 18px; color: var(--t3); flex-shrink: 0; }
.sr-hint:empty { display: none; }
.sr-hint { margin: 8px 0 0; font-size: 12px; line-height: 1.45; color: var(--t2); }

/* ── Portada de "ábrelo en Telegram" ─────────────────────────────────────────
   Lo que ve quien abre la app en un NAVEGADOR desde el dominio espejo. Sin
   initData no hay identidad y la app no puede arrancar: antes eso dejaba una
   pantalla en blanco, que es la peor postal para un dominio que el dueño enseña
   a sus anunciantes. Lo monta index.html, y solo cuando NO hay Telegram. */
.tgfb { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.tgfb-card {
  width: 100%; max-width: 340px; text-align: center; padding: 32px 24px;
  border-radius: 20px; background: var(--card, #fff);
  border: 1px solid var(--line, rgba(20,25,36,.10));
}
.tgfb-logo { border-radius: 20px; margin-bottom: 18px; object-fit: cover; }
.tgfb-card h1 { margin: 0 0 10px; font-size: 1.3rem; font-weight: 750; letter-spacing: -.02em; }
.tgfb-card p { margin: 0; font-size: .95rem; line-height: 1.55; color: var(--t2, #5d6779); }
.tgfb-btn {
  display: block; margin-top: 24px; padding: 14px; border-radius: 14px;
  text-decoration: none; font-size: .95rem; font-weight: 700;
  color: #fff; background: #2AABEE;
}
.tgfb-btn:active { transform: translateY(1px); }
.tgfb-hint { margin-top: 14px !important; font-size: .8rem !important; }
/* ── Social Task (clásico): el cuerpo común de social-tasks.js dentro de la
   verify-sheet de siempre. Las demás skins visten el suyo con su prefijo. ── */
#social-modal { overflow-y: auto; }
.cl-soc-sheet { position: relative; align-items: stretch; text-align: left; }
.cl-soc-x {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--card-h); color: var(--t2); font-size: 14px; cursor: pointer;
}
.cl-soc { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.cl-soc-head { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 0 26px; }
.cl-soc-ico {
  width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; background: color-mix(in srgb, var(--primary) 14%, transparent);
}
.cl-soc-title { font-size: 15px; font-weight: 700; color: var(--t1); margin: 0; overflow-wrap: anywhere; }
.cl-soc-reward { font-size: 13px; font-weight: 800; color: var(--primary); }
.cl-soc-instr {
  font-size: 12.5px; line-height: 1.5; color: var(--t2); white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--card-h); border: 1px solid var(--border-a); border-radius: var(--radius); padding: 10px 12px;
  max-height: 32vh; overflow-y: auto;
}
.cl-soc-state { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; line-height: 1.45; color: var(--t2);
  border-radius: var(--radius); padding: 10px 12px; }
.cl-soc-state b { color: var(--t1); font-size: 13px; }
.cl-soc-state.pending { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.cl-soc-state.bad { background: color-mix(in srgb, var(--danger, #ef4444) 12%, transparent); }
.cl-soc-step { display: flex; align-items: center; gap: 10px; background: var(--card-h); border: 1px solid var(--border-a);
  border-radius: var(--radius); padding: 10px 12px; }
.cl-soc-step.col { flex-direction: column; align-items: stretch; }
.cl-soc-row { display: flex; align-items: center; gap: 10px; }
.cl-soc-n { flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; background: color-mix(in srgb, var(--primary) 16%, transparent); color: var(--primary); }
.cl-soc-step.done .cl-soc-n { background: var(--success, #22c55e); color: #fff; }
.cl-soc-t { flex: 1; min-width: 0; font-size: 12.5px; color: var(--t1); line-height: 1.4; }
.cl-soc-open { flex-shrink: 0; height: 30px; padding: 0 14px; border: none; border-radius: 10px; font-size: 12px; font-weight: 700;
  background: var(--primary); color: #fff; cursor: pointer; }
.cl-soc-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 84px;
  border: 1.5px dashed color-mix(in srgb, var(--primary) 45%, transparent); border-radius: var(--radius-sm); padding: 10px;
  cursor: pointer; text-align: center; }
.cl-soc-drop.has { border-style: solid; }
.cl-soc-prev { max-width: 100%; max-height: 160px; border-radius: 10px; object-fit: contain; }
.cl-soc-drop-t { font-size: 12px; font-weight: 700; color: var(--primary); }
.cl-soc-text { width: 100%; min-height: 52px; resize: vertical; padding: 10px 12px; font: inherit; font-size: 13px; }
.cl-soc-err { min-height: 1em; font-size: 12px; font-weight: 700; color: var(--danger, #ef4444); text-align: center; }
.cl-soc-err:empty { display: none; }
.cl-soc-send { width: 100%; flex: none; }
.task-btn.social-pending { opacity: .75; background: var(--card-h); color: var(--t2); }
.task-btn.social-rejected { background: color-mix(in srgb, var(--danger, #ef4444) 16%, transparent); color: var(--danger, #ef4444); }
.task-btn.social-final { background: var(--card-h); color: var(--t3); }
