html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #0a0a12;
    color: #e5e7eb;
    margin: 0;
    padding: 0;
    height: 100%;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch;
}

.main-container-redesigned {
    background: #0a0a12;
}

[x-cloak] { display: none !important; }

.fancy-title {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.glow-purple-soft { text-shadow: 0 0 8px rgba(192, 132, 252, 0.6), 0 0 12px rgba(167, 139, 250, 0.4); }
.glow-yellow-soft { text-shadow: 0 0 8px rgba(250, 204, 21, 0.6), 0 0 12px rgba(234, 179, 8, 0.4); }
.glow-blue-soft { text-shadow: 0 0 8px rgba(96, 165, 250, 0.6), 0 0 12px rgba(59, 130, 246, 0.4); }


.custom-scrollbar-darker::-webkit-scrollbar { width: 8px; height: 8px; }
.custom-scrollbar-darker::-webkit-scrollbar-track { background: rgba(10, 10, 18, 0.5); border-radius: 4px; }
.custom-scrollbar-darker::-webkit-scrollbar-thumb { background: rgba(76, 29, 149, 0.7); border-radius: 4px; }
.custom-scrollbar-darker::-webkit-scrollbar-thumb:hover { background: rgba(109, 40, 217, 0.8); }
.custom-scrollbar-darker {
    scrollbar-width: thin;
    scrollbar-color: rgba(76, 29, 149, 0.7) rgba(10, 10, 18, 0.5);
}

.loading-spinner {
    width: 70px; height: 70px; border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: #c084fc;
    border-radius: 50%; animation: spin 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}
.loading-spinner-small {
    width: 40px; height: 40px; border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #a78bfa; border-radius: 50%; animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.screen-view-home {
    animation: fadeInScreenHome 0.7s ease-out forwards;
    width: 100%;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom));
}
.screen-view {
    animation: fadeInScreen 0.5s ease-out forwards;
    width: 100%;
    padding-bottom: env(safe-area-inset-bottom);
}

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


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

.game-sections-container {
    flex-direction: column;
    gap: 0;
    padding: 2rem 0 3.5rem 0;
    margin: -0px -10% 0 -10%;
}

.game-section {
    position: relative;
    padding: 2.5rem 1.5rem;
    margin: -50px 0;
    color: white;
    transform: skewY(-4deg);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.4s ease;
    box-shadow: 0 10px 30px rgba(0,0,0, 0.4), inset 0 0 20px rgba(0,0,0,0.2);
    border-top: 3px solid transparent;
    overflow: visible;
}

.game-section:not(:last-child) {
    border-bottom-style: none !important;
}
.game-section:last-child {
    border-bottom-style: solid !important;
    border-bottom-width: 3px !important;
}


.game-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.05), rgba(255,255,255,0));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
}

.game-section:hover, .game-section:active {
    transform: skewY(-4deg) scale(1.03);
    box-shadow: 0 15px 40px rgba(0,0,0, 0.5), inset 0 0 25px rgba(0,0,0,0.3);
}
.game-section:hover::before, .game-section:active::before {
    opacity: 1;
}

.section-content {
    text-align: center;
    position: relative;
    z-index: 2;
    padding-bottom: 40px;
}

.game-section:last-child .section-content {
    padding-bottom: 10px;
}
.game-section:last-child {
    padding-bottom: 20px;
}


@keyframes animateBackgroundIconRight {
    0%, 100% { transform: translateY(-50%) translateX(20%) scale(1) rotate(0deg); opacity: 0.08; }
    50% { transform: translateY(-50%) translateX(5%) scale(1.15) rotate(-8deg); opacity: 0.15; }
}

@keyframes animateBackgroundIconLeft {
    0%, 100% { transform: translateY(-50%) translateX(-20%) scale(1) rotate(0deg); opacity: 0.08; }
    50% { transform: translateY(-50%) translateX(-5%) scale(1.15) rotate(8deg); opacity: 0.15; }
}

