/* style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Inter", sans-serif;
    background: linear-gradient(135deg, #0f0c1f 0%, #1a1a2e 50%, #16213e 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    color: #e0e0e0;
    line-height: 1.5;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 50%, rgba(178, 59, 94, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(74, 63, 114, 0.15) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1000px;
    width: 100%;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Hero секция (первый экран) */
.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    position: relative;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 800;
    background: linear-gradient(135deg, #ff8a9c, #b23b5e, #4a3f72, #7b6c9c);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
    animation: gradientFlow 8s ease infinite;
    text-shadow: 0 0 30px rgba(178, 59, 94, 0.3);
}

@keyframes gradientFlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.timer {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 80px;
    padding: 40px 60px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5),
                inset 0 1px 2px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 50px;
    width: 100%;
    max-width: 700px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timer:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 60px -12px rgba(178, 59, 94, 0.3),
                inset 0 1px 3px rgba(255, 255, 255, 0.2);
    border-color: rgba(178, 59, 94, 0.3);
}

.timer span {
    display: block;
    font-size: 1.3rem;
    font-weight: 300;
    background: linear-gradient(135deg, #ff8a9c, #b23b5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.timer-display {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
    font-size: 0.9rem;
    animation: bounce 2s infinite;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);}
    40% {transform: translateX(-50%) translateY(-20px);}
    60% {transform: translateX(-50%) translateY(-10px);}
}

/* Секция с викториной */
.quiz-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 0;
}

.quiz-title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #ff8a9c, #b23b5e);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 1rem;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.quiz-subtitle {
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3rem;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.quiz-container {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 60px;
    padding: 50px;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.5),
                inset 0 1px 2px rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.quiz-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(178, 59, 94, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.quiz-container:hover::before {
    opacity: 1;
}

.quiz-container:hover {
    transform: scale(1.02);
    border-color: rgba(178, 59, 94, 0.3);
    box-shadow: 0 40px 80px -20px rgba(178, 59, 94, 0.4);
}

.question-text {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff, #ff8a9c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 35px;
    line-height: 1.3;
    text-align: center;
}

.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    position: relative;
    min-height: 180px;
}

/* ЕДИНЫЙ СТИЛЬ ДЛЯ ВСЕХ КНОПОК */
.option-btn {
    min-width: 220px;
    padding: 18px 35px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 60px;
    font-size: 1.2rem;
    font-weight: 500;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2),
                inset 0 1px 2px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    margin: 8px;
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.option-btn:hover {
    transform: translateY(-3px) scale(1.05);
    background: linear-gradient(135deg, rgba(178, 59, 94, 0.8), rgba(74, 63, 114, 0.8));
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 15px 30px rgba(178, 59, 94, 0.4),
                inset 0 1px 3px rgba(255, 255, 255, 0.2);
}

.option-btn:hover::before {
    left: 100%;
}

.option-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Кнопка Ксюша - обычный стиль (не абсолютная) */
.option-btn:not(#evilButton) {
    position: relative;
    display: inline-block;
}

/* Летающая кнопка Владлен */
/* #evilButton {
    position: fixed;
    z-index: 9999;
    cursor: none;
    background: linear-gradient(135deg, #b23b5e, #ff8a9c);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(178, 59, 94, 0.5);
    margin: 0;
    transition: none;
} */

/* Анимация испуга */
#evilButton.scared {
    animation: shake 0.2s ease;
    border-color: #ff4d4d;
    box-shadow: 0 0 40px rgba(255, 77, 77, 0.6);
}

@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-10px, 5px); }
    50% { transform: translate(10px, -5px); }
    75% { transform: translate(-5px, -10px); }
}

/* Стили для колеса */
.wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 40px auto;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.3));
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4),
                inset 0 0 50px rgba(255,255,255,0.1);
    transition: transform 3s cubic-bezier(0.25, 0.1, 0.15, 1);
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
}

.wheel-sector {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: white;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    padding-right: 25px;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.2);
}

.wheel-sector span {
    transform: rotate(45deg);
    white-space: nowrap;
    background: rgba(0,0,0,0.2);
    padding: 5px 10px;
    border-radius: 30px;
    backdrop-filter: blur(5px);
}

.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-top: 50px solid #ffd700;
    filter: drop-shadow(0 10px 10px rgba(0,0,0,0.5));
    z-index: 10;
    transition: none !important;
}

/* Стили для игры в пары */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.memory-card {
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #4a3f72, #6b5f8a);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3),
                inset 0 2px 5px rgba(255,255,255,0.2);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid rgba(255,255,255,0.1);
    position: relative;
    overflow: hidden;
}

.memory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.memory-card:hover::before {
    left: 100%;
}

.memory-card:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 20px 40px rgba(178, 59, 94, 0.4);
    border-color: rgba(255,255,255,0.3);
}

.memory-card.opened {
    background-size: cover;
    background-position: center;
    transform: scale(1);
}

.memory-card.matched {
    opacity: 0.7;
    cursor: default;
    filter: grayscale(50%);
    transform: scale(0.95);
}

