/* Variables CSS para temas día/noche */
:root {
    --night-bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --day-bg: linear-gradient(135deg, #87ceeb 0%, #98d8e8 50%, #b0e0e6 100%);
    --night-text: #e8e8e8;
    --day-text: #2c3e50;
    --night-card-bg: rgba(30, 30, 50, 0.9);
    --day-card-bg: rgba(255, 255, 255, 0.95);
    --accent-color: #d4a574;
    --danger-color: #8b1538;
    --success-color: #2d5016;
    --shadow-night: rgba(0, 0, 0, 0.8);
    --shadow-day: rgba(0, 0, 0, 0.2);
}

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

body {
    background: var(--night-bg);
    font-family: 'Cinzel', 'Georgia', 'Times New Roman', serif;
    color: var(--night-text);
    min-height: 100vh;
    transition: all 0.8s ease-in-out;
    font-size: 16px;
    line-height: 1.6;
}

/* Tema día */
body.day-theme {
    background: var(--day-bg);
    color: var(--day-text);
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    overflow-y: auto;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 60px;
}

/* Títulos */
h1 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    max-width: 600px;
    width: 100%;
}

h2 {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    font-weight: 600;
}

h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: var(--accent-color);
    text-align: center;
}

/* Contenedor principal para pantallas principales */
.game-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    background: var(--night-card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-night);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

body.day-theme .game-container {
    background: var(--day-card-bg);
    box-shadow: 0 10px 30px var(--shadow-day);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Botones principales */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
}

button {
    background: linear-gradient(45deg, var(--accent-color), #b8956a);
    color: #1a1a2e;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(212, 165, 116, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
    background: linear-gradient(45deg, #e0b888, var(--accent-color));
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Botón de volver */
.back-btn {
    background: linear-gradient(45deg, var(--danger-color), #a71c3e) !important;
    color: white !important;
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    font-size: 0.9rem;
    z-index: 10;
    text-transform: none;
}

.back-btn:hover {
    background: linear-gradient(45deg, #a71c3e, var(--danger-color)) !important;
}

/* Inputs */
input[type="text"] {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(212, 165, 116, 0.3);
    border-radius: 10px;
    background: rgba(30, 30, 50, 0.8);
    color: var(--night-text);
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-family: inherit;
    transition: all 0.3s ease;
}

body.day-theme input[type="text"] {
    background: rgba(255, 255, 255, 0.9);
    color: var(--day-text);
    border-color: rgba(44, 62, 80, 0.3);
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(212, 165, 116, 0.3);
}

input[type="text"]::placeholder {
    color: rgba(232, 232, 232, 0.6);
}

body.day-theme input[type="text"]::placeholder {
    color: rgba(44, 62, 80, 0.6);
}

/* Selects */
select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    background: rgba(30, 30, 50, 0.8);
    color: var(--night-text);
    font-size: 1rem;
    margin-bottom: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.day-theme select {
    background: rgba(255, 255, 255, 0.9);
    color: var(--day-text);
    border-color: rgba(44, 62, 80, 0.3);
}

select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(212, 165, 116, 0.3);
}

/* LOBBY SCREEN ESPECÍFICO */
#lobbyScreen {
    justify-content: flex-start;
    align-items: stretch;
}

#lobbyScreen h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

/* Código de sala */
.game-code {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    background: rgba(212, 165, 116, 0.1);
    padding: 20px;
    border-radius: 15px;
    margin: 20px auto;
    letter-spacing: 4px;
    border: 2px solid rgba(212, 165, 116, 0.3);
    max-width: 600px;
    width: 100%;
}

/* Lista de jugadores - ocupa toda la pantalla para no-host */
.players-list {
    margin: 20px auto;
    max-height: none;
    overflow-y: visible;
    width: 100%;
    max-width: 600px;
}

/* Cuando es host, limitamos la altura */
#hostConfigurationLobby:not([hidden]) ~ * .players-list {
    max-height: 300px;
    overflow-y: auto;
}

.player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(212, 165, 116, 0.2);
    transition: all 0.3s ease;
}

.player:hover {
    background: rgba(212, 165, 116, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 165, 116, 0.2);
}

.player span {
    font-weight: 600;
    font-size: 1.1rem;
    flex-grow: 1;
}

/* Contenedor de botones del jugador - alineado a la derecha */
.player-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Botones de jugador SOLO con emojis - sin colores de fondo */
.player-actions button {
    padding: 4px;
    font-size: 18px;
    margin: 0;
    min-width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: none;
    letter-spacing: 0;
    background: rgba(255, 255, 255, 0.1) !important;
    color: var(--night-text) !important;
    box-shadow: none !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

body.day-theme .player-actions button {
    background: rgba(0, 0, 0, 0.1) !important;
    color: var(--day-text) !important;
    border-color: rgba(0, 0, 0, 0.2);
}

.player-actions button:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
}

body.day-theme .player-actions button:hover {
    background: rgba(0, 0, 0, 0.15) !important;
}

/* Contador de jugadores */
#playerCount {
    text-align: center;
    font-size: 1.1rem;
    margin: 20px auto;
    font-weight: 600;
    max-width: 600px;
    width: 100%;
}

