/* ============================================
   FIGU 26 · v3
   Diseño: rojo River (#E10E2A) + neutros
   Dark/Light mode switcheable
   ============================================ */

/* ===== SPLASH SCREEN ===== */
.splash {
  position: fixed;
  inset: 0;
  background: #FFFFFF;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Forzar a cubrir todo el viewport en iOS standalone */
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}
.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 20px;
  max-width: 90vw;
}
.splash-logo {
  width: min(75vw, 380px);
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.10));
}
.splash-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(70vw, 280px);
}
.splash-bar {
  width: 100%;
  height: 4px;
  background: rgba(0,0,0,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.splash-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #E10E2A, #ff3854);
  border-radius: 2px;
  transition: width 0.4s ease-out;
}
.splash-text {
  font-family: 'SF Pro Display', -apple-system, system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(0,0,0,0.55);
  letter-spacing: -0.01em;
  min-height: 18px;
  text-align: center;
  transition: opacity 0.32s ease;
}
.splash-text.fading { opacity: 0; }
.splash-hidden {
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
/* Splash siempre fondo blanco — no se oscurece en dark mode */
@media (prefers-color-scheme: dark) {
  .splash { background: #FFFFFF; }
}


/* ===== TOKENS ===== */
:root {
  --brand: #E10E2A;
  --brand-soft: rgba(225,14,42,0.10);
  --brand-soft-border: rgba(225,14,42,0.20);
  
  --success: #34C759;
  --warning: #FF9500;
  --danger: #FF3B30;
  
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  
  --duration-fast: 0.15s;
  --duration: 0.25s;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  
  --font-display: 'SF Pro Display', -apple-system, system-ui, sans-serif;
  --font-text: -apple-system, 'SF Pro Text', system-ui, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'Menlo', monospace;
}

/* Light mode (default) */
:root, [data-theme="light"] {
  --bg: #FFFFFF;
  --bg-soft: #F5F5F7;
  --bg-card: #FFFFFF;
  --bg-elevated: #FFFFFF;
  
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);
  --separator: rgba(0,0,0,0.06);
  --gold: #C9A227;
  
  --text: #000000;
  --text-soft: rgba(0,0,0,0.60);
  --text-dim: rgba(0,0,0,0.38);
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10);
  
  --overlay: rgba(0,0,0,0.40);
}

/* Dark mode */
[data-theme="dark"] {
  --bg: #000000;
  --bg-soft: #1C1C1E;
  --bg-card: #1C1C1E;
  --bg-elevated: #2C2C2E;
  
  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);
  --separator: rgba(255,255,255,0.08);
  --gold: #E0B947;
  
  --text: #FFFFFF;
  --text-soft: rgba(255,255,255,0.65);
  --text-dim: rgba(255,255,255,0.40);
  
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
  --shadow: 0 1px 3px rgba(0,0,0,0.6);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.7);
  
  --overlay: rgba(0,0,0,0.65);
}

/* Auto mode follows system */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]),
  [data-theme="auto"] {
    --bg: #000000;
    --bg-soft: #1C1C1E;
    --bg-card: #1C1C1E;
    --bg-elevated: #2C2C2E;
    --border: rgba(255,255,255,0.10);
    --border-strong: rgba(255,255,255,0.18);
    --separator: rgba(255,255,255,0.08);
  --gold: #E0B947;
    --text: #FFFFFF;
    --text-soft: rgba(255,255,255,0.65);
    --text-dim: rgba(255,255,255,0.40);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.5);
    --shadow: 0 1px 3px rgba(0,0,0,0.6);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.7);
    --overlay: rgba(0,0,0,0.65);
  }
}

/* ===== RESET ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  height: 100%;
  overscroll-behavior-y: contain;
}
body {
  font-family: var(--font-text);
  font-size: 15px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum' 1;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
input { -webkit-appearance: none; appearance: none; }

/* Default SVG sizing (prevent giant SVGs) */
svg {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
  fill: none;
  stroke-width: 1.8;
}

/* ===== LAYOUT ===== */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg);
}

/* ===== TOP BAR ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 20px 8px;
  background: var(--bg);
  border-bottom: 0.5px solid var(--separator);
  position: sticky;
  top: 0;
  z-index: 30;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: pointer;
}
.logo span { color: var(--brand); }
.top-actions { display: flex; gap: 4px; }

/* ===== BANNER MODO EDITOR =====
   Solo visible cuando body.editor-mode está activo.
   Mantiene siempre visible que estamos editando data permanente. */
.editor-banner {
  display: none;
  position: sticky;
  top: calc(var(--safe-top) + 52px);
  z-index: 28;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(90deg, #fff3cd, #ffe69c);
  border-bottom: 0.5px solid #d6a300;
  color: #6a4d00;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}
body.editor-mode .editor-banner { display: flex; }
.editor-banner-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 3px rgba(255,149,0,0.18);
  animation: editor-pulse 2s ease-in-out infinite;
}
@keyframes editor-pulse {
  50% { box-shadow: 0 0 0 6px rgba(255,149,0,0.05); }
}
.editor-banner-text { flex: 1; }
.editor-banner-action { font-size: 11px; opacity: 0.7; }

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--duration-fast);
}
.icon-btn:active { background: var(--bg-soft); }
.icon-btn svg { width: 20px; height: 20px; stroke-width: 1.8; }

/* ===== MAIN VIEWS ===== */
.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(74px + var(--safe-bottom));
}
.view { display: none; padding: 8px 0 24px; }
.view.active { display: block; }

/* ===== SECTION TITLE ===== */
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 24px 20px 12px;
}
.section-title h3 {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
}
.section-title a {
  font-size: 14px;
  color: var(--brand);
  font-weight: 500;
  cursor: pointer;
}

/* ===== HOME · HERO ===== */
.hero {
  padding: 12px 20px 28px;
}
.hero-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  margin-bottom: 10px;
}
.hero-pct {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--text);
}
.hero-pct .symbol {
  font-size: 32px;
  font-weight: 500;
  color: var(--text-soft);
  margin-left: 2px;
}
.hero-frac {
  font-size: 14px;
  color: var(--text-soft);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.hero-bar {
  height: 4px;
  background: var(--bg-soft);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 16px;
}
.hero-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  transition: width 0.5s var(--ease);
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 20px;
  gap: 4px;
}
.hero-stat {
  text-align: left;
  padding-right: 8px;
  position: relative;
}
.hero-stat + .hero-stat {
  padding-left: 10px;
  border-left: 0.5px solid var(--separator);
}
.hero-stat { padding-right: 4px; }
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.hero-stat-num.success { color: var(--success); }
.hero-stat-num.brand { color: var(--brand); }
.hero-stat-num.gold { color: var(--gold); }
.hero-stat-sub {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
  margin-left: 1px;
}
.hero-stat-label {
  font-size: 11px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 4px;
  font-weight: 600;
}

/* ===== ROW / LIST ITEM (iOS-style) ===== */
.list {
  background: var(--bg-card);
  margin: 0 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  position: relative;
  background: var(--bg-card);
  transition: background var(--duration-fast);
}
.list-row + .list-row::before {
  content: '';
  position: absolute;
  left: 60px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}
