:root {
  /* TrascendIT corporate palette (cyan + gris) */
  --brand-cyan: #1FA9DD;
  --brand-cyan-light: #5DC8EF;
  --brand-gray: #7F8084;
  --brand-gray-light: #A8AAAE;

  --bg: #0a0e1a;
  --bg-elev: #131829;
  --bg-card: #1a2138;
  --bg-rgb: 10, 14, 26;
  --bg-card-rgb: 26, 33, 56;
  --border: #2a3252;
  --text: #e8ecf5;
  --text-dim: #8892a8;
  --accent: var(--brand-cyan);
  --accent-warm: #29ABE2;
  --accent-rgb: 31, 169, 221;
  --accent-warm-rgb: 41, 171, 226;
  --brand-secondary-rgb: 127, 128, 132;
  --success-rgb: 0, 210, 122;
  --danger-rgb: 255, 90, 95;
  --danger: #ff5a5f;
  --success: #00d27a;
  --owned: var(--brand-cyan);
  --dup: #ffb800;
  --missing: #2a3252;
  --text-on-accent: #0a0e1a;
  --text-on-accent-muted: color-mix(in srgb, var(--text-on-accent), transparent 35%);
  --accent-soft: rgba(var(--accent-rgb), 0.08);
  --accent-muted: rgba(var(--accent-rgb), 0.12);
  --accent-surface: rgba(var(--accent-rgb), 0.18);
  --accent-hover: rgba(var(--accent-rgb), 0.25);
  --accent-border: rgba(var(--accent-rgb), 0.35);
  --accent-ring: rgba(var(--accent-rgb), 0.18);
  --warm-soft: rgba(var(--accent-warm-rgb), 0.08);
  --warm-surface: rgba(var(--accent-warm-rgb), 0.18);
  --success-soft: rgba(var(--success-rgb), 0.10);
  --danger-soft: rgba(var(--danger-rgb), 0.10);
  --shadow-rgb: 0, 0, 0;
  --shadow-soft: rgba(var(--shadow-rgb), 0.16);
}

* {
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  padding-bottom: 90px;
}

/* ============ NAVBAR / HEADER ============ */
.app-navbar {
  background: linear-gradient(135deg, rgba(var(--bg-rgb), 0.96) 0%, rgba(var(--bg-card-rgb), 0.96) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
}

.navbar-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-logo {
  flex-shrink: 0;
  display: block;
  width: 42px;
  height: 42px;
  padding: 7px;
  box-sizing: border-box;
  object-fit: contain;
  background: #17245f;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
}

.brand-text {
  min-width: 0;
}

@media (max-width: 400px) {
  .brand-logo {
    width: 36px;
    height: 36px;
    padding: 6px;
  }
}

.brand-title {
  font-weight: 800;
  letter-spacing: -0.5px;
  font-size: 1rem;
  line-height: 1.1;
}

.brand-title .accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.3px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 35vw;
}

/* ============ PROGRESS CHIP ============ */
.progress-chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  justify-self: center;
  white-space: nowrap;
}

.progress-chip:hover {
  border-color: var(--accent);
}

.progress-chip:active {
  transform: scale(0.96);
}

.chip-bar {
  width: 50px;
  height: 5px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
}

.chip-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.chip-text strong {
  color: var(--text);
  font-weight: 700;
}

.chip-sep {
  color: var(--text-dim);
  opacity: 0.5;
}

.chip-dups {
  color: var(--dup);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.chip-dups i {
  font-size: 0.8rem;
}

.chip-sync {
  display: inline-flex;
  align-items: center;
  margin-left: 2px;
}

.chip-sync .sync-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-warm);
  box-shadow: 0 0 6px rgba(var(--accent-warm-rgb), 0.6);
  animation: pulse-sync 1.4s ease-in-out infinite;
}

[data-sync-state="error"] .chip-sync .sync-dot {
  background: var(--danger);
  box-shadow: 0 0 6px rgba(var(--danger-rgb), 0.6);
}

[data-sync-state="offline"] .chip-sync .sync-dot {
  background: var(--text-dim);
  box-shadow: none;
  animation: none;
}

@keyframes pulse-sync {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* ============ NAVBAR ACTIONS ============ */
.navbar-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.icon-btn:hover {
  border-color: var(--accent);
}

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

/* Estado logueado: avatar con nick a la izquierda */
.icon-btn.logged-in {
  width: auto;
  padding: 0 8px 0 12px;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent-surface), var(--accent-soft));
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--accent-border);
}

.icon-btn.logged-in i {
  color: var(--accent);
  font-size: 1.1rem;
}

.icon-btn.logged-in .user-nick {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

@media (max-width: 540px) {
  .icon-btn.logged-in {
    padding: 0 8px 0 10px;
    gap: 6px;
  }
  .icon-btn.logged-in .user-nick {
    max-width: 80px;
    font-size: 0.75rem;
  }
}

@media (max-width: 380px) {
  .icon-btn.logged-in .user-nick {
    max-width: 56px;
  }
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--danger);
  color: white;
  border-radius: 999px;
  border: 2px solid var(--bg-elev);
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

#btnNotif {
  position: relative;
}

/* ============ NOTIFICATIONS DROPDOWN ============ */
.notif-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 2090;
  animation: notifBackdropIn 0.18s ease-out;
}

@keyframes notifBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.notif-dropdown {
  position: fixed;
  z-index: 2100;
  width: min(360px, calc(100vw - 24px));
  max-height: min(520px, 70vh);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: notifPopIn 0.18s ease-out;
}

/* En móvil/tablet · pegado a la derecha con margen · NO se sale del viewport.
   Breakpoint generoso porque algunos móviles reportan width hasta ~768px.
   Estrategia: anclar a la derecha con !important para neutralizar los inline styles
   que el JS pone para el modo desktop. */
@media (max-width: 768px) {
  .notif-dropdown {
    left: 12px !important;
    right: 12px !important;
    top: 64px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 88px);
  }
}

@keyframes notifPopIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.notif-head strong {
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.notif-head strong i {
  color: var(--accent);
}

.notif-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.notif-close:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text);
}

.notif-head-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.notif-clear-read {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.notif-clear-read:hover {
  color: var(--text);
  border-color: var(--accent);
}

.notif-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.notif-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: opacity 0.2s, transform 0.2s;
}

