/* ============================================================
   Paleta: Azul medianoche con acentos naranja (color balón NBA)
   - Fondo       : #0a1a3a
   - Tarjetas    : #15264f
   - Bordes      : #2a3d6b
   - Separadores : #0f1e3d  (sutiles dentro de tarjetas)
   - Hover fila  : #1d2f5e
   - Texto       : #ffffff
   - Texto sec.  : #9ab0d0  (azul-gris)
   - Acento      : #ff8800  (naranja)
   - En vivo     : #ff4455  (rojo)
   ============================================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background-color: #0a1a3a;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding: 20px 12px 60px;
  min-height: 100vh;
}

.contenedor { max-width: 760px; margin: 0 auto; }

/* Cabecera: título + subtítulo a la izquierda, botón a la derecha */
.cabecera {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 6px 0 60px;
}
.cabecera-textos { min-width: 0; }

.titulo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.3px;
  line-height: 1.1;
  margin: 0;
}
.titulo::before {
  content: "";
  display: inline-block;
  width: 4px; height: 22px;
  background: #ff8800;
  border-radius: 2px;
  margin-right: 10px;
  vertical-align: -3px;
}

.subtitulo {
  color: #9ab0d0;
  font-size: 13px;
  margin: 6px 0 0;
}
#actualizado { color: #fff; font-weight: 600; }
#actualizado.cargando { color: #ffaa44; }