.list-row:active { background: var(--bg-soft); }
.list-row-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
}
.list-row-flag {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.list-row-info { flex: 1; min-width: 0; }
.list-row-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.list-row-title .check {
  color: var(--success);
  font-size: 13px;
  font-weight: 700;
}
.list-row-subtitle {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.list-row-trailing {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.list-row-value {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.list-row-value.success { color: var(--success); }
.list-row-value.brand { color: var(--brand); }
.list-row-mini-bar {
  width: 42px;
  height: 3px;
  background: var(--bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.list-row-mini-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
}
.list-row.complete .list-row-mini-fill { background: var(--success); }
.list-row-chevron {
  color: var(--text-dim);
  margin-left: 4px;
}

/* ===== QUICK CARDS (home) ===== */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
  margin-bottom: 8px;
}
.quick-card {
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.quick-card:active { background: var(--bg-soft); }
.quick-card-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--brand);
}
.quick-card-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.quick-card-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.quick-card-label {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
  font-weight: 500;
}

/* ===== PACKS BANNER (home) ===== */
.packs-banner {
  margin: 0 16px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.packs-banner:active { background: var(--bg-soft); }
.packs-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.packs-banner-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.packs-banner-info { flex: 1; min-width: 0; }
.packs-banner-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.packs-banner-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.packs-banner-chevron { color: var(--text-dim); }

/* ===== FILTERS ===== */
.filters {
  display: flex;
  gap: 8px;
  padding: 4px 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  padding: 7px 14px;
  border-radius: 100px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all var(--duration-fast);
}
.filter.active {
  background: var(--text);
  color: var(--bg);
}
.filter .count {
  font-size: 11px;
  opacity: 0.6;
  font-variant-numeric: tabular-nums;
}

/* ===== TEAM DETAIL ===== */
.team-header {
  padding: 12px 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.team-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex-shrink: 0;
  transition: background var(--duration-fast);
}
.team-back:active { background: var(--bg-elevated); }
.team-header-flag {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.team-header-info { flex: 1; min-width: 0; }
.team-header-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.team-header-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.team-header-pct {
  text-align: right;
}
.team-header-pct-big {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.team-header-frac {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.team-header-edit-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,149,0,0.15);
  color: var(--warning);
  border: 0.5px solid rgba(255,149,0,0.35);
  margin-left: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.team-header-edit-btn:active { background: rgba(255,149,0,0.28); }
.team-header-edit-btn svg { width: 18px; height: 18px; stroke-width: 2; }

/* ===== STICKER GRID ===== */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 16px;
}
.sticker {
  aspect-ratio: 0.72;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--bg-soft);
  transition: transform var(--duration-fast);
}
.sticker:active { transform: scale(0.96); }
.sticker.have {
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
}
.sticker.have img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sticker.have.no-img {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  text-align: center;
}
.sticker.have.no-img .num {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.sticker.have.no-img .name {
  font-size: 9px;
  color: var(--text-soft);
  margin-top: 2px;
  line-height: 1.1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.sticker.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0.5px dashed var(--border-strong);
  background: transparent;
  padding: 6px;
  text-align: center;
}
.sticker.empty .num {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: -0.02em;
}
.sticker.empty .name {
  font-size: 9px;
  color: var(--text-dim);
  margin-top: 2px;
  line-height: 1.1;
}
.sticker.star-player.empty {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.sticker.star-player.empty .num,
.sticker.star-player.empty .name { color: var(--brand); }
.sticker .dup-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--brand);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sticker.special {
  background: var(--bg-card);
}
.sticker.special.have {
  border-color: var(--brand);
}
.sticker .star-icon {
  position: absolute;
  top: 4px;
  left: 4px;
  color: var(--brand);
  font-size: 12px;
}

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 16px;
}
.stat-card {
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: 16px;
  cursor: default;
}
.stat-card.wide { grid-column: span 2; }
.stat-card.tappable { cursor: pointer; transition: background var(--duration-fast); }
.stat-card.tappable:active { background: var(--bg-soft); }
.stat-card-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 6px;
}
.stat-card-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-card-detail {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* Invest card (uses brand) */
.invest-card {
  background: var(--brand-soft);
  border-color: var(--brand-soft-border);
}
.invest-card .stat-card-label { color: var(--brand); }

/* ===== HALL OF FAME ===== */
.hall {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 16px;
}
.hall-card {
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.hall-card.miss { opacity: 0.4; }
.hall-card:active { background: var(--bg-soft); }
.hall-img {
  width: 100%;
  aspect-ratio: 0.72;
  margin-bottom: 6px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-soft);
}
.hall-img img { width: 100%; height: 100%; object-fit: cover; }
.hall-flag {
  width: 100%;
  aspect-ratio: 0.72;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 6px;
  background: var(--bg-soft);
  border-radius: 6px;
}
.hall-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 2px;
}
.hall-code {
  font-size: 10px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

/* ===== EXCHANGE ===== */
.segmented {
  display: flex;
  background: var(--bg-soft);
  border-radius: 9px;
  padding: 2px;
  margin: 0 16px 14px;
}
.segmented-item {
  flex: 1;
  padding: 7px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 7px;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.segmented-item.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
}
.share-btn {
  margin: 0 16px 14px;
  padding: 13px 18px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 32px);
  letter-spacing: -0.01em;
  transition: opacity var(--duration-fast);
}
.share-btn:active { opacity: 0.7; }
.share-btn svg { width: 18px; height: 18px; stroke-width: 2; }

.exchange-group-label {
  padding: 16px 20px 6px;
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.exchange-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  position: relative;
  transition: background var(--duration-fast);
}
.exchange-row:active { background: var(--bg-soft); }
.exchange-row + .exchange-row::before {
  content: '';
  position: absolute;
  left: 76px;
  right: 16px;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}
.exchange-thumb {
  width: 48px;
  height: 64px;
  border-radius: 6px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.exchange-thumb img { width: 100%; height: 100%; object-fit: cover; }
.exchange-info { flex: 1; min-width: 0; }
.exchange-code {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.exchange-name {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.exchange-count {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 10px;
  border-radius: 100px;
  font-variant-numeric: tabular-nums;
}

/* ===== PACKS ===== */
.spend-hero {
  padding: 12px 20px 24px;
}
.spend-amount {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.add-pack-btn {
  margin: 8px 16px 16px;
  padding: 14px;
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 32px);
  letter-spacing: -0.01em;
  transition: opacity var(--duration-fast);
}
.add-pack-btn:active { opacity: 0.7; }
.add-pack-btn svg { width: 18px; height: 18px; stroke-width: 2; }

.prediction {
  margin: 0 16px 16px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--separator);
}
.prediction-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  font-weight: 600;
  margin-bottom: 8px;
}
.prediction-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.prediction-text strong {
  font-weight: 600;
  color: var(--brand);
}

.pack-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--bg-card);
  position: relative;
  transition: background var(--duration-fast);
}
.pack-row + .pack-row::before {
  content: '';
  position: absolute;
  left: 60px;
  right: 0;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}
.pack-row:active { background: var(--bg-soft); }
.pack-row .list-row-icon {
  background: var(--brand-soft);
  color: var(--brand);
}
.pack-row .list-row-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.pack-date {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.pack-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}
.pack-cost {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

/* ===== ACHIEVEMENTS ===== */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 16px;
}
.achievement {
  aspect-ratio: 1;
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.achievement:active { background: var(--bg-soft); }
.achievement-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  color: var(--text-dim);
  transition: all var(--duration);
}
.achievement-icon svg { width: 18px; height: 18px; stroke-width: 1.8; }
.achievement.unlocked .achievement-icon {
  background: var(--brand-soft);
  color: var(--brand);
}
.achievement-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}
.achievement.locked { opacity: 0.5; }
.achievement.locked .achievement-label { color: var(--text-soft); }

/* ===== STICKER MODAL ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.modal-backdrop.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg);
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 16px 20px calc(20px + var(--safe-bottom));
  animation: slideUp 0.3s var(--ease);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.modal-handle {
  width: 36px;
  height: 5px;
  background: var(--text-dim);
  border-radius: 100px;
  margin: 0 auto 14px;
  opacity: 0.3;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.modal-subtitle {
  font-size: 13px;
  color: var(--text-soft);
  margin-bottom: 16px;
  font-variant-numeric: tabular-nums;
}
.modal-sticker-preview {
  width: 60%;
  aspect-ratio: 0.72;
  margin: 4px auto 18px;
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
  position: relative;
}
.modal-sticker-preview img { width: 100%; height: 100%; object-fit: cover; }
.modal-sticker-preview .no-img-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: -0.02em;
  position: relative;
  padding: 16px;
  text-align: center;
}
.modal-sticker-preview .no-img-fallback.team {
  background-color: var(--bg-soft);
}
.modal-sticker-preview .no-img-fallback .fb-flag {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.15));
}
.modal-sticker-preview .no-img-fallback .fb-num {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.04em;
  line-height: 1;
}
.modal-sticker-preview .no-img-fallback .fb-tag {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Modal preview: shiny */
.modal-sticker-preview .no-img-fallback.shiny {
  background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  color: white;
}
.modal-sticker-preview .no-img-fallback.shiny .fb-num {
  color: transparent;
  background: linear-gradient(135deg, #ffe680 0%, #ffaa00 25%, #ff6b35 50%, #c9a227 75%, #ffe680 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: holo-shift 3s ease-in-out infinite;
}
.modal-sticker-preview .no-img-fallback.shiny .fb-tag {
  color: rgba(255,255,255,0.7);
}
.modal-sticker-preview .no-img-fallback.shiny .fb-shiny-bg {
  position: absolute;
  inset: 0;
  background: 
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(255,255,255,0.04) 12px 14px),
    radial-gradient(circle at 30% 30%, rgba(147,51,234,0.18), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(201,162,39,0.22), transparent 50%);
  pointer-events: none;
}
@keyframes holo-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ────────────────────────────────────────────────
   Modal: metadata del jugador (nac, altura, peso, club)
   ──────────────────────────────────────────────── */
.modal-player-meta {
  margin: 6px 0 14px;
  padding: 12px 14px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.modal-meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  line-height: 1.4;
}
.modal-meta-label {
  color: var(--text-soft);
  font-weight: 500;
}
.modal-meta-value {
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
  max-width: 60%;
}

/* Modal preview: extra (4 versiones) */
.modal-sticker-preview .no-img-fallback.ex {
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  color: white;
}
.modal-sticker-preview .no-img-fallback.ex .fb-version {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.modal-sticker-preview .no-img-fallback.ex .fb-player {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: white;
  line-height: 1.2;
  margin-bottom: 4px;
}
.modal-sticker-preview .no-img-fallback.ex .fb-team-mini {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.modal-sticker-preview .no-img-fallback.ex.version-purpura .fb-version { color: #B07AFF; }
.modal-sticker-preview .no-img-fallback.ex.version-bronce  .fb-version { color: #D58A57; }
.modal-sticker-preview .no-img-fallback.ex.version-plata   .fb-version { color: #C8CCD2; }
.modal-sticker-preview .no-img-fallback.ex.version-oro     .fb-version {
  color: transparent;
  background: linear-gradient(135deg, #FFE680, #FFAA00 50%, #FFE680);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Modal preview: Coca-Cola */
.modal-sticker-preview .no-img-fallback.cc {
  background: linear-gradient(135deg, #E51E2D 0%, #b71823 100%);
  color: white;
}
.modal-sticker-preview .no-img-fallback.cc .fb-cc-mark {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: white;
  margin-bottom: 8px;
}
.modal-sticker-preview .no-img-fallback.cc .fb-player {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: white;
  line-height: 1.2;
  margin-bottom: 4px;
}
.modal-sticker-preview .no-img-fallback.cc .fb-team-mini {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-title-shiny {
  background: linear-gradient(135deg, #ffe680 0%, #ffaa00 50%, #c9a227 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 22px;
  vertical-align: middle;
}
.modal-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg-soft);
  border: none;
  border-radius: var(--radius);
  font-size: 16px;
  margin-bottom: 14px;
  font-family: inherit;
  color: var(--text);
}
.modal-input:focus { outline: 1px solid var(--brand); }

.dup-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: var(--radius);
  margin-bottom: 14px;
}
.dup-control-label {
  font-size: 14px;
  font-weight: 500;
}
.dup-control-buttons {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dup-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity var(--duration-fast);
  border: 0.5px solid var(--separator);
}
.dup-btn:active { opacity: 0.6; }
.dup-count {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  min-width: 32px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 4px;
}
.btn {
  padding: 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 15px;
  background: var(--bg-soft);
  color: var(--text);
  text-align: center;
  width: 100%;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: opacity var(--duration-fast), background var(--duration-fast);
}
.btn:active { opacity: 0.7; }
.btn.full { width: 100%; }
.btn.primary {
  background: var(--brand);
  color: #fff;
}
.btn.danger {
  background: transparent;
  color: var(--danger);
}

/* ===== FORM (modal) ===== */
.form-group { margin-bottom: 12px; }
.form-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  margin-bottom: 6px;
  font-weight: 600;
  display: block;
}
.form-input-with-suffix {
  display: flex;
  align-items: center;
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 0 14px;
  transition: outline-color var(--duration-fast);
  outline: 1px solid transparent;
}
.form-input-with-suffix:focus-within { outline-color: var(--brand); }
.form-input-with-suffix input {
  flex: 1;
  padding: 13px 0;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  min-width: 0;
  width: 100%;
}
.form-input-with-suffix .suffix {
  font-size: 13px;
  color: var(--text-soft);
}
.qty-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.qty-row > .form-group { min-width: 0; }
.qty-row .form-input-with-suffix { min-width: 0; }
.qty-row .form-input-with-suffix input { width: 100%; min-width: 0; }

/* ===== SEGMENTED THEME PICKER ===== */
.theme-picker {
  display: flex;
  background: var(--bg-soft);
  border-radius: 9px;
  padding: 2px;
  margin-bottom: 10px;
}
.theme-picker-item {
  flex: 1;
  padding: 9px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-soft);
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.theme-picker-item.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
}
.theme-picker-item svg { width: 16px; height: 16px; stroke-width: 1.8; }

/* ===== SEARCH OVERLAY ===== */
.search-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 90;
  display: none;
  flex-direction: column;
}
.search-overlay.active { display: flex; }
.search-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 12px) 16px 12px;
  border-bottom: 0.5px solid var(--separator);
}
.search-input {
  flex: 1;
  padding: 11px 16px;
  background: var(--bg-soft);
  border: none;
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  outline: none;
  font-family: inherit;
}
.search-results {
  flex: 1;
  overflow-y: auto;
  padding-bottom: calc(40px + var(--safe-bottom));
}
.search-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  position: relative;
  transition: background var(--duration-fast);
}
.search-result:active { background: var(--bg-soft); }
.search-result + .search-result::before {
  content: '';
  position: absolute;
  left: 76px;
  right: 16px;
  top: 0;
  height: 0.5px;
  background: var(--separator);
}
.search-add-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 500;
  flex-shrink: 0;
}

/* ===== IMAGE PICKER ===== */
/* ===== IMAGE PICKER ===== */
.img-picker-target {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: var(--brand-soft);
  border: 0.5px solid var(--brand-soft-border);
  border-radius: var(--radius);
}
.img-picker-target-flag { font-size: 22px; line-height: 1; }
.img-picker-target-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}
.img-picker-target-name b {
  font-weight: 700;
  color: var(--text);
}
.img-picker-target-id {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 6px;
}
.img-picker-filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.img-picker-team-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 0.5px solid var(--separator);
  background: var(--bg-soft);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" fill="none" stroke="%23999" stroke-width="2" stroke-linecap="round"%3e%3cpath d="M1 1l5 5 5-5"/%3e%3c/svg%3e');
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.img-picker-hide-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.img-picker-hide-toggle input[type="checkbox"] {
  accent-color: var(--brand);
}
.img-picker-count {
  font-size: 11px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 10px;
}
.img-picker-grid-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.img-picker-item {
  aspect-ratio: 0.72;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  cursor: pointer;
  transition: transform var(--duration-fast);
  position: relative;
}
.img-picker-item:active { transform: scale(0.95); }
.img-picker-item img { width: 100%; height: 100%; object-fit: cover; }

