/* Общие стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --pink: #ff69b4;
    --pink-light: #ffb6c1;
    --pink-dark: #ff1493;
    --purple: #dda0dd;
    --purple-light: #e6b3ff;
    --gold: #ffd700;
    --white: #ffffff;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #f093fb 50%, #f5576c 75%, #4facfe 100%);
    --gradient-pink: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #fecfef 100%);
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Фон с градиентом и анимацией */
.password-screen,
.gift-screen {
    background: var(--gradient);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

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

/* ЭКРАН ВВОДА ПАРОЛЯ */
.password-container {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    max-width: 500px;
    width: 90%;
    animation: fadeInScale 0.8s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.password-title {
    font-size: 2.5em;
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    animation: titlePulse 2s ease-in-out infinite;
}

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

.password-subtitle {
    font-size: 1.2em;
    color: #555;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 25px;
}

.password-input {
    width: 100%;
    padding: 20px;
    font-size: 1.5em;
    text-align: center;
    letter-spacing: 10px;
    border: 3px solid var(--pink);
    border-radius: 15px;
    outline: none;
    transition: all 0.3s ease;
    font-weight: bold;
    text-transform: uppercase;
    background: white;
}

.password-input:focus {
    border-color: var(--pink-dark);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
    transform: scale(1.05);
}

.password-button {
    padding: 15px 40px;
    font-size: 1.3em;
    background: var(--gradient-pink);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 105, 180, 0.4);
    animation: buttonShine 2s ease-in-out infinite;
}

@keyframes buttonShine {
    0%, 100% { transform: scale(1); box-shadow: 0 5px 20px rgba(255, 105, 180, 0.4); }
    50% { transform: scale(1.05); box-shadow: 0 8px 30px rgba(255, 105, 180, 0.6); }
}

.password-button:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.6);
}

.password-button:active {
    transform: scale(0.95);
}

.error-message {
    color: #ff4444;
    margin-top: 15px;
    font-size: 1em;
    min-height: 25px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* ДЕКОРАТИВНЫЕ ЭЛЕМЕНТЫ */
.floating-hearts,
.floating-stars,
.sparkles,
.floating-cats {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

/* Сердечки */
.heart {
    position: absolute;
    font-size: 30px;
    color: var(--pink);
    animation: floatHeart 8s infinite ease-in-out;
    opacity: 0.8;
}

@keyframes floatHeart {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Звёздочки */
.star {
    position: absolute;
    font-size: 25px;
    color: var(--gold);
    animation: floatStar 10s infinite ease-in-out;
    opacity: 0.7;
}

@keyframes floatStar {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-100px) translateX(100px) rotate(720deg);
        opacity: 0;
    }
}

/* Блёстки */
.sparkle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: sparkle 3s infinite;
    box-shadow: 0 0 10px white;
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}

/* Котики */
.cat {
    position: absolute;
    font-size: 40px;
    animation: floatCat 12s infinite ease-in-out;
    opacity: 0.6;
}

@keyframes floatCat {
    0% {
        transform: translateY(100vh) translateX(-50px) rotate(-15deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100px) translateX(50px) rotate(15deg);
        opacity: 0;
    }
}

/* ЭКРАН С ПОДАРКОМ */
.gift-container {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 800px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* КОНВЕРТ */
.envelope-container {
    position: relative;
    width: 400px;
    height: 300px;
    margin: 50px auto;
    cursor: pointer;
    z-index: 20;
}

.envelope {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.envelope-body {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.envelope-flap {
    position: absolute;
    top: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #ffb6c1 0%, #ff69b4 100%);
    border-radius: 10px 10px 0 0;
    transform-origin: top;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 2;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.2);
}

.envelope-flap::before {
    content: '💌';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 60px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.2); }
}

.envelope-shine {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0%, 100% { opacity: 0.3; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.6; transform: translate(-50%, -50%) scale(1.2); }
}

.envelope-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 450px;
    height: 350px;
    background: radial-gradient(circle, rgba(255, 182, 193, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: glow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes glow {
    0%, 100% { opacity: 0.4; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

.envelope.opened .envelope-flap {
    transform: rotateX(-180deg);
}

.envelope.opened .envelope-body {
    animation: envelopeOpen 0.8s ease forwards;
}

@keyframes envelopeOpen {
    0% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(1.1);
    }
    100% {
        transform: scaleY(0);
        opacity: 0;
    }
}

/* СОДЕРЖИМОЕ КОНВЕРТА */
.envelope-content {
    display: none;
    width: 100%;
    animation: contentAppear 1s ease forwards;
}

.envelope-content.visible {
    display: block;
}

@keyframes contentAppear {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.content-wrapper {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.gift-title {
    font-size: 2.5em;
    background: var(--gradient-pink);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 30px;
    animation: titlePulse 2s ease-in-out infinite;
}

/* ВИДЕО */
.video-container {
    margin: 30px 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    background: #000;
}

.birthday-video {
    width: 100%;
    height: auto;
    max-height: 500px;
    display: block;
}

/* КНОПКА СЕРТИФИКАТА */
.certificate-button-container {
    margin-top: 40px;
    position: relative;
}

.certificate-button {
    display: inline-block;
    padding: 20px 50px;
    font-size: 1.5em;
    background: var(--gradient-pink);
    border: none;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(255, 105, 180, 0.4);
    transition: all 0.3s ease;
    animation: buttonPulse 2s ease-in-out infinite, buttonSparkle 3s ease-in-out infinite;
}

@keyframes buttonPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(255, 105, 180, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 50px rgba(255, 105, 180, 0.6);
    }
}

@keyframes buttonSparkle {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.certificate-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: buttonShimmer 3s infinite;
    transform: rotate(45deg);
}

@keyframes buttonShimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.certificate-button:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 60px rgba(255, 105, 180, 0.6);
}

.certificate-button:active {
    transform: scale(0.95);
}

.button-text {
    position: relative;
    z-index: 1;
}

.button-sparkles {
    position: relative;
    z-index: 1;
    margin-left: 10px;
    animation: sparkleRotate 2s linear infinite;
    display: inline-block;
}

@keyframes sparkleRotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* АДАПТИВНОСТЬ */
@media (max-width: 768px) {
    .password-title,
    .gift-title {
        font-size: 1.8em;
    }
    
    .password-container,
    .content-wrapper {
        padding: 20px;
        margin: 20px;
    }
    
    .envelope-container {
        width: 300px;
        height: 225px;
    }
    
    .envelope-flap::before {
        font-size: 40px;
    }
    
    .certificate-button {
        font-size: 1.2em;
        padding: 15px 30px;
    }
    
    .birthday-video {
        max-height: 300px;
    }
    
    .heart {
        font-size: 20px;
    }
    
    .star {
        font-size: 18px;
    }
    
    .cat {
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .password-title,
    .gift-title {
        font-size: 1.5em;
    }
    
    .envelope-container {
        width: 250px;
        height: 187px;
    }
    
    .certificate-button {
        font-size: 1em;
        padding: 12px 25px;
    }
}