/* Pestañas — estilo Material (subrayado), alineadas a la izquierda */
.tabs {
  display: flex;
  gap: 24px;
  justify-content: flex-start;
  margin-bottom: 22px;
  border-bottom: 1px solid #2a3d6b;
  flex-wrap: wrap;
}
.tab {
  background: none;
  border: none;
  color: #9ab0d0;
  padding: 12px 6px;
  font-size: 13px;
  cursor: pointer;
  font-weight: bold;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  position: relative;
  transition: color 0.15s;
}
.tab:hover { color: #e8eef9; }
.tab.activa { color: #fff; }
.tab.activa::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 3px;
  background: #ff8800;
  border-radius: 2px;
}

.card {
  background-color: #15264f;
  border: 1px solid #2a3d6b;
  border-radius: 18px;
  padding: 18px;
  margin-bottom: 14px;
}
.card-clic { cursor: pointer; transition: border-color 0.15s; }
.card-clic:hover { border-color: #ff8800; }

.etiqueta-serie {
  color: #9ab0d0; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 14px;
}

/* Disposición horizontal: equipo · marcador · equipo */
.partido { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.equipo { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; }

.logo-equipo-card {
  width: 56px; height: 56px; object-fit: contain;
  margin-bottom: 8px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.tricode { font-size: 26px; font-weight: bold; letter-spacing: 0.5px; }
.ganador { color: #ff8800; }
.ciudad { color: #9ab0d0; font-size: 12px; margin-top: 4px; }
.record { color: #7d8ba8; font-size: 11px; margin-top: 2px; }

.marcador { text-align: center; padding: 0 10px; min-width: 110px; }
.marcador-num {
  font-size: 32px; font-weight: bold;
  font-variant-numeric: tabular-nums;
}
.marcador-num.vs {
  font-size: 20px; color: #5e6b85; letter-spacing: 2px;
}
.estado { font-size: 13px; margin-top: 8px; color: #ffaa44; }

.en-vivo { color: #ff4455; font-weight: bold; display: inline-flex; align-items: center; gap: 6px; }
.punto-vivo {
  width: 9px; height: 9px; background-color: #ff4455; border-radius: 50%;
  display: inline-block; animation: parpadeo 1.2s infinite;
}
@keyframes parpadeo { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

/* Acciones (chips) al pie de la card de partido */
.acciones-partido {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.chip {
  background-color: #1d2f5e;
  border: 1px solid #2a3d6b;
  color: #e8eef9;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.chip:hover {
  background-color: #ff8800;
  color: #0a1a3a;
  border-color: #ff8800;
}
.chip:active { transform: scale(0.97); }
.chip-icono { font-size: 14px; line-height: 1; }

/* Chip informativo (partido aún no empezado) */
.chip-info {
  background: transparent;
  color: #ffaa44;
  cursor: default;
}
.chip-info:hover {
  background: transparent;
  color: #ffaa44;
  border-color: #2a3d6b;
}

.vacio, .error {
  text-align: center; color: #9ab0d0; padding: 40px 20px; font-style: italic;
}
.error { color: #ff8888; }

.cabecera-botones {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

.boton-refrescar {
  background-color: #ff8800; color: #0a1a3a;
  border: none; border-radius: 10px;
  padding: 9px 18px; font-size: 14px;
  font-weight: bold; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
  transition: background-color 0.15s, transform 0.1s;
}
.boton-refrescar:hover { background-color: #ffa033; }
.boton-refrescar:active { transform: scale(0.97); }

.boton-instalar {
  background-color: #ff4455; color: #fff;
  border: none; border-radius: 10px;
  padding: 9px 18px; font-size: 14px;
  font-weight: bold; cursor: pointer;
  white-space: nowrap; flex-shrink: 0;
  font-family: inherit;
  transition: background-color 0.15s, transform 0.1s;
}
.boton-instalar:hover { background-color: #ff6677; }
.boton-instalar:active { transform: scale(0.97); }
.boton-instalar[hidden] { display: none !important; }

.pie { text-align: center; color: #fff; font-size: 14px; margin-top: 50px; }
.pie + .pie { margin-top: 2px; }
.pie + .pie + .pie { margin-top: 14px; }

/* Modal del box score */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(5,10,28,0.85);
  z-index: 50; padding: 20px 10px; overflow-y: auto;
}
.overlay.abierto { display: block; }
.modal {
  max-width: 760px; margin: 0 auto; background-color: #15264f;
  border: 1px solid #2a3d6b; border-radius: 18px; padding: 18px;
}
.modal-cabecera {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;
}
.modal-titulo { font-size: 20px; font-weight: bold; }
.cerrar {
  background: #2a3d6b; border: none; color: #fff; width: 34px; height: 34px;
  border-radius: 8px; font-size: 18px; cursor: pointer;
}

.equipo-bloque { margin-bottom: 22px; }
.equipo-nombre-tabla {
  font-size: 16px; font-weight: bold; color: #ff8800; margin-bottom: 8px;
}

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 6px 4px; text-align: right; }
th { color: #7d8ba8; border-bottom: 1px solid #2a3d6b; font-weight: normal; }
td:first-child, th:first-child { text-align: left; }
tr td { border-bottom: 1px solid #0f1e3d; }
.jug-nombre { color: #fff; font-weight: bold; }

/* Play-by-play */
.pbp-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #0f1e3d; font-size: 13px;
}
.pbp-reloj { color: #ffaa44; min-width: 60px; }
.pbp-texto { flex: 1; color: #e8eef9; }
.pbp-marcador { color: #ff8800; font-weight: bold; min-width: 60px; text-align: right; }

/* Standings */
.st-tabs {
  display: flex; gap: 8px; justify-content: center;
  margin: 4px 0 14px; flex-wrap: wrap;
}
.st-tab {
  background-color: #15264f; border: 1px solid #2a3d6b; color: #9ab0d0;
  border-radius: 10px; padding: 8px 16px; font-size: 13px;
  cursor: pointer; font-weight: bold;
}
.st-tab.activa { background-color: #ff8800; color: #0a1a3a; border-color: #ff8800; }

.st-scroll {
  background-color: #15264f; border: 1px solid #2a3d6b;
  border-radius: 14px; padding: 10px 6px; overflow-x: auto;
}
.st-tabla {
  width: 100%; border-collapse: collapse; font-size: 13px;
  min-width: 640px;
}
.st-tabla th, .st-tabla td {
  padding: 9px 6px; text-align: right; white-space: nowrap;
}
.st-tabla th {
  color: #9ab0d0; border-bottom: 1px solid #2a3d6b;
  font-weight: normal; font-size: 12px;
}
.st-tabla tbody tr { border-bottom: 1px solid #0f1e3d; }
.st-tabla tbody tr:last-child { border-bottom: none; }
.st-tabla tbody tr:hover { background-color: #1d2f5e; }

.st-tabla th.st-pos, .st-tabla td.st-pos {
  text-align: center; color: #7d8ba8; width: 32px;
}
.st-tabla th.st-equipo, .st-tabla td.st-equipo {
  text-align: left; padding-left: 10px;
}
.st-tabla td.st-equipo {
  display: flex; align-items: center; gap: 10px;
  font-weight: bold; color: #fff;
}
.st-logo { width: 22px; height: 22px; object-fit: contain; }

.rach-w { color: #ff8800; font-weight: bold; }
.rach-l { color: #ff6677; font-weight: bold; }

.cargando-modal { text-align: center; color: #9ab0d0; padding: 30px; }

/* Wrapper con scroll horizontal para tablas anchas (box score) */
.tabla-scroll { overflow-x: auto; }

/* ===== Móvil estrecho (≤ 480px) ===== */
@media (max-width: 480px) {
  body { padding: 16px 10px 50px; }

  .titulo { font-size: 23px; }
  .titulo::before { width: 3px; height: 18px; margin-right: 8px; }
  .cabecera { margin: 4px 0 36px; gap: 12px; }
  .subtitulo { font-size: 12px; }

  .boton-refrescar { padding: 8px 14px; font-size: 13px; }

  .card { padding: 14px; border-radius: 14px; }

  .partido { gap: 4px; }
  .equipo { min-width: 0; }
  .logo-equipo-card { width: 42px; height: 42px; margin-bottom: 6px; }
  .tricode { font-size: 19px; }
  .ciudad { font-size: 11px; }
  .record { font-size: 10px; }

  .marcador { min-width: 80px; padding: 0 4px; }
  .marcador-num { font-size: 24px; }
  .marcador-num.vs { font-size: 16px; letter-spacing: 1px; }
  .estado { font-size: 12px; margin-top: 6px; }

  .chip { padding: 6px 12px; font-size: 12px; }
  .acciones-partido { gap: 8px; margin-top: 12px; }

  .modal { padding: 14px; border-radius: 14px; }
  .modal-titulo { font-size: 17px; }
}