.notif-row:hover {
  background: var(--accent-soft);
}

.notif-row.is-unread {
  background: var(--accent-soft);
}

.notif-row.is-dismissing {
  opacity: 0;
  transform: translateX(20px);
}

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

.notif-item {
  flex: 1;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 8px 12px 16px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text);
}

.notif-dismiss {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 0 14px;
  cursor: pointer;
  font-size: 0.85rem;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  border-left: 1px solid rgba(255,255,255,0.04);
}

.notif-dismiss:hover {
  opacity: 1;
  color: var(--danger);
}

.notif-icon {
  font-size: 1.3rem;
  line-height: 1;
  padding-top: 2px;
}

.notif-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.notif-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.3;
}

.notif-text {
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.35;
  word-break: break-word;
}

.notif-when {
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.7;
  margin-top: 2px;
}

.notif-dot {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  align-self: center;
  flex-shrink: 0;
}

.notif-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
}

.notif-empty i {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
  opacity: 0.5;
}

.notif-empty p {
  margin: 0;
  font-size: 0.9rem;
}

@media (max-width: 540px) {
  .navbar-inner {
    grid-template-columns: 1fr auto auto;
    gap: 8px;
    padding: 8px 12px;
  }
  .progress-chip {
    padding: 5px 10px;
    font-size: 0.72rem;
    gap: 6px;
  }
  .chip-bar {
    width: 36px;
  }
  .brand-subtitle {
    max-width: 38vw;
  }
}

@media (max-width: 400px) {
  .brand-title {
    font-size: 0.9rem;
  }
  .chip-bar {
    display: none;
  }
  .chip-dups span {
    display: none;
  }
}

/* ============ MAIN ============ */
main {
  padding: 16px;
  max-width: 900px;
  margin: 0 auto;
}

/* ============ GROUP HEADERS ============ */
.group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 12px;
}

.group-header:first-child {
  margin-top: 8px;
}

.group-badge {
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  color: var(--text-on-accent);
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

.group-pct {
  margin-left: auto;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 500;
}

.group-pct strong {
  color: var(--text);
}

/* ============ TEAM CARDS ============ */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

@media (min-width: 768px) {
  .team-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.team-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--accent-soft), transparent 60%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.team-card:hover::before {
  opacity: 1;
}

.team-card:active {
  transform: scale(0.97);
}

.team-card.complete {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card), var(--accent-soft));
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px var(--shadow-soft);
}

.team-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.team-code-big {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text);
  line-height: 1;
}

.team-flag-small {
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.85;
}

.team-name {
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: 6px;
  color: var(--text-dim);
}

.team-progress {
  margin-top: 10px;
  height: 5px;
  background: var(--missing);
  border-radius: 3px;
  overflow: hidden;
}

.team-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.team-stats {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
}

.team-stats .dup-count {
  color: var(--dup);
  font-weight: 700;
}

/* ============ SPECIAL CARDS ============ */
.special-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
}

.special-card::before {
  content: '';
  position: absolute;
  right: -20px;
  top: -20px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--warm-surface), transparent 70%);
  pointer-events: none;
}

.special-card:active {
  transform: scale(0.98);
}

.special-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.special-card p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 4px 0 10px;
}

.special-card .mini-bar {
  height: 5px;
  background: var(--missing);
  border-radius: 3px;
  overflow: hidden;
  flex: 1;
}

.special-card .mini-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-warm), var(--accent));
}

/* ============ TEAM DETAIL VIEW ============ */
.team-header-detail {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  transition: all 0.15s;
}

.back-btn:hover {
  border-color: var(--accent);
}

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

.team-detail-info {
  flex: 1;
}

.team-detail-name {
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.team-detail-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 2px;
}

/* ============ TEAM NAV / ACTIONS ============ */
.team-nav-buttons {
  display: flex;
  gap: 6px;
}

.team-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.team-actions .btn {
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 10px;
}

.team-nav-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.team-nav-footer .btn {
  padding: 10px 14px;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-height: 82px;
}

.team-nav-card.is-prev {
  align-items: flex-start;
  text-align: left;
}

.team-nav-card.is-next {
  align-items: flex-end;
  text-align: right;
}