.background-section-icon {
    position: absolute;
    top: 40%;
    font-size: 10rem;
    z-index: 1;
    transform-origin: center center;
    color: rgba(255, 255, 255, 0.5);
    opacity: 0.08;
    transition: opacity 0.3s ease-in-out;
}

.icon-position-right .background-section-icon {
    right: 0px;
    animation: animateBackgroundIconRight 7s ease-in-out infinite;
}

.icon-position-left .background-section-icon {
    left: 0px;
    animation: animateBackgroundIconLeft 7s ease-in-out infinite;
}

.game-section:nth-child(1) .background-section-icon { animation-delay: 0s; }
.game-section:nth-child(2) .background-section-icon { animation-delay: 0.5s; }
.game-section:nth-child(3) .background-section-icon { animation-delay: 1s; }
.game-section:nth-child(4) .background-section-icon { animation-delay: 1.5s; }
.game-section:nth-child(5) .background-section-icon { animation-delay: 2s; }
.game-section:nth-child(6) .background-section-icon { animation-delay: 2.5s; } /* For Who Am I */


.section-title {
    font-family: 'Russo One', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    display: inline-block;
    transition: color 0.3s ease;
}
.game-section:hover .section-title, .game-section:active .section-title {
    color: #f0f0f0;
}

.section-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 1.5rem;
}

