/**
 * Stili Pubblici - Interfaccia Giocatore (Mobile-First)
 */

.quiz-player-container {
    max-width: 100%;
    margin: 0 auto;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header */
.quiz-player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
}

.player-info {
    flex: 1;
}

.player-name {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.player-label {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.player-score {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
}

.player-score .pts {
    font-size: 18px;
    color: #7f8c8d;
}

.timer-display {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 15px 25px;
    border-radius: 50%;
    font-size: 32px;
    font-weight: bold;
    min-width: 70px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.timer-display.warning {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    animation: pulse 1s infinite;
}

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

/* Schermata di Attesa */
.quiz-waiting-screen {
    background: white;
    padding: 40px 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
}

.waiting-content h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.session-code {
    font-size: 24px;
    margin: 20px 0;
}

.session-code strong {
    color: #764ba2;
    font-size: 32px;
}

/* Schermata di Gioco */
.quiz-game-screen {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
}

/* Domanda */
.question-section {
    margin-bottom: 25px;
}

.question-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    margin-bottom: 15px;
}

.question-category {
    margin-left: 10px;
    opacity: 0.9;
}

.question-text {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    line-height: 1.6;
    margin-bottom: 15px;
}

.question-image-container {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
}

.question-image-container img {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: cover;
}

/* Video Container */
.question-video-container {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Risposte */
.answers-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 25px 0;
}

.answer-btn {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: white;
    border: 3px solid #ecf0f1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    font-size: 16px;
    min-height: 60px;
}

.answer-btn:hover:not(:disabled) {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

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

.answer-btn.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.answer-btn.correct {
    background: #27ae60;
    color: white;
    border-color: #229954;
}

.answer-btn.incorrect {
    background: #ff9800;
    color: white;
    border-color: #f57c00;
}

.answer-label {
    display: inline-block;
    background: #667eea;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

.answer-btn.correct .answer-label,
.answer-btn.incorrect .answer-label {
    background: rgba(255,255,255,0.3);
}

.answer-text {
    flex: 1;
}

/* Classifica */
.leaderboard-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
}

.leaderboard-section h3 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 15px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin: 8px 0;
    border-left: 4px solid #667eea;
}

.leaderboard-item.self {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: bold;
    border-left-color: #f1c40f;
}

.leaderboard-position {
    font-size: 20px;
    margin-right: 10px;
}

.leaderboard-name {
    flex: 1;
}

.leaderboard-score {
    font-weight: bold;
    font-size: 18px;
}

/* Premi */
.prizes-section {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 10px;
}

.prizes-section h3 {
    color: #667eea;
    margin-top: 0;
    margin-bottom: 15px;
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.prize-card {
    padding: 15px;
    background: white;
    border-radius: 10px;
    text-align: center;
    border: 3px solid #ddd;
    transition: all 0.3s;
}

.prize-card.qualified {
    background: #e8f4fd;
    border-color: #f1c40f;
    border-width: 4px;
    box-shadow: 0 3px 15px rgba(241, 196, 15, 0.3);
}

.prize-threshold {
    font-size: 14px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.prize-name {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.prize-emoji {
    font-size: 32px;
    margin-bottom: 5px;
}

/* Fine Gioco */
.quiz-final-screen {
    background: white;
    padding: 40px 20px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
}

.final-content h2 {
    color: #667eea;
    margin-bottom: 30px;
    font-size: 36px;
}

.final-score-value {
    font-size: 48px;
    font-weight: bold;
    color: #764ba2;
    margin: 20px 0;
}

/* Messaggi */
.quiz-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 300px;
}

.quiz-message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    animation: slideIn 0.3s;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.quiz-message.success {
    background: #27ae60;
    color: white;
}

.quiz-message.error {
    background: #e74c3c;
    color: white;
}

.quiz-message.info {
    background: #3498db;
    color: white;
}

/* Responsive */
@media (min-width: 768px) {
    .quiz-player-container {
        max-width: 800px;
        padding: 20px;
    }
    
    .question-text {
        font-size: 24px;
    }
    
    .prizes-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .quiz-player-container {
        max-width: 900px;
    }
}

