/* ══════════════════════════════════════
   MODO LIGA
   ══════════════════════════════════════ */
/* ══════════════════════════════════════
   LIGA MODE — nuevo layout
   ══════════════════════════════════════ */
.liga-layout {
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
}

/* ── Sidebar izquierdo ── */
.liga-sidebar {
  border-radius: 0;
  flex: 0 0 304px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px;
  background: var(--bg-surface);
  border-right: 1px solid rgba(117,170,219,0.2);
  box-shadow: 2px 0 12px rgba(0,56,168,0.06);
  overflow-y: auto;
}
.liga-sb-header { border-bottom: 1px solid rgba(117,170,219,0.15); padding-bottom: 8px; }
.liga-sb-team {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-bright);
  letter-spacing: 0.03em;
}
.liga-sb-fecha {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 3px;
}

/* Mini pitch */
.liga-sb-pitch-wrap { width: 100%; }
.liga-sb-pitch svg { display: block; }

/* Rating bars */
.liga-sb-ratings { display: flex; flex-direction: column; gap: 8px; }
.liga-sb-bar-row { display: flex; align-items: center; gap: 8px; }
.liga-sb-bar-label {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  width: 64px;
  flex-shrink: 0;
}
.liga-sb-bar-track {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}
.liga-sb-bar-fill {
  height: 100%;
  background: var(--azul);
  border-radius: 4px;
  transition: width 0.3s;
}
.liga-sb-bar-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-bright);
  width: 28px;
  text-align: right;
}

/* W/E/P record */
.liga-sb-record {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid rgba(117,170,219,0.15);
  border-bottom: 1px solid rgba(117,170,219,0.15);
}
.liga-sb-record-pos {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 800;
  color: var(--azul);
  min-width: 38px;
}
.liga-sb-record-wdl {
  display: flex;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 700;
}
.liga-sb-w { color: var(--green); }
.liga-sb-e { color: var(--text-dim); }
.liga-sb-l { color: var(--red); }
.liga-sb-pts {
  margin-left: auto;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-bright);
}

/* Mini tabla en sidebar */
.liga-sb-tabla-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--azul);
  opacity: 0.7;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.liga-sb-tabla-rows { display: flex; flex-direction: column; gap: 3px; }
.liga-sb-tabla-row {
  display: grid;
  grid-template-columns: 20px 1fr 28px;
  align-items: center;
  gap: 3px;
  padding: 5px 7px;
  font-size: 0.88rem;
  border-radius: 6px;
}
.liga-sb-tabla-row.human {
  background: rgba(117,170,219,0.15);
  font-weight: 700;
}
.liga-sb-tabla-row.human-online { background: rgba(245,208,47,0.12); }
.liga-sb-t-pos { color: var(--text-dim); text-align: center; }
.liga-sb-t-namecol { display: flex; flex-direction: column; gap: 0; overflow: hidden; }
.liga-sb-t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.liga-sb-t-player { font-size: 0.65rem; color: var(--text-dim); font-style: italic; }
.liga-sb-t-pts { text-align: right; font-weight: 700; color: var(--azul); }

/* ── Panel derecho ── */
.liga-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

/* Feed scrollable */
.liga-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.liga-feed-idle {
  padding: 40px 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* Bloque de fecha en el feed */
.liga-fecha-block { display: flex; flex-direction: column; gap: 7px; margin-bottom: 6px; }
.lf-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lf-num {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.lf-mercado-badge {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--orange);
  text-transform: uppercase;
}

/* Fila principal del partido del usuario */
.lf-match-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 15px 18px;
  border: 1px solid rgba(117,170,219,0.2);
  border-radius: 14px;
  background: var(--bg-surface);
  box-shadow: 0 2px 8px rgba(0,56,168,0.06);
  transition: box-shadow 0.15s ease;
}
.lf-match-row:hover { box-shadow: 0 4px 14px rgba(0,56,168,0.11); }
.lf-match-row.win  {
  background: rgba(34,197,94,0.07);
  border-color: rgba(34,197,94,0.3);
}
.lf-match-row.draw {
  background: rgba(245,158,11,0.07);
  border-color: rgba(245,158,11,0.3);
}
.lf-match-row.loss {
  background: rgba(239,68,68,0.07);
  border-color: rgba(239,68,68,0.3);
}