.team-nav-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.team-nav-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-nav-meta {
  font-size: 0.65rem;
  margin-top: 1px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

/* ============ ÁLBUM PAGES (layout 2 col en desktop) ============ */
.album-pages {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.album-page {
  background: rgba(var(--bg-card-rgb), 0.4);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.page-subtitle {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin: -6px 0 12px;
  font-style: italic;
}

@media (min-width: 992px) {
  .album-pages {
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }
  main {
    max-width: 1200px;
  }
  .album-page {
    background: linear-gradient(135deg, rgba(var(--bg-card-rgb), 0.45), rgba(var(--bg-card-rgb), 0.25));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  }
  .album-page .sticker-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (min-width: 1200px) {
  .album-page .sticker-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
  }
}

/* ============ FILTER CHIPS ============ */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.chip:hover {
  border-color: var(--accent);
  color: var(--text);
}

.chip.active {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
  font-weight: 700;
}

.chip .badge-count {
  background: rgba(255, 255, 255, 0.15);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 0.7rem;
  margin-left: 4px;
}

.chip.active .badge-count {
  background: color-mix(in srgb, var(--text-on-accent), transparent 80%);
}

/* ============ PAGE LABELS ============ */
.page-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-dim);
  margin: 16px 0 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-label::before,
.page-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.page-label .page-icon {
  color: var(--accent);
}

/* ============ OVERVIEW SHORTCUTS (faltantes + buscador) ============ */
.overview-shortcuts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 640px) {
  .overview-shortcuts {
    grid-template-columns: 1fr;
  }
}

.overview-shortcuts .missing-cta {
  margin-bottom: 0;
  width: 100%;
}

/* Si solo hay una card (no hay faltantes), que ocupe ancho completo */
.overview-shortcuts:has(> .missing-cta:only-child) {
  grid-template-columns: 1fr;
}

/* ============ VISTA "SOLO FALTANTES" (compacta) ============ */
.missing-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: linear-gradient(135deg, var(--accent-surface), var(--warm-soft));
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.missing-cta:hover {
  box-shadow: 0 4px 16px var(--shadow-soft);
}

.missing-cta:active {
  transform: scale(0.99);
}

.missing-cta-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--text-on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.missing-cta-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.missing-cta-text strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.missing-cta-text span {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.missing-cta-arrow {
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.missing-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.missing-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.missing-group-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.missing-group-count {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Sigla del país visible solo en print (rotada en sidebar) */
.print-team-code {
  display: none;
}

/* ============ BUSCADOR DE CROMOS ============ */
.search-stickers-box {
  margin-bottom: 14px;
}

.search-stickers-input {
  position: relative;
  margin-bottom: 12px;
}

.search-stickers-input > i.bi-search {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 1.1rem;
  pointer-events: none;
}

.search-stickers-input input {
  width: 100%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 14px 50px 14px 46px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-stickers-input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 0.25rem rgba(var(--accent-rgb, 31, 169, 221), 0.18);
}

.search-stickers-input input::placeholder {
  color: var(--text-dim);
  text-transform: none;
  font-weight: 500;
  letter-spacing: 0;
}

.search-stickers-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-dim);
  transition: all 0.15s;
}

.search-stickers-clear:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.search-stickers-hint {
  background: rgba(99, 102, 241, 0.06);
  border-left: 3px solid #6366f1;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text);
  margin-top: -4px;
}

.search-stickers-hint strong {
  color: #6366f1;
  font-weight: 700;
  margin-right: 4px;
}

.search-stickers-hint code {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: monospace;
}

.search-stickers-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  margin: 14px 0 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.search-stickers-summary .text-success { color: #16a34a !important; }
.search-stickers-summary .text-warning { color: #f59e0b !important; }

.search-stickers-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.search-stickers-group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.search-stickers-group-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}

/* Stickers en el buscador · ~50% más chicos que la vista normal
   Usamos doble clase (.sticker-grid.search-stickers-grid) para ganarle a las
   media queries de .sticker-grid que están al final del archivo. */
.sticker-grid.search-stickers-grid {
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)) !important;
  gap: 4px !important;
}

.sticker-grid.search-stickers-grid .sticker {
  border-width: 1.5px;
  border-radius: 6px;
  aspect-ratio: 0.78;
}

.sticker-grid.search-stickers-grid .sticker .s-num {
  font-size: 0.78rem !important;
  font-weight: 800;
  line-height: 1;
}

.sticker-grid.search-stickers-grid .sticker .s-count {
  font-size: 0.55rem !important;
  padding: 0 4px;
  border-radius: 5px;
  top: 2px;
  right: 2px;
}

/* En móvil aún más compacto */
@media (max-width: 540px) {
  .sticker-grid.search-stickers-grid {
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)) !important;
    gap: 4px !important;
  }
  .sticker-grid.search-stickers-grid .sticker .s-num {
    font-size: 0.72rem !important;
  }
}

.missing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 6px;
}

@media (min-width: 768px) {
  .missing-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
}

.sticker-mini {
  aspect-ratio: 0.85;
  background: var(--missing);
  border: 1.5px solid var(--border);
  border-style: dashed;
  border-radius: 7px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s, border-color 0.15s, background 0.2s;
  padding: 2px;
  position: relative;
}

.sticker-mini:hover {
  border-color: var(--accent);
}

.sticker-mini:active {
  transform: scale(0.9);
}

.sticker-mini .sm-prefix {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  opacity: 0.8;
  line-height: 1;
}

.sticker-mini .sm-num {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1;
  margin-top: 2px;
}

.sticker-mini.is-shield,
.sticker-mini.is-team {
  border-style: dashed;
  background-image: linear-gradient(135deg, rgba(255, 215, 0, 0.12), rgba(255, 140, 0, 0.12), rgba(0, 191, 255, 0.12));
}

/* Animación de "tachado" cuando se marca */
.sticker-mini.just-marked {
  animation: just-marked 0.4s ease;
}

@keyframes just-marked {
  0% { transform: scale(1); background: var(--missing); }
  50% { transform: scale(1.15); background: var(--accent); }
  100% { transform: scale(0); opacity: 0; }
}

/* ============ STICKERS ============ */
.sticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}

.sticker {
  aspect-ratio: 0.72;
  background: var(--missing);
  border: 2px solid var(--border);
  border-style: dashed;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  position: relative;
  transition: transform 0.15s, border-color 0.15s, background 0.2s;
  padding: 4px;
  overflow: hidden;
}

.sticker:active {
  transform: scale(0.92);
}

.sticker .s-prefix {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  line-height: 1;
  opacity: 0.85;
}

.sticker .s-num {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-top: 2px;
}

.sticker .s-label {
  font-size: 0.55rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 4px;
  line-height: 1.1;
}

.sticker.owned {
  background: linear-gradient(135deg, var(--owned), var(--accent-warm));
  border-color: var(--owned);
  border-style: solid;
  color: var(--text-on-accent);
  animation: pop 0.3s ease;
}

.sticker.owned .s-label {
  color: var(--text-on-accent-muted);
}

.sticker.duplicate {
  background: linear-gradient(135deg, var(--dup), var(--accent));
  border-color: var(--dup);
  border-style: solid;
  color: var(--text-on-accent);
}

.sticker.duplicate .s-label {
  color: var(--text-on-accent-muted);
}

.sticker.is-shield,
.sticker.is-team {
  border-style: dashed;
}

.sticker.is-shield:not(.owned):not(.duplicate),
.sticker.is-team:not(.owned):not(.duplicate) {
  background-image: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(255, 140, 0, 0.18), rgba(0, 191, 255, 0.18));
}

@keyframes pop {
  0% { transform: scale(0.9); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.dup-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--danger);
  color: white;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--bg);
}

/* ============ BOTTOM NAV ============ */
.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(var(--bg-card-rgb), 0.92);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 6px;
  display: flex;
  gap: 2px;
  z-index: 100;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  max-width: calc(100vw - 24px);
}

.bottom-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  min-width: 56px;
  padding: 6px 8px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.18s;
  position: relative;
}

.bottom-nav-btn:hover {
  color: var(--text);
}

.bottom-nav-btn.active {
  background: var(--accent);
  color: var(--text-on-accent);
}

.bottom-nav-btn .nav-label {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  line-height: 1;
}