/* Configuración del host */
#hostConfigurationLobby {
    max-width: 600px;
    width: 100%;
    margin: 20px auto 0;
    padding: 20px;
    background: var(--night-card-bg);
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-night);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.day-theme #hostConfigurationLobby {
    background: var(--day-card-bg);
    box-shadow: 0 8px 25px var(--shadow-day);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#startGameButton {
    width: 100%;
    margin-bottom: 20px;
    padding: 18px;
    font-size: 1.2rem;
}

/* Configuración de roles */
#gameConfiguration {
    background: rgba(212, 165, 116, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(212, 165, 116, 0.2);
}

/* Header de roles count - más pegado arriba */
.roles-count-header {
    text-align: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent-color);
}

/* Warning de roles - más separado */
.role-warning {
    text-align: center;
    margin: 25px 0;
    padding: 15px;
    background: rgba(139, 21, 56, 0.1);
    border: 1px solid var(--danger-color);
    border-radius: 8px;
    color: var(--danger-color);
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Todos los roles con el mismo estilo que aldeanos/lobos */
#alguacilConfiguration,
#aldeanoConfiguration, 
#loboConfiguration,
#brujaConfiguration,
#cazadorConfiguration,
#cupidoConfiguration,
#niñaConfiguration,
#videnteConfiguration {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(212, 165, 116, 0.2);
    transition: all 0.3s ease;
}

#alguacilConfiguration:hover,
#aldeanoConfiguration:hover, 
#loboConfiguration:hover,
#brujaConfiguration:hover,
#cazadorConfiguration:hover,
#cupidoConfiguration:hover,
#niñaConfiguration:hover,
#videnteConfiguration:hover {
    background: rgba(212, 165, 116, 0.15);
    transform: translateY(-1px);
}

/* Para roles con contador */
#aldeanoConfiguration p, 
#loboConfiguration p {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    flex-grow: 1;
}

#aldeanoConfiguration button, 
#loboConfiguration button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 10px;
}

#aldeanoCount, 
#loboCount {
    font-weight: bold;
    font-size: 1.2rem;
    min-width: 30px;
    text-align: center;
}

/* Para roles con checkbox - checkbox a la derecha */
#alguacilConfiguration label,
#brujaConfiguration label,
#cazadorConfiguration label,
#cupidoConfiguration label,
#niñaConfiguration label,
#videnteConfiguration label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    font-size: 1.1rem;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
}

/* Checkboxes a la derecha */
#alguacilConfiguration input[type="checkbox"],
#brujaConfiguration input[type="checkbox"],
#cazadorConfiguration input[type="checkbox"],
#cupidoConfiguration input[type="checkbox"],
#niñaConfiguration input[type="checkbox"],
#videnteConfiguration input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--accent-color);
}

/* ANIMACIÓN DE CARTAS - Tamaño cuadrado */
#roleImage {
    width: 220px;
    height: 220px;
    margin: 20px auto;
    display: block;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--accent-color);
    transition: transform 0.8s ease-in-out;
    cursor: pointer;
    background: var(--night-card-bg);
    object-fit: cover;
}

body.day-theme #roleImage {
    background: var(--day-card-bg);
}

#roleImage:hover {
    transform: scale(1.05) rotateY(10deg);
}

/* Efecto de flip para la carta */
#roleImage.flipped {
    animation: flipCard 0.8s ease-in-out;
}

@keyframes flipCard {
    0% { transform: rotateY(0deg); }
    50% { transform: rotateY(90deg) scale(1.2); }
    100% { transform: rotateY(0deg); }
}

#roleDisplay {
    text-align: center;
    padding: 20px;
}