/* Fila interna: badge + info */
.lf-match-main {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.lf-result-badge {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 800;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  margin-top: 2px;
}
.lf-match-row.win  .lf-result-badge { background: var(--green); }
.lf-match-row.draw .lf-result-badge { background: #f59e0b; }
.lf-match-row.loss .lf-result-badge { background: var(--red); }

.lf-match-info { flex: 1; min-width: 0; }
.lf-match-label {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.25;
  letter-spacing: 0.01em;
}
.lf-scorers {
  font-size: 0.92rem;
  color: var(--text-dim);
  margin-top: 5px;
  line-height: 1.5;
}
.lf-scorers.rival-scorers { color: var(--text-muted); }

/* Otros resultados (dentro de la card) */
.lf-otros {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding-top: 10px;
  margin-top: 11px;
  border-top: 1px solid rgba(117,170,219,0.25);
}
.lf-match-row.win  .lf-otros { border-top-color: rgba(34,197,94,0.22); }
.lf-match-row.draw .lf-otros { border-top-color: rgba(245,158,11,0.22); }
.lf-match-row.loss .lf-otros { border-top-color: rgba(239,68,68,0.22); }

.lf-otro {
  font-size: 0.84rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.lf-otro b { color: var(--text-bright); font-weight: 700; }
.lf-otro-mas {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Mercado overlay */
.liga-mercado-wrap {
  position: absolute;
  inset: 0;
  bottom: 0;
  background: var(--bg-main);
  overflow-y: auto;
  padding: 14px 16px;
  display: none;
  z-index: 10;
}
.liga-mercado-wrap.visible { display: block; }

/* Controles fijos en la base del feed */
.liga-controls {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border-top: 1px solid rgba(117,170,219,0.2);
  box-shadow: 0 -4px 16px rgba(0,56,168,0.06);
}
.liga-btn-sim {
  border-radius: 10px;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 11px 24px;
  background: linear-gradient(150deg, #2560e8 0%, #0038A8 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 0 #002075, 0 6px 18px rgba(0,56,168,0.35);
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.liga-btn-sim:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #002075, 0 10px 24px rgba(0,56,168,0.45);
}
.liga-btn-sim:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #002075, 0 3px 10px rgba(0,56,168,0.3);
}
.liga-controls-aux { display: flex; gap: 6px; }
.liga-btn-aux {
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 7px 13px;
  background: var(--bg-surface-2);
  color: var(--text-muted);
  border: 1.5px solid rgba(117,170,219,0.3);
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.15s ease;
}
.liga-btn-aux:hover {
  background: var(--celeste-light);
  border-color: var(--celeste);
  color: var(--azul);
}
.liga-btn-aux.auto-active {
  background: var(--azul);
  color: #fff;
  border-color: var(--azul);
  box-shadow: 0 2px 8px rgba(0,56,168,0.3);
}

/* End screen en el feed */
.liga-end-card {
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid rgba(117,170,219,0.2);
  box-shadow: 0 6px 24px rgba(0,56,168,0.1);
  padding: 20px;
  margin-top: 8px;
  margin-bottom: 16px;
}
.liga-end-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.liga-end-campeon {
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--azul);
  margin-bottom: 2px;
}
.liga-end-pos {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 12px;
}
.liga-end-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-bottom: 12px;
}
.liga-end-stat {
  background: var(--bg-surface-2);
  border: 1px solid rgba(117,170,219,0.15);
  border-radius: 8px;
  padding: 8px 4px;
  text-align: center;
}
.liga-end-stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-bright);
}
.liga-end-stat-label {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.liga-end-awards {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--bg-surface-2);
  border: 1px solid rgba(117,170,219,0.15);
  border-radius: 8px;
}
.liga-end-award {
  font-size: 1.1rem;
  color: var(--text);
}
.liga-end-award strong { color: var(--text-bright); }
.liga-end-award span { color: var(--text-dim); font-size: 0.92rem; }
.liga-end-goles {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 14px;
}
.liga-end-goles-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.liga-end-gol-row {
  display: grid;
  grid-template-columns: 28px 1fr 42px;
  align-items: center;
  gap: 6px;
  font-size: 1.1rem;
  padding: 4px 8px;
}
.liga-end-gol-row:nth-child(even) { background: var(--bg-secondary); }
.liga-end-gol-pos { color: var(--text-dim); text-align: center; }
.liga-end-gol-name { color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liga-end-gol-count { font-weight: 800; color: var(--orange); text-align: right; }

/* Tabla de posiciones (usada en end screen) */
.liga-tabla {
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid rgba(117,170,219,0.2);
  box-shadow: 0 4px 16px rgba(0,56,168,0.08);
  font-size: 1.05rem;
  overflow: hidden;
  margin-bottom: 10px;
}
.liga-tabla-head, .liga-tabla-row {
  display: grid;
  grid-template-columns: 26px 1fr 32px 32px 40px 32px 40px;
  gap: 2px;
  padding: 6px 8px;
  align-items: center;
}
.liga-tabla-head {
  background: var(--azul);
  color: rgba(255,255,255,0.8);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.liga-tabla-row { border-bottom: 1px solid var(--bg-secondary); }
.liga-tabla-row:last-child { border-bottom: none; }
.liga-tabla-row.human-row { background: rgba(117,170,219,0.12); font-weight: 700; }
.liga-tabla-row.human-row-other { background: rgba(245,208,47,0.10); }
.liga-tabla-pos { text-align: center; color: var(--text-dim); }
.liga-tabla-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-bright); }
.liga-tabla-player-tag {
  display: inline-block;
  margin-left: 5px;
  font-size: 0.88rem;
  background: var(--gold);
  color: #111;
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 600;
  vertical-align: middle;
}
.liga-tabla-num { text-align: center; color: var(--text); }
.liga-tabla-pts { text-align: center; font-weight: 800; color: var(--azul); }

