* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #4facfe 75%, #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    width: 100%;
    height: 100vh;
    position: relative;
}

.screen {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.screen.active {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 1;
}

/* Начальный экран */
.start-content {
    text-align: center;
    animation: fadeInUp 1s ease;
}

.title {
    font-size: 3.5rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
    opacity: 0.9;
}

.start-button {
    padding: 1rem 3rem;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    color: #764ba2;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #fff;
}

/* Экран с карточками */
.cards-container {
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    padding: 2rem;
    position: relative;
    min-height: 500px;
}

.card-wrapper {
    width: 300px;
    height: 400px;
    position: relative;
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1);
    transition: all 0.5s ease;
    margin: 20px auto;
    display: block;
    z-index: 5;
}

.card-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
    position: absolute;
}

.card-wrapper.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    position: relative;
}

.card-wrapper.flipped .card {
    transform: rotateY(180deg);
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.card-front,
.card-back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.card-front {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.card-back {
    background: #fff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    position: relative;
}

.card-hint {
    font-size: 1.1rem;
    color: #fff;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 0 4px #000;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.4;
    position: relative;
    top: -20px; /* Чуть выше центра */
}

.card-number {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 0 4px #000;
    font-weight: 700;
    text-align: center;
    margin-top: 0.5rem;
}

@keyframes pulseHint {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 15px;
}

/* Поле ввода кодового слова */
.code-input-container {
    margin-top: 2rem;
    text-align: center;
    animation: fadeInUp 0.5s ease;
}

.code-hint {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.input-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.code-input {
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    color: #764ba2;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    min-width: 250px;
}

.code-input:focus {
    border-color: #fff;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: scale(1.05);
}

.code-input.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.submit-code-btn {
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    color: #764ba2;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    width: 55px;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-code-btn:hover {
    transform: scale(1.1);
    background: #fff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.code-error {
    color: #ff6b6b;
    font-size: 1rem;
    margin-top: 10px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* Экраны с подарками */
.gift-screen {
    display: none;
}

.gift-screen.active {
    display: flex;
}

.gift-content {
    text-align: center;
    animation: fadeInUp 1s ease;
    z-index: 10;
    max-width: 600px;
    padding: 2rem;
}

.gift-title {
    font-size: 3rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    font-weight: 300;
}

.gift-message {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
    opacity: 0.95;
    line-height: 1.6;
}

.gift-button {
    padding: 1.2rem 3rem;
    font-size: 1.3rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    color: #764ba2;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.gift-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
    background: #fff;
}

/* Финальный экран */
.final-content {
    text-align: center;
    animation: fadeInUp 1s ease;
    z-index: 10;
}

.final-title {
    font-size: 3rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    font-weight: 300;
}

.final-message {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
    opacity: 0.95;
}

.love-button {
    padding: 1.2rem 3rem;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    color: #e91e63;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: heartbeat 1.5s infinite;
}

.love-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.05); }
    50% { transform: scale(1); }
    75% { transform: scale(1.05); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Конфетти */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

/* ЭКРАН: Проверка доступа */
.access-content {
    text-align: center;
    animation: fadeInUp 1s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100%;
}

.access-subtitle {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
    animation: fadeIn 1s ease 0.5s both;
}

.fingerprint-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.fingerprint-container:hover {
    transform: scale(1.05);
}

.fingerprint-container:active {
    transform: scale(0.95);
}

.fingerprint-icon {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

.fingerprint-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: fingerprintDraw 2.5s ease-in-out forwards;
}

.fingerprint-path:nth-of-type(2) {
    animation-delay: 0.2s;
}

.fingerprint-path:nth-of-type(3) {
    animation-delay: 0.4s;
}

.fingerprint-path:nth-of-type(4) {
    animation-delay: 0.6s;
}

.fingerprint-path:nth-of-type(5) {
    animation-delay: 0.8s;
}

.fingerprint-path:nth-of-type(6) {
    animation-delay: 1s;
}

.fingerprint-path:nth-of-type(7) {
    animation-delay: 1.2s;
}

.fingerprint-path:nth-of-type(8) {
    animation-delay: 1.4s;
}

.fingerprint-circle {
    stroke-dasharray: 250;
    stroke-dashoffset: 250;
    animation: fingerprintDraw 2s ease-in-out 1.5s forwards;
}

.fingerprint-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    animation: fingerprintPulse 2s ease-in-out infinite;
    z-index: 1;
}

@keyframes fingerprintDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes fingerprintPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.fingerprint-container.scanning .fingerprint-glow {
    animation: fingerprintScan 1.5s ease-in-out infinite;
}

@keyframes fingerprintScan {
    0% {
        transform: scale(0.8);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
    100% {
        transform: scale(0.8);
        opacity: 0.3;
    }
}

.access-status {
    margin-top: 2rem;
    animation: fadeInUp 0.5s ease;
}

.access-success,
.access-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.checkmark,
.crossmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    animation: scaleIn 0.5s ease;
}

.checkmark {
    background: rgba(76, 175, 80, 0.9);
    color: white;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.crossmark {
    background: rgba(244, 67, 54, 0.9);
    color: white;
    box-shadow: 0 0 20px rgba(244, 67, 54, 0.5);
}

.access-success p,
.access-error p {
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* ЭКРАН: Проверка даты */
.date-content {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    animation: fadeInUp 1s ease;
}

.screen-title {
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    font-weight: 300;
}

.question-text {
    font-size: 1.3rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.date-input {
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.95);
    color: #764ba2;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    min-width: 200px;
    margin-bottom: 1rem;
}

.date-input:focus {
    border-color: #fff;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hint-btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 25px;
    cursor: pointer;
    color: #764ba2;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.hint-btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

.primary-btn {
    padding: 1rem 2.5rem;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    color: #764ba2;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin-top: 1rem;
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: #fff;
}

.error-message {
    color: #ff6b6b;
    font-size: 1rem;
    margin-top: 1rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.3s ease;
}

.hint-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    color: #764ba2;
    font-size: 1rem;
    line-height: 1.6;
    animation: fadeInUp 0.5s ease;
}

/* ЭКРАН: Знакомство с Лавой */
.lava-intro-content {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    animation: fadeInUp 1s ease;
}

.lava-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

.lava-message {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: #764ba2;
    font-size: 1.1rem;
    line-height: 1.8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lava-message p {
    margin-bottom: 1rem;
}

.lava-message p:last-child {
    margin-bottom: 0;
}

/* ЭКРАН: Сообщения от Лавы */
.lava-message-screen {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    animation: fadeInUp 1s ease;
}

.lava-avatar-small {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 1.5rem;
}

.lava-message-box {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: #764ba2;
    font-size: 1rem;
    line-height: 1.8;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.lava-message-box p {
    margin-bottom: 1rem;
}

.lava-message-box p:last-child {
    margin-bottom: 0;
}

/* ЭКРАН: Карточка с результатом */
.card-screen-content {
    text-align: center;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    animation: fadeInUp 1s ease;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    position: relative;
    visibility: visible !important;
    opacity: 1 !important;
}

.card-result {
    margin-top: 2rem;
    animation: fadeInUp 0.5s ease;
    display: none !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    visibility: hidden !important;
    opacity: 0 !important;
}

.card-result.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-top: 2rem;
}

.opened-card {
    /* Убрано - больше не используется */
    display: none;
}

.result-card-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 15px;
    margin-bottom: 1rem;
}

.card-text {
    font-size: 1.3rem;
    color: #764ba2;
    font-weight: 600;
    line-height: 1.6;
}

/* ЭКРАН: Финальные карточки со свайпом */
.final-cards-content {
    text-align: center;
    padding: 2rem;
    max-width: 600px;
    animation: fadeInUp 1s ease;
}

.final-title {
    font-size: 3rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    font-weight: 300;
}

.cards-swipe-container {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.cards-wrapper {
    display: flex;
    width: 500%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.final-card {
    width: 20%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0.5;
    transform: scale(0.9);
    transition: all 0.5s ease;
}

.final-card.active {
    opacity: 1;
    transform: scale(1);
}

.final-card-image-wrapper {
    width: 100%;
    max-width: 250px;
    height: 300px;
    margin-bottom: 1rem;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.final-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.final-card-code {
    font-size: 1.5rem;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.final-card-text {
    font-size: 1.2rem;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    font-weight: 500;
}

.swipe-hint {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    animation: pulseHint 2s infinite;
    text-align: center;
    width: 100%;
}

#continue-final-cards-btn {
    display: block !important;
    margin: 2rem auto 0;
    width: auto;
    min-width: 200px;
    text-align: center;
}

/* Кнопка "Назад" */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateX(-5px);
}

.back-btn:active {
    transform: translateX(-3px) scale(0.95);
}

/* Адаптивность */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .screen-title {
        font-size: 2rem;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .cards-container {
        gap: 1rem;
        padding: 1rem;
    }
    
    .card-wrapper {
        width: 250px;
        height: 350px;
    }
    
    .final-title {
        font-size: 2rem;
    }
    
    .final-message {
        font-size: 1.2rem;
    }
    
    .lava-avatar {
        width: 120px;
        height: 120px;
    }
    
    .lava-avatar-small {
        width: 80px;
        height: 80px;
    }
    
    .cards-swipe-container {
        height: 400px;
    }
    
    .final-card-image-wrapper {
        max-width: 200px;
        height: 250px;
    }
}

