/* ================================
   PLAYERS LAYOUT
================================ */

.players-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}

.player-right-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ================================
   LISTA DE JUGADORES
================================ */

.players-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ITEM JUGADOR */

.player {
  display: flex;
  align-items: center;
  cursor: url("assets/cursor/cur5.cur"), auto;
  background: linear-gradient(#2f6db5, #1c3f7a);
  border: 2px solid transparent;
  image-rendering: pixelated;
  transition: 0.15s;
}

.player img {
  width: 100%;
}

.player:hover {
  filter: brightness(1.2);
}

/* ================================
   SELECCIÓN ESTILO ISSD
================================ */

.player.selected {
  position: relative;
  background: linear-gradient(#4faeff, #2f6db5);
  animation: issdBlink 0.35s infinite;
  outline: 1px solid black;
}

.player.selected::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 2px solid #004cff;
  animation: issdBlinkAlt 0.1s steps(2) infinite;
}

@keyframes issdBlink {
  0% {
    box-shadow: 0 0 0 6px #004cff, 0 0 0 6px #ffd800, 0 0 0 6px #004cff;
  }
  50% {
    box-shadow: 0 0 0 6px #ffbe00, 0 0 0 6px #e7e7e7, 0 0 0 6px #ffbe00;
  }
  100% {
    box-shadow: 0 0 0 6px #0000ff, 0 0 0 6px #ffff00, 0 0 0 6px #0000ff;
  }
}

/* ================================
   PANEL INFO
================================ */

.player-info {
  padding: 20px;
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  text-align: center;
  display: flex;
  align-items: flex-start;
  gap: 40px;
}

.player-image {
  flex-shrink: 0;
  margin-top: 15%;
}

.player-info img {
  width: 200px;
  height: auto;
  align-self: flex-start;
  image-rendering: pixelated;
}

.player-info h3 {
  margin-top: 10px;
}

.player-info p {
  color: #ccc;
}

/* ===== PLAYER CARD ===== */

.card {
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid rgba(245,197,24,0.15);
  max-width: 100%;
}

.card-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 40px;
}

.card-img {
  width: 10%;
  border-radius: 10px;
}

.card-stats {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 10px;
  width: 100%;
}

.stat {
  background: rgba(255,255,255,0.06);
  padding: 10px;
  border-radius: 8px;
  text-align: center;
}

.stat span {
  font-size: 12px;
  color: #aaa;
}

.stat strong {
  font-size: 16px;
  color: #f5c518;
}

.stats-group {
  padding-bottom: 10px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 25px;
}

.stats-group:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 25px rgba(0,0,0,0.3);
}

.stats-group h4 {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-box {
  margin: 3px;
}

.stat-box span {
  font-size: 13px;
  color: #aaa;
}

.stat-box strong {
  font-size: 16px;
  color: #f5c518;
}

.stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ================================
   MOBILE CARD (inline, en lista)
================================ */

.mobile-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(245,197,24,0.2);
  padding: 16px;
  border-radius: 12px;
  margin: 6px 0 10px 0;
  animation: fadeIn 0.25s ease;
}

.mobile-img {
  width: 90px;
  display: block;
  margin: 0 auto 12px;
  image-rendering: pixelated;
}

.mobile-card-name {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #f5c518;
  margin-bottom: 12px;
}

.mobile-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-section {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 10px;
  padding: 10px 12px 8px;
}

.mobile-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  margin: 0 0 8px 0;
}

.mobile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  font-size: 12px;
}

.mobile-grid div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 5px 8px;
  line-height: 1.4;
}

.mobile-grid div span {
  font-size: 10px;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mobile-grid div strong {
  font-size: 13px;
  color: #f5c518;
  font-weight: 600;
}

/* ================================
   YOUTUBE CHIP
================================ */

.yt-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 0, 0, 0.2);
  color: #ff4d4d;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.25s ease;
}

.yt-chip:hover {
  background: rgba(255, 0, 0, 0.5);
  transform: translateY(-1px);
}

.hidden {
  display: none;
}

/* ================================
   H2H SECTION
================================ */

.h2h-section {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 20px 24px;
  box-sizing: border-box;
}

.h2h-section h3 {
  text-align: center;
  margin: 0 0 16px 0;
  font-size: 20px;
}

.h2h-dropdown {
  position: relative;
  width: 260px;
  margin: 10px auto;
  font-size: 14px;
  text-align: center;
}

.h2h-selected {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: #fff;
}

.h2h-selected:hover {
  background: rgba(255,255,255,0.12);
}

.h2h-options {
  position: absolute;
  top: 110%;
  left: 0;
  width: 100%;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10;
}

.h2h-options.hidden {
  display: none;
}

.h2h-option {
  padding: 10px 14px;
  cursor: pointer;
}

.h2h-option:hover {
  background: rgba(255,255,255,0.1);
}

.h2h-option.selected {
  background: rgba(255,204,0,0.2);
}