.img-picker-item.is-mine {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.img-picker-item.is-other {
  opacity: 0.45;
}
.img-picker-item.is-hd::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--success);
  border-radius: 8px;
  pointer-events: none;
}
.img-picker-badge-hd {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--success);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 4px;
  z-index: 2;
}
.img-picker-item-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 12px 4px 3px;
  text-align: center;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.img-picker-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-soft);
  font-size: 13px;
}
.img-picker-empty p { margin-bottom: 12px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 640px;
  margin: 0 auto;
  height: calc(56px + var(--safe-bottom));
  background: var(--bg);
  border-top: 0.5px solid var(--separator);
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 8px;
  padding-bottom: var(--safe-bottom);
  z-index: 40;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 4px;
  flex: 1;
  max-width: 80px;
  transition: color var(--duration-fast);
}
.nav-item.active { color: var(--brand); }
.nav-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: calc(var(--safe-top) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text);
  color: var(--bg);
  padding: 11px 18px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all var(--duration) var(--ease);
  max-width: 90%;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { background: var(--success); color: #fff; }

/* ===== CONFETTI ===== */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
  overflow: hidden;
}
.confetti-piece {
  position: absolute;
  width: 8px;
  height: 14px;
  top: -20px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  to { transform: translateY(110vh) rotate(720deg); }
}

