/* ESTILOS ESPECÍFICOS PARA EL CUBILETE */
/* Tema específico */
body.theme-cubilete {
  --primary-color: #8B4513;
  --secondary-color: #D2691E;
  --gradient: linear-gradient(135deg, #8B4513, #D2691E, #CD853F);
  --accent-color: #FFD700;
}

/* Configuración del juego */
.config-section {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.config-section h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--accent-color);
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.config-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.config-item label {
  font-weight: bold;
  color: var(--light-color);
}

.number-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.number-input {
  width: 60px;
  padding: 8px;
  text-align: center;
  font-size: 1.1rem;
  font-weight: bold;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  color: white;
}

.select-input {
  padding: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid var(--primary-color);
  border-radius: 6px;
  color: white;
  font-size: 1rem;
  cursor: pointer;
}

.players-config {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.players-config h3 {
  margin-bottom: 15px;
  color: var(--light-color);
}

.players-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.player-config-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.player-config-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-color);
}

.player-number {
  width: 30px;
  height: 30px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  flex-shrink: 0;
}

.player-name-input {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: none;
  color: white;
  font-size: 1rem;
  border-bottom: 2px dashed rgba(255, 255, 255, 0.3);
}

.player-name-input:focus {
  outline: none;
  border-bottom-color: var(--accent-color);
}

.config-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
}

/* Juego en curso */
.game-section {
  animation: fadeIn 0.5s ease;
}

.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(139, 69, 19, 0.3);
  padding: 15px 20px;
  border-radius: 10px;
  margin-bottom: 25px;
}

.current-player-info h3 {
  color: var(--accent-color);
  margin-bottom: 5px;
}

.round-info {
  text-align: right;
}

/* Área de dados */
.dice-area {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dice-area h3 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--light-color);
}

.dice-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin: 25px 0;
  min-height: 120px;
}

