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

:root {
    --bg-primary: #0d1329;
    --bg-secondary: #1a2140;
    --bg-card: #252b4a;
    --accent-pink: #ff3b6f;
    --accent-pink-dark: #cc2f59;
    --accent-blue: #4a6cf7;
    --accent-orange: #ff922b;
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --text-placeholder: #5a6380;
    --success: #4ade80;
    --error: #f87171;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(180deg, var(--bg-primary) 0%, #0a0f1f 100%);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

.app {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
}

.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    padding: 40px 24px;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
}

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

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
}

/* Back Button */
.btn-back {
    position: absolute;
    top: 40px;
    left: 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    z-index: 10;
}

/* Add Player Button */
.btn-add-player {
    background: transparent;
    border: 2px solid var(--accent-pink);
    color: var(--text-primary);
    padding: 16px 40px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin: 0 auto 30px;
    display: block;
    transition: all 0.3s ease;
}

.btn-add-player:hover {
    background: var(--accent-pink);
    transform: scale(1.02);
}

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

/* Players List */
.players-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.player-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease;
}

.player-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 20px;
}

.player-icon.filled {
    background: var(--accent-orange);
}

.player-icon.empty {
    background: var(--bg-secondary);
    border: 1px solid var(--text-secondary);
}

.player-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 18px;
    outline: none;
}

.player-input::placeholder {
    color: var(--text-placeholder);
}

.player-remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.player-remove:hover {
    color: var(--accent-pink);
}

/* Bottom Section */
.bottom-section {
    padding: 20px 0;
    margin-top: auto;
}

/* Question Count Selector */
.question-count-selector {
    text-align: center;
    margin-bottom: 20px;
}

.selector-label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 12px;
}

.selector-options {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.selector-btn {
    padding: 10px 18px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.selector-btn:hover {
    border-color: var(--accent-pink);
}

.selector-btn.active {
    border-color: var(--accent-pink);
    color: var(--text-primary);
    background: var(--bg-secondary);
}

/* Play Button */
.btn-play {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
    border: none;
    color: white;
    padding: 18px;
    border-radius: 30px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 59, 111, 0.3);
}

.btn-play:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 59, 111, 0.4);
}

.btn-play:active {
    transform: translateY(0);
}

.play-icon {
    font-size: 20px;
}

/* Secondary Button */
.btn-secondary {
    width: 100%;
    background: transparent;
    border: 2px solid var(--accent-pink);
    color: var(--text-primary);
    padding: 16px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.3s;
}

.btn-secondary:hover {
    background: rgba(255, 59, 111, 0.1);
}

/* Question Screen */
.question-progress {
    text-align: center;
    margin-bottom: 20px;
}

#question-counter {
    color: var(--text-secondary);
    font-size: 14px;
}

.question-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    padding: 30px 24px;
    border-radius: 24px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.question-prefix {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 12px;
}

.question-text {
    font-size: 22px;
    font-weight: 600;
    color: var(--accent-orange);
    line-height: 1.4;
}

.voter-indicator {
    text-align: center;
    margin-bottom: 20px;
    font-size: 16px;
    color: var(--text-secondary);
}

.voter-name {
    color: var(--accent-pink);
    font-weight: 600;
    margin-left: 8px;
}

/* Vote Options */
.vote-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
}

.vote-btn {
    padding: 16px 20px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.vote-btn:hover {
    border-color: var(--accent-pink);
    background: var(--bg-secondary);
}

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

.vote-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Results Screen */
.result-question {
    text-align: center;
    margin-bottom: 20px;
}

.question-prefix-small {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
}

.result-question-text {
    font-size: 18px;
    color: var(--accent-orange);
}

.winner-card {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
    padding: 30px;
    border-radius: 24px;
    text-align: center;
    margin-bottom: 24px;
}

.winner-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.winner-name {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.winner-votes {
    font-size: 16px;
    opacity: 0.9;
}

.winner-card.tie {
    background: linear-gradient(135deg, var(--accent-blue) 0%, #3a5bd9 100%);
}

/* Vote Breakdown */
.vote-breakdown {
    flex: 1;
    overflow-y: auto;
}

.vote-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-card);
    border-radius: 12px;
    margin-bottom: 8px;
}

.breakdown-name {
    font-size: 16px;
}

.breakdown-votes {
    color: var(--accent-pink);
    font-weight: 600;
}

/* Final Results */
.final-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 20px;
}

.final-results {
    flex: 1;
    overflow-y: auto;
}

.result-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--bg-card);
    border-radius: 16px;
    margin-bottom: 12px;
}

.result-position {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 16px;
    flex-shrink: 0;
}

.result-position.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 100%);
    color: #1a1a1a;
}

.result-position.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: #1a1a1a;
}

.result-position.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #a05a20 100%);
    color: #1a1a1a;
}

.result-position.other {
    background: var(--bg-secondary);
    color: var(--text-secondary);
}

.result-name {
    flex: 1;
    font-size: 18px;
}

.result-score {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-pink);
}

/* Onboarding Screen */
.onboarding-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    align-items: center;
    padding-top: 40px;
}

.onboarding-slides {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.onboarding-slide {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    animation: fadeIn 0.4s ease;
}

.onboarding-slide.active {
    display: flex;
}

.slide-icon {
    font-size: 80px;
    margin-bottom: 30px;
}

.slide-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.slide-text {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 300px;
}

.onboarding-dots {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active {
    background: var(--accent-orange);
    width: 30px;
    border-radius: 5px;
}

.onboarding-buttons {
    display: flex;
    gap: 16px;
    width: 100%;
    max-width: 320px;
}

.btn-skip {
    flex: 1;
    background: transparent;
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 16px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-skip:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.btn-next-slide {
    flex: 1.5;
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-pink-dark) 100%);
    border: none;
    color: white;
    padding: 16px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 59, 111, 0.3);
}

.btn-next-slide:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 59, 111, 0.4);
}

/* Responsive */
@media (max-height: 700px) {
    .screen {
        padding: 20px;
    }

    .title {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .question-card {
        padding: 20px;
    }

    .question-text {
        font-size: 18px;
    }

    .winner-card {
        padding: 20px;
    }

    .winner-icon {
        font-size: 36px;
    }

    .winner-name {
        font-size: 22px;
    }
}
