/* Variables */
:root {
    --primary-color: #FF6B00;
    --primary-dark: #E55A00;
    --primary-light: #FF8833;
    --background: #FAFAFA;
    --white: #FFFFFF;
    --text-dark: #2D3748;
    --text-gray: #718096;
    --border-color: #E2E8F0;
    --success-color: #48BB78;
    --error-color: #E53E3E;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset et Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Screens */
.screen {
    display: none;
    min-height: 100vh;
    padding: 40px 0;
    animation: fadeIn 0.3s ease-out;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Animation d'apparition */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page d'accueil */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.bitcoin-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    background: radial-gradient(circle, var(--primary-light), var(--primary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(255, 107, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 40px rgba(255, 107, 0, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 60px rgba(255, 107, 0, 0.5);
    }
}

.btc-symbol {
    font-size: 60px;
    font-weight: 700;
    color: var(--white);
}

.main-title {
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.subtitle {
    font-size: 24px;
    font-weight: 400;
    text-align: center;
    color: var(--text-gray);
    margin-bottom: 40px;
}

/* Login Card */
.login-card {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    margin: 0 auto;
}

.player-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: var(--white);
    font-size: 36px;
    font-weight: 700;
}

.avatar-placeholder {
    animation: rotate 2s linear infinite;
}

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

#login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

#nickname {
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--background);
}

#nickname:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--white);
}

/* Boutons */
.btn-primary, .btn-secondary {
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 0, 0.3);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.player-count {
    text-align: center;
    color: var(--text-gray);
    margin-top: 20px;
    font-size: 14px;
}

/* Écran d'attente */
.waiting-content {
    text-align: center;
    background: var(--white);
    border-radius: 12px;
    padding: 60px;
    box-shadow: var(--shadow-lg);
}

.player-avatar-large {
    width: 120px;
    height: 120px;
    margin: 30px auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
}

.waiting-text {
    font-size: 18px;
    color: var(--text-gray);
    margin: 20px 0;
}

/* Loader */
.loader {
    width: 50px;
    height: 50px;
    margin: 30px auto;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Écran de question */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.question-progress {
    flex: 1;
}

.question-number {
    font-size: 14px;
    color: var(--text-gray);
    display: block;
    margin-bottom: 10px;
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

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

.timer-circle {
    position: relative;
    width: 60px;
    height: 60px;
}

.timer-circle svg {
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--border-color);
    stroke-width: 4;
}

.timer-fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 4;
    stroke-dasharray: 176;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}

.timer-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Question Card */
.question-card {
    background: var(--white);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.question-text {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 40px;
    text-align: center;
    line-height: 1.4;
}

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

.option-button {
    padding: 20px;
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
}

.option-letter {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.option-text {
    flex: 1;
    color: var(--text-dark);
}

.option-button:hover {
    background: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.option-button.selected {
    background: var(--primary-light);
    border-color: var(--primary-color);
    color: var(--white);
}

.option-button.selected .option-text {
    color: var(--white);
}

.option-button.correct {
    background: var(--success-color);
    border-color: var(--success-color);
    color: var(--white);
}

.option-button.incorrect {
    background: var(--error-color);
    border-color: var(--error-color);
    color: var(--white);
}

/* Score Display */
.score-display {
    text-align: center;
    background: var(--white);
    border-radius: 8px;
    padding: 15px 30px;
    display: inline-block;
    margin: 0 auto;
    box-shadow: var(--shadow);
}

.score-label {
    font-size: 14px;
    color: var(--text-gray);
    margin-right: 10px;
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

/* Écran de résultat */
.result-content {
    text-align: center;
    background: var(--white);
    border-radius: 12px;
    padding: 60px;
    box-shadow: var(--shadow-lg);
}

.result-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
}

.result-icon.correct {
    background: var(--success-color);
    color: var(--white);
}

.result-icon.incorrect {
    background: var(--error-color);
    color: var(--white);
}

.result-text {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
}

.points-earned {
    font-size: 24px;
    color: var(--text-gray);
}

.points-earned.positive {
    color: var(--success-color);
}

/* Classement */
.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.leaderboard-title {
    font-size: 36px;
    text-align: center;
    margin: 0;
    flex: 1;
}

.leaderboard-timer {
    margin-left: 20px;
    flex-shrink: 0;
}

.leaderboard-list {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    background: var(--background);
}

.leaderboard-item.top-3 {
    background: linear-gradient(135deg, rgba(255, 107, 0, 0.1), rgba(255, 107, 0, 0.05));
}

.rank-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-gray);
    min-width: 50px;
}

.rank-number.gold {
    color: #FFD700;
    font-size: 24px;
}

.rank-number.silver {
    color: #C0C0C0;
    font-size: 22px;
}

.rank-number.bronze {
    color: #CD7F32;
    font-size: 22px;
}

.rank-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 15px;
}

.rank-name {
    flex: 1;
    font-weight: 600;
}

.rank-score {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.rank-separator {
    height: 2px;
    background: var(--border-color);
    margin: 20px 0;
}

.player-rank {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 20px auto 0;
}

.player-rank-item {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 107, 0, 0.1);
    border-radius: 8px;
}

/* Écran final */
.final-content {
    text-align: center;
    background: var(--white);
    border-radius: 12px;
    padding: 60px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.final-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.final-subtitle {
    font-size: 20px;
    color: var(--text-gray);
    margin-bottom: 40px;
}

.final-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Animation Bitcoin Rain */
.bitcoin-rain {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
}

.btc-rain {
    position: absolute;
    font-size: 30px;
    color: var(--primary-color);
    animation: fall linear infinite;
    opacity: 0.3;
}

.btc-rain:nth-child(1) { left: 10%; animation-duration: 3s; animation-delay: 0s; }
.btc-rain:nth-child(2) { left: 30%; animation-duration: 4s; animation-delay: 1s; }
.btc-rain:nth-child(3) { left: 50%; animation-duration: 3.5s; animation-delay: 0.5s; }
.btc-rain:nth-child(4) { left: 70%; animation-duration: 4.5s; animation-delay: 2s; }
.btc-rain:nth-child(5) { left: 90%; animation-duration: 3.2s; animation-delay: 1.5s; }

@keyframes fall {
    from {
        transform: translateY(-100px) rotate(0deg);
    }
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

.final-score, .final-rank {
    position: relative;
    z-index: 1;
    background: var(--background);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    display: inline-block;
}

.final-score-label, .final-rank-label {
    display: block;
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.final-score-value {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
}

.final-rank-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
}

/* Message d'erreur */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--error-color);
    color: var(--white);
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease-out;
}

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

/* Responsive */
@media (max-width: 768px) {
    .main-title {
        font-size: 36px;
    }
    
    .subtitle {
        font-size: 18px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .question-text {
        font-size: 20px;
    }
    
    .final-title {
        font-size: 36px;
    }
    
    .leaderboard-header {
        flex-direction: column;
        gap: 20px;
    }
    
    .leaderboard-timer {
        margin-left: 0;
    }
}