/* ===== TEMA BALONCESTO ===== */
:root {
  --primary-color: #e74c3c;
  --secondary-color: #3498db;
  --accent-color: #f39c12;
  --success-color: #2ecc71;
  --danger-color: #e74c3c;
  --warning-color: #f1c40f;
  --info-color: #3498db;
}

/* ===== DISEÑO RESPONSIVE PARA PWA ===== */
.game-info-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  padding: 15px;
  margin: 20px 0;
  flex-wrap: wrap;
  gap: 15px;
}

.quarter-display,
.timer-display,
.period-info {
  flex: 1;
  min-width: 200px;
  text-align: center;
  padding: 15px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
}

.quarter-number {
  font-size: 3.5rem;
  font-weight: bold;
  color: var(--accent-color);
  margin: 10px 0;
  text-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

.timer-count {
  font-size: 3rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  color: var(--success-color);
  margin: 10px 0;
  text-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.quarter-controls,
.timer-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.btn-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover:not(:disabled) {
  transform: scale(1.1);
}

.btn-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== MARCADOR PRINCIPAL ===== */
.scoreboard-container {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 20px;
  margin: 30px 0;
  min-height: 300px;
}

@media (orientation: portrait) {
  .scoreboard-container {
    flex-direction: column;
  }
}

.team-scoreboard {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 15px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  border: 3px solid;
  min-height: 300px;
}

.team-local {
  border-color: var(--secondary-color);
}

.team-visitor {
  border-color: var(--primary-color);
}

.team-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

.team-name {
  font-size: 1.8rem;
  text-align: center;
  cursor: pointer;
  padding: 5px 15px;
  border-radius: 8px;
  transition: background 0.3s;
}

.team-name:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-edit-name {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-size: 1rem;
  padding: 5px;
}

.team-score {
  font-size: 5rem;
  font-weight: bold;
  margin: 20px 0;
  text-shadow: 0 0 20px currentColor;
}

.team-local .team-score {
  color: var(--secondary-color);
}

.team-visitor .team-score {
  color: var(--primary-color);
}

/* Botones de puntos */
.points-controls {
  display: flex;
  gap: 10px;
  width: 100%;
  justify-content: center;
  margin: 15px 0;
}

.btn-point {
  flex: 1;
  padding: 15px 5px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  min-height: 70px;
}

.btn-point:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-point[data-points='1'] {
  border-top: 4px solid var(--success-color);
}

.btn-point[data-points='2'] {
  border-top: 4px solid var(--warning-color);
}

.btn-point[data-points='3'] {
  border-top: 4px solid var(--danger-color);
}

.point-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.point-label {
  font-size: 0.8rem;
  opacity: 0.9;
  margin-top: 5px;
}

/* Faltas por equipo */
.team-fouls-display {
  text-align: center;
  margin-top: 15px;
  width: 100%;
}

.fouls-count {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--warning-color);
  margin: 10px 0;
}

/* VS Central */
.vs-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 100px;
}

.vs-text {
  font-size: 2.5rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}

.game-status {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 20px;
  border-radius: 10px;
  text-align: center;
  margin-bottom: 10px;
  font-weight: bold;
}

.possession-indicator {
  background: var(--accent-color);
  color: #2c3e50;
  padding: 8px 15px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.possession-indicator:hover {
  transform: scale(1.05);
}

/* ===== SISTEMA DE FALTAS POR DORSAL ===== */
.fouls-management {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  padding: 20px;
  margin: 30px 0;
}

.fouls-input-section {
  margin-bottom: 25px;
}

.input-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.input-dorsal {
  flex: 1;
  min-width: 120px;
  padding: 12px 15px;
  border-radius: 10px;
  border: 2px solid var(--accent-color);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 1.2rem;
  text-align: center;
}

.select-team {
  padding: 12px 15px;
  border-radius: 10px;
  border: 2px solid var(--info-color);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 1rem;
  min-width: 140px;
}

.btn-foul-add {
  padding: 12px 25px;
  background: linear-gradient(135deg, var(--danger-color), #c0392b);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-foul-add:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.help-text {
  text-align: center;
  margin-top: 10px;
  opacity: 0.8;
  font-size: 0.9rem;
}

/* Lista de jugadores */
.players-fouls-container {
  display: flex;
  gap: 20px;
  margin-top: 20px;
}

@media (orientation: portrait) {
  .players-fouls-container {
    flex-direction: column;
  }
}

.players-team {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 15px;
}

.players-team h4 {
  text-align: center;
  margin-bottom: 15px;
  color: var(--info-color);
}

.players-list {
  max-height: 200px;
  overflow-y: auto;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: background 0.3s;
}

.player-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.player-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-dorsal {
  background: var(--accent-color);
  color: #2c3e50;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.player-fouls {
  display: flex;
  gap: 5px;
}

.foul-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

.foul-dot.active {
  background: var(--warning-color);
}

.foul-dot.expelled {
  background: var(--danger-color);
}

.btn-remove-foul {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  padding: 5px;
  font-size: 0.9rem;
}

.btn-remove-foul:hover {
  color: var(--danger-color);
}

/* Jugadores expulsados */
.expelled-container {
  margin-top: 25px;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 10px;
  padding: 15px;
  border: 2px solid var(--danger-color);
}

.expelled-container h4 {
  color: var(--danger-color);
  text-align: center;
  margin-bottom: 15px;
}

.expelled-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  margin-bottom: 8px;
  background: rgba(231, 76, 60, 0.2);
  border-radius: 8px;
}

/* ===== HISTORIAL ===== */
.game-history {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 15px;
  padding: 20px;
  margin: 30px 0;
}

.history-log {
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
}

.history-entry {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
}

.history-time {
  color: var(--accent-color);
  font-weight: bold;
  min-width: 70px;
}

.history-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

.btn-reset-game,
.btn-save-game,
.btn-share-game {
  padding: 12px 25px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-reset-game {
  background: var(--danger-color);
  color: white;
}

.btn-save-game {
  background: var(--success-color);
  color: white;
}

.btn-share-game {
  background: var(--info-color);
  color: white;
}

.btn-reset-game:hover,
.btn-save-game:hover,
.btn-share-game:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* ===== MODALES ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  border-radius: 15px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  border: 2px solid var(--primary-color);
}

/* ===== RESPONSIVE EXTREMO ===== */
@media (max-width: 768px) {
  .game-info-container {
    flex-direction: column;
  }

  .quarter-display,
  .timer-display,
  .period-info {
    width: 100%;
  }

  .quarter-number {
    font-size: 2.8rem;
  }

  .timer-count {
    font-size: 2.5rem;
  }

  .team-score {
    font-size: 4rem;
  }

  .points-controls {
    flex-direction: column;
  }

  .btn-point {
    min-height: 60px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 5px;
  }

  .scoreboard-container {
    gap: 10px;
  }

  .team-scoreboard {
    padding: 15px;
  }

  .team-score {
    font-size: 3.5rem;
  }

  .input-group {
    flex-direction: column;
  }

  .input-dorsal,
  .select-team,
  .btn-foul-add {
    width: 100%;
  }
}

/* ===== ANIMACIONES ===== */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.pulse {
  animation: pulse 0.5s ease;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.bounce {
  animation: bounce 0.5s ease;
}

/* ===== SCROLLBAR PERSONALIZADO ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #c0392b;
}
