/* ============================================
   PARTIDOS — SISTEMA DE RANKING Y PARTIDOS
   ============================================ */

/* ── Tabs ── */
.partidos-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  scrollbar-width: none;
}
.partidos-tabs::-webkit-scrollbar { display: none; }

.partidos-tab {
  padding: .875rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--gray-600);
  white-space: nowrap;
  transition: all var(--transition);
}
.partidos-tab.active { color: var(--red); border-bottom-color: var(--red); }
.partidos-tab:hover:not(.active) { color: var(--gray-800); }

.partidos-panel { display: none; }
.partidos-panel.active { display: block; animation: fadeIn .25s ease; }

/* ── Buscar filters ── */
.buscar-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .875rem;
  margin-bottom: 2rem;
}

/* ── Partido card ── */
.partido-card {
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  background: var(--white);
  margin-bottom: 1rem;
}
.partido-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.partido-card.completo { opacity: .75; }

.partido-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--off-white);
  border-bottom: 1px solid var(--gray-200);
  gap: 1rem;
  flex-wrap: wrap;
}
.partido-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.partido-fecha  { font-weight: 700; font-size: .95rem; color: var(--dark); }
.partido-hora   { background: var(--dark); color: var(--white); font-size: .78rem; font-weight: 700; padding: .25rem .625rem; border-radius: 50px; }
.partido-sede   { font-size: .82rem; color: var(--gray-600); }