.dice {
  width: 80px;
  height: 80px;
  background: linear-gradient(145deg, #f5deb3, #deb887);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: bold;
  color: #333;
  box-shadow: 
    0 6px 15px rgba(0, 0, 0, 0.3),
    inset 0 -3px 5px rgba(0, 0, 0, 0.2),
    inset 0 3px 5px rgba(255, 255, 255, 0.8);
  border: 3px solid var(--primary-color);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.dice::before {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;
  border: 2px solid rgba(139, 69, 19, 0.3);
  border-radius: 6px;
}

/* Estilos específicos para cada tipo de dado */
.dice.as {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  color: #dc143c;
}

.dice.as .dice-symbol {
  font-size: 3rem;
}

.dice.joker {
  background: linear-gradient(145deg, #9370DB, #8A2BE2);
  color: #fff;
}

.dice.rey {
  background: linear-gradient(145deg, #FFD700, #FFA500);
  color: #8B4513;
}

.dice.reina {
  background: linear-gradient(145deg, #FF69B4, #FF1493);
  color: #fff;
}

.dice.rojo {
  background: linear-gradient(145deg, #dc143c, #8B0000);
  color: #fff;
}

.dice.negro {
  background: linear-gradient(145deg, #2f2f2f, #000000);
  color: #fff;
}

.dice.kept {
  transform: scale(1.05);
  box-shadow: 
    0 0 20px rgba(255, 215, 0, 0.8),
    0 6px 15px rgba(0, 0, 0, 0.3);
  border-color: #FFD700;
}

.dice.kept::after {
  content: '✓';
  position: absolute;
  top: -5px;
  right: -5px;
  background: #FFD700;
  color: #8B4513;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.dice:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.dice-symbol {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 2px;
}

.dice-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.dice-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.dice-stats {
  text-align: center;
  margin-top: 15px;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Combinación actual */
.combination-area {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.combination-area h3 {
  text-align: center;
  margin-bottom: 15px;
  color: var(--light-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.combination-display {
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 15px 0;
}

.combinations-list-display {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 15px;
}

.combination-item-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(255, 215, 0, 0.3);
}

.combo-name {
  font-weight: bold;
  color: var(--accent-color);
  font-size: 1.1rem;
}

.combo-points {
  color: var(--light-color);
  font-size: 1rem;
  background: rgba(255, 215, 0, 0.2);
  padding: 4px 10px;
  border-radius: 4px;
}

.total-points {
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--accent-color);
  padding: 10px;
  background: rgba(255, 215, 0, 0.15);
  border-radius: 8px;
  border: 2px solid var(--accent-color);
}

.no-combination {
  text-align: center;
  opacity: 0.7;
  font-style: italic;
}

.combination-points {
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--light-color);
}

.combination-points span {
  color: var(--accent-color);
  font-size: 1.5rem;
}

/* Tabla de jugadores */
.players-scoreboard {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow-x: auto;
}

.players-scoreboard h3 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--light-color);
}

.scoreboard-table {
  width: 100%;
  overflow-x: auto;
}

.scoreboard-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.scoreboard-table th {
  background-color: var(--primary-color);
  color: white;
  padding: 12px 15px;
  text-align: left;
  font-weight: bold;
}

.scoreboard-table td {
  padding: 12px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--light-color);
}

.scoreboard-table tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

.scoreboard-table tr.current-player {
  background-color: rgba(255, 215, 0, 0.2);
  border-left: 4px solid var(--accent-color);
}

.scoreboard-table tr.winner {
  background-color: rgba(46, 204, 113, 0.2);
  border-left: 4px solid #2ecc71;
}

.position-cell {
  font-weight: bold;
  text-align: center;
  width: 50px;
}

.position-1 {
  color: #FFD700;
}

.position-2 {
  color: #C0C0C0;
}

.position-3 {
  color: #CD7F32;
}

.player-name-cell {
  font-weight: bold;
}

.player-points-cell {
  text-align: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.player-rounds-cell {
  text-align: center;
}

.player-actions-cell {
  text-align: center;
  min-width: 120px;
}

.btn-small {
  padding: 5px 10px;
  font-size: 0.8rem;
}

/* Controles del juego */
.game-controls {
  margin-bottom: 30px;
}

/* Modal de combinaciones */
.combinations-list {
  max-height: 400px;
  overflow-y: auto;
  margin: 20px 0;
}

.combination-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  border-left: 4px solid var(--accent-color);
}

.combination-item h4 {
  color: var(--accent-color);
  margin-bottom: 5px;
}

.combination-item p {
  margin: 0;
  opacity: 0.9;
}

/* Historial */
.history {
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 25px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.history h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--light-color);
}

.history-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.history-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-item-title {
  font-weight: bold;
  color: var(--accent-color);
  font-size: 1.1rem;
}

.history-item-date {
  font-size: 0.9rem;
  opacity: 0.7;
}

.history-item-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  font-size: 0.9rem;
}

.history-item-info div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.empty-history {
  text-align: center;
  padding: 30px;
  opacity: 0.7;
  font-style: italic;
}

.empty-history i {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

/* Modal de partidas guardadas */
.saved-games-list {
  max-height: 400px;
  overflow-y: auto;
  margin: 20px 0;
}

.saved-game-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.saved-game-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary-color);
  transform: translateX(5px);
}

.saved-game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.saved-game-title {
  font-weight: bold;
  color: var(--accent-color);
  font-size: 1.1rem;
}

.saved-game-date {
  font-size: 0.9rem;
  opacity: 0.7;
}

.saved-game-info {
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 10px;
}

.saved-game-players {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
}

.player-tag {
  background: rgba(139, 69, 19, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Responsive */
@media (max-width: 768px) {
  .config-grid {
    grid-template-columns: 1fr;
  }
  
  .players-list {
    grid-template-columns: 1fr;
  }
  
  .dice {
    width: 70px;
    height: 70px;
  }
  
  .dice-symbol {
    font-size: 2rem;
  }
  
  .dice.as .dice-symbol {
    font-size: 2.5rem;
  }
  
  .dice-name {
    font-size: 0.6rem;
  }
  
  .game-info {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .round-info {
    text-align: center;
  }
  
  .dice-controls {
    flex-direction: column;
    align-items: center;
  }
  
  .dice-controls button {
    width: 100%;
    max-width: 250px;
  }
  
  .scoreboard-table {
    font-size: 0.9rem;
  }
  
  .scoreboard-table th,
  .scoreboard-table td {
    padding: 8px 10px;
  }
}

@media (max-width: 480px) {
  .dice {
    width: 60px;
    height: 60px;
  }
  
  .dice-symbol {
    font-size: 1.6rem;
  }
  
  .dice.as .dice-symbol {
    font-size: 2rem;
  }
  
  .dice-name {
    font-size: 0.55rem;
  }
  
  .combo-name {
    font-size: 1rem;
  }
  
  .combo-points {
    font-size: 0.9rem;
  }
}

/* Animaciones */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rollDice {
  0% { transform: rotate(0deg) scale(0.8); }
  25% { transform: rotate(90deg) scale(1.1); }
  50% { transform: rotate(180deg) scale(0.9); }
  75% { transform: rotate(270deg) scale(1.05); }
  100% { transform: rotate(360deg) scale(1); }
}

.rolling {
  animation: rollDice 0.8s ease-out;
}
