html {
    height: 100%;
}

body {
    font-family: 'Nunito', sans-serif;
    background-color: #111827; /* темно-серый фон */
    color: #e5e7eb; /* светло-серый текст */
    margin: 0;
    padding: 0;
    height: 100%;
    overscroll-behavior: none; /* отключает "pull-to-refresh" */
    -webkit-tap-highlight-color: transparent; /* убирает подсветку при тапе на iOS */
    -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
}

.main-container {
    background: linear-gradient(160deg, #1f2937 0%, #374151 100%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

[x-cloak] { display: none !important; }

.app-title {
    font-family: 'Nunito', sans-serif; 
    font-size: 1.5rem; 
    font-weight: 800;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    color: #fff; 
    background: linear-gradient(45deg, #f87171, #fb923c, #facc15, #a3e635, #4ade80, #22d3ee, #818cf8, #d8b4fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%; 
    animation: gradientTextAnimation 10s ease infinite;
    margin-bottom: 0.5rem; 
}

.fancy-title {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    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.5), 0 0 12px rgba(167, 139, 250, 0.3);
}
.glow-yellow-soft {
    text-shadow: 0 0 8px rgba(250, 204, 21, 0.5), 0 0 12px rgba(234, 179, 8, 0.3);
}
.glow-blue-soft {
     text-shadow: 0 0 8px rgba(96, 165, 250, 0.5), 0 0 12px rgba(59, 130, 246, 0.3);
}


@keyframes gradientTextAnimation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); border-radius: 3px; }
::-webkit-scrollbar-thumb { background: rgba(128, 128, 128, 0.5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(128, 128, 128, 0.7); }
.custom-scrollbar { 
    scrollbar-width: thin;
    scrollbar-color: rgba(128, 128, 128, 0.5) rgba(255,255,255,0.05);
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff; 
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.loading-spinner-small {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #8b5cf6; 
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.screen-view {
    animation: fadeInScreen 0.6s ease-out forwards;
    width: 100%; 
}

@keyframes fadeInScreen {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

.category-banner:hover h3, .category-banner:hover p {
    transform: translateX(5px);
    transition: transform 0.3s ease-out;
}
.category-banner h3, .category-banner p {
    transition: transform 0.3s ease-out;
}

.choice-buttons-enter {
    animation: slideUpFadeIn 0.5s 0.2s ease-out forwards; 
    opacity: 0;
}

@keyframes slideUpFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.player-name-input {
    font-size: 1.1rem; 
    transition: all 0.3s ease;
}
.player-name-input:focus {
    transform: scale(1.02); 
    box-shadow: 0 0 15px rgba(167, 139, 250, 0.3); 
}

.player-list-item {
    animation: listItemEnter 0.4s ease-out forwards;
    opacity: 0;
    transform: translateX(-20px); 
}
.player-list-item:nth-child(odd) {
    background: linear-gradient(to right, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}
.player-list-item:nth-child(even) {
    background: linear-gradient(to right, rgba(255,255,255,0.02), rgba(255,255,255,0.05));
}

@keyframes listItemEnter {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.player-name-gradient {
    background: linear-gradient(90deg, #fbc2eb 0%, #a6c1ee 100%); 
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Nunito', 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: 10px;
    min-height: 350px; 
}

.question-card {
    width: 100%;
    padding: 20px 25px; 
    border-radius: 20px; 
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 0 0 15px rgba(0,0,0,0.2) 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(42, 50, 66, 0.85); 
}

.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.2), rgba(37, 99, 235, 0.3)), rgba(42, 50, 66, 0.85);
}

.question-card.dare {
    border-top-color: #f472b6; 
    background: linear-gradient(145deg, rgba(236, 72, 153, 0.2), rgba(219, 39, 119, 0.3)), rgba(42, 50, 66, 0.85);
}

.question-card.never-task {
    border-top-color: #2dd4bf; 
    background: linear-gradient(145deg, rgba(20, 184, 166, 0.2), rgba(15, 118, 110, 0.3)), rgba(42, 50, 66, 0.85);
}

.question-card.activity-task { 
    border-top-color: #f59e0b; 
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.35)), rgba(42, 50, 66, 0.85);
}

.question-card.super-task {
    border-top-color: #a78bfa; 
    background: linear-gradient(145deg, rgba(109, 40, 217, 0.3) 0%, rgba(167, 139, 250, 0.4) 100%), rgba(42, 50, 66, 0.85);
    box-shadow: 0 12px 35px rgba(167, 139, 250, 0.2), 0 0 25px rgba(129, 140, 248, 0.15) 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 8px #f59e0b, 0 0 15px #f59e0b; 
    padding: 8px 0;
    margin-bottom: 10px;
    border-radius: 5px;
    background: rgba(0,0,0,0.3); 
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; 
    letter-spacing: 1px; 
}
.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: 8px;
    background: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.1) 30%, rgba(0,0,0,0.1) 70%, rgba(0,0,0,0.4) 100%), rgba(26, 42, 108, 0.5); 
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5); 
    border: 2px solid rgba(255, 255, 255, 0.2); 
}
.slot-machine-reel {
    transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1); /* Уменьшил время для spinSlotMachine */
}
.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 2px rgba(0,0,0,0.7); 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); 
    box-sizing: border-box;
    font-family: 'Nunito', sans-serif; 
    background: rgba(255, 255, 255, 0.03); 
    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: 2px solid rgba(255, 215, 0, 0.8); 
    border-bottom: 2px solid rgba(255, 215, 0, 0.8);
    box-sizing: border-box;
    pointer-events: none; 
    background: linear-gradient(to right, transparent 0%, rgba(255, 215, 0, 0.1) 20%, rgba(255, 215, 0, 0.1) 80%, transparent 100%); 
}

