body {
    background: #1a1a1a;
    overflow: hidden;
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    background: rgba(0, 0, 0, 0.1);
    background-size: cover;
    opacity: 0.2;
    animation: vhs-noise 0.2s infinite steps(1);
}

.crt-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 0, 0, 0.05),
        rgba(0, 255, 0, 0.05),
        rgba(0, 0, 255, 0.05),
        transparent 50%
    );
    animation: vhs-lines 2s infinite linear;
}

.crt-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Статичные горизонтальные полосы через повторяющийся градиент */
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.05) 0,
        rgba(255, 255, 255, 0.05) 1px,
        transparent 1px,
        transparent 10vh /* Расстояние между полосами */
    );
    opacity: 0.8; /* Чуть ярче, чем движущиеся полосы */
    animation: vhs-flicker 0.5s infinite steps(1); /* Оставляем мерцание */
}

.heart-container {
    position: relative;
    width: 60vw;
    height: 50vw;
    max-width: 800px;
    max-height: 667px;
    min-width: 200px;
    min-height: 167px;
}

.heart {
    position: absolute;
    width: 50%;
    height: 60%;
    background: #ff69b4;
    box-shadow: 0 0 2vw #ff69b4, 0 0 4vw #ff69b4;
    transform: rotate(-45deg);
    top: 20%;
    left: 25%;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: #ff69b4;
    border-radius: 50%;
    box-shadow: 0 0 2vw #ff69b4, 0 0 4vw #ff69b4;
}

.heart::before {
    top: -50%;
    left: 0;
}

.heart::after {
    top: 0;
    left: 50%;
}

.input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60vw;
    max-width: 300px;
    margin-top: 2vw;
}

#nameInput {
    padding: 1vw;
    font-family: 'Press Start 2P', cursive;
    background: #1a1a1a;
    color: #ff69b4;
    border: none;
    outline: none;
    flex-grow: 1;
    font-size: clamp(12px, 1.5vw, 16px);
}

#sendBtn {
    padding: 1.2vw;
    background: #ff69b4;
    border: none;
    color: #1a1a1a;
    cursor: pointer;
    margin-left: 1vw;
    box-shadow: 0 0 1vw #ff69b4, 0 0 2vw #ff69b4;
    transition: transform 0.2s ease;
    font-size: clamp(12px, 1.5vw, 16px);
}

#sendBtn:hover {
    transform: scale(1.1);
}

.flying-names span {
    position: absolute;
    color: #ff69b4;
    font-family: 'Press Start 2P', cursive;
    animation: fly 10s linear infinite;
    font-size: clamp(10px, 1.2vw, 14px);
}

@keyframes fly {
    from { left: 100%; }
    to { left: -100%; }
}

/* Стили для попапа */
.popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.popup-content {
    background: #1a1a1a;
    padding: 3vw;
    border: 2px solid #ff69b4;
    box-shadow: 0 0 2vw #ff69b4, 0 0 4vw #ff69b4;
    position: relative;
    width: 80%;
    max-width: 400px;
    text-align: center;
    font-family: 'Press Start 2P', cursive;
    color: #ff69b4;
}

#popup-message {
    font-size: clamp(12px, 1.5vw, 18px);
    line-height: 1.8;
    margin: 0;
}

.popup-close {
    position: absolute;
    top: 0.5vw;
    right: 1vw;
    color: #ff69b4;
    font-size: clamp(20px, 2vw, 24px);
    cursor: pointer;
}

.popup-close:hover {
    color: #fff;
}

/* Анимации для VHS-эффекта */
@keyframes vhs-noise {
    0% { transform: translate(0, 0); }
    25% { transform: translate(0.2vw, -0.2vw); }
    50% { transform: translate(-0.2vw, 0.2vw); }
    75% { transform: translate(0.1vw, -0.1vw); }
    100% { transform: translate(0, 0); }
}

@keyframes vhs-lines {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

@keyframes vhs-flicker {
    0% { opacity: 0.02; }
    50% { opacity: 0.05; }
    100% { opacity: 0.02; }
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .heart-container {
        width: 80vw;
        height: 67vw;
    }

    .input-wrapper {
        width: 80vw;
        margin-top: 3vw;
    }

    #nameInput {
        padding: 0.8vw;
    }

    #sendBtn {
        padding: 0.8vw;
        margin-left: 0.5vw;
    }

    .popup-content {
        padding: 4vw;
    }

    .crt-overlay::after {
        background: repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.05) 0,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px,
            transparent 8vh /* Уменьшаем расстояние на телефонах */
        );
    }
}

@media (max-width: 480px) {
    .heart-container {
        width: 90vw;
        height: 75vw;
    }

    .input-wrapper {
        width: 90vw;
        margin-top: 4vw;
    }

    .crt-overlay::after {
        background: repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.05) 0,
            rgba(255, 255, 255, 0.05) 1px,
            transparent 1px,
            transparent 6vh /* Ещё меньше на маленьких экранах */
        );
    }
}