/* Слайдер */
.slider-container {
    width: 100%;
    padding: 30px 0;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, #b23b5e, #4a3f72, #7b6c9c);
    border-radius: 20px;
    outline: none;
    border: 1px solid rgba(255,255,255,0.2);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 35px;
    height: 35px;
    background: white;
    border: 4px solid #b23b5e;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 10px 25px rgba(178, 59, 94, 0.6);
}

.slider-value {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 25px;
    background: linear-gradient(135deg, #ffffff, #ff8a9c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Confetti */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #f00;
    opacity: 0.8;
    animation: fall linear forwards;
    pointer-events: none;
    z-index: 9999;
    filter: blur(0.5px);
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.result-message {
    text-align: center;
    margin-top: 35px;
    padding: 18px 30px;
    border-radius: 60px;
    font-size: 1.4rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    letter-spacing: 0.5px;
}

.result-message.show {
    opacity: 1;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Прогресс бар */
.progress-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    margin-top: 30px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #b23b5e, #ff8a9c, #4a3f72);
    background-size: 200% 100%;
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 20px;
    animation: gradientMove 2s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.question-counter {
    text-align: center;
    margin-top: 20px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* Адаптивность */
@media (max-width: 600px) {
    .quiz-container {
        padding: 35px 25px;
    }
    .option-btn {
        min-width: 160px;
        padding: 14px 25px;
        font-size: 1rem;
    }
    .question-text {
        font-size: 1.6rem;
    }
    .wheel-container {
        width: 250px;
        height: 250px;
    }
    .timer {
        padding: 30px 40px;
    }
}

/* Анимации появления */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quiz-container {
    animation: fadeInUp 0.6s ease;
}

.hero-title, .timer, .scroll-hint {
    animation: fadeInUp 0.8s ease;
}

/* Спецэффекты для кликера */
.clicker-heart {
    font-size: 6rem !important;
    background: none !important;
    border: none !important;
    cursor: pointer;
    transition: all 0.1s ease;
    filter: drop-shadow(0 15px 25px rgba(178, 59, 94, 0.5));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.clicker-heart:hover {
    transform: scale(1.2) rotate(5deg) !important;
    filter: drop-shadow(0 20px 30px rgba(178, 59, 94, 0.7));
}

#clickerTimer {
    font-size: 2.5rem !important;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 60px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Исправленные стили для колеса свиданий */
.wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 50px auto 30px;
    filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.3));
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 0 50px rgba(255,255,255,0.1);
    transition: transform 3s cubic-bezier(0.25, 0.1, 0.15, 1);
    overflow: hidden;
    border: 3px solid rgba(255, 255, 255, 0.2);
    background: #2a1f3a;
}

.wheel-sector {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%);
}

.wheel-sector-text {
    position: absolute;
    left: 35%;
    top: 35%;
    transform-origin: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    white-space: nowrap;
    background: rgba(0, 0, 0, 0.3);
    padding: 5px 12px;
    border-radius: 30px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    pointer-events: none;
    z-index: 5;
}

.wheel-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: #ffd700;
    color: #333;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 10;
    border: 3px solid white;
    font-weight: bold;
}

/* Адаптивность для мобильных */
@media (max-width: 600px) {
    .wheel-container {
        width: 250px;
        height: 250px;
        margin: 40px auto;
    }
    
    .wheel-sector-text {
        font-size: 0.8rem;
        padding: 3px 8px;
        left: 30%;
        top: 30%;
    }
    
    .wheel-pointer {
        width: 30px;
        height: 30px;
        font-size: 18px;
        top: -10px;
    }
}

/* Стили для пазла */
.puzzle-container {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 60px;
    padding: 40px;
    box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
}

.puzzle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto 30px;
    aspect-ratio: 1/1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    padding: 10px;
}

.puzzle-piece {
    width: 100%;
    aspect-ratio: 1/1;
    background-size: 400% 400%; /* 4x4 сетка */
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.puzzle-piece:hover {
    transform: scale(1.05);
    border-color: rgba(255, 138, 156, 0.5);
    box-shadow: 0 10px 25px rgba(178, 59, 94, 0.4);
    z-index: 2;
}

.puzzle-piece.empty {
    opacity: 0.3;
    background: rgba(255, 255, 255, 0.1) !important;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    cursor: default;
}

.puzzle-piece.empty:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.puzzle-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
}

.puzzle-controls .option-btn {
    min-width: 150px;
}

#solvePuzzle {
    background: linear-gradient(135deg, #4a3f72, #6b5f8a);
}

#solvePuzzle:hover {
    background: linear-gradient(135deg, #5b4e7c, #7b6c9c);
}

/* Модальное окно с оригиналом */
.preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.preview-modal img {
    max-width: 80%;
    max-height: 80%;
    border-radius: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    border: 3px solid rgba(255, 255, 255, 0.2);
    animation: scaleIn 0.3s ease;
}

.preview-modal .close-modal {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.preview-modal .close-modal:hover {
    transform: scale(1.1);
    background: rgba(178, 59, 94, 0.8);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 600px) {
    .puzzle-grid {
        max-width: 350px;
    }
    .puzzle-controls {
        flex-direction: column;
        align-items: center;
    }
    .puzzle-controls .option-btn {
        width: 100%;
        max-width: 250px;
    }
}