* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f0c1f 0%, #1a0f3f 50%, #2d1b4e 100%);
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Анимированный фон */
.stars {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.container {
    position: relative;
    z-index: 2;
    background: rgba(20, 10, 40, 0.8);
    backdrop-filter: blur(10px);
    padding: 60px 50px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(138, 43, 226, 0.3),
                0 0 60px rgba(75, 0, 130, 0.2);
    border: 1px solid rgba(138, 43, 226, 0.3);
    max-width: 450px;
    width: 90%;
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.title {
    text-align: center;
    color: #e0b0ff;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(224, 176, 255, 0.5);
    animation: pulse 2s ease-in-out infinite;
}

.title-video {
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto 15px;
    border-radius: 50%;
    animation: scaleInRotate 0.8s ease-out, glowPulse 2s ease-in-out 0.8s infinite;
    border: 3px solid #8a2be2;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.6),
                0 0 40px rgba(138, 43, 226, 0.3),
                inset 0 0 20px rgba(138, 43, 226, 0.2);
    object-fit: cover;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.subtitle {
    text-align: center;
    color: #b88ddb;
    font-size: 14px;
    margin-bottom: 40px;
    letter-spacing: 1px;
    animation: slideInDown 0.8s ease-out 0.3s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleInRotate {
    from {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 20px rgba(138, 43, 226, 0.6),
                    0 0 40px rgba(138, 43, 226, 0.3),
                    inset 0 0 20px rgba(138, 43, 226, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(138, 43, 226, 0.8),
                    0 0 80px rgba(138, 43, 226, 0.5),
                    inset 0 0 30px rgba(138, 43, 226, 0.4);
    }
    100% {
        box-shadow: 0 0 20px rgba(138, 43, 226, 0.6),
                    0 0 40px rgba(138, 43, 226, 0.3),
                    inset 0 0 20px rgba(138, 43, 226, 0.2);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.form-group {
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

label {
    display: block;
    color: #d4a5ff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(138, 43, 226, 0.1);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 10px;
    color: #e0b0ff;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
}

input::placeholder {
    color: rgba(224, 176, 255, 0.4);
}

input:focus {
    background: rgba(138, 43, 226, 0.2);
    border-color: #8a2be2;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.4);
}

button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #8a2be2 0%, #4b0082 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.4);
    animation: fadeInScale 0.8s ease-out 0.6s both;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(138, 43, 226, 0.6);
    background: linear-gradient(135deg, #9d3cff 0%, #5a0099 100%);
}

button:active {
    transform: translateY(0);
}

.dev-btn {
    width: auto;
    padding: 8px 16px;
    margin-top: 20px;
    font-size: 12px;
    background: rgba(138, 43, 226, 0.3);
    border: 1px solid rgba(138, 43, 226, 0.5);
    animation: none;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.error {
    color: #ff6b9d;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    display: none;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.error.show {
    display: block;
}

.glow {
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(138, 43, 226, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(40px);
    animation: float 6s ease-in-out infinite;
}

.glow1 {
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.glow2 {
    bottom: -100px;
    right: -100px;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, 20px); }
}

/* Анимация успешного входа */
body.success {
    animation: successFade 0.5s ease forwards;
}

@keyframes successFade {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Анимация ошибки поля */
input.error-shake {
    animation: inputShake 0.5s;
}

@keyframes inputShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Экран загрузки */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c1f 0%, #1a0f3f 50%, #2d1b4e 100%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.5s ease;
}

.loading-screen.show {
    display: flex;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loading-content {
    text-align: center;
    animation: slideIn 0.8s ease-out;
}

.loading-video {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin-bottom: 30px;
    border: 3px solid #8a2be2;
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.6),
                0 0 60px rgba(138, 43, 226, 0.3);
    object-fit: cover;
    animation: scaleInRotate 0.8s ease-out;
}

.loading-title {
    color: #e0b0ff;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 0 0 20px rgba(224, 176, 255, 0.5);
    letter-spacing: 2px;
}

.loading-bar {
    width: 300px;
    height: 8px;
    background: rgba(138, 43, 226, 0.2);
    border-radius: 10px;
    margin: 30px auto;
    overflow: hidden;
    border: 1px solid rgba(138, 43, 226, 0.4);
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #8a2be2, #d4a5ff, #8a2be2);
    border-radius: 10px;
    animation: loadingProgress 3s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.6);
}

@keyframes loadingProgress {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 100%; }
}

.loading-text {
    color: #d4a5ff;
    font-size: 16px;
    margin-top: 20px;
    min-height: 24px;
    animation: fadeInUp 0.6s ease-out;
}

/* Экран с фотографией */
.photo-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.photo-screen.show {
    display: flex;
    animation: fadeIn 0.8s ease;
}

.photo-container {
    position: relative;
    width: 350px;
    height: 350px;
    animation: scaleInRotate 1s ease-out;
}

.photo-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #ff1493;
    box-shadow: 0 0 40px rgba(255, 20, 147, 0.6),
                0 0 80px rgba(255, 20, 147, 0.3),
                inset 0 0 30px rgba(255, 20, 147, 0.2);
    animation: photoGlow 2s ease-in-out infinite;
}

@keyframes photoGlow {
    0%, 100% {
        box-shadow: 0 0 40px rgba(255, 20, 147, 0.6),
                    0 0 80px rgba(255, 20, 147, 0.3),
                    inset 0 0 30px rgba(255, 20, 147, 0.2);
    }
    50% {
        box-shadow: 0 0 60px rgba(255, 20, 147, 0.8),
                    0 0 120px rgba(255, 20, 147, 0.5),
                    inset 0 0 40px rgba(255, 20, 147, 0.3);
    }
}

.hearts-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.heart {
    position: absolute;
    font-size: 40px;
    animation: heartPulse 1.5s ease-in-out infinite;
}

.heart:nth-child(1) {
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0s;
}

.heart:nth-child(2) {
    top: -10px;
    right: 20px;
    animation-delay: 0.15s;
}

.heart:nth-child(3) {
    top: 30px;
    right: -20px;
    animation-delay: 0.3s;
}

.heart:nth-child(4) {
    bottom: 30px;
    right: -20px;
    animation-delay: 0.45s;
}

.heart:nth-child(5) {
    bottom: -10px;
    right: 20px;
    animation-delay: 0.6s;
}

.heart:nth-child(6) {
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    animation-delay: 0.75s;
}

.heart:nth-child(7) {
    bottom: -10px;
    left: 20px;
    animation-delay: 0.9s;
}

.heart:nth-child(8) {
    top: 30px;
    left: -20px;
    animation-delay: 1.05s;
}

@keyframes heartPulse {
    0%, 100% {
        transform: scale(1) translateY(0);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3) translateY(-15px);
        opacity: 1;
    }
}

/* Надпись под фотографией */
.photo-caption {
    position: fixed;
    bottom: 150px;
    left: 50%;
    color: #ff1493;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 20, 147, 0.6),
                 0 0 40px rgba(255, 20, 147, 0.3);
    white-space: normal;
    width: 90vw;
    max-width: 90vw;
    box-sizing: border-box;
    padding: 0 20px;
}

#photoCaption {
    animation: captionAppear 1s ease-out 1s both, captionFade 0.8s ease-out 3.4s both;
}

#captionDanya {
    animation: captionAppearHidden 1s ease-out 4.2s both, captionFade 0.8s ease-out 6.4s both;
}

@keyframes captionAppearHidden {
    0% {
        opacity: 0;
        transform: translateY(20px) translateX(-50%);
        visibility: hidden;
    }
    1% {
        visibility: visible;
    }
    100% {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
        visibility: visible;
    }
}

#captionLove {
    animation: captionAppear 1s ease-out 7.2s both;
}

/* Обёртка для двух фотографий */
.photos-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

/* Первая фотография остаётся по центру */
.photo-container {
    animation: scaleInRotate 1s ease-out;
    position: relative;
}

/* Знак плюса */
.plus-sign {
    font-size: 60px;
    color: #ff1493;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 20, 147, 0.6);
    animation: plusAppear 0.8s ease-out 4s both;
}

@keyframes plusAppear {
    from {
        opacity: 0;
        transform: scale(0);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Вторая фотография справа */
.photo-container-right {
    animation: scaleInRotate 1s ease-out 4.2s both;
}

/* Надпись справа */
.caption-right {
    position: fixed;
    bottom: 150px;
    left: 50%;
    margin-left: -200px;
    display: none;
}

.caption-right.show {
    display: block;
    animation: captionAppear 1s ease-out, captionFade 0.8s ease-out 2.2s both;
}

.caption-love {
    position: fixed;
    bottom: 150px;
    left: 50%;
    color: #ff1493;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 20, 147, 0.6),
                 0 0 40px rgba(255, 20, 147, 0.3);
    white-space: normal;
    width: 90vw;
    max-width: 90vw;
    box-sizing: border-box;
    padding: 0 20px;
    animation: captionAppear 1s ease-out 4.2s both, captionFade 0.8s ease-out 6.4s both;
}

.caption-love {
    position: fixed;
    bottom: 150px;
    left: 50%;
    color: #ff1493;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 20, 147, 0.6),
                 0 0 40px rgba(255, 20, 147, 0.3);
    white-space: normal;
    width: 90vw;
    max-width: 90vw;
    box-sizing: border-box;
    padding: 0 20px;
    animation: captionAppear 1s ease-out 4.2s both, captionFade 0.8s ease-out 6.4s both;
}

/* Финальный экран */
.final-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1002;
}

.final-screen.show {
    display: flex;
    animation: fadeIn 1s ease;
}

.final-text {
    color: #ff1493;
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 3px;
    text-shadow: 0 0 30px rgba(255, 20, 147, 0.8),
                 0 0 60px rgba(255, 20, 147, 0.5);
    animation: finalAppear 1.5s ease-out both;
    white-space: normal;
    padding: 20px;
    max-width: 90vw;
    box-sizing: border-box;
    position: fixed;
    top: 50%;
    left: 50%;
    width: 90vw;
}

@keyframes captionAppear {
    from {
        opacity: 0;
        transform: translateY(20px) translateX(-50%);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
}

@keyframes finalAppear {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Экран поздравлений */
.congratulations-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c1f 0%, #1a0f3f 50%, #2d1b4e 100%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1003;
}

.congratulations-screen.show {
    display: flex;
    animation: fadeIn 0.8s ease;
}

.congratulations-content {
    text-align: center;
    max-width: 90%;
}

.congrats-title {
    color: #e0b0ff;
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 40px;
    text-shadow: 0 0 30px rgba(224, 176, 255, 0.6);
    animation: slideInDown 0.8s ease-out both;
}

#congratulationsScreen2 .congrats-title {
    font-size: 28px;
    margin-bottom: 25px;
}

.congrats-text {
    color: #d4a5ff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(212, 165, 255, 0.4);
    animation: fadeInUp 0.8s ease-out both;
}

.congrats-text:nth-of-type(1) {
    animation-delay: 0.3s;
}

.congrats-text:nth-of-type(2) {
    animation-delay: 0.6s;
}

.congrats-text:nth-of-type(3) {
    animation-delay: 0.9s;
}

@keyframes captionFade {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* Предупреждение об ориентации */
.orientation-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c1f 0%, #1a0f3f 50%, #2d1b4e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.orientation-warning p {
    color: #e0b0ff;
    font-size: 24px;
    text-align: center;
    text-shadow: 0 0 20px rgba(224, 176, 255, 0.5);
    padding: 20px;
}

@media (orientation: landscape) {
    .orientation-warning {
        display: none;
    }
}

@media (min-width: 1024px) {
    .orientation-warning {
        display: none;
    }
}

/* Адаптивный дизайн для мобильных */
@media (max-width: 768px) {
    body {
        overflow: hidden;
        height: 100vh;
    }

    .container {
        padding: 25px 20px;
        max-width: 85%;
        border-radius: 15px;
    }

    .title-video {
        width: 90px;
        height: 90px;
        margin-bottom: 15px;
    }

    .subtitle {
        font-size: 14px;
        margin-bottom: 20px;
        letter-spacing: 1.5px;
    }

    label {
        font-size: 13px;
        margin-bottom: 8px;
    }

    input {
        padding: 11px 14px;
        font-size: 14px;
        border-radius: 8px;
    }

    button {
        padding: 11px;
        font-size: 13px;
        border-radius: 8px;
    }

    .dev-btn {
        font-size: 10px;
        padding: 6px 12px;
        margin-top: 10px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    /* Фотографии */
    .photo-container {
        width: 180px;
        height: 180px;
    }

    .heart {
        font-size: 24px;
    }

    .plus-sign {
        font-size: 40px;
        margin: 0 15px;
    }

    .photo-caption {
        font-size: 24px;
        bottom: 100px;
        letter-spacing: 1px;
        font-weight: 700;
    }

    #photoCaption {
        margin-left: 0;
    }

    .caption-right {
        margin-left: 0;
    }

    .caption-love {
        margin-left: 0;
    }

    .final-text {
        font-size: 40px;
        letter-spacing: 2px;
        padding: 30px;
        font-weight: 700;
    }

    .loading-video {
        width: 120px;
        height: 120px;
        margin-bottom: 25px;
    }

    .loading-title {
        font-size: 22px;
        margin-bottom: 25px;
    }

    .loading-bar {
        width: 250px;
        margin: 25px auto;
    }

    .loading-text {
        font-size: 15px;
        margin-top: 20px;
    }
}

@media (max-width: 480px) {
    body {
        overflow: hidden;
        height: 100vh;
    }

    .container {
        padding: 20px 15px;
        max-width: 90%;
        border-radius: 12px;
    }

    .title-video {
        width: 70px;
        height: 70px;
        margin-bottom: 12px;
    }

    .subtitle {
        font-size: 12px;
        margin-bottom: 18px;
        letter-spacing: 1px;
    }

    label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    input {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: 6px;
    }

    button {
        padding: 10px;
        font-size: 12px;
        border-radius: 6px;
    }

    .dev-btn {
        font-size: 9px;
        padding: 5px 10px;
        margin-top: 8px;
    }

    .form-group {
        margin-bottom: 12px;
    }

    /* Фотографии */
    .photo-container {
        width: 140px;
        height: 140px;
    }

    .heart {
        font-size: 18px;
    }

    .plus-sign {
        font-size: 30px;
        margin: 0 10px;
    }

    .photo-caption {
        font-size: 18px;
        bottom: 80px;
        letter-spacing: 0.5px;
        font-weight: 700;
    }

    #photoCaption {
        margin-left: 0;
    }

    .caption-right {
        margin-left: 0;
    }

    .caption-love {
        margin-left: 0;
    }

    .final-text {
        font-size: 32px;
        letter-spacing: 1.5px;
        padding: 20px;
        font-weight: 700;
    }

    .loading-video {
        width: 100px;
        height: 100px;
        margin-bottom: 20px;
    }

    .loading-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .loading-bar {
        width: 180px;
        margin: 20px auto;
    }

    .loading-text {
        font-size: 13px;
        margin-top: 15px;
    }
}

/* Кнопка перехода к поздравлениям друзей */
.to-friends-btn {
    display: inline-block;
    margin-top: 40px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #ff1493 0%, #ff69b4 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
    animation: fadeInScale 0.8s ease-out 1.2s both;
    text-decoration: none;
}

.to-friends-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(255, 20, 147, 0.6);
    background: linear-gradient(135deg, #ff3cb0 0%, #ff85c0 100%);
    color: #fff;
}

.to-friends-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .to-friends-btn {
        margin-top: 30px;
        padding: 11px 20px;
        font-size: 13px;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .to-friends-btn {
        margin-top: 25px;
        padding: 10px 18px;
        font-size: 12px;
        border-radius: 6px;
    }
}