@keyframes pulseSectionButtonTruthDareCompany {
    0%, 100% { background-color: transparent; color: white; transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.2);}
    50% { background-color: white; color: #6d28d9; transform: scale(1.05); box-shadow: 0 6px 15px rgba(0,0,0,0.3);}
}
@keyframes pulseSectionButtonTruthDareCouple {
    0%, 100% { background-color: transparent; color: white; transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.2);}
    50% { background-color: white; color: #db2777; transform: scale(1.05); box-shadow: 0 6px 15px rgba(0,0,0,0.3);}
}
@keyframes pulseSectionButtonWhoAmIGame { 
    0%, 100% { background-color: transparent; color: white; transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.2);}
    50% { background-color: white; color: #7c3aed; transform: scale(1.05); box-shadow: 0 6px 15px rgba(0,0,0,0.3);}
}
@keyframes pulseSectionButtonActivityGame {
    0%, 100% { background-color: transparent; color: white; transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.2);}
    50% { background-color: white; color: #d97706; transform: scale(1.05); box-shadow: 0 6px 15px rgba(0,0,0,0.3);}
}
@keyframes pulseSectionButtonNeverHaveIEver {
    0%, 100% { background-color: transparent; color: white; transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.2);}
    50% { background-color: white; color: #059669; transform: scale(1.05); box-shadow: 0 6px 15px rgba(0,0,0,0.3);}
}
@keyframes pulseSectionButtonMafiaGame {
    0%, 100% { background-color: transparent; color: white; transform: scale(1); box-shadow: 0 4px 10px rgba(0,0,0,0.2);}
    50% { background-color: white; color: #dc2626; transform: scale(1.05); box-shadow: 0 6px 15px rgba(0,0,0,0.3);}
}

.section-button {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.9rem 2rem;
    border-radius: 50px;
    color: white;
    border: 2px solid white;
    background-color: transparent;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    margin-top: 0.5rem;
    margin-bottom: 15px;
    display: inline-block;
}

.truth-dare-company .section-button { animation: pulseSectionButtonTruthDareCompany 7s ease-in-out infinite; }
.truth-dare-couple .section-button { animation: pulseSectionButtonTruthDareCouple 7s ease-in-out infinite 0.25s; }
.who-am-i-game .section-button { animation: pulseSectionButtonWhoAmIGame 7s ease-in-out infinite 0.5s; } 
.activity-game .section-button { animation: pulseSectionButtonActivityGame 7s ease-in-out infinite 0.75s; }
.never-have-i-ever .section-button { animation: pulseSectionButtonNeverHaveIEver 7s ease-in-out infinite 1s; }
.mafia-game .section-button { animation: pulseSectionButtonMafiaGame 7s ease-in-out infinite 1.25s; }


.truth-dare-company { background: linear-gradient(135deg, #6d28d9, #4c1d95); border-top-color: #a78bfa; border-bottom-color: #a78bfa; }
.truth-dare-company:hover .section-title, .truth-dare-company:active .section-title { color: #e9d5ff; }
.truth-dare-company .background-section-icon i { color: #c4b5fd; }

.truth-dare-couple { background: linear-gradient(135deg, #db2777, #9d174d); border-top-color: #f9a8d4; border-bottom-color: #f9a8d4; }
.truth-dare-couple:hover .section-title, .truth-dare-couple:active .section-title { color: #fbcfe8; }
.truth-dare-couple .background-section-icon i { color: #fecdd3; }

.who-am-i-game { background: linear-gradient(135deg, #7c3aed, #5b21b6); border-top-color: #c084fc; border-bottom-color: #c084fc; } 
.who-am-i-game:hover .section-title, .who-am-i-game:active .section-title { color: #e9d5ff; } 
.who-am-i-game .background-section-icon i { color: #d8b4fe; } 


.activity-game { background: linear-gradient(135deg, #d97706, #b45309); border-top-color: #fbbf24; border-bottom-color: #fbbf24; }
.activity-game:hover .section-title, .activity-game:active .section-title { color: #fde68a; }
.activity-game .background-section-icon i { color: #fef08a; }

.never-have-i-ever { background: linear-gradient(135deg, #059669, #047857); border-top-color: #6ee7b7; border-bottom-color: #6ee7b7; }
.never-have-i-ever:hover .section-title, .never-have-i-ever:active .section-title { color: #a7f3d0; }
.never-have-i-ever .background-section-icon i { color: #d1fae5; }


.mafia-game { background: linear-gradient(135deg, #dc2626, #991b1b); border-top-color: #fca5a5; border-bottom-color: #fca5a5; }
.mafia-game:hover .section-title, .mafia-game:active .section-title { color: #fee2e2; }
.mafia-game .background-section-icon i { color: #fecaca; }


.referral-premium-banner-redesigned {
    background: linear-gradient(145deg, rgba(55, 22, 100, 0.7), rgba(30, 10, 60, 0.85));
}

.player-name-input {
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
}
.player-name-input:focus {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.4);
    background-color: rgba(255, 255, 255, 0.08);
    border-color: #a78bfa;
}

.player-list-item {
    animation: listItemEnter 0.4s ease-out forwards;
    opacity: 0;
    transform: translateX(-20px);
    background-color: rgba(255,255,255,0.03);
    border-left: 3px solid #a78bfa;
}
.player-list-item:nth-child(odd) { background-color: rgba(255,255,255,0.04); }
.player-list-item:nth-child(even) { background-color: rgba(255,255,255,0.02); }

@keyframes listItemEnter { to { opacity: 1; transform: translateX(0); } }

.player-name-gradient {
    background: linear-gradient(90deg, #e9d5ff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.player-turn-title {
    font-family: 'Pacifico', cursive;
    font-size: 2.5rem;
    letter-spacing: 1px;
}

.question-card-container {
    position: relative; width: 100%; max-width: 420px; perspective: 1000px;
    display: flex; justify-content: center; align-items: center;
    margin-top: 30px;
}

.question-card {
    width: 100%; padding: 20px 25px; border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0,0,0,0.3) inset;
    color: white; transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease-out, background 0.5s ease-out;
    opacity: 0; transform: translateY(30px) scale(0.95) rotateX(-10deg);
    border-top: 4px solid transparent;
    background-color: rgba(25, 28, 36, 0.9);
}
.question-card.active { opacity: 1; transform: translateY(0) scale(1) rotateX(0deg); }

@keyframes questionCardFlyOut {
    0% { transform: translateY(0) scale(1) rotateX(0deg); opacity: 1; }
    30% { transform: translateY(0) scale(1) rotateX(0deg); opacity: 1; }
    100% { transform: translateY(80px) scale(0.6) rotateX(15deg); opacity: 0; }
}
.question-card.animate-out { animation: questionCardFlyOut 0.5s ease-in-out forwards; }

.question-card.truth { border-top-color: #60a5fa; background: linear-gradient(145deg, rgba(59, 130, 246, 0.25), rgba(37, 99, 235, 0.35)), rgba(25, 28, 36, 0.9); }
.question-card.dare { border-top-color: #f472b6; background: linear-gradient(145deg, rgba(236, 72, 153, 0.25), rgba(219, 39, 119, 0.35)), rgba(25, 28, 36, 0.9); }
.question-card.never-task { border-top-color: #2dd4bf; background: linear-gradient(145deg, rgba(20, 184, 166, 0.25), rgba(15, 118, 110, 0.35)), rgba(25, 28, 36, 0.9); }
.question-card.activity-task { border-top-color: #f59e0b; background: linear-gradient(145deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.4)), rgba(25, 28, 36, 0.9); }
.question-card.super-task {
    border-top-color: #a78bfa;
    background: linear-gradient(145deg, rgba(109, 40, 217, 0.35) 0%, rgba(167, 139, 250, 0.45) 100%), rgba(25, 28, 36, 0.9);
    box-shadow: 0 12px 35px rgba(167, 139, 250, 0.25), 0 0 25px rgba(129, 140, 248, 0.2) inset;
}

.super-task-banner, .activity-banner {
    font-family: 'Press Start 2P', cursive; font-size: 0.9rem; text-align: center; color: #fde047;
    text-shadow: 1px 1px 0px #c2410c, -1px -1px 0px #c2410c, 1px -1px 0px #c2410c, -1px 1px 0px #c2410c, 0 0 10px #f59e0b, 0 0 18px #f59e0b;
    padding: 10px 0; margin-bottom: 12px; border-radius: 6px; background: rgba(0,0,0,0.4);
    display: flex; justify-content: center; align-items: center; gap: 12px; letter-spacing: 1.5px;
}
.super-task-banner i.fa-star, .activity-banner i.fa-lightbulb { animation: starShine 1.5s infinite ease-in-out; }
@keyframes starShine { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3) rotate(15deg); opacity: 0.7; } }

.slot-machine-wrapper { position: relative; width: 100%; padding: 0; }
.slot-machine-container {
    height: 120px; overflow: hidden; position: relative; border-radius: 10px;
    background: linear-gradient(180deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.2) 30%, rgba(0,0,0,0.2) 70%, rgba(0,0,0,0.5) 100%), rgba(46, 26, 108, 0.6);
    box-shadow: inset 0 0 15px rgba(0,0,0,0.6); border: 2px solid rgba(167, 139, 250, 0.4);
}
.slot-machine-reel { transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1); }
.slot-option {
    height: 40px; display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; font-weight: 700; color: #fff;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8); border-bottom: 1px solid rgba(167, 139, 250, 0.2);
    box-sizing: border-box; font-family: 'Montserrat', sans-serif;
    background: rgba(255, 255, 255, 0.02); padding-left: 5px; padding-right: 5px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slot-option:last-child { border-bottom: none; }
.slot-indicator {
    position: absolute; top: 50%; left: 0; right: 0; height: 40px; transform: translateY(-50%);
    border-top: 3px solid rgba(250, 204, 21, 0.9);
    border-bottom: 3px solid rgba(250, 204, 21, 0.9);
    box-sizing: border-box; pointer-events: none;
    background: linear-gradient(to right, transparent 0%, rgba(250, 204, 21, 0.15) 20%, rgba(250, 204, 21, 0.15) 80%, transparent 100%);
}

.drawing-area-container {
    width: 100%; max-width: 400px; margin-left: auto; margin-right: auto; padding: 12px;
    background-color: rgba(10, 10, 18, 0.4);
    border-radius: 14px; box-shadow: 0 5px 12px rgba(0,0,0,0.25);
    display: flex; flex-direction: column; align-items: center;
}
.drawing-canvas {
    display: block; width: 100%; height: 250px; cursor: crosshair; touch-action: none;
    border-radius: 10px; background-color: #f0f0f5;
    border: 2px solid #4a5568;
}
.filter-blur-active { filter: blur(5px); transition: filter 0.3s ease-in-out; }

.shadow-top { box-shadow: 0 -5px 20px rgba(0,0,0,0.35); }
.nav-button {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: #9ca3af; font-size: 0.7rem; padding: 5px 10px; border-radius: 10px;
    transition: color 0.25s ease-in-out, background-color 0.25s ease-in-out, transform 0.25s ease;
    flex-grow: 1; max-width: 33%;
}
.nav-button i { font-size: 1.3rem; margin-bottom: 3px; }
.nav-button:hover, .nav-button:active {
    color: #c4b5fd;
    transform: translateY(-2px) scale(1.05);
}
.nav-button.active { color: #a78bfa; }
.nav-button.active i { animation: bounceIcon 0.5s ease-out; }

.nav-button.active-premium,
.nav-button.active-premium i,
.nav-button.active-premium span {
    color: #fbbf24;
    font-weight: 600;
}
.nav-button.active-premium:hover,
.nav-button.active-premium:active {
    color: #f59e0b;
}


@keyframes bounceIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

input[type="text"] { caret-color: #a78bfa; }
input[type="text"]::placeholder { color: #718096; }

button:not(.nav-button) { transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1); }
.random-choice-button:active { transform: scale(0.97); filter: brightness(0.85); }

.referral-premium-banner-redesigned {
    background: linear-gradient(145deg, rgba(80, 30, 150, 0.6), rgba(50, 15, 90, 0.75));
    border: 1px solid #a78bfa;
}
@keyframes pulseSlow { 0%, 100% { opacity: 0.6; } 50% { opacity: 0.85; } }
.animate-pulse-slow { animation: pulseSlow 3.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes bounceSlow { 0%, 100% { transform: translateY(-18%); animation-timing-function: cubic-bezier(0.8,0,1,1); } 50% { transform: none; animation-timing-function: cubic-bezier(0,0,0.2,1); } }
.animate-bounce-slow { animation: bounceSlow 1.7s infinite; }

.setting-card {
    background-color: rgba(255, 255, 255, 0.03);
    border-radius: 14px; padding: 18px 22px;
    box-shadow: 0 5px 18px rgba(0,0,0,0.12);
    transition: all 0.35s ease; border: 1px solid rgba(255, 255, 255, 0.08);
}
.setting-card:hover { transform: translateY(-3px); box-shadow: 0 7px 22px rgba(0,0,0,0.18); }

.switch { position: relative; display: inline-block; width: 52px; height: 30px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #4b5563; transition: .4s; border-radius: 30px;
}
.slider:before {
    position: absolute; content: ""; height: 22px; width: 22px;
    left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: #8b5cf6; }
input:focus + .slider { box-shadow: 0 0 2px #8b5cf6; }
input:checked + .slider:before { transform: translateX(22px); }

.setting-input {
    background-color: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e5e7eb; border-radius: 10px; padding: 12px 16px; font-size: 1rem;
    transition: all 0.3s ease;
}
.setting-input:focus {
    background-color: rgba(255, 255, 255, 0.07); border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.35); outline: none;
}
.setting-input::placeholder { color: #9ca3af; opacity: 0.6; }

.rated-settings-enter {
    animation: fadeInSettings 0.5s ease-out forwards; opacity: 0; transform: translateY(-10px);
}
@keyframes fadeInSettings { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

.tooltip-trigger { cursor: help; }

.rated-action-buttons button {
    transform: perspective(1px) translateZ(0); transition-duration: 0.3s;
    transition-property: transform, box-shadow;
}
.rated-action-buttons button:hover, .rated-action-buttons button:active {
    transform: scale(1.04);
    box-shadow: 0 12px 22px -10px rgba(0,0,0,0.45);
}

@media (max-width: 370px) {
    .app-title-redesigned-v2 { font-size: 1.9rem; }
    .section-title { font-size: 1.9rem; }
    .background-section-icon { font-size: 8rem; }
    .icon-position-right .background-section-icon { right: -30px; }
    .icon-position-left .background-section-icon { left: -30px; }
    .question-card p { font-size: 1.0rem; }
    .nav-button i { font-size: 1.15rem; }
    .nav-button span { font-size: 0.68rem; }
    .player-turn-title { font-size: 2.1rem; }
    .super-task-banner, .activity-banner { font-size: 0.75rem; }
    .slot-machine-container { height: 110px; }
    .slot-option { height: 36.66px; font-size: 1.15rem; }
    .slot-indicator { height: 36.66px; }
    .drawing-canvas { height: 190px; }
}

.game-sections-container .game-section {
    opacity: 0;
    transform: translateY(50px) skewY(-4deg);
    animation: sectionAppear 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes sectionAppear {
    to {
        opacity: 1;
        transform: translateY(0) skewY(-4deg);
    }
}

.game-sections-container .game-section:nth-child(1) { animation-delay: 0.1s; }
.game-sections-container .game-section:nth-child(2) { animation-delay: 0.2s; }
.game-sections-container .game-section:nth-child(3) { animation-delay: 0.3s; }
.game-sections-container .game-section:nth-child(4) { animation-delay: 0.4s; }
.game-sections-container .game-section:nth-child(5) { animation-delay: 0.5s; }
.game-sections-container .game-section:nth-child(6) { animation-delay: 0.6s; } 


.game-close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 20;
}

.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}
.confirm-modal-content {
    background-color: #1f2937;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    text-align: center;
    width: 100%;
    max-width: 28rem;
    border: 1px solid #fbbf24;
}

.text-shadow-md {
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

.level-chest {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-size: 200% 200%;
    animation: chestBreathing 10s ease infinite, fadeInChest 0.5s ease-out forwards;
    opacity: 0;
}
.level-chest:nth-of-type(odd) { animation-delay: 0.1s, 0.1s; }
.level-chest:nth-of-type(even) { animation-delay: 0.25s, 0.25s; }


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

.available-chest {
    --chest-color-1: #4ade80; 
    --chest-color-2: #22c55e; 
    --chest-glow-color: rgba(77, 220, 128, 0.4);
    background-image: linear-gradient(145deg, var(--chest-color-1), var(--chest-color-2), #15803d); 
}
.available-chest.referral-unlocked { 
    --chest-color-1: #60a5fa; 
    --chest-color-2: #3b82f6; 
    --chest-glow-color: rgba(96, 165, 250, 0.4);
    background-image: linear-gradient(145deg, var(--chest-color-1), var(--chest-color-2), #1d4ed8); 
}
.available-chest.premium-unlocked { 
    --chest-color-1: #facc15; 
    --chest-color-2: #eab308; 
    --chest-glow-color: rgba(250, 204, 21, 0.5);
    background-image: linear-gradient(145deg, var(--chest-color-1), var(--chest-color-2), #ca8a04); 
}
.available-chest.premium-unlocked .chest-icon-container i,
.available-chest.premium-unlocked .chest-icon-container span {
    color: #a16207; 
}


.locked-chest {
    background: linear-gradient(145deg, #374151, #1f2937); 
    border-color: rgba(255, 255, 255, 0.15);
}

.chest-glow {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle, var(--chest-glow-color) 0%, transparent 70%);
    animation: rotateGlow 15s linear infinite;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.level-chest:hover .chest-glow {
    opacity: 0.7;
}
.locked-chest .chest-glow {
    background: radial-gradient(circle, rgba(156, 163, 175, 0.2) 0%, transparent 70%); 
}
.locked-chest:hover .chest-glow {
    opacity: 0.4;
}


@keyframes rotateGlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
@keyframes chestBreathing {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.chest-icon-container {
    width: 50px; 
    height: 50px; 
    border-radius: 0.625rem; 
    display: flex; align-items: center; justify-content: center;
    margin-left: auto; margin-right: auto;
    background-color: rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15); 
    transition: background-color 0.3s ease;
}
.level-chest:hover .chest-icon-container {
    background-color: rgba(255, 255, 255, 0.15);
}
.chest-icon-container i, .chest-icon-container span {
    font-size: 1.75rem; 
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 1px rgba(0,0,0,0.2); 
    transition: transform 0.3s ease;
}
.level-chest:hover .chest-icon-container i,
.level-chest:hover .chest-icon-container span {
    transform: scale(1.1);
}
.locked-chest .chest-icon-container i,
.locked-chest .chest-icon-container span {
    color: rgba(156, 163, 175, 0.7);
}


.chest-status-badge {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.65rem; 
    font-weight: 600;
    padding: 0.25rem 0.625rem; 
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15); 
}
.chest-status-badge.free { background-color: #10b981; color: #064e3b; } 
.chest-status-badge.referral-unlocked { background-color: #38bdf8; color: #0c4a6e; } 
.chest-status-badge.premium-unlocked { background-color: #f59e0b; color: #78350f; } 

.chest-status-badge.locked-premium { background-color: #78350f; color: #fef3c7; border: 1px solid #f59e0b; }
.chest-status-badge.locked-referral { background-color: #1e40af; color: #dbeafe; border: 1px solid #38bdf8; }
.chest-status-badge.locked-other { background-color: #4b5563; color: #d1d5db; border: 1px solid #6b7280; }

.chest-lock-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(10, 10, 18, 0.75);
    backdrop-filter: blur(3px);
    border-radius: 0.75rem; 
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: opacity 0.3s ease;
}
.locked-chest:hover .chest-lock-overlay {
    background-color: rgba(10, 10, 18, 0.65);
}
.chest-lock-overlay i {
    animation: lockPulse 2s infinite ease-in-out;
}
@keyframes lockPulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.1); opacity: 0.9; }
}

.chest-particles {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.chest-particles::before,
.chest-particles::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--chest-glow-color);
    border-radius: 50%;
    opacity: 0;
    animation: particleFlow 3s infinite linear;
}

.chest-particles::before {
    left: 20%;
    animation-delay: 0s;
}
.chest-particles::after {
    left: 70%;
    width: 3px; height: 3px;
    animation-delay: 1.5s;
}

@keyframes particleFlow {
    0% { transform: translateY(-100%) scale(0.5); opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(200%) scale(1.5); opacity: 0; }
}

.level-chest.available-chest .chest-icon-container i,
.level-chest.available-chest .chest-icon-container span {
    animation: iconPop 0.6s ease-out 0.3s forwards;
    opacity: 0;
    transform: scale(0.5);
}

@keyframes iconPop {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Стили для игры "Кто я?" --- */
.screen-view.who-am-i-game-active {
    display: flex;
    flex-direction: column;
    height: 100%; 
    overflow: hidden; 
    position: relative; 
    padding: 0; /* Убираем padding с основного контейнера экрана игры */
}

.who-am-i-fixed-header {
    width: 100%;
    padding: 0.75rem 1rem; /* Небольшие отступы для хедера */
    box-sizing: border-box;
    position: relative; /* Или fixed/absolute если нужно строгое позиционирование */
    z-index: 20; 
    flex-shrink: 0; 
    background-color: #0a0a12; /* Фон, чтобы контент под ним не просвечивал */
}

.who-am-i-rotation-viewport { /* Новый контейнер для области, которая будет содержать повернутый контент */
    flex-grow: 1; /* Занимает все оставшееся пространство по вертикали */
    width: 100%;
    position: relative;
    overflow: hidden; /* Важно, чтобы повернутый контент не вылезал */
    display: flex; /* Для центрирования .who-am-i-rotated-content */
    align-items: center;
    justify-content: center;
}

.who-am-i-rotated-content {
    /* Этот блок будет повернут. Его размеры должны быть такими, 
       чтобы после поворота он заполнил .who-am-i-rotation-viewport */
    width: var(--viewport-height-minus-header, 100vh); /* Ширина = высота доступной области */
    height: var(--viewport-width, 100vw);           /* Высота = ширина доступной области */
    
    transform-origin: center center;
    transform: rotate(90deg);
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Распределяем пространство: карточка, таймер, кнопка */
    padding: 1rem; /* Внутренние отступы в повернутом блоке */
    box-sizing: border-box;
    /* background-color: rgba(255, 0, 0, 0.1); */ /* DEBUG */
}

.who-am-i-game-active .question-card-container {
  background: transparent !important;
  box-shadow: none !important;
}

.who-am-i-game-active .question-card {
  background: transparent !important;
  box-shadow: none !important;
}

.who-am-i-game-active .question-card-inner {
  background: transparent !important;
}

.question-card.who-am-i-task {
    width: 100%; 
    height: 100%; 
    padding: clamp(0.5rem, 2vw, 1rem); 
}

.question-card.who-am-i-task .question-card-inner {
    display: flex;
    flex-direction: column;
    justify-content: center; 
    align-items: center; 
    width: 100%;
    height: 100%;
}

.who-am-i-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; 
    width: 100%;
    height: 100%; 
    padding: 0.2rem; 
}

.countdown-animation {
    font-family: 'Russo One', sans-serif;
    animation: countdownPulse 1s infinite;
    font-size: clamp(2.5rem, 10vw, 6rem); /* Используем vw, т.к. это теперь "высота" */
    margin: 0.5rem 0;
}

@keyframes countdownPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

.who-am-i-word-display {
    font-family: 'Comfortaa', cursive;
    font-weight: 700;
    font-size: clamp(1.5rem, 4.5vw, 3.5rem); /* Используем vw */
    color: #ffffff;
    text-align: center;
    padding: 5px;
    margin: 0.5rem 0;
    width: 100%;
    word-break: break-word;
    line-height: 1.1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px; 
}

.who-am-i-instruction {
    font-size: clamp(0.8rem, 2vw, 1.1rem); /* Используем vw */
    color: #e5e7eb;
    margin-bottom: 0.5rem;
}

.who-am-i-timer-display {
    font-family: 'Russo One', sans-serif;
    font-size: clamp(1rem, 2.8vw, 1.6rem); /* Используем vw */
    color: #fde047; 
    background-color: rgba(0,0,0,0.6);
    padding: 0.3rem 0.7rem;
    border-radius: 0.5rem;
    /* margin-top: 0.5rem; */ /* Управляется space-between родителя */
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    flex-shrink: 0;
}

.who-am-i-next-button {
  color: white !important;
  font-size: 1.5rem !important;
  font-weight: bold !important;
  text-shadow: 0 0 5px rgba(0,0,0,0.7);
}

/* Медиа-запрос для корректировки размеров на очень маленьких экранах (по высоте в ландшафте) */
/* Теперь vw - это новая "высота" экрана */
@media (max-width: 450px) { /* Если ширина экрана (новая высота) маленькая */
    .question-card.who-am-i-task {
        padding: 0.3rem;
    }
    .who-am-i-word-display {
        font-size: clamp(2.3rem, 4vw, 2.8rem);
    }
    .who-am-i-instruction {
        font-size: clamp(2.3rem, 1.8vw, 0.9rem);
    }
    .countdown-animation {
        font-size: clamp(2rem, 7vw, 4.5rem);
    }
    .who-am-i-timer-display {
        font-size: clamp(0.9rem, 2.2vw, 1.3rem);
    }
    .who-am-i-next-button {
        padding: 0.5rem 0.8rem;
        font-size: clamp(0.7rem, 2vw, 1rem);
        min-width: 130px;
    }
}
