/* Общий стиль страницы */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;

    /* Фон: градиент + картинка */
    background:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.2) 0, transparent 55%),
        radial-gradient(circle at 80% 0%, rgba(255, 215, 0, 0.25) 0, transparent 60%),
        linear-gradient(135deg, rgba(2, 6, 23, 0.9), rgba(17, 24, 39, 0.95) 45%, rgba(31, 41, 55, 0.95) 100%),
        url("images/bg.jpg") center/cover no-repeat fixed;
}

main {
    flex: 1;
}

/* Снег */
.snow {
    pointer-events: none;
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 20px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 80px 60px, rgba(255,255,255,0.7), transparent),
        radial-gradient(2px 2px at 150px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(2px 2px at 220px 40px, rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 300px 100px, rgba(255,255,255,0.8), transparent),
        radial-gradient(2px 2px at 380px 30px, rgba(255,255,255,0.7), transparent);
    background-size: 400px 200px;
    animation: snowfall 18s linear infinite;
    opacity: 0.7;
    z-index: 1;
}

@keyframes snowfall {
    0% {
        transform: translateY(-100px);
    }
    100% {
        transform: translateY(100px);
    }
}

/* Салюты */
.fireworks {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.firework {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: transparent;
    box-shadow:
        0 -18px #fbbf24,
        12px -12px #ef4444,
        18px 0 #22c55e,
        12px 12px #3b82f6,
        0 18px #e879f9,
        -12px 12px #fb7185,
        -18px 0 #38bdf8,
        -12px -12px #a3e635;
    animation: firework-explode 2.4s infinite ease-out;
}

.firework-1 {
    top: 25%;
    left: 18%;
    animation-delay: 0s;
}

.firework-2 {
    top: 40%;
    right: 15%;
    animation-delay: 0.8s;
}

.firework-3 {
    top: 70%;
    left: 50%;
    animation-delay: 1.6s;
}

@keyframes firework-explode {
    0% {
        transform: scale(0.2);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Страница входа по паролю */
.login-body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.2) 0, transparent 55%),
        radial-gradient(circle at 80% 0%, rgba(255, 215, 0, 0.25) 0, transparent 60%),
        linear-gradient(135deg, rgba(2, 6, 23, 0.9), rgba(17, 24, 39, 0.95) 45%, rgba(31, 41, 55, 0.95) 100%),
        url("images/bg.jpg") center/cover no-repeat fixed;
}

.login-wrapper {
    max-width: 360px;
    width: 100%;
    padding: 0 16px;
}

.login-card {
    background: rgba(15, 23, 42, 0.9);
    border-radius: 18px;
    padding: 24px 20px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.login-card h1 {
    margin: 0 0 8px;
    font-size: 22px;
}

.login-subtitle {
    margin: 0 0 16px;
    font-size: 14px;
    color: rgba(209, 213, 219, 0.9);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.login-form input[type="password"] {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    outline: none;
    font-size: 14px;
}

.login-form input[type="password"]::placeholder {
    color: rgba(148, 163, 184, 0.9);
}

.login-form button {
    border: none;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #0b1120;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.2s;
    box-shadow: 0 10px 25px rgba(248, 250, 252, 0.25);
}

.login-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(248, 250, 252, 0.3);
}

.login-form button:active {
    transform: translateY(0);
    box-shadow: 0 6px 15px rgba(248, 250, 252, 0.25);
}

.login-error {
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(248, 113, 113, 0.7);
    color: #fecaca;
    font-size: 13px;
}

/* Шапка */
.hero {
    position: relative;
    z-index: 2;
    padding: 40px 16px 24px;
    text-align: center;
}

.hero-inner {
    max-width: 900px;
    margin: 0 auto;
}

.hero-tagline {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 8px;
}

.hero h1 {
    font-size: clamp(32px, 5vw, 48px);
    margin: 0 0 16px;
    text-shadow: 0 0 18px rgba(15, 23, 42, 0.9);
}

.hero-subtitle {
    font-size: 16px;
    max-width: 650px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.85);
}

/* Музыка */
.audio-controls {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.audio-controls button {
    border: none;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.audio-controls button:hover {
    background: rgba(30, 64, 175, 0.9);
    transform: translateY(-1px);
}

.audio-controls {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.audio-hint {
    font-size: 12px;
    color: rgba(209, 213, 219, 0.9);
    flex-basis: 100%;      /* строка целиком */
    text-align: center;    /* по центру */
    margin-top: 4px;
}

/* Поздравление */
.greeting {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 24px auto 32px;
    padding: 20px 16px;
}

.greeting-card {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 18px;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.greeting-title {
    font-size: 20px;
    margin: 0 0 10px;
}

.greeting-text {
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 12px;
}

.greeting-sign {
    margin-top: 10px;
    font-size: 14px;
    color: rgba(209, 213, 219, 0.9);
}

/* Галерея / кинолента */
.gallery {
    position: relative;
    z-index: 2;
    padding: 8px 16px 40px;
}

.gallery-inner {
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
}

.gallery h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

.gallery-desc {
    font-size: 14px;
    margin-bottom: 16px;
    color: rgba(209, 213, 219, 0.9);
}

/* === Кинолента с фото === */

.filmstrip-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    margin-top: 8px;
}

.filmstrip {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 32px;
    /* движение теперь будет через JS */
    will-change: transform;
}

/* Пауза анимации */
.filmstrip.paused {
    animation-play-state: paused;
}

/* Один кадр "плёнки" */
.film-item {
    flex: 0 0 auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    background: #020617;
    position: relative;
    z-index: 1;
}

.film-item img {
    display: block;
    height: 180px;
    width: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: center;
}

/* Активный (увеличенный) кадр в ленте */
.film-item.zoom {
    z-index: 2;
}

.film-item.zoom img {
    transform: scale(1.7);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
}

/* плавная бесконечная прокрутка */
@keyframes filmstrip-scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* затемнённые градиенты по краям — эффект "из невидимости" */
.filmstrip-wrapper::before,
.filmstrip-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    width: 64px;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.filmstrip-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(15, 23, 42, 0.98), transparent);
}

.filmstrip-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(15, 23, 42, 0.98), transparent);
}

/* Стиль для сообщения "нет фоток" */
.film-item-empty {
    padding: 16px 24px;
}

.film-empty-text {
    color: rgba(209, 213, 219, 0.9);
    font-size: 14px;
}

/* === Большое фото (лайтбокс) === */

.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 16px;
}

.lightbox.open {
    display: flex;
}

.lightbox-image-wrapper {
    position: relative;
    max-width: min(90vw, 1000px);
    max-height: 90vh;
}

.lightbox img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

/* Кнопка закрытия */
.lightbox-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.lightbox-close:hover {
    background: rgba(30, 64, 175, 0.95);
}

/* Когда открыт лайтбокс — блокируем прокрутку фона */
body.no-scroll {
    overflow: hidden;
}

/* Footer */
footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 12px 16px 18px;
    font-size: 12px;
    color: rgba(156, 163, 175, 0.9);
}

footer span {
    color: #fbbf24;
}

/* Адаптация под телефон */
@media (max-width: 640px) {
    .greeting-card {
        padding: 16px;
    }

    .audio-controls {
        flex-direction: column;
    }

    .audio-hint {
        text-align: center;
    }

    .film-item img {
        height: 140px;
    }

    .film-item.zoom img {
        transform: scale(1.5);
    }
}