* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.screen {
    display: none;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.screen.active {
    display: block;
}

h1 {
    color: #667eea;
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 40px;
    font-size: 1.1em;
}

/* Join Screen */
.join-form {
    max-width: 400px;
    margin: 0 auto;
}

.join-form h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.join-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.join-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Waiting Screen */
.waiting-message {
    text-align: center;
    padding: 40px;
}

.waiting-message h2 {
    color: #333;
    margin-bottom: 20px;
}

.waiting-message p {
    color: #666;
    font-size: 1.1em;
    margin: 10px 0;
}

.loader {
    margin: 40px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.game-header h1 {
    font-size: 1.8em;
    margin: 0;
}

.timer {
    font-size: 1.5em;
    font-weight: bold;
    color: #667eea;
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stat {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    color: white;
}

.stat-label {
    display: block;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 2em;
    font-weight: bold;
}

.team-info {
    text-align: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #333;
}

/* Question Card */
.question-card {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.question-subject {
    color: #667eea;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.question-text {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
}

.options {
    display: grid;
    gap: 12px;
    margin-bottom: 25px;
}

.option {
    padding: 15px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.1em;
}

.option:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* Path Selection */
.result-message {
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    text-align: center;
    font-size: 1.2em;
    font-weight: 600;
}

.result-message.correct {
    background: #d4edda;
    color: #155724;
}

.result-message.incorrect {
    background: #f8d7da;
    color: #721c24;
}

.paths-container {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.path-card {
    padding: 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.path-card:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.path-card.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

.path-card.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.path-card.roulette-highlight {
    border-color: #ffa500;
    background: #fff4e6;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 165, 0, 0.6);
    animation: pulse 0.15s ease-in-out;
}

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

.path-name {
    font-size: 1.2em;
    font-weight: 600;
    margin-bottom: 8px;
}

.path-description {
    margin-bottom: 12px;
    font-size: 0.95em;
}

.path-effects {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    font-weight: 600;
}

.effect {
    display: flex;
    align-items: center;
    gap: 5px;
}

.effect.positive {
    color: #28a745;
}

.effect.negative {
    color: #dc3545;
}

/* End Screen */
.final-stats {
    margin-bottom: 40px;
}

.final-stats h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

.total-score {
    text-align: center;
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
    margin-top: 20px;
}

.leaderboard {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 8px;
}

.leaderboard h2 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

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

.leaderboard-item.first {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    font-weight: bold;
}

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

.leaderboard-item.third {
    background: linear-gradient(135deg, #cd7f32 0%, #e9a063 100%);
}

.leaderboard-rank {
    font-size: 1.5em;
    font-weight: bold;
    margin-right: 15px;
}

.leaderboard-name {
    flex: 1;
    font-size: 1.1em;
}

.leaderboard-score {
    font-size: 1.2em;
    font-weight: bold;
    color: #667eea;
}

@media (max-width: 768px) {
    .stats-panel {
        grid-template-columns: 1fr;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .game-header {
        flex-direction: column;
        text-align: center;
    }
}