/* Botón Compartir */
.liga-btn-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  font-family: var(--font-title);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(150deg, #f5861a 0%, #c95f00 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 0 #8a3e00, 0 6px 18px rgba(200,80,0,0.32);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.liga-btn-share:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #8a3e00, 0 8px 22px rgba(200,80,0,0.38);
}
.liga-btn-share:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #8a3e00, 0 2px 6px rgba(200,80,0,0.2);
}

/* Overlay animación CAMPEÓN */
@keyframes campeon-bg-fade {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  72%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes campeon-pop {
  0%   { opacity: 0; transform: scale(0.35) rotate(-4deg); }
  18%  { opacity: 1; transform: scale(1.12) rotate(2deg); }
  30%  { transform: scale(0.96) rotate(-1deg); }
  42%  { transform: scale(1.02) rotate(0deg); }
  70%  { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(0.88); }
}
.liga-campeon-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 20, 80, 0.78);
  backdrop-filter: blur(6px);
  animation: campeon-bg-fade 3s ease forwards;
  pointer-events: none;
}
.liga-campeon-text {
  font-family: var(--font-title);
  font-size: 5rem;
  font-weight: 900;
  color: #FFD700;
  text-align: center;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-shadow:
    0 4px 32px rgba(255,215,0,0.7),
    0 0 80px rgba(255,215,0,0.45),
    0 2px 6px rgba(0,0,0,0.9);
  animation: campeon-pop 3s ease forwards;
}

