/**
 * Live Quiz Player Styles
 * Mobile-first responsive design
 * 
 * @package LiveQuiz
 */

/* Wrapper */
.live-quiz-player-wrapper {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
    position: relative;
}

.live-quiz-player-wrapper .player-header {
    text-align: center;
    margin-bottom: 30px;
}

.live-quiz-player-wrapper .player-header h1 {
    color: white;
    font-size: 36px;
    font-weight: 700;
    margin: 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Players Waiting Section */
.players-waiting-section {
    margin: 30px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
}

.players-waiting-title {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    text-align: center;
}

.players-waiting-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.player-waiting-item {
    background: white;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.player-waiting-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.player-waiting-item.current-user {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    border: 2px solid #667eea;
}

.player-waiting-item.current-user .player-waiting-avatar {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.player-waiting-item.current-user .player-waiting-name {
    color: white;
}

.player-waiting-item.current-user .player-waiting-name .name-text {
    color: white;
    font-weight: 600;
}

.player-waiting-item.current-user .player-waiting-name .username-text {
    color: rgba(255, 255, 255, 0.9);
}

.player-waiting-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    margin: 0 auto 8px;
}

.player-waiting-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}

.player-waiting-name .name-text {
    font-weight: 500;
}

.player-waiting-name .username-text {
    font-size: 11px;
    color: #666;
    font-weight: 400;
}

.players-waiting-list .no-players {
    grid-column: 1 / -1;
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Clickable players (for host) */
.player-waiting-item.clickable {
    cursor: pointer;
    position: relative;
}

.player-waiting-item.clickable:hover {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.player-waiting-item.clickable.current-user:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.95;
}

.player-waiting-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 18px;
    color: #999;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s;
}

.player-waiting-item.clickable:hover .player-waiting-indicator {
    opacity: 1;
}

.player-waiting-item.current-user .player-waiting-indicator {
    color: white;
}

/* Reset & Base */
.live-quiz-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

.live-quiz-container * {
    box-sizing: border-box;
}

/* Screens */
.quiz-screen {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.quiz-screen.active {
    display: block;
}

/* Mobile responsive for players list */
@media (max-width: 480px) {
    .players-waiting-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .player-waiting-avatar {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .player-waiting-name {
        font-size: 12px;
    }
}

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

/* Card */
.quiz-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .quiz-card {
        padding: 20px;
        border-radius: 12px;
    }
}

.text-center {
    text-align: center;
}

/* User Welcome */
.user-welcome {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
}

.user-welcome .welcome-text {
    font-size: 18px;
    color: #333;
    margin: 0;
}

.user-welcome strong {
    color: #667eea;
}

.live-quiz-login-required {
    background: white;
    border-radius: 16px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    margin: 50px auto;
}

.live-quiz-login-required p {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
}

.live-quiz-login-required a {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.live-quiz-login-required a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Form */
.quiz-form {
    max-width: 400px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-block;
}

.btn-primary {
    background: #3498db;
    color: #ffffff;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-large {
    width: 100%;
    padding: 16px;
    font-size: 18px;
}

/* Error Message */
.error-message {
    background: #e74c3c;
    color: #ffffff;
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
}

/* Spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Waiting Screen */
.waiting-info {
    font-size: 18px;
    margin: 20px 0;
    line-height: 1.6;
}

.room-code {
    display: inline-block;
    background: #f8f9fa;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 3px;
    color: #3498db;
    font-family: 'Courier New', monospace;
}

.room-code.clickable-room-code {
    cursor: pointer;
    user-select: none;
    transition: opacity 0.2s ease;
}

.room-code.clickable-room-code:hover {
    opacity: 0.8;
}

.room-code.room-code-hidden {
    letter-spacing: 3px;
}

.participant-count {
    color: #7f8c8d;
    font-size: 16px;
}

/* Quiz Header */
.quiz-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px 16px 0 0;
    padding: 20px;
    color: #ffffff;
    margin: -30px -30px 20px -30px;
    position: relative;
}

@media (max-width: 768px) {
    .quiz-header {
        margin: -20px -20px 15px -20px;
        padding: 15px;
    }
}

/* Leave room icon button in header */
.leave-room-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leave-room-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.leave-room-floating {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 150;
    display: none;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    padding: 10px 16px;
    border-radius: 999px;
    font-weight: 600;
    backdrop-filter: blur(8px);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.leave-room-floating.is-visible {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.leave-room-floating:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-1px);
}

@media (max-width: 768px) {
    .leave-room-floating {
        top: 6px;
        left: 6px;
        font-size: 12px;
        padding: 8px 14px;
    }
}

.question-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-number {
    font-size: 18px;
    font-weight: 600;
}

.question-score {
    font-size: 16px;
}

/* Timer */
.timer-container {
    position: relative;
}

.timer-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.timer-fill {
    height: 100%;
    background: #2ecc71;
    transition: width 0.1s linear, background-color 0.3s;
    border-radius: 4px;
}

.timer-text {
    position: absolute;
    top: -30px;
    right: 0;
    font-size: 18px;
    font-weight: 700;
    color: #2ecc71;
}

.answer-count-display {
    text-align: center;
    margin-top: 12px;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.answer-count-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

.answer-count-text {
    color: white;
    font-size: 15px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

/* Answered Players Section */
.answered-players-section {
    margin-top: 35px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(248, 249, 250, 0.95) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(225, 232, 237, 0.6);
}

.answered-players-section h4 {
    font-size: 20px;
    margin-bottom: 20px;
    color: #2c3e50;
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
    position: relative;
    padding-bottom: 12px;
}

.answered-players-section h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.answered-players-section .answer-count-display {
    text-align: center;
    margin: 15px 0 20px 0;
    padding: 10px 18px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(102, 126, 234, 0.4);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.answered-players-section .answer-count-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

.answered-players-section .answer-count-text {
    color: white;
    font-size: 15px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

.answered-players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 18px;
    min-height: 60px;
    padding: 5px;
}

@media (max-width: 768px) {
    .answered-players-list {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 12px;
    }
}

.answered-player-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    animation: answerPulse 0.5s ease-out;
    border: 2px solid transparent;
}

.answered-player-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
    border-color: rgba(40, 167, 69, 0.3);
}

@keyframes answerPulse {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }
    50% {
        transform: scale(1.08);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.answered-player-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 22px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.35);
    transition: all 0.3s ease;
    position: relative;
}

.answered-player-item:hover .answered-player-avatar {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.45);
}

.answered-player-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.answered-player-item:hover .answered-player-avatar::after {
    opacity: 0.3;
    filter: blur(8px);
}

.answered-player-name {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
    text-align: center;
    word-break: break-word;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.3;
}

.answered-player-name .name-text {
    font-weight: 600;
    color: #2c3e50;
}

.answered-player-name .username-text {
    font-size: 11px;
    color: #7f8c8d;
}

/* Highlight correct answers */
.answered-player-item.correct-answer {
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.15) 0%, rgba(32, 201, 151, 0.15) 100%);
    border: 2px solid #28a745;
    box-shadow: 0 4px 16px rgba(40, 167, 69, 0.4);
    transform: scale(1.05);
    opacity: 1;
}