#roleText {
    font-size: 1.3rem;
    margin: 20px 0;
    font-weight: 600;
}

/* Pantallas de juego */
#nightScreen, #dayScreen {
    text-align: center;
    padding: 40px 20px;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background: var(--night-card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-night);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.day-theme #dayScreen {
    background: var(--day-card-bg);
    box-shadow: 0 10px 30px var(--shadow-day);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

#nightScreen h2 {
    color: #87ceeb;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(135, 206, 235, 0.5);
}

#dayScreen h2 {
    color: #ffd700;
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Pantallas de muerte */
#deathScreen, #playerDeadScreen {
    text-align: center;
    padding: 40px 20px;
    background: rgba(139, 21, 56, 0.1);
    border-radius: 20px;
    border: 2px solid var(--danger-color);
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

/* Lista de roles finales */
.final-roles-list {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.player-role-final {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 8px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(212, 165, 116, 0.2);
}

.alive {
    color: var(--success-color);
    font-weight: bold;
}

.dead {
    color: var(--danger-color);
    font-weight: bold;
}

/* Pantallas de asignación de roles */
#roleAssignScreen > div:not([hidden]) {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    background: var(--night-card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-night);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.day-theme #roleAssignScreen > div:not([hidden]) {
    background: var(--day-card-bg);
    box-shadow: 0 10px 30px var(--shadow-day);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Centrado vertical para roleAssignScreen */
#roleAssignScreen {
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#roleReveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
}

#roleReveal button {
    margin-bottom: 20px;
}

/* Selects para asignación de roles */
.role-select-container {
    margin-bottom: 10px;
}

.role-select-container select {
    margin-bottom: 0;
}

/* Uniformizar altura de selects y jugadores asignados */
.role-select-container select,
.assigned-player {
    min-height: 50px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

/* Jugadores asignados en selección de roles */
.assigned-player {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(212, 165, 116, 0.2);
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 0;
    border: 2px solid rgba(212, 165, 116, 0.3);
    min-height: 50px;
}

.assigned-player span {
    font-weight: 600;
    flex-grow: 1;
    text-align: left;
}

.assigned-player button {
    background: rgba(139, 21, 56, 0.8) !important;
    color: white !important;
    border: none !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    font-size: 12px !important;
    font-weight: bold !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    flex-shrink: 0;
}

.assigned-player button:hover {
    background: rgba(139, 21, 56, 1) !important;
    transform: scale(1.1) !important;
}

/* Mensajes de espera y estado */
.waiting-message {
    text-align: center;
    font-style: italic;
    color: rgba(232, 232, 232, 0.8);
    margin: 20px 0;
}

body.day-theme .waiting-message {
    color: rgba(44, 62, 80, 0.8);
}

/* ASIGNACIÓN DE ROLES - Contenedores de roles */
.role-container {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(30, 30, 50, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(212, 165, 116, 0.2);
}

body.day-theme .role-container {
    background: rgba(255, 255, 255, 0.3);
}

.role-container h3 {
    margin-bottom: 15px;
    text-align: center;
}

/* Botones de asignación aleatoria y confirmación */
.role-assignment-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(212, 165, 116, 0.2);
}

.role-assignment-buttons button {
    min-width: 250px;
    max-width: 300px;
}

/* Pantalla de host para empezar partida - centrado completo CORREGIDO */
.host-game-start {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
}

body.day-theme .host-game-start {
    background: var(--day-bg) !important;
}

.host-game-start button {
    font-size: 1.5rem !important;
    padding: 25px 50px !important;
    min-width: 350px !important;
    max-width: 90vw !important;
    border-radius: 15px !important;
    box-shadow: 0 8px 25px rgba(212, 165, 116, 0.4) !important;
}

/* VOTACIÓN DEL ALGUACIL */

/* Selects - arreglar desbordamiento */
select {
    width: 100%;
    max-width: 100%;
    padding: 12px 15px;
    border: 2px solid rgba(212, 165, 116, 0.3);
    border-radius: 8px;
    background: rgba(30, 30, 50, 0.8);
    color: var(--night-text);
    font-size: 1rem;
    margin-bottom: 15px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Votación del alguacil - estructura para host */
.alguacil-voting-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    background: var(--night-card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-night);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.day-theme .alguacil-voting-container {
    background: var(--day-card-bg);
    box-shadow: 0 10px 30px var(--shadow-day);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Sección de instrucciones */
.alguacil-instructions {
    text-align: center;
    padding: 20px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(212, 165, 116, 0.3);
}

.alguacil-instructions h3 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.alguacil-instructions p {
    font-size: 1rem;
    opacity: 0.9;
}

/* Sección de votos - más llamativa */
.alguacil-votes-section {
    background: rgba(30, 30, 50, 0.5);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(212, 165, 116, 0.3);
}

body.day-theme .alguacil-votes-section {
    background: rgba(255, 255, 255, 0.3);
}

.alguacil-votes-section h3 {
    text-align: center;
    color: var(--accent-color);
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

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

.vote-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.add-vote-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.add-vote-button:hover {
    background-color: #45a049;
    transform: scale(1.1);
}

.add-vote-button.vote-added {
    background-color: #2196F3;
    transform: scale(1.3);
}

.vote-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(212, 165, 116, 0.15);
    border-radius: 12px;
    border: 1px solid rgba(212, 165, 116, 0.4);
    transition: all 0.3s ease;
}

.vote-card:hover {
    background: rgba(212, 165, 116, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 165, 116, 0.2);
}

.vote-card .player-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--night-text);
}

body.day-theme .vote-card .player-name {
    color: var(--day-text);
}

.vote-card .vote-count {
    background: var(--accent-color);
    color: #1a1a2e;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1rem;
    min-width: 45px;
    text-align: center;
}

/* Sección de selección - más espaciada */
.alguacil-selection-section {
    background: rgba(212, 165, 116, 0.05);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(212, 165, 116, 0.2);
    text-align: center;
}

.alguacil-selection-section h3 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.alguacil-selection-section select {
    margin-bottom: 25px;
    font-size: 1.1rem;
    padding: 15px;
}

.alguacil-selection-section button {
    margin: 0 auto;
    min-width: 200px;
}

/* Mensaje de espera para votación */
.alguacil-waiting {
    text-align: center;
    padding: 20px;
    background: rgba(135, 206, 235, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(135, 206, 235, 0.3);
}

.alguacil-waiting p {
    font-size: 1.1rem;
    color: #87ceeb;
    font-weight: 500;
}

/* ANUNCIO DEL ALGUACIL */
.alguacil-reveal-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 70vh;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--night-card-bg);
    border-radius: 20px;
    box-shadow: 0 15px 40px var(--shadow-night);
    border: 2px solid var(--accent-color);
    position: relative;
    overflow: hidden;
}