/* ===== EMPTY STATES ===== */
.empty-state {
  text-align: center;
  padding: 60px 24px 40px;
  color: var(--text-soft);
}
.empty-state-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
}
.empty-state-icon svg { width: 30px; height: 30px; stroke-width: 1.5; }
.empty-state-text {
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

/* ===== UTILITIES ===== */
.log-recent-list { max-height: 180px; overflow-y: auto; }
.log-recent-item {
  padding: 9px 12px;
  background: var(--bg-soft);
  border-radius: 8px;
  margin-bottom: 4px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.note {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-soft);
}
.note strong { color: var(--text); font-weight: 600; }

.log-counter {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
  margin-bottom: 12px;
}
.log-counter-big {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.log-counter-big .of { color: var(--text-dim); font-weight: 500; }
.log-counter-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
}
.log-counter-meta .new { color: var(--success); font-weight: 600; }
.log-counter-meta .dup { color: var(--brand); font-weight: 600; }

/* ============================================
   PACK SUMMARY (resumen al cerrar sobre)
   ============================================ */
.pack-summary {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 18px calc(20px + var(--safe-bottom));
  background: var(--bg);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pack-summary-header { text-align: center; }
.pack-summary-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.pack-summary-subtitle {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 2px;
}
.pack-summary-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.pack-summary-stat {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 14px;
  text-align: center;
}
.pack-summary-stat-num {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}
.pack-summary-stat.success .pack-summary-stat-num { color: var(--success); }
.pack-summary-stat.brand .pack-summary-stat-num { color: var(--brand); }
.pack-summary-stat-label {
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-top: 4px;
}

.pack-summary-section { }
.pack-summary-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--separator);
}
.pack-summary-section-title.success { color: var(--success); }
.pack-summary-section-title.brand { color: var(--brand); }

.pack-summary-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.pack-summary-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 0.5px solid var(--separator);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.pack-summary-item:active { background: var(--bg-soft); }
.pack-summary-item.dup {
  border-color: rgba(225,14,42,0.3);
  background: rgba(225,14,42,0.04);
}
.pack-summary-item.new {
  border-color: rgba(52,199,89,0.3);
  background: rgba(52,199,89,0.04);
}
.pack-summary-thumb {
  width: 40px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pack-summary-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pack-summary-thumb-fallback {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-soft);
}
.pack-summary-info { flex: 1; min-width: 0; }
.pack-summary-id {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.pack-summary-name {
  font-size: 11px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.pack-summary-actions {
  margin-top: 4px;
}
@media (max-width: 380px) {
  .pack-summary-list { grid-template-columns: 1fr; }
}

/* ============================================
   PACK OPENING ANIMATION
   ============================================ */

.pack-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(225,14,42,0.15) 0%, rgba(0,0,0,0.92) 60%);
  z-index: 180;
  display: none;
  align-items: center;
  justify-content: center;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: pack-overlay-in 0.3s var(--ease);
}
.pack-overlay.active { display: flex; }
@keyframes pack-overlay-in { from { opacity: 0; } to { opacity: 1; } }

.pack-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(24px + var(--safe-top)) 16px calc(120px + var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* Cuando el sobre está cerrado (pre-tear), centrar verticalmente */
.pack-stage:has(.pack-anim-pack) {
  justify-content: center;
  padding-top: 24px;
  padding-bottom: 24px;
  overflow: hidden;
}

/* Pack closed — entry animation */
.pack-anim-pack {
  width: 200px;
  cursor: pointer;
  position: relative;
  animation: pack-drop 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.pack-anim-pack img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  pointer-events: none;
}
.pack-anim-pack::before {
  /* subtle wobble */
  content: '';
  position: absolute;
  inset: 0;
  animation: pack-wobble 2s ease-in-out infinite;
  animation-delay: 0.8s;
  pointer-events: none;
}

@keyframes pack-drop {
  0%   { transform: translateY(-100vh) rotate(-15deg) scale(0.6); opacity: 0; }
  60%  { transform: translateY(20px) rotate(8deg) scale(1.05); opacity: 1; }
  80%  { transform: translateY(-8px) rotate(-3deg) scale(1); }
  100% { transform: translateY(0) rotate(0) scale(1); }
}

.pack-anim-pack:active { transform: scale(0.96); }

.pack-anim-hint {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  letter-spacing: -0.01em;
  white-space: nowrap;
  animation: pack-hint-pulse 1.4s ease-in-out infinite;
  animation-delay: 1s;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
@keyframes pack-hint-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(2px); }
}