@media (max-width: 700px) {
  /* La página scrollea entera; los controles quedan pegados abajo */
  .liga-layout { flex-direction: column; height: auto; overflow: visible; }

  /* Sidebar → tarjeta compacta: equipo + récord a la izquierda,
     mini-cancha a la derecha, tabla colapsada abajo */
  .liga-sidebar {
    flex: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    grid-template-areas:
      "header pitch"
      "record pitch"
      "tabla  tabla";
    gap: 8px 14px;
    align-items: center;
    padding: 12px 14px;
    border-right: none;
    border-bottom: 1px solid rgba(117,170,219,0.2);
    overflow: visible;
  }
  .liga-sb-header { grid-area: header; border-bottom: none; padding-bottom: 0; min-width: 0; align-self: end; }
  .liga-sb-team { font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .liga-sb-pitch-wrap { grid-area: pitch; width: 118px; }
  .liga-sb-record { grid-area: record; border: none; padding: 0; align-self: start; }
  .liga-sb-record-pos { font-size: 1.5rem; min-width: 30px; }
  .liga-sb-ratings { display: none; }
  .liga-sb-tabla { grid-area: tabla; border-top: 1px solid rgba(117,170,219,0.15); padding-top: 8px; }
  .liga-sb-tabla-rows { max-height: 136px; overflow-y: auto; }

  .liga-right { height: auto; flex: none; }
  .liga-feed { flex: none; overflow: visible; padding: 12px 12px 0; }

  /* Controles: SIMULAR + AUTO + SALTAR en una fila, velocidad debajo */
  .liga-controls {
    position: sticky;
    bottom: 0;
    z-index: 30;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }
  .liga-controls-aux { display: contents; }
  .liga-btn-sim { flex: 1; padding: 12px 10px; font-size: 0.8rem; white-space: nowrap; }
  .liga-btn-aux { padding: 10px 10px; white-space: nowrap; }
  .liga-controls .csp-wrap { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; justify-content: center; }

  /* Mercado de pases: una card debajo de la otra */
  .mercado-layout { flex-direction: column; }
  .mercado-card { width: 100%; }
  .mercado-xi-panel { flex: none; width: 100%; }
}

/* posiciones destacadas en draft al tocar un jugador colocado */
.drft3-slot.swap-eligible {
  outline: 3px solid var(--celeste);
  outline-offset: 2px;
  cursor: pointer;
}
.drft3-slot.swap-origin {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}
.drft3-circle.swap-eligible-bg { background: var(--celeste-light) !important; }

/* ── MERCADO DE PASES ─────────────────────────────────────────── */
.mercado-layout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  max-width: 860px;
  margin: 0 auto;
}
.mercado-card {
  background: var(--bg-card);
  border-radius: 10px;
  border: 2px solid var(--azul);
  padding: 14px;
  flex: 1;
  min-width: 0;
}
.mercado-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.mercado-cambios {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mercado-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--text-muted);
  display: inline-block;
}
.mercado-dot.activo {
  background: var(--azul);
  border-color: var(--azul);
}
.mercado-cerrar-btn {
  font-size: 0.65rem !important;
  padding: 4px 8px !important;
  background: transparent !important;
  color: var(--text-dim) !important;
  border: 1px solid var(--text-muted) !important;
}
.mercado-cerrar-btn:hover {
  background: var(--bg-secondary) !important;
  color: var(--text) !important;
}
.mercado-equipo-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: var(--azul);
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.mercado-equipo-name {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mercado-equipo-year {
  font-size: 0.75rem;
  font-weight: 400;
  opacity: 0.75;
  margin-left: 4px;
}
.mercado-equipo-rating {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
}
.mercado-fichaje-header {
  background: var(--green);
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 8px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mercado-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.mercado-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.mercado-prow {
  display: grid;
  grid-template-columns: 1fr 50px 32px;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 5px;
  background: var(--bg-surface-2);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.mercado-prow:hover {
  background: var(--bg-card-hover);
  border-color: var(--celeste);
}
.mercado-prow-out {
  grid-template-columns: 40px 1fr 32px;
}
.mercado-prow-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mercado-prow-pos {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-align: center;
}
.mercado-prow-pos-out {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--azul);
  text-align: center;
}
.mercado-prow-rating {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--azul);
  text-align: right;
}
.mercado-acciones {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.mercado-acciones > button { flex: 1; }
.mercado-pasar-btn {
  font-size: 0.72rem !important;
  padding: 6px !important;
  background: transparent !important;
  color: var(--text-dim) !important;
  border: 1px solid var(--text-muted) !important;
}
.mercado-pasar-btn:hover {
  background: var(--bg-secondary) !important;
}
.mercado-reroll-btn {
  font-size: 0.72rem !important;
  padding: 6px !important;
  background: transparent !important;
  color: var(--azul) !important;
  border: 1px solid var(--azul) !important;
}
.mercado-reroll-btn:hover {
  background: rgba(77,166,255,0.1) !important;
}
.mercado-reroll-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--azul);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  margin-left: 4px;
}
.mercado-cerrado {
  text-align: center;
  padding: 20px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--green);
  letter-spacing: 0.05em;
}

/* Mercado XI panel (panel derecho) */
.mercado-xi-panel {
  flex: 0 0 260px;
  background: var(--bg-surface);
  border: 1px solid rgba(117,170,219,0.2);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,56,168,0.08);
  overflow: hidden;
}
.mercado-xi-header {
  background: var(--bg-surface-2);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid rgba(117,170,219,0.15);
}
.mercado-xi-title {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.mercado-xi-bs {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text);
}
.mercado-xi-bs b { color: var(--azul); }
.mercado-xi-list {
  display: flex;
  flex-direction: column;
}
.mercado-xi-row {
  display: grid;
  grid-template-columns: 36px 1fr 26px 30px;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-bottom: 1px solid var(--bg-secondary);
  font-size: 0.72rem;
  transition: background 0.1s;
}
.mercado-xi-row:last-child { border-bottom: none; }
.mercado-xi-row.compatible {
  cursor: pointer;
  background: rgba(34,197,94,0.07);
}
.mercado-xi-row.compatible:hover { background: rgba(34,197,94,0.18); }
.mercado-xi-row.incompat {
  opacity: 0.4;
}
.mercado-xi-pos {
  font-size: 0.58rem;
  font-weight: 700;
  color: var(--azul);
  text-transform: uppercase;
}
.mercado-xi-row.compatible .mercado-xi-pos { color: var(--green); }
.mercado-xi-name {
  color: var(--text-bright);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mercado-xi-rating {
  font-weight: 700;
  color: var(--text);
  text-align: right;
}
.mercado-diff {
  font-size: 0.6rem;
  font-weight: 700;
  text-align: right;
  color: var(--text-dim);
}
.mercado-diff.up   { color: var(--green); }
.mercado-diff.down { color: var(--red); }
.mercado-incompat-msg {
  background: rgba(239,68,68,0.1);
  border: 1px solid var(--red);
  color: var(--red);
  font-size: 0.72rem;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.drft3-circle.swap-origin-bg   { background: #ffe0bb !important; }

