/* ===== All Predictions Modal ===== */

#allPredictionsModal .modal-content {
  max-width: 600px;
}

#predictionsModalContent {
  max-height: 70vh;
  overflow-y: auto;
}

.predictions-section-title {
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.predictions-double-note {
  font-size: 0.8rem;
  color: #667eea;
  margin-bottom: 0.75rem;
}

/* --- Banner de resultado final --- */
.game-result-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem;
  margin-bottom: 1rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  color: #065f46;
  font-weight: 600;
  font-size: 0.9rem;
}

.game-result-banner i {
  color: #10b981;
}

.game-result-banner .result-score {
  font-weight: 700;
}

/* --- Resumen cards --- */
.predictions-summary {
  margin-bottom: 1.5rem;
}

.predictions-summary-cards {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.summary-card {
  flex: 1;
  min-width: 90px;
  padding: 0.75rem 0.5rem;
  background: #f3f4f6;
  border-radius: 8px;
  text-align: center;
}

.summary-card .team-flag {
  width: 32px;
  height: 32px;
  object-fit: contain;
  margin: 0 auto 0.4rem;
  display: block;
}

.summary-card .tie-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #9ca3af;
}

.summary-card-label {
  font-weight: 600;
  color: #374151;
  font-size: 0.8rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-card-count {
  font-size: 1.4rem;
  font-weight: 700;
  color: #667eea;
}

.summary-card-pct {
  font-size: 0.8rem;
  color: #6b7280;
}

.summary-card-winner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}

.summary-card-winner .summary-card-count {
  color: #10b981;
}

/* --- Tabla de predicciones individuales (juegos) --- */
.predictions-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.predictions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  table-layout: fixed;
}

.predictions-table th,
.predictions-table td {
  padding: 0.5rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
}

.predictions-table thead th {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
  vertical-align: bottom;
}

.predictions-table .col-user {
  text-align: left;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 46%;
}

.predictions-table th.col-user {
  text-align: left;
}

.predictions-table .col-pick {
  width: 13%;
}

.predictions-table .col-pick.result-winner {
  background: #ecfdf5;
}

.predictions-table .col-result {
  width: 14%;
  white-space: nowrap;
}

.predictions-table .team-flag {
  width: 22px;
  height: 22px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.predictions-table .col-tie i {
  font-size: 1rem;
  color: #9ca3af;
}

.predictions-table th.result-winner.col-tie i {
  color: #10b981;
}

.predictions-table th.result-winner {
  border-bottom: 2px solid #10b981;
}

.pick-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.75rem;
}

.pick-mark.pick-double {
  background: #667eea;
  color: #fff;
}

.pick-mark.pick-correct {
  background: #10b981;
  color: #fff;
}

.pick-mark.pick-incorrect {
  background: #ef4444;
  color: #fff;
}

.row-double .col-user {
  color: #667eea;
}

.double-badge {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.65rem;
  background: #667eea;
  color: #fff;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  vertical-align: middle;
}

.pts-correct {
  color: #10b981;
  font-weight: 700;
}

.pts-incorrect {
  color: #ef4444;
  font-weight: 700;
}

.pts-pending {
  color: #9ca3af;
}

/* ===== FIFA Knockout phase column ===== */
.predictions-table .col-phase {
  width: 12%;
  text-align: center;
  white-space: nowrap;
}

.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #f3f4f6;
  color: #6b7280;
  font-weight: 500;
}

.phase-badge.phase-normal {
  background: #eff6ff;
  color: #3b82f6;
}

.phase-badge.phase-extra {
  background: #fef3c7;
  color: #d97706;
}

.phase-badge.phase-badge-correct {
  background: #d1fae5;
  color: #059669;
  font-weight: 700;
}

/* Phase summary row below summary cards */
.phase-summary {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.phase-summary-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: #6b7280;
  background: #f9fafb;
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid #e5e7eb;
}

.phase-summary-item.phase-winner {
  background: #d1fae5;
  color: #059669;
  border-color: #6ee7b7;
  font-weight: 700;
}

/* --- Lista de predicciones individuales (series) --- */
.predictions-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.predictions-list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: #f9fafb;
  border-radius: 6px;
  border-left: 4px solid transparent;
  gap: 0.5rem;
}

.predictions-list-row.row-correct {
  background: #f0fdf4;
  border-left-color: #10b981;
}

.predictions-list-row.row-incorrect {
  background: #fef2f2;
  border-left-color: #ef4444;
}

.list-row-user {
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.list-row-pick {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.list-row-team {
  font-weight: 600;
  color: #667eea;
}

.team-flag-sm {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  #allPredictionsModal .modal-content {
    max-width: 98vw;
    width: 98vw;
    padding: 1rem 0.75rem;
    max-height: 95vh;
  }

  #predictionsModalContent {
    max-height: 75vh;
  }

  .predictions-summary-cards {
    gap: 0.4rem;
  }

  .summary-card {
    min-width: 70px;
    padding: 0.5rem 0.25rem;
  }

  .summary-card-label {
    font-size: 0.7rem;
  }

  .summary-card-count {
    font-size: 1.15rem;
  }

  .summary-card-pct {
    font-size: 0.7rem;
  }

  .predictions-table {
    font-size: 0.75rem;
  }

  .predictions-table th,
  .predictions-table td {
    padding: 0.35rem 0.2rem;
  }

  .predictions-table .col-user {
    font-size: 0.75rem;
  }

  .pick-header-name {
    font-size: 0.6rem;
  }

  .pick-mark {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  .double-badge {
    font-size: 0.6rem;
  }

  .predictions-list-row {
    flex-wrap: wrap;
    padding: 0.5rem 0.6rem;
  }

  .list-row-user,
  .list-row-pick {
    font-size: 0.85rem;
  }
}