/* Pack tearing animation */
.pack-anim-pack.tearing {
  animation: pack-tear 0.7s cubic-bezier(0.5, 0, 0.5, 1) forwards;
}
@keyframes pack-tear {
  0%   { transform: scale(1) rotate(0); filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5)); }
  30%  { transform: scale(1.1) rotate(-2deg); filter: drop-shadow(0 0 60px rgba(225,14,42,0.6)); }
  60%  { transform: scale(0.95) rotate(3deg); filter: drop-shadow(0 0 30px rgba(225,14,42,0.4)); opacity: 1; }
  100% { transform: scale(0.5) rotate(-180deg) translateY(40px); opacity: 0; }
}

.pack-anim-skip {
  position: fixed;
  top: calc(var(--safe-top) + 20px);
  right: 20px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 100px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  z-index: 2;
}
.pack-anim-skip:active { transform: scale(0.95); }

/* After-tear title */
.pack-anim-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 30px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.6);
  animation: pack-title-in 0.5s var(--ease);
}
@keyframes pack-title-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cards fanned out */
.pack-anim-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: flex-start;
  margin-bottom: 20px;
  width: 100%;
  max-width: 380px;
  perspective: 1000px;
}

.pack-anim-card {
  width: 64px;
  height: 90px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  opacity: 0;
  animation: card-fly-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transition: transform 0.3s var(--ease);
}
.pack-anim-card:active { transform: scale(0.94); }
.pack-anim-card.flipping {
  animation: card-flip-out 0.4s var(--ease) forwards;
}
@keyframes card-fly-in {
  0%   { opacity: 0; transform: translateY(-200px) rotate(-30deg) scale(0.6); }
  60%  { opacity: 1; transform: translateY(8px) rotate(3deg) scale(1.05); }
  100% { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}
@keyframes card-flip-out {
  0%   { transform: rotateY(0) scale(1); }
  50%  { transform: rotateY(90deg) scale(1.1); }
  100% { transform: rotateY(180deg) scale(0); opacity: 0; }
}

/* === CARD BACK · Estilo Panini FIGURITAPP STICKER ===
   Replica el dorso oficial de las figuritas Panini Extra Sticker:
   - Fondo gris claro
   - "FIFA WORLD CUP 2026" arriba en negro
   - Burbuja negra orgánica centrada con PANINI + FIGURITAPP STICKER
   - Bloque negro inferior con badge "26" y texto legal
*/
.pack-anim-card-back {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  background: #d9d9dd;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.4);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* "FIFA WORLD CUP 2026" arriba */
.pack-anim-card-back-header {
  width: 100%;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  color: #0a0a0a;
  font-size: 6px;
  letter-spacing: 0.02em;
  line-height: 1;
  padding: 5px 4px 3px;
  flex-shrink: 0;
}

/* Burbuja negra orgánica con PANINI + FIGURITAPP STICKER */
.pack-anim-card-back-bubble {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 86%;
  margin: 1px 0 2px;
  background: #0a0a0a;
  /* forma orgánica asimétrica (referencia: burbuja Panini) */
  border-radius: 48% 52% 42% 58% / 38% 48% 52% 62%;
  padding: 6px 4px;
  position: relative;
}
.pack-anim-card-back-panini {
  background: #fff;
  color: #0a0a0a;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 6px;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 1px;
  line-height: 1.1;
  margin-bottom: 3px;
}
.pack-anim-card-back-title {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 6.5px;
  line-height: 1;
  text-align: center;
  letter-spacing: 0.02em;
}
.pack-anim-card-back-title span {
  display: block;
  font-size: 6.5px;
  margin-top: 1px;
}

/* Bloque negro inferior con badge "26" + legal */
.pack-anim-card-back-footer {
  width: 100%;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 4px;
  flex-shrink: 0;
}
.pack-anim-card-back-fifa-badge {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  background: #fff;
  color: #0a0a0a;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 7px;
  line-height: 1;
}
.pack-anim-card-back-legal {
  flex: 1;
  color: rgba(255,255,255,0.85);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 3.5px;
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-align: left;
}

/* === CARD REVEALED · Frente con figu o slot === */
.pack-anim-card.revealed {
  animation: card-reveal-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes card-reveal-in {
  0% { transform: rotateY(180deg) scale(0.6); opacity: 0; }
  60% { transform: rotateY(0deg) scale(1.1); opacity: 1; }
  100% { transform: rotateY(0deg) scale(1); opacity: 1; }
}
.pack-anim-card-front {
  position: absolute;
  inset: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}
.pack-anim-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pack-anim-card-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f5f5f7 0%, #e5e5ea 100%);
  gap: 4px;
}
.pack-anim-card-empty .flag { font-size: 18px; }
.pack-anim-card-empty .code {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: rgba(0,0,0,0.7);
  letter-spacing: -0.01em;
}
.pack-anim-card-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 2;
}
.pack-anim-card.is-new .pack-anim-card-badge {
  background: var(--success);
}
.pack-anim-card.is-dup .pack-anim-card-badge {
  background: var(--warning);
}

/* Subtitle below title */
.pack-anim-subtitle {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
  margin-top: -22px;
  margin-bottom: 26px;
  letter-spacing: -0.01em;
  animation: pack-title-in 0.5s var(--ease);
}

/* Secondary version of continue button */
.pack-anim-continue.secondary {
  background: rgba(255,255,255,0.12);
  color: #fff;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

/* When pack overlay must sit BEHIND the search overlay */
.pack-overlay.behind {
  z-index: 80;
  filter: blur(2px) brightness(0.5);
  pointer-events: none;
}

.pack-anim-continue {
  background: #fff;
  color: #000;
  padding: 14px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: continue-in 0.5s var(--ease) 0.5s both;
  transition: transform var(--duration-fast);
  border: none;
  /* Sticky abajo del overlay para que siempre se vea aunque la grilla scrollee */
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 2;
  min-width: 180px;
  text-align: center;
}
.pack-anim-continue:active { transform: translateX(-50%) scale(0.96); }
@keyframes continue-in {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   ALBUM BANNER (Home)
   ============================================ */
.album-banner {
  margin: 0 16px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background var(--duration-fast);
  overflow: hidden;
}
.album-banner:active { background: var(--bg-soft); }
.album-banner-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), #b30922);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(225, 14, 42, 0.25);
}
.album-banner-icon svg {
  width: 20px;
  height: 20px;
}
.album-banner-info { flex: 1; min-width: 0; }
.album-banner-title {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.album-banner-meta {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 1px;
}

/* ============================================
   ALBUM VIEWER
   ============================================ */
.album-viewer {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 95;
  display: none;
  flex-direction: column;
  animation: album-fade-in 0.3s var(--ease);
}
.album-viewer.active { display: flex; }
@keyframes album-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.album-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 10px) 16px 10px;
  border-bottom: 0.5px solid var(--separator);
  background: var(--bg);
}
.album-page-indicator-wrap {
  text-align: center;
}
.album-page-indicator-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  font-weight: 600;
}
.album-page-indicator {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.album-page-wrap {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
  background: var(--bg);
}

/* ────────────────────────────────────────────────
   ÁLBUM SCROLLEABLE (v11)
   Vista de figuritas estilo grilla, organizada por
   secciones (Intro, Grupos A-L, Coca-Cola, Brillantes)
   ──────────────────────────────────────────────── */

.album-scroller {
  display: flex;
  flex-direction: column;
  padding: 14px 16px calc(30px + var(--safe-bottom));
  gap: 32px;
}

/* Hero del álbum: progreso global */
.album-hero {
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius-lg);
  padding: 20px 18px;
  text-align: center;
}
.album-hero-pct {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--brand);
}
.album-hero-pct .symbol {
  font-size: 28px;
  font-weight: 500;
  margin-left: 2px;
}
.album-hero-frac {
  font-size: 13px;
  color: var(--text-soft);
  margin-top: 4px;
  margin-bottom: 14px;
}
.album-hero-bar {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.album-hero-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 3px;
  transition: width var(--duration-fast);
}