.bottom-nav-btn .lock-badge {
  display: none;
}

.bottom-nav-btn.locked {
  opacity: 0.55;
}

.bottom-nav-btn.locked .lock-badge {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 14px;
  height: 14px;
  background: var(--bg-card);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.45rem;
  color: var(--accent);
  border: 1px solid var(--border);
}

@media (max-width: 400px) {
  .bottom-nav-btn {
    min-width: 50px;
    padding: 5px 6px;
  }
  .bottom-nav-btn .nav-label {
    font-size: 0.58rem;
  }
}

/* ============ TOAST ============ */
.toast-container {
  z-index: 2000;
}

.toast-custom {
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  color: var(--text);
  border-radius: 12px;
}

/* ============ MODALS / OFFCANVAS ============ */
.modal-content,
.offcanvas {
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--border);
}

.modal-header,
.offcanvas-header {
  border-bottom: 1px solid var(--border);
}

.modal-footer {
  border-top: 1px solid var(--border);
}

.btn-close {
  filter: invert(1) opacity(0.7);
}

.form-control,
.form-control:focus {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem var(--accent-ring);
}

/* ============ BUTTONS ============ */
.btn-accent {
  background: var(--accent);
  color: var(--text-on-accent);
  border: 1px solid var(--accent);
  font-weight: 600;
}

.btn-accent:hover {
  background: var(--brand-cyan-light);
  border-color: var(--brand-cyan-light);
  color: var(--text-on-accent);
}

.btn-outline-light {
  border-color: var(--border);
  color: var(--text);
}

.btn-outline-light:hover {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--text);
}

/* ============ TRADE VIEW ============ */
.trade-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.trade-card .sticker {
  width: 60px;
  aspect-ratio: 0.72;
  flex-shrink: 0;
}

.trade-info {
  flex: 1;
}

.trade-info .id {
  font-weight: 700;
  font-size: 0.95rem;
}

.trade-info .meta {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.trade-count {
  background: var(--dup);
  color: var(--text-on-accent);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
}

/* ============ TRADES · SUB-TABS ============ */
.trades-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.trades-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.trades-tab:hover {
  color: var(--text);
}

.trades-tab.active {
  background: var(--accent-surface);
  color: var(--accent);
}

.trades-tab i {
  font-size: 0.9rem;
}

@media (max-width: 360px) {
  .trades-tab {
    font-size: 0.72rem;
  }
}

/* Search bar */
.trades-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.trades-search-bar .form-control {
  text-transform: uppercase;
}

/* Match cards */
.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.match-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.match-card-user {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

.match-card-user i {
  color: var(--accent);
  font-size: 1.2rem;
}

.match-card-score {
  background: var(--accent-surface);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.match-card-body {
  font-size: 0.85rem;
  margin-bottom: 10px;
}

/* ============================================================
   VISTA CAMBIOS · Hero + toolbar + match cards (Mundial style)
   ============================================================ */

/* Hero de la pestaña Cambios */
.trades-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 4px 0;
}
.trades-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}
.trades-hero-text h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.1;
}
.trades-hero-text p {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Toolbar de búsqueda + filtros + count */
.trades-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.trades-search {
  flex: 1 1 220px;
  min-width: 0;
  position: relative;
}
.trades-search i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}
.trades-search input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px 10px 40px;
  font-size: 0.92rem;
}
.trades-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 0.2rem rgba(var(--accent-rgb, 31, 169, 221), 0.18);
}
.trades-filter-btn {
  position: relative;
  white-space: nowrap;
}
.trades-filter-btn.is-active {
  background: var(--accent);
  color: var(--text-on-accent, #fff);
  border-color: var(--accent);
}
.trades-filter-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  margin-left: 4px;
}
.trades-count-chip {
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 6px rgba(168, 85, 247, 0.3);
}

.trades-filters-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}