.answered-player-item.correct-answer .answered-player-avatar {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
    transform: scale(1.1);
}

.answered-player-item.correct-answer .answered-player-name {
    color: #155724;
    font-weight: 700;
}

.answered-player-item.correct-answer .answered-player-name .name-text {
    color: #155724;
    font-weight: 700;
}

/* Dim incorrect answers */
.answered-player-item.incorrect-answer {
    opacity: 0.35;
    filter: grayscale(0.7);
    background: rgba(231, 76, 60, 0.05);
    border: 2px solid rgba(231, 76, 60, 0.2);
}

.answered-player-item.incorrect-answer .answered-player-avatar {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.answered-player-item.incorrect-answer .answered-player-name {
    color: #7f8c8d;
}

.answered-player-item.incorrect-answer .answered-player-name .name-text {
    color: #7f8c8d;
}
    font-weight: 400;
    opacity: 0.8;
}

/* Question */
.question-text {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #2c3e50;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .question-text {
        font-size: 20px;
        margin-bottom: 20px;
    }
}

/* Choices */
/* Shared choices container styles (same for both host and player) */
.choices-container,
.choices-preview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 30px 0;
}

.choice-button {
    background: #f8f9fa;
    border: 3px solid #e1e8ed;
    border-radius: 12px;
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.choice-button:hover:not(:disabled) {
    background: #e8f4f8;
    color: #2c3e50;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.choice-button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.choice-button.selected {
    background: #3498db;
    color: #ffffff;
    border-color: #2980b9;
}

.choice-button.correct {
    background: #2ecc71;
    color: #ffffff;
    border-color: #27ae60;
}

.choice-button.incorrect {
    background: #e74c3c;
    color: #ffffff;
    border-color: #c0392b;
}

.choice-button.correct-answer {
    background: #d5f4e6;
    color: #27ae60;
    border-color: #2ecc71;
    border-width: 4px;
    font-weight: 700;
}

/* Results */
.result-feedback {
    text-align: center;
    margin-bottom: 30px;
}

.feedback-icon {
    font-size: 64px;
    margin-bottom: 15px;
    display: block;
}

.feedback-icon.correct {
    color: #2ecc71;
}

.feedback-icon.incorrect {
    color: #e74c3c;
}

.feedback-text {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
}

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

/* Leaderboard */
.leaderboard-container {
    margin: 30px 0;
}

.leaderboard-container h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.leaderboard {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: transform 0.2s;
}

.leaderboard-item:hover {
    transform: translateX(5px);
}

.leaderboard-item.current-user {
    background: #e8f4f8;
    border: 2px solid #3498db;
}

.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    background: #95a5a6;
    color: #ffffff;
    margin-right: 15px;
    flex-shrink: 0;
}

