/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: block;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Pantalla principal */
.game-title {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-subtitle {
    font-size: 1.5rem;
    text-align: center;
    color: #cccccc;
    margin-bottom: 60px;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.menu-btn {
    padding: 15px 40px;
    font-size: 1.2rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px;
    font-weight: bold;
}

.menu-btn.primary {
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    color: white;
}

.menu-btn.primary:hover {
    background: linear-gradient(45deg, #0099cc, #007399);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 212, 255, 0.3);
}

.menu-btn.secondary {
    background: linear-gradient(45deg, #666666, #888888);
    color: white;
}

.menu-btn.secondary:hover {
    background: linear-gradient(45deg, #888888, #aaaaaa);
    transform: translateY(-2px);
}

.menu-btn:disabled {
    background: #444444;
    color: #888888;
    cursor: not-allowed;
    transform: none;
}

/* Formularios */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #cccccc;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #444444;
    border-radius: 8px;
    background: #2a2a3e;
    color: white;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Lobby */
.game-info {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.label {
    font-weight: bold;
    color: #cccccc;
}

.game-code {
    font-family: 'Courier New', monospace;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffd700;
    letter-spacing: 2px;
}

.players-section {
    margin-bottom: 30px;
}

.players-section h3 {
    margin-bottom: 15px;
    color: #cccccc;
}

.players-list {
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    padding: 15px;
    min-height: 120px;
}

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

.player-item:last-child {
    margin-bottom: 0;
}

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

.player-status {
    font-size: 0.9rem;
    color: #cccccc;
}

.host-badge {
    background: #ffd700;
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.waiting-message {
    text-align: center;
    margin: 30px 0;
    font-size: 1.1rem;
    color: #cccccc;
}

/* Pantalla de juego */
.game-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

.question-counter {
    font-size: 1.1rem;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.difficulty-indicator {
    font-size: 0.9rem;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: bold;
}

.difficulty-indicator.easy {
    background: rgba(0, 255, 0, 0.2);
    color: #00ff00;
    border: 1px solid #00ff00;
}

.difficulty-indicator.medium {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border: 1px solid #ffd700;
}

.difficulty-indicator.hard {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border: 1px solid #ff4444;
}

.timer-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer {
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    background: rgba(255,215,0,0.2);
    padding: 10px 20px;
    border-radius: 50px;
    border: 3px solid #ffd700;
    min-width: 80px;
    text-align: center;
}

.timer.warning {
    color: #ff4444;
    border-color: #ff4444;
    background: rgba(255,68,68,0.2);
    animation: pulse 1s infinite;
}

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

.score-container {
    font-size: 1.1rem;
    font-weight: bold;
}

.question-section {
    margin-bottom: 40px;
}

.question-text {
    font-size: 1.4rem;
    line-height: 1.6;
    text-align: center;
    padding: 30px;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    border-left: 5px solid #00d4ff;
}

.answers-section {
    margin-bottom: 30px;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.answer-btn {
    display: flex;
    align-items: center;
    padding: 20px;
    background: rgba(255,255,255,0.1);
    border: 2px solid #444444;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.answer-btn:hover {
    background: rgba(0,212,255,0.2);
    border-color: #00d4ff;
    transform: translateY(-2px);
}

.answer-btn.selected {
    background: rgba(0,212,255,0.3);
    border-color: #00d4ff;
}

.answer-btn.correct {
    background: rgba(0,255,0,0.3);
    border-color: #00ff00;
}

.answer-btn.incorrect {
    background: rgba(255,0,0,0.3);
    border-color: #ff0000;
}

.answer-btn:disabled {
    cursor: not-allowed;
}

.answer-letter {
    font-weight: bold;
    margin-right: 15px;
    color: #ffd700;
    font-size: 1.1rem;
}

.answer-text {
    flex: 1;
}

/* Pantalla de resultados */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin: 40px 0;
    gap: 20px;
}

.podium-place {
    text-align: center;
    padding: 20px;
    border-radius: 10px;
    min-width: 150px;
}

.podium-place.first {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #000;
    height: 200px;
    order: 2;
}

.podium-place.second {
    background: linear-gradient(45deg, #c0c0c0, #e8e8e8);
    color: #000;
    height: 160px;
    order: 1;
}

.podium-place.third {
    background: linear-gradient(45deg, #cd7f32, #daa520);
    color: #000;
    height: 120px;
    order: 3;
}

.place-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.player-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 5px;
}

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

.all-results {
    margin-top: 40px;
}

.all-results h3 {
    margin-bottom: 20px;
    text-align: center;
    color: #cccccc;
}

.results-list {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 20px;
}

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

.result-item:last-child {
    margin-bottom: 0;
}

.result-position {
    font-weight: bold;
    color: #ffd700;
    margin-right: 15px;
}

.result-name {
    flex: 1;
    font-weight: bold;
}

.result-score {
    font-weight: bold;
    color: #00d4ff;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }
    
    .game-subtitle {
        font-size: 1.2rem;
    }
    
    .menu-btn {
        min-width: 200px;
        font-size: 1rem;
    }
    
    .button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .question-text {
        font-size: 1.2rem;
        padding: 20px;
    }
    
    .answers-grid {
        grid-template-columns: 1fr;
    }
    
    .podium {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-place {
        width: 100%;
        max-width: 300px;
        height: auto !important;
    }
    
    .podium-place.first {
        order: 1;
    }
    
    .podium-place.second {
        order: 2;
    }
    
    .podium-place.third {
        order: 3;
    }
}
/* Estilos para la pantalla de monitoreo del host */
.monitoring-header {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    border-left: 5px solid #ffd700;
}

.monitoring-header h2 {
    margin-bottom: 20px;
    color: #ffd700;
    text-align: center;
}

.game-info-monitoring {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.game-status {
    color: #00ff00;
    font-weight: bold;
}

.game-status.finished {
    color: #ffd700;
}

.game-status.waiting {
    color: #00d4ff;
}

.monitoring-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.current-question-info {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 10px;
}

.current-question-info h3 {
    margin-bottom: 15px;
    color: #00d4ff;
}

.question-display {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
}

.question-number {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffd700;
    text-align: center;
}

.question-text-monitoring {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 15px;
    text-align: center;
    color: #ffffff;
}

.question-answers-monitoring {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.answer-preview {
    padding: 8px 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    font-size: 0.9rem;
    border-left: 3px solid #666;
}

.answer-preview.correct {
    border-left-color: #00ff00;
    background: rgba(0,255,0,0.1);
}

.players-monitoring {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 10px;
}

.players-monitoring h3 {
    margin-bottom: 15px;
    color: #00d4ff;
}

.players-grid {
    display: grid;
    gap: 10px;
}

.player-monitoring-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
    border-left: 4px solid #666;
}

.player-monitoring-item.playing {
    border-left-color: #00ff00;
}

.player-monitoring-item.finished {
    border-left-color: #ffd700;
}

.player-monitoring-item.disconnected {
    border-left-color: #ff4444;
    opacity: 0.7;
}

.player-info-monitoring {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-name-monitoring {
    font-weight: bold;
    font-size: 1rem;
}

.player-status-monitoring {
    font-size: 0.8rem;
    color: #cccccc;
}

.player-stats-monitoring {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.player-score-monitoring {
    font-weight: bold;
    color: #ffd700;
}

.player-progress-monitoring {
    font-size: 0.8rem;
    color: #cccccc;
}

.game-statistics {
    grid-column: 1 / -1;
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 10px;
}

.game-statistics h3 {
    margin-bottom: 15px;
    color: #00d4ff;
    text-align: center;
}

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

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

.stat-label {
    color: #cccccc;
}

.stat-value {
    font-weight: bold;
    color: #ffd700;
}

.monitoring-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.menu-btn.emergency {
    background: linear-gradient(45deg, #ff4444, #cc0000);
    color: white;
}

.menu-btn.emergency:hover {
    background: linear-gradient(45deg, #cc0000, #990000);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 68, 68, 0.3);
}

.monitoring-log {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 10px;
}

.monitoring-log h3 {
    margin-bottom: 15px;
    color: #00d4ff;
}

.log-container {
    background: rgba(0,0,0,0.3);
    padding: 15px;
    border-radius: 6px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
}

.log-entry {
    display: flex;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.log-time {
    color: #666;
    min-width: 60px;
}

.log-message {
    color: #ffffff;
}

.log-entry.info .log-message {
    color: #00d4ff;
}

.log-entry.success .log-message {
    color: #00ff00;
}

.log-entry.warning .log-message {
    color: #ffd700;
}

.log-entry.error .log-message {
    color: #ff4444;
}

/* Responsive para monitoreo */
@media (max-width: 1024px) {
    .monitoring-content {
        grid-template-columns: 1fr;
    }
    
    .game-info-monitoring {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .monitoring-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .menu-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .question-answers-monitoring {
        grid-template-columns: 1fr;
    }
}