.trades-hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
}
.trades-hint > i {
  color: #f59e0b;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* Grid responsive de matches */
.trades-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* === Card de match · estilo Mundial 2026 === */
.trade-mcard {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.trade-mcard:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.trade-mcard-header {
  padding: 16px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  overflow: hidden;
}
.trade-mcard-header::after {
  /* decoración: círculo grande tenue arriba a la derecha */
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 120px;
  height: 120px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.trade-mcard-user {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  min-width: 0;
}
.trade-mcard-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.trade-mcard-info {
  min-width: 0;
}
.trade-mcard-info strong {
  font-size: 1.05rem;
  font-weight: 800;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trade-mcard-city {
  font-size: 0.78rem;
  opacity: 0.92;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.trade-mcard-pct {
  text-align: right;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.trade-mcard-pct-num {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}
.trade-mcard-pct-label {
  font-size: 0.7rem;
  opacity: 0.95;
  font-weight: 600;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trade-mcard-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.trade-mcard-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.trade-mcard-stat {
  background: rgba(var(--accent-rgb, 31, 169, 221), 0.05);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.trade-mcard-stat.stat-need {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}
.trade-mcard-stat.stat-offer {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
}
.trade-mcard-stat-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.trade-mcard-stat.stat-need .trade-mcard-stat-head i { color: #22c55e; }
.trade-mcard-stat.stat-offer .trade-mcard-stat-head i { color: #38bdf8; }
.trade-mcard-stat-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}
.trade-mcard-stat-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.trade-mcard-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.trade-mcard-preview-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 600;
}
.trade-mcard-preview-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.trade-preview-chip {
  background: rgba(168, 85, 247, 0.12);
  color: #a855f7;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: monospace;
  letter-spacing: 0.4px;
}
.trade-preview-chip.more {
  background: rgba(168, 85, 247, 0.2);
}

.trade-mcard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: auto;
}

.btn-mcard-cta {
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.btn-mcard-cta:hover {
  filter: brightness(1.1);
  color: #fff !important;
}

@media (max-width: 380px) {
  .trade-mcard-actions {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MATCH DETAIL MODAL · header gradient + 2 cols + footer fijo
   ============================================================ */
.match-detail-modal .modal-dialog {
  max-width: 900px;
}

/* Flex column explícito · evita que el body crezca más que su contenido
   (sin esto Bootstrap deja flex:1 en .modal-body y queda un hueco enorme
   cuando el contenido es corto) */
.match-detail-modal .modal-content {
  background: var(--bg-card);
  border: none;
  overflow: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}

.match-detail-header {
  flex-shrink: 0;
  padding: 18px 24px 18px 20px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.match-detail-header::after {
  content: '';
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

.match-detail-user {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
}
.match-detail-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}
.match-detail-info {
  min-width: 0;
  overflow: hidden;
}
.match-detail-info strong {
  font-size: 1.2rem;
  font-weight: 800;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}
.match-modal-city {
  font-size: 0.82rem;
  opacity: 0.92;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.match-detail-pct {
  text-align: right;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  margin-right: 32px;
  line-height: 1;
}
.match-detail-pct-num {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}
.match-detail-pct-label {
  font-size: 0.7rem;
  opacity: 0.95;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
  font-weight: 700;
}

.match-detail-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  opacity: 0.95;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  padding: 8px;
  width: 32px;
  height: 32px;
}
.match-detail-close:hover {
  background-color: rgba(255, 255, 255, 0.3);
  opacity: 1;
}

/* Body: NO crece más que su contenido (flex:0 1 auto) · scrollea si overflow */
.match-detail-body {
  flex: 0 1 auto;
  overflow-y: auto;
  min-height: 0;
  padding: 20px;
  background: var(--bg);
}

/* Ajustes móvil · achicar header para que no domine la pantalla */
@media (max-width: 540px) {
  .match-detail-modal .modal-content {
    max-height: calc(100vh - 1rem);
  }
  .match-detail-header {
    padding: 14px 16px;
  }
  .match-detail-avatar {
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
  }
  .match-detail-info strong {
    font-size: 1.05rem;
  }
  .match-modal-city {
    font-size: 0.75rem;
  }
  .match-detail-pct {
    margin-right: 36px;
  }
  .match-detail-pct-num {
    font-size: 1.4rem;
  }
  .match-detail-pct-label {
    font-size: 0.62rem;
  }
  .match-detail-body {
    padding: 14px;
  }
}

.match-detail-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 720px) {
  .match-detail-cols {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.match-detail-col-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.match-detail-col-head i {
  font-size: 1.8rem;
}
.match-detail-col-need .match-detail-col-head i { color: #22c55e; }
.match-detail-col-offer .match-detail-col-head i { color: #38bdf8; }
.match-detail-col-head strong {
  font-size: 1rem;
  color: var(--text);
  line-height: 1;
}

.match-detail-col-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}

/* Chips de cromos (en modal detalle) */
.match-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
  transition: transform 0.12s ease;
  border: 2px solid var(--border);
}
.match-chip:hover {
  transform: translateY(-1px);
}
.match-chip.chip-need {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.05);
}
.match-chip.chip-offer {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(56, 189, 248, 0.05);
}
.match-chip.chip-need .match-chip-num { color: #16a34a; }
.match-chip.chip-offer .match-chip-num { color: #0284c7; }

/* Footer fijo del modal · resumen + CTA */
.match-detail-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.match-detail-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}
.match-detail-summary-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.match-detail-summary-text strong {
  color: var(--text);
}

.match-detail-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .match-detail-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .match-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* === LEGACY: clases viejas (mantener por si quedan referencias) === */
.trade-match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  display: block;
}

.trade-match-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.trade-match-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.trade-match-user > i {
  font-size: 1.6rem;
  color: var(--accent);
  flex-shrink: 0;
}

.trade-match-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.trade-match-id strong {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trade-match-city {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.trade-match-score {
  background: var(--accent-surface, rgba(var(--accent-rgb, 31, 169, 221), 0.18));
  color: var(--accent);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
}

.trade-match-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: rgba(var(--accent-rgb, 31, 169, 221), 0.04);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.trade-match-summary-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  flex-wrap: wrap;
}

.trade-match-summary-line i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.trade-match-summary-line strong {
  color: var(--text);
}

.trade-match-count {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.85rem;
  min-width: 36px;
  text-align: center;
}

.trade-match-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.trade-match-actions .btn {
  white-space: nowrap;
}

/* En móviles muy estrechos: botones apilados verticalmente */
@media (max-width: 380px) {
  .trade-match-actions {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   MODAL DETALLE · cromos agrupados por país
   ============================================================ */
.match-section {
  margin-bottom: 18px;
}

.match-section:last-child {
  margin-bottom: 0;
}

.match-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--text);
}

.match-section-head i {
  font-size: 1.15rem;
}

.match-country-group {
  margin-bottom: 12px;
}

.match-country-group:last-child {
  margin-bottom: 0;
}

.match-country-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-dim);
  margin: 0 0 6px;
  padding: 0;
}

.match-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
}

.match-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}

.match-chip-num {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  line-height: 1;
}

.match-chip-id {
  font-size: 0.6rem;
  color: var(--text-dim);
  margin-top: 2px;
  font-family: monospace;
  letter-spacing: 0.3px;
}

.match-row {
  padding: 4px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

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

.match-row-label {
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 100px;
}

.match-row-list {
  flex: 1;
  font-family: monospace;
  font-size: 0.82rem;
  word-break: break-word;
}

/* Disclaimer */
.disclaimer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}

.disclaimer-card h5 {
  color: var(--accent);
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.disclaimer-list {
  padding-left: 1.2rem;
  margin-bottom: 14px;
}

.disclaimer-list li {
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 8px;
  color: var(--text);
}

/* ============ MIGRATION DECISION MODAL ============ */
.migration-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-bottom: 10px;
}

.migration-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.migration-option.migration-migrate {
  border-color: rgba(34, 197, 94, 0.4);
  background: rgba(34, 197, 94, 0.05);
}
.migration-option.migration-migrate:hover {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.migration-option.migration-discard {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.04);
}
.migration-option.migration-discard:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.migration-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

.migration-option.migration-migrate .migration-icon {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
}

.migration-option.migration-discard .migration-icon {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
}

.migration-text {
  flex: 1;
  min-width: 0;
}

.migration-text strong {
  display: block;
  color: var(--text);
  font-size: 0.95rem;
  margin-bottom: 2px;
}

/* ============ CHECKLIST DE ONBOARDING DE CAMBIOS ============ */
.checklist-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 12px;
}

.checklist-head {
  margin-bottom: 20px;
}

.checklist-head h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
}

.checklist-head p {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0 0 14px;
}

.checklist-progress {
  height: 8px;
  background: rgba(var(--accent-rgb, 31, 169, 221), 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.checklist-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #22c55e 0%, #16a34a 100%);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.checklist-progress-meta {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 6px;
  font-weight: 600;
}

.checklist-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}

.checklist-item:first-of-type {
  border-top: none;
  padding-top: 6px;
}

.checklist-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.checklist-item.is-pending .checklist-icon {
  background: rgba(var(--accent-rgb, 31, 169, 221), 0.12);
  color: var(--accent);
  border: 2px dashed var(--accent);
}

.checklist-item.is-done .checklist-icon {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  font-size: 1.2rem;
  border: 2px solid transparent;
}

.checklist-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.checklist-title strong {
  font-size: 1rem;
  color: var(--text);
}

.checklist-item.is-done .checklist-title strong {
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-color: rgba(34, 197, 94, 0.5);
}

.checklist-badge-done {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.checklist-desc {
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 10px;
}

.checklist-item.is-done .checklist-desc {
  color: var(--text-dim);
}

.checklist-cta {
  margin-top: 8px;
}

/* ============ STATS VIEW ============ */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
}

.stat-card .stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  font-weight: 600;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  margin-top: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ============ ADMIN PANEL ============ */
.admin-match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.admin-match-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.admin-match-teams {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.admin-match-teams .m-flag {
  font-size: 1.2rem;
}

.admin-match-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
}

.admin-badge.admin-disabled {
  background: var(--bg-elev);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.admin-badge.admin-open {
  background: var(--accent-surface);
  color: var(--accent);
}

.admin-badge.admin-closed {
  background: var(--warm-surface);
  color: var(--accent-warm);
}

.admin-badge.admin-finished {
  background: var(--accent-surface);
  color: var(--accent);
}

/* ============ QUINIELA (PREDICCIONES) ============ */
.quiniela-hint {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.quiniela-hint i {
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.quiniela-hint strong {
  color: var(--text);
}

.prediction-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.prediction-card.locked {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--bg-card), var(--accent-soft));
}

.prediction-card.past {
  opacity: 0.85;
}

.prediction-card.missed {
  opacity: 0.55;
  border-style: dashed;
}

.prediction-card.hit {
  border-color: var(--accent-warm);
  background: linear-gradient(135deg, var(--bg-card), var(--warm-soft));
  box-shadow: 0 0 0 1px var(--accent-warm), 0 4px 16px var(--shadow-soft);
}

.prediction-card.hit .pred-hit {
  color: var(--accent-warm);
  font-weight: 800;
  letter-spacing: 1px;
}

.prediction-card.missed .pred-score-empty {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.pred-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 10px;
}

.pred-header .pred-time {
  color: var(--accent);
  font-weight: 800;
}

.pred-header .pred-status {
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 5px;
}

.pred-match {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.pred-team {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.92rem;
  min-width: 0;
}

.pred-team.away {
  justify-content: flex-end;
  text-align: right;
}

.pred-team .m-flag {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.pred-score,
.pred-score-input {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.pred-score .score-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  min-width: 24px;
  text-align: center;
  line-height: 1;
}

.pred-score .score-sep,
.pred-score-input .score-sep {
  color: var(--text-dim);
  font-weight: 600;
}

.pred-score-input .score-input {
  width: 50px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  padding: 8px 4px;
  -moz-appearance: textfield;
}

.pred-score-input .score-input::-webkit-outer-spin-button,
.pred-score-input .score-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.pred-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.pred-footer .m-group {
  background: var(--accent-muted);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.8px;
  font-size: 0.68rem;
}

.pred-confirm-box {
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}

.pred-confirm-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
}

.pred-confirm-team.away {
  /* mismo layout vertical para ambos */
}

.pred-confirm-team .m-flag {
  font-size: 2rem;
}

.pred-confirm-score {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
}

@media (max-width: 420px) {
  .pred-team {
    font-size: 0.78rem;
  }
  .pred-team .m-flag {
    font-size: 1.1rem;
  }
  .pred-score-input .score-input {
    width: 42px;
    font-size: 1.05rem;
  }
}

/* ============ MATCHES VIEW v2 ============ */
.countdown-banner {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-muted) 100%);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 18px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.countdown-banner.live {
  padding: 14px;
}

.countdown-banner .countdown-num {
  font-size: 2.2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
}

.countdown-banner .countdown-label {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-align: left;
  font-weight: 600;
}

.match-day {
  margin-bottom: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.match-day.day-today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 4px 16px var(--shadow-soft);
}

.match-day.day-past {
  opacity: 0.7;
}

.match-day-header {
  padding: 12px 16px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.match-day-header .weekday {
  text-transform: capitalize;
  font-weight: 700;
  color: var(--text);
}

.match-day-header .day-num {
  color: var(--text-dim);
  text-transform: capitalize;
}

.match-day-header .today-badge {
  margin-left: auto;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  padding: 3px 8px;
  border-radius: 4px;
}

.match-card-v2 {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.match-card-v2:last-child {
  border-bottom: none;
}

.match-card-v2:hover {
  background: var(--accent-soft);
}

.match-card-v2 .m-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 6px;
}

.match-card-v2 .m-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.match-card-v2 .m-team {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.match-card-v2 .m-team.home {
  justify-content: flex-start;
}

.match-card-v2 .m-team.away {
  justify-content: flex-end;
  text-align: right;
}

.match-card-v2 .m-flag {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}

.match-card-v2 .m-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-card-v2 .m-vs {
  color: var(--text-dim);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  flex-shrink: 0;
}

.match-card-v2 .m-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.7rem;
  color: var(--text-dim);
}

.match-card-v2 .m-group {
  background: var(--accent-muted);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.8px;
  font-size: 0.65rem;
}

.match-card-v2 .m-venue {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.match-card-v2 .m-venue i {
  color: var(--accent);
  margin-right: 3px;
}

@media (max-width: 420px) {
  .match-card-v2 .m-teams {
    font-size: 0.82rem;
  }
  .match-card-v2 .m-flag {
    font-size: 1.1rem;
  }
  .match-card-v2 .m-venue {
    font-size: 0.65rem;
  }
}

/* ============ MATCHES VIEW (deprecated cards v1) ============ */
.section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.8px;
  color: var(--text-dim);
  font-weight: 700;
  margin: 22px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.match-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.match-card.live {
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--bg-card), var(--danger-soft));
}

.match-time {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  min-width: 64px;
  text-align: center;
}

.match-time.live {
  color: var(--danger);
}

.match-time .date {
  display: block;
  font-size: 0.62rem;
  color: var(--text-dim);
  margin-top: 2px;
  font-weight: 500;
}

.match-teams {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  flex: 1;
}

.match-team.away {
  justify-content: flex-end;
}

.match-team .flag {
  font-size: 1.2rem;
}

.match-score {
  font-weight: 800;
  font-size: 1rem;
  min-width: 42px;
  text-align: center;
  background: var(--bg);
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--accent);
}

.match-score.pending {
  color: var(--text-dim);
  font-weight: 500;
}

.match-venue {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 2px;
  text-align: center;
}

/* ============ COMING SOON ============ */
.coming-soon-card {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--accent-soft) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 24px;
  text-align: center;
  margin: 30px 0;
}

.coming-soon-card .icon {
  font-size: 3rem;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-warm));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.coming-soon-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.coming-soon-card p {
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 360px;
  margin: 0 auto 16px;
}

.coming-soon-card ul {
  list-style: none;
  padding: 0;
  text-align: left;
  max-width: 320px;
  margin: 0 auto;
  font-size: 0.82rem;
}

.coming-soon-card ul li {
  padding: 6px 0;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 8px;
}

.coming-soon-card ul li i {
  color: var(--accent);
}

/* ============ PROFILE VIEW ============ */
.profile-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 12px;
}

.profile-card h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 12px;
}

.profile-card .row-action {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.15s;
}

.profile-card .row-action:last-child {
  border-bottom: none;
}

.profile-card .row-action:hover {
  opacity: 0.85;
}

.profile-card a.row-action {
  text-decoration: none;
  color: inherit;
}

.profile-card .row-action .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--accent);
  flex-shrink: 0;
}