.rank-badge.gold {
    background: linear-gradient(135deg, #f39c12, #f1c40f);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #95a5a6, #bdc3c7);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #d35400, #e67e22);
}

.player-name {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-name .name-text {
    font-weight: 600;
}

.player-name .username-text {
    font-size: 13px;
    color: #666;
    font-weight: 400;
}

.player-score {
    font-weight: 700;
    font-size: 18px;
    color: #3498db;
}

/* Your Rank */
.your-rank {
    background: #e8f4f8;
    border: 2px solid #3498db;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.your-rank p {
    margin: 8px 0;
    font-size: 18px;
}

.your-rank strong {
    color: #3498db;
    font-size: 24px;
}

/* Final Results */
.final-stats {
    text-align: center;
    margin-bottom: 30px;
}

.your-final-rank {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 30px 0;
}

@media (max-width: 768px) {
    .your-final-rank {
        gap: 20px;
    }
}

.rank-display,
.score-display {
    text-align: center;
}

.rank-number,
.score-number {
    display: block;
    font-size: 48px;
    font-weight: 700;
    color: #3498db;
    line-height: 1;
}

.rank-label,
.score-label {
    display: block;
    font-size: 16px;
    color: #7f8c8d;
    margin-top: 8px;
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(100%);
    }
    to {
        transform: translateX(-50%) translateY(0);
    }
}

.connection-status.warning {
    background: #f39c12;
}

.connection-status.error {
    background: #e74c3c;
}

.status-icon::before {
    content: '●';
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Ping Indicator */
.live-quiz-player-wrapper .ping-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    z-index: 100;
}

.live-quiz-player-wrapper .ping-indicator .ping-value {
    font-weight: 600;
}

@media (max-width: 768px) {
    .live-quiz-player-wrapper .ping-indicator {
        top: 8px;
        right: 8px;
        font-size: 12px;
    }
}

/* Responsive Typography */
@media (max-width: 768px) {
    .live-quiz-container {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    .rank-number,
    .score-number {
        font-size: 36px;
    }
    
    .choice-button {
        font-size: 16px;
        padding: 18px;
        min-height: 70px;
    }
}

/* Accessibility */
.choice-button:focus,
.btn:focus,
input:focus {
    outline: 3px solid #3498db;
    outline-offset: 2px;
}

/* Error Box */
.error-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    margin: 0 auto;
}

.error-box.kicked {
    border: 3px solid #dc3545;
}

.error-box h3 {
    color: #dc3545;
    font-size: 24px;
    margin: 0 0 15px 0;
}

.error-box p {
    color: #333;
    font-size: 16px;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

/* Countdown Screen */
.countdown-title {
    font-size: 32px;
    color: #333;
    margin-bottom: 30px;
    font-weight: 600;
}

.countdown-number {
    font-size: 120px;
    font-weight: 700;
    color: #667eea;
    animation: countdown-pulse 1s ease-in-out;
}

.total-questions-display {
    font-size: 24px;
    color: #666;
    margin-top: 30px;
    font-weight: 500;
}

@keyframes countdown-pulse {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Final Question Announcement */
.final-announcement-title {
    font-size: 36px;
    color: #f39c12;
    margin-bottom: 20px;
    font-weight: 700;
    animation: announcement-shake 0.5s ease-in-out;
}

.final-announcement-text {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

.final-announcement-points {
    font-size: 80px;
    font-weight: 700;
    color: #e74c3c;
    animation: points-bounce 0.8s ease-in-out infinite;
}

@keyframes announcement-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

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

/* Top 3 Podium */
.top3-title {
    font-size: 36px;
    color: #f39c12;
    margin-bottom: 40px;
    font-weight: 700;
}

.top3-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 40px 0;
    min-height: 350px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: podium-rise 0.8s ease-out;
}

.podium-place.first {
    order: 2;
    animation-delay: 0.2s;
}

.podium-place.second {
    order: 1;
    animation-delay: 0.4s;
}

.podium-place.third {
    order: 3;
    animation-delay: 0.6s;
}

@keyframes podium-rise {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.podium-medal {
    font-size: 60px;
    margin-bottom: 10px;
}

.podium-name {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.podium-score {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 10px;
}

.podium-stand {
    width: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.podium-place.first .podium-stand {
    height: 200px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.podium-place.second .podium-stand {
    height: 150px;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.podium-place.third .podium-stand {
    height: 120px;
    background: linear-gradient(135deg, #cd7f32 0%, #b87333 100%);
}

/* Top 10 Container for Player */
.top10-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.top10-title {
    font-size: 42px;
    color: #f39c12;
    margin-bottom: 30px;
    font-weight: 700;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Top 3 Podium for Player */
.top3-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 40px auto;
    min-height: 300px;
    max-width: 600px;
}

/* Top 10 List for Player */
.top10-list {
    max-width: 800px;
    margin: 40px auto;
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.top10-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.top10-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.top10-item.current-user {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf7 100%);
    border: 2px solid #3498db;
    font-weight: 700;
}

.top10-rank {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    min-width: 50px;
    text-align: center;
}

.top10-name {
    flex: 1;
    font-size: 18px;
    color: #333;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.top10-score {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    min-width: 100px;
    text-align: right;
}

/* Highlight current user in podium */
.podium-place.current-user {
    animation: pulse 2s infinite;
}

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

.podium-place.current-user .podium-name {
    color: #3498db;
    font-weight: 700;
}

/* Leaderboard Overlay */
.leaderboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Hidden state */
.leaderboard-overlay-hidden {
    display: none !important;
}

.leaderboard-overlay .leaderboard-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.leaderboard-overlay .leaderboard-container h2 {
    text-align: center;
    margin: 0 0 30px 0;
    font-size: 32px;
    color: #333;
}

.animated-leaderboard {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.animated-leaderboard .leaderboard-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.animated-leaderboard .leaderboard-item.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    transform: scale(1.05);
}

.animated-leaderboard .leaderboard-item.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
}

.animated-leaderboard .leaderboard-item.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e5a76c 100%);
}

/* Highlight current user in leaderboard */
.animated-leaderboard .leaderboard-item.current-user {
    border: 3px solid #3498db;
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

.animated-leaderboard .rank {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 24px;
    margin-right: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

.animated-leaderboard .player-name {
    flex: 1;
    font-weight: 700;
    font-size: 20px;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.animated-leaderboard .player-name .name-text {
    font-weight: 700;
}

.animated-leaderboard .player-name .username-text {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

.animated-leaderboard .score-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.animated-leaderboard .current-score {
    font-weight: 900;
    font-size: 28px;
    color: #667eea;
}

.animated-leaderboard .score-gain {
    font-weight: 700;
    font-size: 20px;
    color: #28a745;
    animation: pulseScore 0.5s ease-in-out;
}

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

/* Responsive for mobile */
@media (max-width: 768px) {
    .leaderboard-overlay .leaderboard-container {
        padding: 20px;
        width: 95%;
    }
    
    .leaderboard-overlay .leaderboard-container h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .animated-leaderboard {
        gap: 10px;
    }
    
    .animated-leaderboard .leaderboard-item {
        padding: 15px;
    }
    
    .animated-leaderboard .rank {
        width: 40px;
        height: 40px;
        font-size: 20px;
        margin-right: 15px;
    }
    
    .animated-leaderboard .player-name {
        font-size: 16px;
    }
    
    .animated-leaderboard .player-name .username-text {
        font-size: 14px;
    }
    
    .animated-leaderboard .current-score {
        font-size: 22px;
    }
    
    .animated-leaderboard .score-gain {
        font-size: 18px;
    }
}

/* Print styles */
@media print {
    .quiz-header,
    .btn,
    .connection-status,
    .leaderboard-overlay {
        display: none;
    }
}