.drawing-area-container {
    width: 100%;
    max-width: 400px; 
    margin-left: auto;
    margin-right: auto;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    /* Добавлено для корректного отображения в потоке flex */
    display: flex;
    flex-direction: column;
    align-items: center;
}
.drawing-canvas {
    display: block; 
    width: 100%;
    height: 250px; 
    cursor: crosshair; 
    touch-action: none; 
    border-radius: 8px; 
}
/* Стиль для размытия текста */
.filter-blur-active {
    filter: blur(5px);
    transition: filter 0.3s ease-in-out;
}
/* Убираем размытие при наведении, если нужно */
/* .filter-blur-active:hover {
    filter: blur(0px);
} */


.shadow-top { box-shadow: 0 -4px 15px rgba(0,0,0,0.25); } 
.nav-button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; color: #9ca3af; 
    font-size: 0.7rem; padding: 4px 8px; border-radius: 8px;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out, transform 0.2s ease;
    flex-grow: 1; max-width: 33%; 
}
.nav-button i { font-size: 1.25rem; margin-bottom: 2px; }
.nav-button:hover { color: #e5e7eb; transform: translateY(-2px); } 
.nav-button.active { color: #a78bfa; } 
.nav-button.active i { animation: bounceIcon 0.5s ease-out; }

@keyframes bounceIcon { 
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

input[type="text"] { caret-color: #a78bfa; } 
input[type="text"]::placeholder { color: #6b7280; } 

button:not(.nav-button) {
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}
button:not(.nav-button):hover {
    filter: brightness(1.1); 
}
button:not(.nav-button):active {
    transform: scale(0.97); 
    filter: brightness(0.95); 
}
.random-choice-button:active { 
    transform: scale(0.98);
    filter: brightness(0.9);
}

.referral-premium-banner {
    background-color: rgba(0,0,0,0.3); 
    border: 1px solid rgba(255, 255, 255, 0.1); 
}
@keyframes pulseSlow { 0%, 100% { opacity: 0.7; } 50% { opacity: 0.9; } }
.animate-pulse-slow { animation: pulseSlow 3s cubic-bezier(0.4, 0, 0.6, 1) infinite; } 
@keyframes bounceSlow { 0%, 100% { transform: translateY(-15%); 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.5s infinite; } 

.setting-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.setting-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.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: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    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 1px #8b5cf6;
}
input:checked + .slider:before {
    transform: translateX(22px);
}

.setting-input {
    background-color: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.setting-input:focus {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #a78bfa; 
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.3);
    outline: none;
}
.setting-input::placeholder {
    color: #9ca3af; 
    opacity: 0.7;
}

.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 {
    transform: scale(1.03);
    box-shadow: 0 10px 20px -10px rgba(0,0,0,0.4);
}


@media (max-width: 360px) {
    .app-title { font-size: 2.2rem; }
    .question-card p { font-size: 1.0rem; } 
    .nav-button i { font-size: 1.1rem; }
    .nav-button span { font-size: 0.65rem; }
    .player-turn-title { font-size: 2rem; }
    .super-task-banner, .activity-banner { font-size: 0.8rem; }
    .slot-machine-container { height: 100px; } 
    .slot-option { height: 33.33px; font-size: 1.1rem; } 
    .slot-indicator { height: 33.33px; }
    .drawing-canvas { height: 200px; } 
}