.profile-card .row-action .info {
  flex: 1;
  min-width: 0;
}

.profile-card .row-action .label {
  font-weight: 600;
  font-size: 0.95rem;
}

.profile-card .row-action .desc {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 1px;
}

.profile-card .row-action .arrow {
  color: var(--text-dim);
  font-size: 1.1rem;
}

.profile-guest {
  background: linear-gradient(135deg, var(--bg-card), var(--accent-soft));
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  margin-bottom: 12px;
}

.profile-guest .avatar-big {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  margin: 0 auto 10px;
  border: 2px solid var(--accent);
}

.profile-guest .guest-logo {
  width: 90px;
  height: 90px;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
}

.brand-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 0 8px;
  margin-top: 8px;
  opacity: 0.7;
}

.brand-footer-text {
  text-align: left;
  line-height: 1.2;
}

.brand-footer-line1 {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.brand-footer-line2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.profile-guest .title {
  font-weight: 700;
  font-size: 1.1rem;
}

.profile-guest .desc {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 4px 0 14px;
}

/* progress bar genérica (usada en stats by-group) */
.progress-bar-wrap {
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-warm));
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-section-title {
  color: var(--text-dim);
  letter-spacing: 1.5px;
  font-weight: 700;
}

.stats-group-row,
.stats-group-count {
  color: var(--text);
}