/* Sección (Intro, Grupo X, CC, Brillantes) */
.album-section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.album-section-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg);
  padding: 8px 0 12px;
  border-bottom: 0.5px solid var(--separator);
}
.album-section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.album-section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.album-section-subtitle {
  font-size: 12px;
  color: var(--text-soft);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.album-section-progress {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.album-section-progress.complete { color: var(--success); }
.album-section-bar {
  height: 3px;
  background: var(--separator);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.album-section-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
  transition: width var(--duration-fast);
}

/* Grupo (equipo) dentro de una sección */
.album-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.album-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 8px;
  cursor: pointer;
  transition: opacity var(--duration-fast);
}
.album-group-header:active { opacity: 0.7; }
.album-group-flag {
  font-size: 26px;
  line-height: 1;
}
.album-group-info { flex: 1; min-width: 0; }
.album-group-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.album-group-meta {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.album-group-progress {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.album-group-progress.complete { color: var(--success); }

/* Grilla de cards (figuritas) */
.album-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* Card de figurita en el álbum */
.album-card {
  position: relative;
  aspect-ratio: 0.72 / 1;
  background: var(--bg-card);
  border: 0.5px dashed var(--separator);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 4px;
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast), transform var(--duration-fast);
  text-align: center;
  overflow: hidden;
}
.album-card:active { background: var(--bg-soft); transform: scale(0.97); }
.album-card.have {
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-style: solid;
}
.album-card.dup {
  border-color: rgba(225,14,42,0.35);
  background: rgba(225,14,42,0.04);
}
.album-card-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-soft);
  line-height: 1;
}
.album-card.have .album-card-num { color: var(--text); }
.album-card-name {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-soft);
  margin-top: 4px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
}
.album-card.have .album-card-name { color: var(--text); }
.album-card.star { border-color: var(--brand); }
.album-card-star {
  position: absolute;
  top: 4px;
  left: 4px;
  color: var(--brand);
  opacity: 0.6;
}
.album-card.have .album-card-star { opacity: 1; }

