/* Player Styles - Uses shared.css variables */
@import url('/shared.css');

body {
    background: linear-gradient(135deg, var(--primary-color) 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.screen {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
}

/* Join Screen */
.join-container {
    background: white;
    padding: 3rem;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large);
    text-align: center;
}

.join-container h1 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.subtitle {
    color: var(--text-light);
    margin-bottom: 2rem;
}

#join-form input {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    text-align: center;
}

#session-code {
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.2em;
}

#join-form button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

#join-form button:hover {
    background: var(--primary-hover);
}

/* Waiting Screen */
.waiting-container {
    text-align: center;
}

.session-info {
    background: rgba(255,255,255,0.2);
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
}

.code {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 0.2em;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

/* Question Screen */
.question-container {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large);
    color: var(--text-color);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.timer {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    flex-shrink: 0;
}

.timer.warning {
    background: var(--warning-color);
    animation: pulse 0.5s infinite;
}

.timer.danger {
    background: var(--danger-color);
}

.question-number {
    color: var(--text-light);
    font-size: 1.2rem;
}

.question-text {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.answers {
    display: grid;
    gap: 1rem;
}

.answer {
    padding: 1.2rem;
    background: var(--bg-light);
    border: 3px solid transparent;
    border-radius: 15px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
    word-wrap: break-word;
}

.answer:hover {
    background: #e8e8e8;
    transform: translateY(-2px);
}

.answer.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-hover);
}

.answer.correct {
    background: var(--success-color);
    color: white;
    border-color: #27ae60;
}

.answer.incorrect {
    background: var(--danger-color);
    color: white;
    border-color: #c0392b;
}

.answer.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* Result Screen */
.result-container {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large);
    color: var(--text-color);
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.stat {
    text-align: center;
    max-width: 100%;
    overflow: hidden;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    max-width: 100%;
    display: block;
}

.stat-label {
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Leaderboard Screen */
.leaderboard-container {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-large);
    color: var(--text-color);
}

.leaderboard-container h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.leaderboard {
    margin-bottom: 2rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.leaderboard-rank {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.leaderboard-rank.gold { background: var(--warning-color); }
.leaderboard-rank.silver { background: var(--gray-color); }
.leaderboard-rank.bronze { background: #cd7f32; }

.leaderboard-name {
    flex: 1;
    font-size: 1.1rem;
    font-weight: bold;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.leaderboard-score {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--primary-color);
    flex-shrink: 0;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .screen {
        padding: 0.75rem;
    }
    
    .join-container,
    .question-container,
    .result-container,
    .leaderboard-container {
        padding: 1.5rem;
    }
    
    .question-text {
        font-size: 1.2rem;
    }
    
    .answer {
        padding: 0.9rem;
        font-size: 1rem;
    }
    
    .timer {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .result-icon {
        font-size: 3rem;
    }
    
    .stat-value {
        font-size: 1.2rem !important;
        max-width: 90vw;
        padding: 0 0.5rem;
    }
    
    .result-stats {
        flex-direction: column;
        gap: 0.5rem;
        max-width: 100%;
    }
    
    .stat {
        max-width: 100%;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 0.5rem;
    }
    
    .join-container,
    .question-container,
    .result-container,
    .leaderboard-container {
        padding: 1rem;
        border-radius: var(--border-radius);
    }
    
    .join-container h1 {
        font-size: 1.3rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .answer {
        font-size: 0.9rem;
        padding: 0.75rem;
        border-radius: var(--border-radius);
    }
    
    .stat-value {
        font-size: 1rem !important;
        max-width: 85vw;
        padding: 0 0.25rem;
        line-height: 1.2;
    }
    
    .code {
        font-size: 1.3rem;
    }
    
    .result-container {
        max-width: 100vw;
        overflow: hidden;
    }
    
    .result-container h2 {
        font-size: 1.2rem;
    }
    
    #result-message {
        font-size: 0.9rem;
    }
    
    .leaderboard-name {
        font-size: 0.9rem;
    }
    
    .leaderboard-score {
        font-size: 1rem;
    }
    
    .leaderboard-rank {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}
