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

:root {
    --accent-pink: #ff3b6f;
    --accent-pink-dark: #cc2f59;
    --accent-orange: #ff922b;
    --settings-accent: var(--accent-pink);
    --settings-accent-dark: var(--accent-pink-dark);
}

/* Back Button */

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

/* Play Button */
/* Inline icon spacing for this game’s action content. */
.btn-play { display: flex; align-items: center; justify-content: center; gap: 10px; }

.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 */

.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;
    }
}

/* Pack gallery — square, full-bleed illustrated covers */
#packs-screen {
    width: 100%;
    max-width: 520px;
    height: 100vh;
    height: var(--app-height, 100dvh);
    min-height: 0;
    margin: 0 auto;
    overflow: hidden;
}

#packs-screen .title {
    margin-bottom: 6px;
}

#packs-screen .subtitle {
    margin-top: 0;
    margin-bottom: 20px;
    color: var(--text-secondary);
    text-align: center;
    font-size: 14px;
}

#packs-screen .packs-container {
    flex: 1 1 auto;
    min-height: 0;
    padding: 4px 2px 24px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#packs-screen .bottom-section {
    position: relative;
    z-index: 10;
    flex: 0 0 auto;
    margin-top: 0;
    padding: 14px 0 0;
    background: linear-gradient(180deg, rgba(13, 19, 41, 0) 0, rgba(13, 19, 41, 0.96) 18px, #0d1329 100%);
}

/* Player avatars inside the question (PlayerAvatar chips replacing @) */
.card-text .rp-player { gap: 0.25em; }

/* Card in and out: dealt in from below with a tilt, flies off on «Готово», slides aside on «Другая карточка».
   Id-scoped to win over the theme's screen arrival (#card-screen.active .tod-card). */
@media (prefers-reduced-motion: no-preference) {
    #card-screen.active .tod-card.tod-card--enter { animation: tod-card-enter 460ms cubic-bezier(.2, .9, .3, 1.2) both; }
    #card-screen.active .tod-card.tod-card--leave { animation: tod-card-leave 260ms cubic-bezier(.5, 0, .75, .3) both; pointer-events: none; }
    #card-screen.active .tod-card.tod-card--leave-side { animation: tod-card-leave-side 260ms cubic-bezier(.5, 0, .75, .3) both; pointer-events: none; }
}
@keyframes tod-card-enter {
    0% { opacity: 0; transform: translateY(70px) rotate(-7deg) scale(.86); }
    60% { opacity: 1; transform: translateY(-6px) rotate(1.5deg) scale(1.02); }
    100% { opacity: 1; transform: none; }
}
@keyframes tod-card-leave {
    0% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translate(40%, -55%) rotate(14deg) scale(.82); }
}
@keyframes tod-card-leave-side {
    0% { opacity: 1; transform: none; }
    100% { opacity: 0; transform: translateX(-75%) rotate(-10deg) scale(.9); }
}
