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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #e94560 100%);
    background-size: 400% 400%;
    animation: gradientShift 20s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(233, 69, 96, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(83, 52, 131, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(233, 69, 96, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.screen {
    display: none !important;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 50px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(233, 69, 96, 0.2) inset;
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(233, 69, 96, 0.3);
}

.screen.active {
    display: block !important;
}

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

/* Экран приветствия */
#welcome-screen {
    text-align: center;
}

#welcome-screen h1 {
    background: linear-gradient(135deg, #e94560 0%, #f5576c 50%, #533483 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 3em;
    margin-bottom: 25px;
    animation: pulse 2s infinite, shimmer 3s infinite;
    font-weight: 700;
    letter-spacing: -1px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

@keyframes shimmer {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#welcome-screen p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.3em;
    margin-bottom: 40px;
    font-weight: 300;
    line-height: 1.6;
}

.btn {
    background: linear-gradient(135deg, #e94560 0%, #533483 50%, #0f3460 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.3em;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 10px 30px rgba(233, 69, 96, 0.4),
        0 0 0 0 rgba(233, 69, 96, 0.5);
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 15px 40px rgba(233, 69, 96, 0.5),
        0 0 0 4px rgba(233, 69, 96, 0.2);
}

.btn:active {
    transform: translateY(-1px) scale(1.02);
}

/* Прогресс бар */
.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    margin-bottom: 40px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e94560 0%, #533483 50%, #0f3460 100%);
    background-size: 200% 100%;
    animation: gradientShift 2s ease infinite;
    border-radius: 20px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.5);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 1.5s infinite;
}

/* Вопросы */
#question-text {
    background: linear-gradient(135deg, #e94560 0%, #533483 50%, #0f3460 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2em;
    margin-bottom: 40px;
    text-align: center;
    font-weight: 600;
    line-height: 1.4;
}

#answers-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.answer-btn {
    background: rgba(30, 30, 50, 0.8);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(233, 69, 96, 0.3);
    color: rgba(255, 255, 255, 0.9);
    padding: 20px 30px;
    font-size: 1.15em;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.answer-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e94560 0%, #533483 50%, #0f3460 100%);
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.answer-btn span {
    position: relative;
    z-index: 1;
}

.answer-btn {
    position: relative;
}

.answer-btn:hover {
    border-color: transparent;
    color: white;
    transform: translateX(15px) scale(1.02);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.4);
}

.answer-btn:hover::before {
    left: 0;
}

/* Экран результата */
#result-screen {
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 30px 40px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: auto;
}

#rose-canvas {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin: 0 auto 20px;
    display: block;
    animation: growRose 2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    filter: drop-shadow(0 10px 30px rgba(233, 69, 96, 0.4));
    position: relative;
    z-index: 10; /* Выше салюта */
}

@keyframes growRose {
    from {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Сообщение только на финальной странице */
#result-screen .message {
    margin-top: 20px;
    z-index: 15; /* Выше салюта */
    position: relative;
    width: 100%;
}

#result-screen .message h1 {
    background: linear-gradient(135deg, #e94560 0%, #f5576c 50%, #533483 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.2em;
    margin-bottom: 12px;
    animation: slideInUp 1s ease-out 0.5s both, pulse 3s ease-in-out 2s infinite;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

#result-screen .message h2 {
    background: linear-gradient(135deg, #e94560 0%, #533483 50%, #0f3460 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 1.8em;
    margin-bottom: 15px;
    animation: slideInUp 1s ease-out 0.7s both;
    font-weight: 600;
    line-height: 1.3;
}

#result-screen .heart-message {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.1em;
    line-height: 1.6;
    animation: slideInUp 1s ease-out 0.9s both;
    font-weight: 300;
    max-width: 550px;
    margin: 0 auto;
    padding: 0 10px;
}

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-10px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(10px);
    }
}

/* Салют */
#fireworks-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 3; /* Ниже цветов и текста */
    overflow: hidden;
}

.firework {
    position: absolute;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}

.firework-particle {
    position: absolute;
    border-radius: 50%;
    will-change: transform, opacity;
    transform: translateZ(0); /* GPU ускорение */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    pointer-events: none;
    /* Свечение будет добавляться через inline стили */
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }
    
    .screen {
        padding: 25px 20px;
        border-radius: 25px;
    }
    
    #welcome-screen {
        padding: 30px 20px;
    }
    
    #welcome-screen h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }
    
    #welcome-screen p {
        font-size: 1em;
        margin-bottom: 25px;
    }
    
    .btn {
        padding: 14px 30px;
        font-size: 1.1em;
        width: 100%;
        max-width: 280px;
    }
    
    #question-text {
        font-size: 1.4em;
        margin-bottom: 25px;
    }
    
    .answer-btn {
        padding: 16px 20px;
        font-size: 1em;
    }
    
    .progress-bar {
        margin-bottom: 25px;
    }
    
    #result-screen {
        padding: 20px 15px 30px;
    }
    
    #rose-canvas {
        max-width: 220px;
        margin-bottom: 15px;
    }
    
    #result-screen .message {
        margin-top: 15px;
    }
    
    #result-screen .message h1 {
        font-size: 1.6em;
        margin-bottom: 10px;
    }
    
    #result-screen .message h2 {
        font-size: 1.4em;
        margin-bottom: 12px;
    }
    
    #result-screen .heart-message {
        font-size: 0.95em;
        line-height: 1.5;
        padding: 0 5px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 10px;
    }
    
    .screen {
        padding: 20px 15px;
        border-radius: 20px;
    }
    
    #welcome-screen h1 {
        font-size: 1.5em;
    }
    
    #welcome-screen p {
        font-size: 0.95em;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 1em;
    }
    
    #question-text {
        font-size: 1.2em;
        margin-bottom: 20px;
    }
    
    .answer-btn {
        padding: 14px 18px;
        font-size: 0.95em;
    }
    
    #result-screen {
        padding: 15px 10px 25px;
    }
    
    #rose-canvas {
        max-width: 180px;
    }
    
    #result-screen .message h1 {
        font-size: 1.4em;
    }
    
    #result-screen .message h2 {
        font-size: 1.2em;
    }
    
    #result-screen .heart-message {
        font-size: 0.9em;
    }
}

/* Горизонтальная ориентация на мобильных */
@media (max-height: 600px) and (orientation: landscape) {
    #result-screen {
        padding: 15px 20px;
        flex-direction: row;
        gap: 20px;
        align-items: center;
    }
    
    #rose-canvas {
        max-width: 200px;
        margin: 0;
        flex-shrink: 0;
    }
    
    #result-screen .message {
        margin-top: 0;
        text-align: left;
        flex: 1;
    }
    
    #result-screen .message h1 {
        font-size: 1.5em;
    }
    
    #result-screen .message h2 {
        font-size: 1.2em;
    }
    
    #result-screen .heart-message {
        font-size: 0.9em;
        max-width: 100%;
    }
}