.partido-badges { display: flex; gap: .5rem; flex-wrap: wrap; }
.pbadge {
  font-size: .72rem; font-weight: 700;
  padding: .2rem .625rem; border-radius: 50px; letter-spacing: .03em;
}
.pbadge-sport    { background: rgba(192,57,43,.1); color: var(--red); }
.pbadge-level    { background: #e8f5e9; color: #2e7d32; }
.pbadge-gender   { background: #e8eaf6; color: #283593; }
.pbadge-completo { background: var(--gray-200); color: var(--gray-600); }
.pbadge-abierto  { background: #e8f5e9; color: #2e7d32; }

.partido-card-body {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.partido-jugadores { display: flex; align-items: center; gap: .75rem; }
.jugadores-label   { font-size: .82rem; color: var(--gray-600); }
.jugadores-avatars { display: flex; gap: .3rem; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700; color: var(--white);
  border: 2px solid var(--white); box-shadow: var(--shadow-sm);
}
.avatar-empty { background: var(--gray-200); color: var(--gray-400); font-size: 1rem; font-weight: 400; }
.avatar-0 { background: #c0392b; }
.avatar-1 { background: #16213e; }
.avatar-2 { background: #0f3460; }
.avatar-3 { background: #5c3600; }

.partido-desc    { font-size: .85rem; color: var(--gray-600); font-style: italic; flex: 1; }
.partido-actions { display: flex; gap: .625rem; flex-shrink: 0; }

.btn-join {
  background: var(--red); color: var(--white); border: none;
  padding: .55rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .85rem; transition: background var(--transition);
}
.btn-join:hover { background: var(--red-dark); }
.btn-join:disabled { background: var(--gray-300); color: var(--gray-500); cursor: not-allowed; }

.btn-result {
  background: #16213e; color: var(--white); border: none;
  padding: .55rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .85rem; transition: background var(--transition);
}
.btn-result:hover { background: #0f3460; }

.btn-leave {
  background: transparent; color: var(--gray-600);
  border: 1.5px solid var(--gray-300);
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  font-weight: 600; font-size: .82rem; transition: all var(--transition);
}
.btn-leave:hover { border-color: var(--red); color: var(--red); }

.empty-state { text-align: center; padding: 4rem 2rem; color: var(--gray-500); }
.empty-state .es-icon { font-size: 3rem; display: block; margin-bottom: 1rem; }
.empty-state h3 { color: var(--gray-700); margin-bottom: .5rem; }
.empty-state p { font-size: .9rem; }

/* ── Crear partido ── */
.crear-partido-wrap {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2.5rem;
  align-items: start;
}
.crear-form-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 2rem;
}
.crear-form-card h3 { margin-bottom: 1.5rem; }
.crear-form-card form { display: flex; flex-direction: column; gap: 1.25rem; }

.level-radio-group { display: flex; flex-wrap: wrap; gap: .5rem; }
.radio-pill { cursor: pointer; }
.radio-pill input { display: none; }
.radio-pill span {
  display: inline-block;
  padding: .4rem 1rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 50px;
  font-size: .82rem; font-weight: 600; color: var(--gray-600);
  transition: all var(--transition);
}
.radio-pill input:checked + span { background: var(--red); color: var(--white); border-color: var(--red); }
.radio-pill:hover span { border-color: var(--red); color: var(--red); }
.radio-pill input:checked + span { color: var(--white) !important; }

.how-list { display: flex; flex-direction: column; gap: .75rem; list-style: none; }
.how-list li { display: flex; align-items: flex-start; gap: .75rem; font-size: .88rem; color: var(--gray-700); }
.how-list li > span {
  width: 22px; height: 22px; background: var(--red); color: var(--white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
}

.points-rules { display: flex; flex-direction: column; gap: .875rem; }
.points-rule { display: flex; align-items: flex-start; gap: .875rem; padding: .875rem; border-radius: var(--radius-sm); }
.points-rule.win     { background: #e8f5e9; }
.points-rule.loss    { background: #fce4ec; }
.points-rule.neutral { background: var(--gray-100); }
.pr-icon {
  font-size: 1.1rem; font-weight: 900;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.win  .pr-icon { background: #2e7d32; color: var(--white); }
.loss .pr-icon { background: var(--red); color: var(--white); }
.neutral .pr-icon { background: var(--gray-500); color: var(--white); }
.points-rule > div { display: flex; flex-direction: column; gap: .15rem; }
.points-rule strong { font-size: .88rem; }
.points-rule span   { font-size: .82rem; color: var(--gray-600); }

/* ── Ranking ── */
.ranking-header { margin-bottom: 1.5rem; }
.ranking-filters { display: flex; gap: .875rem; flex-wrap: wrap; }
.ranking-filters select { max-width: 200px; }

.ranking-podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2.5rem;
  padding: 2rem 1rem 0;
}
.podium-item { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.podium-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 900; color: var(--white);
  border: 3px solid var(--white); box-shadow: var(--shadow-md);
}
.podium-1 .podium-avatar { background: var(--red); width: 68px; height: 68px; font-size: 1.5rem; }
.podium-2 .podium-avatar { background: #16213e; }
.podium-3 .podium-avatar { background: #5c3600; }
.podium-name { font-size: .82rem; font-weight: 700; text-align: center; max-width: 90px; }
.podium-pts  { font-size: .78rem; color: var(--gray-600); }
.podium-bar  { border-radius: var(--radius-sm) var(--radius-sm) 0 0; width: 80px; display: flex; align-items: center; justify-content: center; }
.podium-1 .podium-bar { background: rgba(192,57,43,.15); height: 80px; border: 2px solid rgba(192,57,43,.3); }
.podium-2 .podium-bar { background: rgba(22,33,62,.1);   height: 60px; border: 2px solid rgba(22,33,62,.2); }
.podium-3 .podium-bar { background: rgba(92,54,0,.1);    height: 44px; border: 2px solid rgba(92,54,0,.2); }
.podium-rank { font-weight: 900; font-size: 1.1rem; }
.podium-1 .podium-rank { color: var(--red); }
.podium-2 .podium-rank { color: #16213e; }
.podium-3 .podium-rank { color: #5c3600; }

.ranking-table .trend-up   { color: #2e7d32; font-weight: 700; font-size: .8rem; }
.ranking-table .trend-down { color: var(--red); font-weight: 700; font-size: .8rem; }
.ranking-table .trend-same { color: var(--gray-400); font-size: .8rem; }

/* ── Mis partidos ── */
.mis-section-title {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--gray-500); font-weight: 700; margin: 1.5rem 0 .875rem;
}
.mis-section-title:first-child { margin-top: 0; }

/* ── Resultado modal ── */
.resultado-form { display: flex; flex-direction: column; gap: 1.25rem; }
.pair-select-group { display: flex; flex-direction: column; gap: .625rem; }
.pair-option { cursor: pointer; }
.pair-option input { display: none; }
.pair-card {
  border: 2px solid var(--gray-200); border-radius: var(--radius-sm);
  padding: .875rem 1.25rem; transition: all var(--transition);
  display: flex; align-items: center; justify-content: space-between;
}
.pair-option input:checked + .pair-card { border-color: var(--red); background: rgba(192,57,43,.05); }
.pair-option:hover .pair-card { border-color: var(--red-light); }
.pair-card strong { font-size: .9rem; }
.pair-card span   { font-size: .8rem; color: var(--gray-500); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .crear-partido-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .buscar-filters { grid-template-columns: 1fr 1fr; }
  .ranking-podium { gap: .5rem; }
  .podium-bar { width: 64px; }
  .podium-1 .podium-avatar { width: 56px; height: 56px; font-size: 1.25rem; }
}
