* {
    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;
    --settings-accent: var(--accent-pink);
    --settings-accent-dark: var(--accent-pink-dark);
}

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;
    min-height: var(--app-height, 100dvh);
    color: var(--text-primary);
    overflow-x: hidden;
}

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

.screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    min-height: var(--app-height, 100dvh);
    padding: 40px 24px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: flex;
}

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

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

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

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

/* 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);
}

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

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

.btn-play:disabled {
    background: var(--bg-card);
    box-shadow: none;
    cursor: not-allowed;
}

.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-top: 12px;
    transition: all 0.3s;
}

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


/* Players Screen */
.subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: -20px;
    margin-bottom: 20px;
    line-height: 1.5;
}

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

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

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

.card-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.statement-card {
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-orange) 100%);
    border-radius: 24px;
    padding: 40px 30px;
    width: 100%;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 8px 40px rgba(255, 59, 111, 0.4);
    transition: all 0.3s ease;
    user-select: none;
}

.card-header {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.card-text {
    font-size: 26px;
    font-weight: 700;
    color: white;
    line-height: 1.4;
}

.card-instruction {
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
    margin-top: 24px;
    line-height: 1.5;
    max-width: 320px;
}

/* Card flip animation */
@keyframes cardFlip {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.95); opacity: 0.5; }
    100% { transform: scale(1); opacity: 1; }
}

.statement-card.flip {
    animation: cardFlip 0.4s ease;
}

/* Game Over Screen */
.gameover-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
}

.gameover-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

.gameover-subtitle {
    color: var(--text-secondary);
    font-size: 18px;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .app {
        max-width: 100%;
    }

    .screen {
        padding: 20px 12px;
        padding-top: calc(20px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

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

    .selector-label {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .selector-options {
        gap: 8px;
    }

    .selector-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .btn-play {
        padding: 16px;
        font-size: 16px;
    }

    .btn-secondary {
        padding: 14px;
        font-size: 14px;
    }

    #question-counter {
        font-size: 13px;
    }

    .settings-icon {
        font-size: 60px;
        margin-bottom: 16px;
    }

    .statement-card {
        min-height: 220px;
        padding: 28px 20px;
        border-radius: 20px;
    }

    .card-header {
        font-size: 14px;
        margin-bottom: 14px;
    }

    .card-text {
        font-size: 20px;
        line-height: 1.3;
    }

    .card-instruction {
        font-size: 13px;
        margin-top: 18px;
    }

    .gameover-icon {
        font-size: 60px;
    }

    .gameover-subtitle {
        font-size: 16px;
    }

    .subtitle {
        font-size: 13px;
        margin-bottom: 16px;
    }

}

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

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

    .statement-card {
        min-height: 200px;
        padding: 24px 20px;
    }

    .card-text {
        font-size: 20px;
    }
}

/* Tablet and larger */
@media (min-width: 768px) {
    .app {
        max-width: 100%;
    }

    .screen {
        padding: 50px 40px;
    }

    .title {
        font-size: 32px;
        margin-bottom: 40px;
    }

    .statement-card {
        min-height: 320px;
        padding: 50px 40px;
    }

    .card-text {
        font-size: 30px;
    }
}
