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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
}

#app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.screen {
    display: none;
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* Setup Screen */
#setup-screen h1 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.players-section {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.players-section h2 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}


.player-input {
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 16px;
}

.settings-section {
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

select {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.9);
    color: #333;
    font-size: 16px;
}

.toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.toggle input {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-skip, .btn-reveal, .btn-add-player {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: white;
    color: #667eea;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background: rgba(255,255,255,0.2);
    color: white;
    margin-top: 10px;
}

.btn-skip {
    background: rgba(255,0,0,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    font-size: 1rem;
    padding: 12px;
}

.btn-skip:active {
    transform: scale(0.98);
    background: rgba(255,0,0,0.3);
}

.btn-reveal {
    background: rgba(0,255,0,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    font-size: 1rem;
    padding: 12px;
}

.btn-reveal:active {
    transform: scale(0.98);
    background: rgba(0,255,0,0.3);
}

.game-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.btn-add-player {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 2px dashed rgba(255,255,255,0.4);
    font-size: 1rem;
    padding: 12px;
    margin-top: 15px;
    text-transform: none;
}

.btn-add-player:active {
    transform: scale(0.98);
    background: rgba(255,255,255,0.2);
}

.btn-add-player:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#players-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Loading Screen */
#loading-screen {
    text-align: center;
}

.loader {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Game Screen */
.game-header {
    text-align: center;
    margin-bottom: 20px;
}

.question-counter {
    font-size: 1.2rem;
    opacity: 0.9;
}

.question-section {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question {
    font-size: 1.8rem;
    line-height: 1.5;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 500;
}

.countdown {
    font-size: 5rem;
    font-weight: bold;
    text-align: center;
    margin: 20px 0;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.3);
    animation: pulse 1s ease infinite;
}

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

.answer {
    font-size: 2.5rem;
    text-align: center;
    font-weight: bold;
    min-height: 60px;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
}

.answer.revealing {
    opacity: 1;
    visibility: visible;
}

.answer .letter {
    display: inline-block;
    animation: letterAppear 0.3s ease;
}

@keyframes letterAppear {
    from {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 20px 0;
}

.score-item {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
}

.score-item .name {
    font-size: 0.9rem;
    opacity: 0.9;
}

.score-item .score {
    font-size: 1.5rem;
    font-weight: bold;
}

.hidden {
    display: none !important;
}

/* Results Screen */
#results-screen h1 {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.final-scores {
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.final-score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    font-size: 1.3rem;
}

.winner {
    background: linear-gradient(135deg, gold, orange);
    color: #333;
    font-weight: bold;
}

/* Mobile optimizations */
@media (max-width: 480px) {
    #setup-screen h1 {
        font-size: 2.5rem;
    }

    .question {
        font-size: 1.5rem;
    }

    .answer {
        font-size: 2rem;
    }

    .countdown {
        font-size: 4rem;
    }

    #players-list {
        grid-template-columns: 1fr;
    }
}