body.day-theme .alguacil-reveal-container {
    background: var(--day-card-bg);
    box-shadow: 0 15px 40px var(--shadow-day);
}

/* Efecto de brillo de fondo */
.alguacil-reveal-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(212, 165, 116, 0.1) 0%, transparent 70%);
    animation: shimmer 3s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes shimmer {
    0% { transform: rotate(0deg) scale(1); opacity: 0.3; }
    100% { transform: rotate(360deg) scale(1.1); opacity: 0.6; }
}

/* Contenido del anuncio */
.alguacil-reveal-content {
    position: relative;
    z-index: 1;
}

.alguacil-crown {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
    animation: bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.5));
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.alguacil-title {
    font-size: 2.5rem;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    letter-spacing: 2px;
    animation: fadeInUp 1s ease-out;
}

.alguacil-subtitle {
    font-size: 1.2rem;
    color: var(--night-text);
    margin-bottom: 30px;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.3s both;
}

body.day-theme .alguacil-subtitle {
    color: var(--day-text);
}

.alguacil-name {
    font-size: 30px;
    text-align: center;
    font-weight: bold;
    color: #ffd700;
    background: linear-gradient(45deg, #ffd700, #ffed4e, #ffd700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
    margin-bottom: 30px;
    animation: goldShine 2s ease-in-out infinite alternate, fadeInUp 1s ease-out 0.6s both;
    padding: 15px 25px;
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 15px;
    background-color: rgba(255, 215, 0, 0.1);
}

@keyframes goldShine {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alguacil-description {
    font-size: 1.1rem;
    color: var(--night-text);
    opacity: 0.8;
    line-height: 1.6;
    max-width: 400px;
    margin-bottom: 25px;
    animation: fadeInUp 1s ease-out 0.9s both;
}

body.day-theme .alguacil-description {
    color: var(--day-text);
}

.alguacil-powers {
    background: rgba(212, 165, 116, 0.15);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(212, 165, 116, 0.3);
    margin-bottom: 25px;
    animation: fadeInUp 1s ease-out 1.2s both;
}

.alguacil-powers h4 {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.alguacil-powers p {
    font-size: 0.95rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Partículas decorativas */
.alguacil-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
    opacity: 0.6;
}

.particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { top: 80%; left: 20%; animation-delay: 1s; }
.particle:nth-child(3) { top: 40%; right: 15%; animation-delay: 2s; }
.particle:nth-child(4) { top: 70%; right: 25%; animation-delay: 3s; }
.particle:nth-child(5) { top: 30%; left: 80%; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Responsive para anuncio del alguacil */
@media (max-width: 768px) {
    .alguacil-reveal-container {
        padding: 30px 15px;
        min-height: 60vh;
    }
    
    .alguacil-crown {
        font-size: 3rem;
    }
    
    .alguacil-title {
        font-size: 2rem;
    }
    
    .alguacil-name {
        font-size: 24px;
        padding: 12px 20px;
    }
}

@media (max-width: 480px) {
    .alguacil-crown {
        font-size: 2.5rem;
    }
    
    .alguacil-title {
        font-size: 1.7rem;
    }
    
    .alguacil-name {
        font-size: 20px;
        padding: 10px 15px;
    }
}

/* PANTALLAS DEL HOST DURANTE EL JUEGO */

/* Contenedor principal para todas las fases del host */
.host-phase-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    background: var(--night-card-bg);
    border-radius: 20px;
    box-shadow: 0 15px 40px var(--shadow-night);
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

body.day-theme .host-phase-container {
    background: var(--day-card-bg);
    box-shadow: 0 15px 40px var(--shadow-day);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Títulos de tiempo (Noche/Día) */
.time-indicator {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    letter-spacing: 2px;
    animation: fadeInDown 1s ease-out;
}

.time-indicator.night {
    color: #87ceeb;
    text-shadow: 0 0 20px rgba(135, 206, 235, 0.6);
}

.time-indicator.day {
    color: #ffd700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Instrucciones del host */
.host-instructions {
    background: rgba(212, 165, 116, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(212, 165, 116, 0.3);
    margin-bottom: 30px;
    width: 100%;
    animation: fadeInUp 1s ease-out 0.3s both;
}

.host-instructions h3 {
    color: var(--accent-color);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.host-instructions p {
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* CUPIDO */
.cupido-selection {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.couple-selectors {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
}

.couple-selectors select {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
}

.heart-separator {
    font-size: 2rem;
    color: #ff69b4;
    animation: heartBeat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 105, 180, 0.5));
}

@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.couple-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 105, 180, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(255, 105, 180, 0.3);
    width: 100%;
}

.couple-member {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: rgba(212, 165, 116, 0.15);
    border-radius: 12px;
    border: 1px solid rgba(212, 165, 116, 0.3);
    min-width: 150px;
}

.couple-member .name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--night-text);
    margin-bottom: 5px;
}

body.day-theme .couple-member .name {
    color: var(--day-text);
}

.couple-member .role {
    font-size: 0.9rem;
    color: var(--accent-color);
    opacity: 0.8;
    font-style: italic;
}

/* VIDENTE */
.vidente-selection {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.vidente-card-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.vidente-role-card {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 3px solid var(--accent-color);
    transition: transform 0.8s ease-in-out;
    cursor: pointer;
    background: var(--night-card-bg);
    object-fit: cover;
    animation: fadeInScale 1s ease-out;
}

body.day-theme .vidente-role-card {
    background: var(--day-card-bg);
}

.vidente-role-card:hover {
    transform: scale(1.05) rotateY(10deg);
}

.vidente-role-card.flipped {
    animation: flipCard 0.8s ease-in-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.vidente-selection select {
    min-width: 300px;
    max-width: 100%;
}

.vidente-selection button {
    min-width: 200px;
}

/* LOBO */
.lobo-kill-selection {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.kill-target-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 25px;
    background: rgba(139, 21, 56, 0.1);
    border-radius: 15px;
    border: 2px solid var(--danger-color);
    width: 100%;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(139, 21, 56, 0.2);
}

.kill-target-display h4 {
    color: var(--danger-color);
    font-size: 1.3rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.target-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.1rem;
}

.target-name {
    font-weight: 600;
    color: var(--night-text);
}

body.day-theme .target-name {
    color: var(--day-text);
}

.target-role {
    color: var(--accent-color);
    font-style: italic;
    opacity: 0.8;
}

.skull-icon {
    font-size: 1.5rem;
    color: var(--danger-color);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.lobo-kill-selection select {
    min-width: 300px;
    max-width: 100%;
}

/* BRUJA */
.bruja-decision {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.victim-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: rgba(139, 21, 56, 0.1);
    border-radius: 15px;
    border: 2px solid var(--danger-color);
    width: 100%;
    margin-bottom: 20px;
}

.victim-info h4 {
    color: var(--danger-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.victim-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--night-text);
    margin-bottom: 10px;
}

body.day-theme .victim-name {
    color: var(--day-text);
}

.potion-choices {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.potion-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: rgba(212, 165, 116, 0.1);
    border-radius: 15px;
    border: 2px solid rgba(212, 165, 116, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
    flex: 1;
    max-width: 200px;
}

.potion-option:hover {
    background: rgba(212, 165, 116, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(212, 165, 116, 0.3);
}

.potion-option.healing {
    border-color: var(--success-color);
    background: rgba(45, 80, 22, 0.1);
}

.potion-option.healing:hover {
    background: rgba(45, 80, 22, 0.2);
    box-shadow: 0 8px 20px rgba(45, 80, 22, 0.3);
}

.potion-option.no-action {
    border-color: rgba(200, 200, 200, 0.5);
    background: rgba(100, 100, 100, 0.1);
}

.potion-option.no-action:hover {
    background: rgba(100, 100, 100, 0.2);
}

.potion-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.potion-text {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
}

/* Estados de botones */
.button-processing {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.button-processing::after {
    content: " ...";
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0%, 20% { content: " ."; }
    40% { content: " .."; }
    60%, 100% { content: " ..."; }
}

/* Responsive para pantallas del host */
@media (max-width: 768px) {
    .host-phase-container {
        padding: 20px 15px;
        min-height: 60vh;
    }
    
    .time-indicator {
        font-size: 2rem;
    }
    
    .couple-selectors {
        flex-direction: column;
        gap: 15px;
    }
    
    .couple-selectors select {
        min-width: 250px;
    }
    
    .couple-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .vidente-role-card {
        width: 160px;
        height: 160px;
    }
    
    .potion-choices {
        flex-direction: column;
        align-items: center;
    }
    
    .potion-option {
        max-width: 100%;
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .time-indicator {
        font-size: 1.7rem;
    }
    
    .couple-selectors select {
        min-width: 200px;
    }
    
    .vidente-role-card {
        width: 140px;
        height: 140px;
    }
    
    .couple-member {
        min-width: 120px;
        padding: 10px;
    }
}

/* PANTALLAS DE MUERTE Y ANUNCIOS */
.death-announcement-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    background: var(--night-card-bg);
    border-radius: 20px;
    box-shadow: 0 15px 40px var(--shadow-night);
    border: 2px solid var(--danger-color);
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

body.day-theme .death-announcement-container {
    background: var(--day-card-bg);
    box-shadow: 0 15px 40px var(--shadow-day);
}

.death-announcement-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 21, 56, 0.1) 0%, transparent 70%);
    animation: deathShimmer 4s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes deathShimmer {
    0% { transform: rotate(0deg) scale(1); opacity: 0.2; }
    100% { transform: rotate(360deg) scale(1.1); opacity: 0.4; }
}

.death-announcement-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.death-title {
    font-size: 2.5rem;
    color: var(--danger-color);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
    animation: fadeInUp 1s ease-out;
}

.death-card {
    width: 220px;
    height: 220px;
    margin: 20px auto;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 3px solid var(--danger-color);
    transition: transform 0.8s ease-in-out;
    cursor: pointer;
    background: var(--night-card-bg);
    object-fit: cover;
    animation: fadeInScale 1s ease-out 0.3s both;
}

body.day-theme .death-card {
    background: var(--day-card-bg);
}

.death-card.flipped {
    animation: flipCard 0.8s ease-in-out;
}

.victim-name-display {
    font-size: 2rem;
    font-weight: 700;
    color: var(--danger-color);
    margin: 20px 0;
    text-shadow: 0 0 10px rgba(139, 21, 56, 0.5);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.victim-role-display {
    font-size: 1.3rem;
    color: var(--accent-color);
    margin-bottom: 30px;
    font-style: italic;
    animation: fadeInUp 1s ease-out 0.9s both;
}

/* PANTALLAS DE VOTACIÓN DEL DÍA - Mejorado para visibilidad */
.day-voting-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 30px 20px;
    background: var(--day-card-bg);
    border-radius: 20px;
    box-shadow: 0 10px 30px var(--shadow-day);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body:not(.day-theme) .day-voting-container {
    background: var(--night-card-bg);
    box-shadow: 0 10px 30px var(--shadow-night);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.day-voting-instructions {
    text-align: center;
    padding: 20px;
    background: rgba(44, 62, 80, 0.15);
    border-radius: 15px;
    border: 2px solid rgba(44, 62, 80, 0.3);
}

.day-voting-instructions h3 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 10px;
    text-shadow: none;
    font-weight: 700;
}

.day-voting-instructions p {
    color: #34495e;
    font-weight: 600;
    font-size: 1rem;
}

.day-voting-votes-section {
    background: rgba(44, 62, 80, 0.1);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(44, 62, 80, 0.2);
}

body:not(.day-theme) .day-voting-votes-section {
    background: rgba(30, 30, 50, 0.5);
}

.day-voting-votes-section h3 {
    text-align: center;
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-shadow: none;
    font-weight: 700;
}

.day-voting-selection-section {
    background: rgba(44, 62, 80, 0.1);
    padding: 25px;
    border-radius: 15px;
    border: 2px solid rgba(44, 62, 80, 0.2);
    text-align: center;
}

.day-voting-selection-section h3 {
    color: #2c3e50;
    font-size: 1.3rem;
    margin-bottom: 20px;
    text-shadow: none;
    font-weight: 700;
}

.day-voting-waiting {
    text-align: center;
    padding: 20px;
    background: rgba(44, 62, 80, 0.15);
    border-radius: 15px;
    border: 2px solid rgba(44, 62, 80, 0.3);
}

.day-voting-waiting p {
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 600;
    text-shadow: none;
}

/* PANTALLAS DE VICTORIA - Arreglado para scroll y contenido completo */
.victory-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
}

.victory-wolves {
    background: linear-gradient(135deg, #8b1538 0%, #a71c3e 50%, #8b1538 100%);
    color: white;
}

.victory-villagers {
    background: linear-gradient(135deg, #2d5016 0%, #4a7c23 50%, #2d5016 100%);
    color: white;
}

.victory-content {
    max-width: 800px;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 25px;
    padding: 30px;
    text-align: center;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: victoryEntrance 1.5s ease-out;
    margin: auto 0;
    min-height: fit-content;
}

@keyframes victoryEntrance {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(50px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.victory-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    display: block;
    animation: victoryPulse 2s ease-in-out infinite;
}

@keyframes victoryPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.victory-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
    letter-spacing: 2px;
    animation: fadeInUp 1s ease-out 0.5s both;
}

.victory-subtitle {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.stats-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    animation: fadeInUp 1s ease-out 1.1s both;
}

.stats-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.stat-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-role {
    font-size: 0.85rem;
    color: #ffd700;
    font-style: italic;
    margin-bottom: 5px;
}

.stat-status {
    font-size: 0.85rem;
    font-weight: 600;
}

.stat-status.alive {
    color: #4ade80;
}

.stat-status.dead {
    color: #f87171;
}

.back-lobby-section {
    animation: fadeInUp 1s ease-out 1.4s both;
}

.back-lobby-btn {
    background: linear-gradient(45deg, var(--accent-color), #b8956a);
    color: #1a1a2e;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 20px rgba(212, 165, 116, 0.4);
    min-width: 200px;
    margin-bottom: 15px;
}

.back-lobby-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(212, 165, 116, 0.5);
    background: linear-gradient(45deg, #e0b888, var(--accent-color));
}

/* Responsive para victorias - Mejorado */
@media (max-width: 768px) {
    .victory-container {
        padding: 15px;
    }
    
    .victory-content {
        padding: 20px;
        margin: 10px 0;
    }
    
    .victory-icon {
        font-size: 3rem;
    }
    
    .victory-title {
        font-size: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .victory-container {
        padding: 10px;
    }
    
    .victory-content {
        padding: 15px;
    }
    
    .victory-title {
        font-size: 1.6rem;
    }
    
    .victory-icon {
        font-size: 2.5rem;
    }
    
    .death-card {
        width: 160px;
        height: 160px;
    }
    
    .death-title {
        font-size: 2rem;
    }
}

/* PANTALLA DE MUERTE PARA JUGADORES MUERTOS - Más estética */
.player-death-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    background: var(--night-card-bg);
    border-radius: 20px;
    box-shadow: 0 15px 40px var(--shadow-night);
    border: 2px solid var(--danger-color);
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

body.day-theme .player-death-container {
    background: var(--day-card-bg);
    box-shadow: 0 15px 40px var(--shadow-day);
}

.player-death-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139, 21, 56, 0.15) 0%, transparent 70%);
    animation: deathPulse 3s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes deathPulse {
    0% { transform: rotate(0deg) scale(1); opacity: 0.3; }
    100% { transform: rotate(180deg) scale(1.1); opacity: 0.6; }
}

.player-death-content {
    position: relative;
    z-index: 1;
    width: 100%;
}

.player-death-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: floatSlow 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(139, 21, 56, 0.5));
}

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

.player-death-title {
    font-size: 2.5rem;
    color: var(--danger-color);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
    animation: fadeInUp 1s ease-out;
}

.player-death-message {
    font-size: 1.2rem;
    color: var(--night-text);
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 400px;
    animation: fadeInUp 1s ease-out 0.3s both;
}

body.day-theme .player-death-message {
    color: var(--day-text);
}

.player-death-role {
    background: rgba(212, 165, 116, 0.15);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(212, 165, 116, 0.3);
    animation: fadeInUp 1s ease-out 0.6s both;
}

.player-death-role p {
    font-size: 1rem;
    color: var(--night-text);
    margin-bottom: 10px;
    opacity: 0.8;
}

body.day-theme .player-death-role p {
    color: var(--day-text);
}

.player-death-role .role-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(212, 165, 116, 0.5);
}

/* Responsive para muerte de jugador */
@media (max-width: 768px) {
    .player-death-container {
        padding: 30px 15px;
        min-height: 60vh;
    }
    
    .player-death-icon {
        font-size: 3rem;
    }
    
    .player-death-title {
        font-size: 2rem;
    }
    
    .player-death-message {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .player-death-icon {
        font-size: 2.5rem;
    }
    
    .player-death-title {
        font-size: 1.7rem;
    }
    
    .player-death-message {
        font-size: 1rem;
    }
    
    .player-death-role .role-name {
        font-size: 1.3rem;
    }
    
    .alguacil-description {
        font-size: 1rem;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .screen {
        padding: 10px;
    }

    h1 {
        font-size: 2.5rem;
        margin-bottom: 1.5rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    button {
        padding: 12px 25px;
        font-size: 1rem;
    }

    .back-btn {
        top: 10px;
        left: 10px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .player {
        padding: 12px;
    }

    .player span {
        font-size: 1rem;
    }

    .player-actions button {
        min-width: 30px;
        height: 30px;
        font-size: 16px;
    }

    #roleImage {
        width: 180px;
        height: 180px;
    }

    .game-container,
    #hostConfigurationLobby,
    .game-code,
    .players-list,
    #playerCount {
        margin-left: 10px;
        margin-right: 10px;
        max-width: calc(100% - 20px);
    }

    .host-game-start button {
        min-width: 300px !important;
        padding: 20px 40px !important;
        font-size: 1.3rem !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    input[type="text"], select {
        padding: 12px;
        font-size: 1rem;
    }

    #aldeanoConfiguration button, #loboConfiguration button {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    #roleImage {
        width: 160px;
        height: 160px;
    }

    .player {
        padding: 10px 12px;
    }

    .player span {
        font-size: 0.95rem;
    }

    .player-actions button {
        min-width: 28px;
        height: 28px;
        font-size: 15px;
    }

    .role-assignment-buttons button {
        min-width: 200px;
        font-size: 0.95rem;
        padding: 12px 20px;
    }

    .host-game-start button {
        min-width: 250px !important;
        padding: 18px 35px !important;
        font-size: 1.2rem !important;
    }
}

/* Utilidades */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }

/* Animación de carga */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(212, 165, 116, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Transiciones suaves */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.error-message {
    background: rgba(139, 21, 56, 0.9);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    border: 2px solid var(--danger-color);
    margin: 15px 0;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(139, 21, 56, 0.3);
    animation: errorSlideIn 0.3s ease-out;
    max-width: 100%;
    word-wrap: break-word;
}

@keyframes errorSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.error-message[hidden] {
    display: none;
}

/* Para tema día */
body.day-theme .error-message {
    background: rgba(139, 21, 56, 0.95);
    box-shadow: 0 4px 15px rgba(139, 21, 56, 0.4);
}