.stats-group-pct {
  color: var(--text-dim);
  font-weight: 600;
}

/* ============ EMPTY ============ */
.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-dim);
}

.empty-state .emoji {
  font-size: 3rem;
  margin-bottom: 10px;
}

/* ============ HINT BANNER ============ */
.hint-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 16px;
}

.hint-banner strong {
  color: var(--accent);
}

.theme-info-alert {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text);
}

.theme-warning-alert {
  background: var(--warm-soft);
  border-color: var(--warm-surface);
  color: var(--text);
}

/* ============ BENEFITS LIST (modal auth-required) ============ */
.benefits-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.benefits-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.benefits-list li i {
  color: var(--accent);
  font-size: 1.05rem;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* ============ INSTALL STEPS (modal de instrucciones) ============ */
.install-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.install-steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.install-steps li:last-child {
  border-bottom: none;
}

.install-steps .step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.install-steps strong {
  color: var(--text);
}

/* ============ UPDATE BANNER (nueva versión disponible) ============ */
.update-banner {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translate(-50%, -20px);
  background: var(--bg-elev);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 10px 14px;
  z-index: 1050;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 32px);
  font-size: 0.88rem;
}

.update-banner.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.update-banner i.bi-stars {
  color: var(--accent);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.update-banner .msg {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 540px) {
  .update-banner {
    top: auto;
    bottom: 76px;
    transform: translate(-50%, 20px);
  }
  .update-banner.show {
    transform: translate(-50%, 0);
  }
  .update-banner .msg {
    font-size: 0.78rem;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 380px) {
  .team-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sticker-grid {
    grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
  }
}

@media (min-width: 768px) {
  main {
    padding: 24px;
  }
  .sticker-grid {
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  }
}

/* ============ MISSING · BOTÓN PDF ============ */
.missing-pdf-btn {
  margin-left: auto;
  color: var(--danger);
}
.missing-pdf-btn i {
  font-size: 1.2rem;
}
.missing-pdf-btn:hover {
  background: rgba(255, 90, 95, 0.12);
  border-color: var(--danger);
}

/* Bloque que solo aparece en print · oculto en pantalla siempre */
.print-only,
.print-checklist,
.print-checklist-title,
.print-checklist-table {
  display: none !important;
}

/* ============================================================
   MODO IMPRESIÓN · Solo Faltantes a PDF (A4 optimizado)
   ============================================================ */
@media print {
  /* === RESETEO BASE · papel blanco, tinta negra === */
  @page {
    size: A4 portrait;
    margin: 8mm 7mm;
  }

  html, body {
    background: #fff !important;
    color: #000 !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
    overflow: visible !important;
    font-family: Arial, Helvetica, sans-serif !important;
  }

  /* Forzar static para que nada quede fixed/sticky en papel */
  body * {
    position: static !important;
  }

  /* === OCULTAR TODO LO DE LA APP === */
  body > *:not(main) {
    display: none !important;
  }

  /* Dentro de main, ocultar todo excepto el checklist de impresión */
  main > *:not(.print-checklist) {
    display: none !important;
  }

  /* Mostrar SOLO el checklist de impresión */
  .print-only.print-checklist {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Cualquier otro .print-only (header viejo) queda oculto */
  .print-only:not(.print-checklist) {
    display: none !important;
  }

  main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    height: auto !important;
    overflow: visible !important;
    display: block !important;
  }

  /* === TÍTULO · sólo se muestra el título principal, sin user/fecha/instrucciones === */
  .print-checklist-title {
    display: block !important;
    text-align: center;
    font-size: 13pt !important;
    font-weight: 900 !important;
    color: #6a0c2a !important;
    margin: 0 0 2.5mm !important;
    padding: 0 !important;
    letter-spacing: 0.2px;
  }

  /* (Se eliminó .print-checklist-intro · ya no se renderiza) */

  /* === TABLA CHECKLIST · compacta para 1 hoja A4 === */
  .print-checklist-table {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    font-size: 8pt !important;
    color: #000 !important;
    page-break-inside: auto;
  }

  /* === COLGROUP · anchos explícitos por columna · ignora el colspan de la fila Especiales === */
  .print-checklist-table col.col-group   { width: 4% !important; }
  .print-checklist-table col.col-country { width: 12% !important; }
  .print-checklist-table col.col-numbers { width: 34% !important; }

  .print-checklist-table td {
    border: 0.4px solid #aaa !important;
    padding: 0.8mm 1.4mm !important;
    vertical-align: middle !important;
    line-height: 1.25 !important;
    background: #fff !important;
  }

  /* === COLUMNA VERTICAL "GRUPO X" · muy angosta · ~8mm === */
  .print-checklist-table td.cell-group {
    padding: 1mm 0 !important;
    background: #f8d4dc !important;
    border: 0.4px solid #d4a5b0 !important;
    text-align: center !important;
    vertical-align: middle !important;
    overflow: hidden !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Letras "GRUPO" apiladas verticalmente y la letra del grupo abajo */
  .print-checklist-table .group-vert {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.05 !important;
    color: #6a0c2a !important;
    font-weight: 900 !important;
    font-size: 7pt !important;
  }
  /* "GRUPO" cada letra en su línea (sin rotación) */
  .print-checklist-table .group-vert .gv-word {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    margin: 0 !important;
  }
  .print-checklist-table .group-vert .gv-sep {
    display: block !important;
    width: 3mm !important;
    height: 0 !important;
    border-top: 0.5px solid #c89ba6 !important;
    margin: 1mm 0 !important;
  }
  .print-checklist-table .group-vert .gv-letter {
    font-size: 11pt !important;
    font-weight: 900 !important;
    line-height: 1 !important;
  }

  /* Anchos efectivos vienen del colgroup. Solo damos padding/alineación a las celdas */
  .print-checklist-table td.cell-country {
    padding: 0.7mm 1mm !important;
    text-align: left !important;
  }
  .print-checklist-table td.cell-numbers {
    padding: 1mm 1.5mm !important;
  }

  /* Nombre del país arriba, código [XXX] abajo · apilados */
  .print-checklist-table .cc-name {
    display: block !important;
    font-weight: 800 !important;
    font-size: 7.5pt !important;
    color: #000 !important;
    line-height: 1.15 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .print-checklist-table .cc-code {
    display: block !important;
    font-weight: 500 !important;
    font-size: 6pt !important;
    color: #777 !important;
    line-height: 1.1 !important;
    margin-top: 0.2mm;
    letter-spacing: 0.3px;
  }

  /* Fila Especiales · fondo neutro + ocupa todo el ancho · números en 1 línea */
  .print-checklist-table tr.row-special td {
    background: #fafafa !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .print-checklist-table tr.row-special td.cell-country {
    width: auto !important;
  }
  .print-checklist-table tr.row-special td.cell-numbers {
    width: auto !important;
  }

  /* === LÍNEAS DE NÚMEROS · grilla con 10 columnas equitativas === */
  .print-checklist-table .chk-line {
    display: grid !important;
    grid-template-columns: repeat(10, 1fr) !important;
    gap: 0 !important;
    align-items: center !important;
    line-height: 1.4 !important;
    font-variant-numeric: tabular-nums !important;
    width: 100% !important;
    font-size: 8pt !important;
    text-align: center !important;
  }
  .print-checklist-table .chk-line + .chk-line {
    margin-top: 0.6mm !important;
  }
  /* Variante Especiales · 20 columnas equitativas en 1 sola línea */
  .print-checklist-table .chk-line-wide {
    grid-template-columns: repeat(20, 1fr) !important;
  }

  /* Variante "solo faltantes" · flex-wrap para que los números se agrupen
     compactos a la izquierda sin huecos vacíos (varía entre 1 y 20 por equipo).
     Sobrescribe grid del chk-line.  */
  .print-checklist-table .chk-line-missing {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0.4mm 1.8mm !important;
    justify-content: flex-start !important;
    grid-template-columns: none !important;
    text-align: left !important;
  }
  .print-checklist-table .chk-line-missing > strong {
    min-width: 5mm !important;
    text-align: center !important;
    padding: 0 0.4mm !important;
  }

  /* Cada número ocupa SU celda del grid · sin solapamiento posible */
  .print-checklist-table .chk-line > s,
  .print-checklist-table .chk-line > strong {
    display: inline-block !important;
    text-align: center !important;
    padding: 0 0.3mm !important;
    line-height: 1.2 !important;
  }

  /* Números tachados (ya los tengo) */
  .print-checklist-table .chk-owned {
    color: #888 !important;
    text-decoration: line-through !important;
    font-weight: 500 !important;
  }
  /* Números en negrita (me faltan) */
  .print-checklist-table .chk-miss {
    color: #000 !important;
    font-weight: 900 !important;
    text-decoration: none !important;
  }

  /* Quitar gradientes y backgrounds caros · ahorra tinta */
  * {
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* Evitar páginas en blanco al final */
  .print-checklist-table tr:last-child td {
    border-bottom: 0.4px solid #999 !important;
  }
  .print-checklist {
    page-break-after: avoid !important;
    break-after: avoid !important;
  }
}