/* Resumen H2H */

.h2h-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin: 20px 0 25px 0;
}

.summary-card {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: 0.2s;
}

.summary-card:hover {
  transform: translateY(-2px);
}

.summary-card .label {
  font-size: 12px;
  color: #aaa;
}

.summary-card .value {
  font-size: 18px;
  font-weight: bold;
  color: #ffcc00;
}

.summary-card.win  { border-bottom: 3px solid #4caf50; }
.summary-card.draw { border-bottom: 3px solid #ccc; }
.summary-card.loss { border-bottom: 3px solid #f44336; }
.summary-card.goals { border-bottom: 3px solid #ffcc00; }

/* Fila de partido H2H */

.h2h-match {
  display: grid;
  grid-template-columns: 0.6fr 0.6fr 0.6fr 0.6fr 0.1fr;
  align-items: center;
  background: rgba(255,255,255,0.05);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 6px;
  font-size: 14px;
}

.h2h-left {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.h2h-left span {
  color: #e5e7eb;
  font-weight: 600;
}

.h2h-left small {
  color: #aaa;
  font-size: 13px;
  font-weight: 400;
}

.h2h-center {
  text-align: center;
  color: #e5e7eb;
}

.h2h-center-score {
  text-align: center;
}

.h2h-score-chip {
  display: inline-block;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 3px 10px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.h2h-match.win  .h2h-score-chip { color: #6ee87a; }
.h2h-match.loss .h2h-score-chip { color: #f87171; }

.h2h-obs {
  display: block;
  font-size: 11px;
  color: #aaa;
  margin-top: 2px;
}

.h2h-rom {
  text-align: center;
  color: #64748b;
  font-size: 12px;
}

.h2h-right {
  text-align: right;
}

.h2h-match.win  { background: rgba(0,255,0,0.09); }
.h2h-match.loss { background: rgba(255,0,0,0.09); }

.playLink {
  text-decoration: none;
  color: #f44336;
  font-size: 16px;
  transition: color 0.2s;
}

.playLink:hover {
  color: #ff6b6b;
}

/* ================================
   RESPONSIVE — MOBILE
================================ */

@media (max-width: 768px) {

  /* Layout principal pasa a columna única */
  .players-container {
    display: block;
  }

  /* Lista horizontal en mobile: scroll horizontal */
  .players-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-start;
    margin-bottom: 12px;
  }

  .player {
    width: calc(25% - 4px); /* 4 por fila */
    flex-shrink: 0;
  }

  /* Ocultar columna derecha completa en mobile (stats + h2h desktop) */
  .player-right-col {
    display: none;
  }

  /* Mobile card más compacta */
  .mobile-grid {
    grid-template-columns: 1fr 1fr;
    font-size: 11px;
  }

  /* H2H summary: 2 columnas en mobile */
  .h2h-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  /* H2H match: colapsar columnas en mobile */
  .h2h-match {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 4px;
    font-size: 12px;
    padding: 8px 10px;
  }

  .h2h-left {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .h2h-center:nth-of-type(1) {
    grid-column: 2 / 3;
    grid-row: 1;
  }

  .h2h-center-score {
    grid-column: 1 / 2;
    grid-row: 2;
  }

  .h2h-center:nth-of-type(2) {
    grid-column: 2 / 3;
    grid-row: 2;
  }

  .h2h-right {
    grid-column: 1 / 3;
    grid-row: 3;
    text-align: center;
  }

  /* stats-grid ya tiene 2 columnas, ok en mobile */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* stats-container a 1 columna en mobile pequeño */
  .stats-container {
    grid-template-columns: 1fr;
  }

  /* section padding reducido */
  .section {
    padding: 8px 3%;
  }

  .section > div {
    padding: 16px;
  }

}

@media (max-width: 480px) {

  /* En pantallas muy chicas, 3 jugadores por fila */
  .player {
    width: calc(33.33% - 4px);
  }


}

/* ================================
   H2H DENTRO DE MOBILE CARD
================================ */

.mobile-h2h-section {
  margin-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 14px;
}

.mobile-h2h-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #aaa;
  margin: 0 0 10px 0;
  text-align: center;
}

/* Dropdown ocupa todo el ancho dentro de la card */
.mobile-h2h-section .h2h-dropdown {
  width: 100%;
  margin: 0 0 10px 0;
}

/* Summary cards en 2 columnas dentro de la card mobile */
.mobile-h2h-section .h2h-summary {
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 10px 0 14px 0;
}

.mobile-h2h-vs {
    text-align: center;
    margin: 15px 0;
}

/* Fila de partido — versión mobile: layout vertical compacto */
.h2h-match-mobile {
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
}

.h2h-match-mobile.win  { background: rgba(76,255,80,0.09); }
.h2h-match-mobile.loss { background: rgba(255,67,54,0.09); }

.hmm-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.hmm-torneo {
  font-size: 12px;
  color: #e5e7eb;
  font-weight: 600;
}

.hmm-fase {
  font-size: 11px;
  color: #aaa;
}

.hmm-teams {
  color: #e5e7eb;
  font-size: 12px;
  text-align: center;
}

.hmm-vs {
  color: #aaa;
  margin: 0 4px;
  font-size: 11px;
}

.hmm-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

.hmm-score {
  display: inline-block;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.h2h-match-mobile.win  .hmm-score { color: #6ee87a; }
.h2h-match-mobile.loss .hmm-score { color: #f87171; }

.hmm-obs {
  font-size: 11px;
  color: #aaa;
}

.hmm-rom {
  font-size: 11px;
  color: #64748b;
}

#titles {
  white-space: pre-line;
}

/* ================================
   ACHIEVEMENTS
================================ */

.achievements-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.badge {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(245,197,24,0.3);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: #f5c518;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: 0.2s;
}

.badge:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,0.12);
}

.badge.locked {
  opacity: 0.3;
  filter: grayscale(1);
}

@media (max-width: 768px) {
  .achievements-grid {
    justify-content: flex-start;
  }

  .badge {
    font-size: 11px;
    padding: 6px 8px;
  }
}

.achievements-grid.collapsed {
  max-height: 60px;
  overflow: hidden;
}

/* badge especial */
.career-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* título */
.career-title {
  font-size: 11px;
  color: #f5c518;
}

/* fila de medallas */
.career-levels {
  display: flex;
  gap: 6px;
}

/* medallas */
.career-medal {
  font-size: 16px;
  transition: 0.2s;
}

/* desbloqueadas */
.career-medal.on {
  opacity: 1;
  filter: none;
}

/* bloqueadas */
.career-medal.off {
  opacity: 0.25;
  filter: grayscale(1);
}

.career-badge.complete {
  box-shadow: 0 0 10px rgba(245,197,24,0.6);
  border: 1px solid #f5c518;
}

.career-badge.complete .career-medal {
  transform: scale(1.1);
}

.career-badge.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.career-badge.partial .career-title {
  opacity: 0.4;
}


/* contenedor */
[data-tooltip] {
  position: relative;
}

/* burbuja */
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  
  background: rgba(0,0,0,0.85);
  color: #fff;
  font-size: 11px;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: nowrap;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* flechita */
[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);

  border: 5px solid transparent;
  border-top-color: rgba(0,0,0,0.85);

  opacity: 0;
  transition: opacity 0.2s ease;
}

/* hover */
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  opacity: 1;
}
/* ================================
   PALMARÉS
================================ */

#palmaresPanel {
    padding: 0;
    overflow: hidden;
}

/* Header colapsable */
.palmares-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    transition: background 0.2s;
}

.palmares-toggle:hover {
    background: rgba(255,255,255,0.04);
}

.palmares-count {
    background: rgba(245,197,24,0.15);
    border: 1px solid rgba(245,197,24,0.3);
    color: #f5c518;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
}

.palmares-arrow {
    margin-left: auto;
    color: #64748b;
    font-size: 13px;
    transition: color 0.2s;
}

.palmares-toggle.open .palmares-arrow {
    color: #f5c518;
}

/* Contenido colapsable */
.palmares-body {
    display: none;
    padding: 0 14px 14px;
}

.palmares-body.open {
    display: block;
}

/* Grid 2 columnas */
.palmares-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* Card compacta: ícono + nombre en una línea */
.palmares-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 7px 10px;
    transition: border-color 0.2s;
    min-width: 0;
}

.palmares-card:hover {
    border-color: rgba(245,197,24,0.3);
}

.palmares-card--copa {
    border-color: rgba(245,197,24,0.2);
    background: rgba(245,197,24,0.04);
}

.palmares-icon {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

.palmares-info {
    min-width: 0;
}

.palmares-name {
    font-size: 11px;
    font-weight: 600;
    color: #cbd5e1;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile */
.palmares-mobile-section {
    padding: 0;
}

.palmares-mobile-section .palmares-toggle {
    border-radius: 8px;
}

.palmares-mobile-section .palmares-body {
    padding: 8px 0 0;
}

@media (max-width: 480px) {
    .palmares-grid {
        grid-template-columns: 1fr;
    }
}

.loading-status{

    display:flex;

    justify-content:center;

    align-items:center;

    gap:10px;

    margin:20px 0;

    color:#bbb;

    font-size:15px;

    transition:opacity .25s;

}

.loading-status.hidden{

    display:none;

}

.loading-spinner{

    width:16px;

    height:16px;

    border:2px solid rgba(255,255,255,.25);

    border-top-color:#f5c518;

    border-radius:50%;

    animation:spin .8s linear infinite;

}

@keyframes spin{

    to{

        transform:rotate(360deg);

    }

}

/* ================================
   OBSERVACIÓN DE PARTIDO
================================ */