/* ─── Brillantes (shiny) ─── */
.album-card.shiny {
  background:
    radial-gradient(circle at 30% 30%, rgba(147, 51, 234, 0.08), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(201, 162, 39, 0.10), transparent 60%),
    var(--bg-card);
  border-color: rgba(201, 162, 39, 0.35);
}
.album-card.shiny.have {
  background:
    radial-gradient(circle at 30% 30%, rgba(147, 51, 234, 0.15), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(201, 162, 39, 0.20), transparent 60%),
    var(--bg-card);
  border-color: rgba(201, 162, 39, 0.6);
}
.album-card.shiny .album-card-num {
  background: linear-gradient(135deg, #FFE680, #C9A227 50%, #FFE680);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.album-card-shiny-mark {
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 12px;
  color: var(--gold, #C9A227);
  font-weight: 700;
  text-shadow: 0 0 4px rgba(201,162,39,0.5);
}
.album-card.shiny.have .album-card-shiny-mark { color: #FFD43B; }
.album-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.album-card-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  background: var(--success);
  border: 1.5px solid var(--bg-card);
  border-radius: 50%;
}
.album-card-badge.dup {
  width: auto;
  height: auto;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  border: none;
  letter-spacing: -0.01em;
}

/* ─── EXTRAS / BRILLANTES ──────────────────────── */

.album-extra-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid var(--separator);
}
.album-extra-row:last-child { border-bottom: none; }

.album-extra-player {
  flex: 0 0 auto;
  width: 110px;
  min-width: 0;
}
.album-extra-player-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.album-extra-player-team {
  font-size: 10px;
  color: var(--text-soft);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 500;
}

.album-extra-versions {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

/* Card mini (para versiones de extras: púrpura/bronce/plata/oro) */
.album-card-mini {
  aspect-ratio: 0.78 / 1;
  padding: 4px 3px;
  border-radius: 8px;
}
.album-card-mini .album-card-num {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.album-card-mini .album-card-name { display: none; }

/* Colores característicos por versión brillante */
.album-card.version-purpura.have { border-color: rgba(147, 51, 234, 0.6); background: rgba(147, 51, 234, 0.08); }
.album-card.version-purpura.have .album-card-num { color: #9333EA; }
.album-card.version-bronce.have  { border-color: rgba(176, 88, 40, 0.6); background: rgba(176, 88, 40, 0.08); }
.album-card.version-bronce.have  .album-card-num { color: #B05828; }
.album-card.version-plata.have   { border-color: rgba(165, 169, 178, 0.7); background: rgba(165, 169, 178, 0.08); }
.album-card.version-plata.have   .album-card-num { color: #8C9098; }
.album-card.version-oro.have     { border-color: rgba(201, 162, 39, 0.7); background: rgba(201, 162, 39, 0.10); }
.album-card.version-oro.have     .album-card-num { color: #C9A227; }

/* Image picker debe estar encima del modal-backdrop (z-index 100) */
#image-picker-overlay {
  z-index: 110;
}

/* ============================================
   TEAM EDITOR · modo editor (overlay full-screen)
   ============================================ */
.team-editor {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 96;  /* arriba del album-viewer (95), debajo del modal (100) */
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.team-editor.active {
  display: flex;
  animation: editor-slide-in 0.25s var(--ease);
}
@keyframes editor-slide-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.ed-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 10px) 14px 10px;
  background: var(--bg);
  border-bottom: 0.5px solid var(--separator);
}
.ed-title { flex: 1; text-align: center; }
.ed-title-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.ed-title-meta {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 2px;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ed-stats {
  display: flex;
  padding: 12px 14px;
  gap: 8px;
  border-bottom: 0.5px solid var(--separator);
  background: var(--bg);
}
.ed-stat {
  flex: 1;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 8px 10px;
  text-align: center;
}
.ed-stat-num {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.ed-stat-lbl {
  font-size: 10px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.ed-toggle {
  display: flex;
  margin: 12px 14px;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 3px;
}
.ed-toggle-option {
  flex: 1;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 8px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ed-toggle-option.active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.ed-grid {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 14px 24px;
}
.ed-card {
  position: relative;
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.ed-card:active { background: var(--bg-soft); }
.ed-card.has { border-color: rgba(52,199,89,0.4); background: rgba(52,199,89,0.04); }
.ed-card-num {
  position: absolute;
  top: 4px;
  left: 6px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.ed-card-thumb {
  width: 100%;
  aspect-ratio: 0.72;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}
.ed-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ed-card-placeholder {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: -0.01em;
}
.ed-card-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.01em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  min-height: 26px;
}
.ed-card-meta {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.ed-tag {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  letter-spacing: 0.04em;
}
.ed-tag.name { background: rgba(0,123,255,0.15); color: #0050d0; }
.ed-tag.img  { background: rgba(255,149,0,0.15); color: #c97400; }
.ed-tag.have { background: rgba(52,199,89,0.15); color: #1b7e2f; }

.ed-empty {
  text-align: center;
  color: var(--text-soft);
  padding: 40px 20px;
  font-size: 13px;
}

/* Nav bar dentro del modal de sticker cuando estás en editor */
.ed-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  margin: -16px -16px 12px;
  background: rgba(255,149,0,0.10);
  border-bottom: 0.5px solid rgba(255,149,0,0.25);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}
.ed-nav-btn {
  background: var(--bg);
  border: 0.5px solid var(--separator);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background var(--duration-fast);
}
.ed-nav-btn:active { background: var(--bg-soft); }
.ed-nav-btn:disabled { opacity: 0.4; pointer-events: none; }
.ed-nav-counter {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

/* ============================================
   ACTION SHEET (menú modal del editor)
   ============================================ */
.action-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: as-fade 0.2s ease;
}
@keyframes as-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.action-sheet {
  width: 100%;
  max-width: 420px;
  margin: 0 8px calc(var(--safe-bottom) + 12px);
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  animation: as-slide 0.25s var(--ease);
}
@keyframes as-slide {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.action-sheet-text {
  padding: 16px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
  white-space: pre-line;
  border-bottom: 0.5px solid var(--separator);
}
.action-sheet-options { display: flex; flex-direction: column; }
.action-sheet-btn {
  background: var(--bg-card);
  border: none;
  padding: 16px;
  font-size: 15px;
  font-weight: 500;
  color: var(--brand);
  font-family: inherit;
  cursor: pointer;
  border-bottom: 0.5px solid var(--separator);
}
.action-sheet-btn:active { background: var(--bg-soft); }
.action-sheet-btn.danger { color: var(--danger); }
.action-sheet-btn.cancel {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--text);
  border-bottom: none;
  margin-top: 6px;
  border-radius: 0 0 16px 16px;
}

/* ============================================
   SALAS · Onboarding + Detalle + Modal social
   ============================================ */

#view-rooms { padding: 12px 16px 80px; }

/* ── Onboarding ── */
.rooms-onboarding { padding: 0 4px; }
.onb-hero {
  text-align: center;
  padding: 24px 0 28px;
}
.onb-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}
.onb-logo {
  width: min(60vw, 220px);
  height: auto;
  filter: drop-shadow(0 3px 10px rgba(0,0,0,0.08));
}
.onb-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
  color: var(--text);
}
.onb-sub {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.4;
  max-width: 280px;
  margin: 0 auto;
}

.input-block { margin-bottom: 14px; }
.input-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
  padding-left: 4px;
}

.pill-toggle {
  display: flex;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 18px;
}
.pill-option {
  flex: 1;
  padding: 9px 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--duration-fast);
}
.pill-option.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ── Selector de salas múltiples (arriba) ── */
.room-selector {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 14px;
  padding-bottom: 2px;
}
.room-selector::-webkit-scrollbar { display: none; }
.room-selector-pill {
  flex-shrink: 0;
  padding: 6px 12px;
  background: var(--bg-soft);
  color: var(--text-soft);
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.room-selector-pill.active {
  background: var(--brand);
  color: #fff;
}
.room-selector-pill.add {
  background: transparent;
  border: 1px dashed var(--border-strong, var(--separator));
  color: var(--text-soft);
  padding: 6px 10px;
}

/* ── Banner de sala ── */
.room-banner {
  background: linear-gradient(135deg, #E10E2A 0%, #b00b21 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
}
.room-banner-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.room-banner-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}
.room-banner-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin: 2px 0 10px;
}
.room-menu-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.room-menu-btn:active { background: rgba(255,255,255,0.25); }
.room-menu-btn svg { width: 18px; height: 18px; }
.room-code-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  padding: 6px 12px;
  border-radius: 18px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
}
.room-code-pill:active { background: rgba(255,255,255,0.30); }

/* ── Share row ── */
.share-row {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}
.share-btn {
  flex: 1;
  background: var(--bg-soft);
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  font-family: inherit;
}
.share-btn:active { background: var(--separator); }
.share-btn.whatsapp {
  background: #25D366;
  color: #fff;
}
.share-btn.whatsapp:active { background: #1faa53; }

/* ── Section title ── */
.members-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.members-count {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Member cards (ranking) ── */
.member-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: background var(--duration-fast);
}
.member-card:active:not(.you) { background: var(--bg-soft); }
.member-card.you {
  background: var(--brand-soft);
  border-color: var(--brand-soft-border);
  cursor: default;
}
.rank {
  width: 22px;
  text-align: center;
  font-weight: 700;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 13px;
  flex-shrink: 0;
}
.rank.gold   { color: #FFB300; }
.rank.silver { color: #9E9E9E; }
.rank.bronze { color: #8D6E63; }

.member-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: #fff;
  flex-shrink: 0;
}
.member-avatar.small {
  width: 24px;
  height: 24px;
  font-size: 11px;
}
.member-info {
  flex: 1;
  min-width: 0;
}
.member-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.you-tag {
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
}
.member-progress { margin-top: 4px; }
.progress-bar {
  height: 4px;
  background: var(--bg-soft);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.member-stats {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-soft);
}
.member-pct {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}

/* ── Resumen álbum de un miembro (modal) ── */
.member-album-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.member-album-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-soft);
  border-radius: 10px;
  font-size: 13px;
}
.member-album-flag { font-size: 18px; }
.member-album-name {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-album-stats {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-soft);
}
.member-album-pct {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
  min-width: 38px;
  text-align: right;
}

/* ── Estado vacío y loading ── */
.rooms-empty,
.room-loading {
  text-align: center;
  padding: 0;
}

/* ── Botones full ── */
.btn.full { width: 100%; display: block; }
.btn.ghost {
  background: transparent;
  color: var(--brand);
  font-weight: 500;
}
.btn.ghost:active { background: var(--brand-soft); }
.btn.danger {
  background: var(--danger);
  color: #fff;
}
.btn.danger:active { background: #d92e22; }

/* ── Matches (Pantalla 3) ── */
.match-card {
  background: var(--bg-card);
  border: 0.5px solid var(--separator);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.match-with {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 0.5px solid var(--separator);
}
.match-with .match-name {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  color: var(--text);
}
.match-with .match-count {
  font-size: 11px;
  color: var(--text-soft);
  background: var(--bg-soft);
  padding: 3px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.match-row {
  display: grid;
  grid-template-columns: 1fr 24px 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
}
.match-col {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.match-col span:not(.figu-chip) {
  font-size: 11px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.match-col.right { justify-content: flex-end; }
.match-arrow {
  text-align: center;
  color: var(--brand);
  font-size: 14px;
  font-weight: 600;
}
.figu-chip {
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: var(--font-mono);
}
.figu-chip.brand { background: var(--brand-soft); color: var(--brand); }
.figu-chip.success { background: rgba(52,199,89,0.15); color: #1B5E20; }
[data-theme="dark"] .figu-chip.success { color: #5FE38C; }

.match-with-action {
  margin-top: 12px;
  background: var(--bg-soft);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}
.match-with-action:active { background: var(--brand-soft); }

.matches-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-soft);
  font-size: 13px;
}

/* ── Modal social: friends-have ── */
.friends-have {
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 12px;
  margin: 0 0 14px;
}
.friends-have-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.friend-have-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.friend-have-row .small-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 10px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}
.friend-have-row .friend-name { flex: 1; font-weight: 500; }
.friend-have-row .qty {
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.friend-have-row .qty.dup { background: var(--brand-soft); color: var(--brand); }
.friend-have-row .qty.have { background: rgba(52,199,89,0.15); color: #1B5E20; }
.friend-have-row .qty.miss { color: var(--text-soft); background: transparent; }
[data-theme="dark"] .friend-have-row .qty.have { color: #5FE38C; }

/* Mode badge en onboarding (mock vs supabase) */
.rooms-mode-badge {
  margin-top: 24px;
  padding: 8px 12px;
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 500;
  background: var(--bg-soft);
  border-radius: 8px;
}
.rooms-mode-badge[data-mode="mock"] {
  color: #B07900;
  background: rgba(255, 149, 0, 0.10);
}
.rooms-mode-badge[data-mode="supabase"] {
  color: #1B5E20;
  background: rgba(52, 199, 89, 0.10);
}
[data-theme="dark"] .rooms-mode-badge[data-mode="supabase"] { color: #5FE38C; }

/* ============================================
   STICKER TEMPLATE (fallback con base del álbum + texto encima)
   Se usa cuando no hay imagen HD asignada.
   ============================================ */
.sticker-template {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 0.75 / 1;
  overflow: hidden;
  border-radius: inherit;
  background: #5cc4cf;  /* Color base del template por si la imagen tarda */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.sticker-template-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}
.sticker-template-flag {
  position: absolute;
  top: 4%;
  left: 4%;
  font-size: 14%; /* relativo al ancho del contenedor — ver tweak abajo */
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
  z-index: 1;
}
.sticker-template-text {
  position: absolute;
  left: 0; right: 0;
  bottom: 8%;
  padding: 0 8%;
  z-index: 1;
  text-align: center;
  color: #FFFFFF;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}
.sticker-template-firstname {
  font-size: 11%;
  font-weight: 500;
  opacity: 0.92;
  margin-bottom: 2%;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sticker-template-lastname {
  font-size: 16%;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  word-break: break-word;
}

/* Variante 'thumb' (chico, en listas) — texto y bandera más grandes proporcionalmente */
.sticker-template.thumb .sticker-template-flag { font-size: 18px; top: 3px; left: 3px; }
.sticker-template.thumb .sticker-template-lastname { font-size: 8px; line-height: 1.1; padding: 0 2px; }
.sticker-template.thumb .sticker-template-firstname { display: none; }
.sticker-template.thumb .sticker-template-text { bottom: 4px; padding: 0 4px; }

/* Variante 'large' (modal, full preview) — texto más grande, más aire */
.sticker-template.large .sticker-template-flag { font-size: 36px; top: 12px; left: 12px; }
.sticker-template.large .sticker-template-firstname { font-size: 11px; opacity: 0.85; }
.sticker-template.large .sticker-template-lastname { font-size: 18px; }
.sticker-template.large .sticker-template-text { bottom: 14px; padding: 0 14px; }

/* Section title dentro del picker (cuando agrupamos por página) */
.img-picker-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 18px 0 8px;
  padding-bottom: 6px;
  border-bottom: 0.5px solid var(--separator);
}
.img-picker-section-title:first-child { margin-top: 4px; }

/* ── Botón subir foto en image picker ── */
.img-picker-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin: 8px 0 10px;
  transition: opacity var(--duration-fast);
}
.img-picker-upload-btn:active { opacity: 0.85; }
.img-picker-upload-btn svg { width: 18px; height: 18px; }

.img-picker-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: var(--text-soft);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.img-picker-divider::before,
.img-picker-divider::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--separator);
}

/* ── Info de desarrollador en Settings ── */
.dev-info {
  background: var(--bg-soft);
  border-radius: var(--radius);
  padding: 12px;
}
.dev-info-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dev-info-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.dev-info-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
  user-select: text;
  -webkit-user-select: text;
}
.dev-info-hint {
  font-size: 11px;
  color: var(--text-soft);
  margin-top: 10px;
  line-height: 1.5;
}

/* ── Admin toggle en image picker ── */
.img-picker-admin-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 0.5px solid var(--brand-soft-border);
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  margin-top: 4px;
}
.img-picker-admin-toggle input[type="checkbox"] {
  accent-color: var(--brand);
}

/* ── Badge admin en Settings ── */
.dev-admin-badge {
  background: linear-gradient(135deg, #E10E2A 0%, #b00b21 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.4;
}
.dev-admin-badge b {
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Aviso de fallback en el picker (cuando 'same' da 0 resultados) ── */
.img-picker-fallback-notice {
  background: rgba(255, 149, 0, 0.10);
  color: #B07900;
  border: 0.5px solid rgba(255, 149, 0, 0.30);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 10px;
}
[data-theme="dark"] .img-picker-fallback-notice {
  color: #FFB454;
  background: rgba(255, 149, 0, 0.12);
}
.img-picker-fallback-notice b { font-weight: 700; }

/* ── Banner de foto recién subida ── */
.img-picker-uploaded-banner {
  background: var(--bg-soft);
  border: 0.5px solid var(--success);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 14px;
}
.img-picker-uploaded-preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.img-picker-uploaded-preview {
  width: 72px;
  height: 100px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 0.5px solid var(--separator);
}
.img-picker-uploaded-info { flex: 1; min-width: 0; }
.img-picker-uploaded-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 2px;
}
.img-picker-uploaded-sub {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
}
.img-picker-uploaded-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ── Template "26" dentro de album-card ── */
/* El template debería ocupar todo el card, anulando el padding del album-card */
.album-card .sticker-template {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  width: 100%;
  height: 100%;
}
/* Texto del template ajustado al tamaño chico del álbum */
.album-card .sticker-template.thumb .sticker-template-flag {
  font-size: 16px;
  top: 4px;
  left: 4px;
}
.album-card .sticker-template.thumb .sticker-template-lastname {
  font-size: 9px;
  line-height: 1.1;
  padding: 0 4px;
}
.album-card .sticker-template.thumb .sticker-template-text {
  bottom: 6px;
}
/* Cuando hay template, no queremos el background del card "have" tapando */
.album-card.have:has(.sticker-template),
.album-card:has(.sticker-template) {
  padding: 0;
  background: transparent;
}

/* z-index para que badges queden encima del template */
.album-card-badge,
.album-card-shiny-mark,
.album-card-star {
  z-index: 2;
}
