* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #0a1a2d 0%, #1a0b2e 50%, #0d2b1a 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
    letter-spacing: -0.01em;
    position: relative;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Новогодний снег */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.snowflake {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.8;
    animation: fall linear infinite;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
    }
}

/* Стилизация скроллбара с новогодними цветами */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 26, 45, 0.8);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #45B7D1);
    border-radius: 10px;
    border: 2px solid rgba(10, 26, 45, 0.8);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #FF8E8E, #5ED9D0, #55C7E1);
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.7);
}

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #FF6B6B rgba(10, 26, 45, 0.8);
}

/* Новогодний фон с гирляндами */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(255, 107, 107, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(78, 205, 196, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(69, 183, 209, 0.1) 0%, transparent 50%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    opacity: 0.5;
    z-index: -1;
    animation: twinkle 8s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 0.7;
    }
}

/* Новогодние украшения по углам */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23FF6B6B' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Новогодний заголовок */
header {
    width: 100%;
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    position: relative;
}

header::before {
    content: '🎄';
    position: absolute;
    left: 10%;
    top: 50%;
    font-size: 2rem;
    animation: swing 3s ease-in-out infinite;
}

header::after {
    content: '🎅';
    position: absolute;
    right: 10%;
    top: 50%;
    font-size: 2rem;
    animation: swing 3s ease-in-out infinite reverse;
}

@keyframes swing {
    0%, 100% {
        transform: translateY(-50%) rotate(-10deg);
    }
    50% {
        transform: translateY(-50%) rotate(10deg);
    }
}

.logo {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4, #45B7D1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
    position: relative;
    display: inline-block;
}

.logo::after {
    content: '✨';
    position: absolute;
    right: -40px;
    top: 0;
    font-size: 2rem;
    animation: sparkle 1.5s ease-in-out infinite;
}

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

.tagline {
    font-size: 1.2rem;
    color: #a8e6cf;
    font-weight: 400;
    letter-spacing: 0.02em;
    position: relative;
    display: inline-block;
}

.tagline::before,
.tagline::after {
    content: '❄️';
    margin: 0 10px;
    animation: spin 4s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Новогодний поиск */
.search-container {
    width: 100%;
    max-width: 600px;
    margin: 25px 0 35px;
    display: flex;
    gap: 12px;
    position: relative;
}

.search-container::before {
    content: '🔍';
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    animation: bounce 2s ease-in-out infinite;
}

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

.search-input {
    flex: 1;
    padding: 14px 22px;
    background: rgba(10, 26, 45, 0.9);
    border: 2px solid rgba(255, 107, 107, 0.5);
    border-radius: 15px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.2);
}

.search-input:focus {
    outline: none;
    border-color: #4ECDC4;
    box-shadow: 0 0 20px rgba(78, 205, 196, 0.5);
    background: rgba(15, 35, 60, 0.95);
}

.search-input::placeholder {
    color: #a8e6cf;
    opacity: 0.7;
}

.search-btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E8E);
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    position: relative;
    overflow: hidden;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
    background: linear-gradient(135deg, #FF8E8E, #FF6B6B);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn::after {
    content: '🎁';
    position: absolute;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-btn:hover::after {
    opacity: 1;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 35px;
}

/* Новогодняя сетка аниме */
.anime-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    width: 100%;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(10, 26, 45, 0.7);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 107, 107, 0.3);
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.2);
    position: relative;
}

.anime-grid::before {
    content: '✨ С Наступающим Новым Годом! ✨';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(45deg, #FF6B6B, #4ECDC4);
    padding: 5px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.anime-card {
    background: linear-gradient(145deg, rgba(10, 26, 45, 0.9), rgba(26, 11, 46, 0.9));
    border-radius: 18px;
    overflow: hidden;
    transition: all 0.4s ease;
    cursor: pointer;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(78, 205, 196, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
}

.anime-card:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 15px 40px rgba(255, 107, 107, 0.4);
    border-color: rgba(255, 107, 107, 0.6);
}

.anime-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 107, 107, 0.1), rgba(78, 205, 196, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.anime-card:hover::before {
    opacity: 1;
}

.anime-preview {
    width: 100%;
    height: 360px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    position: relative;
    z-index: 0;
}

.anime-card:hover .anime-preview {
    transform: scale(1.08);
}

.anime-btn {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.9), rgba(78, 205, 196, 0.9));
    border: none;
    color: white;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    padding: 18px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.anime-btn:hover {
    background: linear-gradient(135deg, rgba(255, 140, 140, 0.9), rgba(94, 217, 208, 0.9));
    letter-spacing: 0.03em;
    padding-left: 25px;
}

.anime-btn::after {
    content: '🎬';
    position: absolute;
    right: 20px;
    opacity: 0;
    transition: all 0.3s ease;
}

.anime-btn:hover::after {
    opacity: 1;
    right: 15px;
}

.no-results {
    text-align: center;
    color: #a8e6cf;
    font-size: 1.2rem;
    margin: 45px 0;
    grid-column: 1 / -1;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 20px;
    background: rgba(10, 26, 45, 0.8);
    border-radius: 15px;
    border: 2px solid rgba(255, 107, 107, 0.3);
}

/* Новогодняя кнопка Telegram */
.telegram-container {
    width: 100%;
    max-width: 600px;
    margin: 25px 0;
    display: flex;
    justify-content: center;
}

.telegram-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #0088cc, #00a2ff);
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.02em;
    backdrop-filter: blur(10px);
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0, 136, 204, 0.3);
    position: relative;
    overflow: hidden;
}

.telegram-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 136, 204, 0.5);
    background: linear-gradient(135deg, #00a2ff, #0088cc);
}

.telegram-btn:active {
    transform: translateY(0);
}

.telegram-btn::before {
    content: '🌟';
    position: absolute;
    left: -20px;
    transition: all 0.3s ease;
}

.telegram-btn:hover::before {
    left: 15px;
}

.telegram-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

/* Новогодний футер */
footer {
    margin-top: 45px;
    font-size: 0.9rem;
    text-align: center;
    color: #a8e6cf;
    padding: 25px 0;
    width: 100%;
    max-width: 900px;
    border-top: 2px solid rgba(255, 107, 107, 0.3);
    letter-spacing: 0.02em;
    position: relative;
}

footer::before {
    content: '🎉';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    animation: bounce 2s ease-in-out infinite;
}

footer::after {
    content: '🎊';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    animation: bounce 2s ease-in-out infinite reverse;
}

/* Эффект конфетти при клике */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #FF6B6B;
    opacity: 0;
    pointer-events: none;
    animation: confetti-fall 1s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .logo {
        font-size: 2.8rem;
    }

    .logo::after {
        right: -30px;
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 1.1rem;
    }

    .search-container {
        flex-direction: column;
        margin: 20px 0 30px;
    }

    .search-container::before {
        left: 50%;
        top: -30px;
        transform: translateX(-50%);
    }

    .anime-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
        padding: 15px;
    }

    .anime-preview {
        height: 300px;
    }

    .search-input,
    .search-btn {
        padding: 12px 18px;
        border-radius: 12px;
    }

    .telegram-container {
        margin: 20px 0;
    }

    .telegram-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
        border-radius: 12px;
    }

    header::before,
    header::after {
        font-size: 1.5rem;
        top: 30%;
    }

    footer::before,
    footer::after {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 2.2rem;
        letter-spacing: 1px;
    }

    .logo::after {
        right: -20px;
        font-size: 1.2rem;
    }

    .tagline {
        font-size: 1rem;
    }

    .tagline::before,
    .tagline::after {
        margin: 0 5px;
        font-size: 0.8rem;
    }

    .anime-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
    }

    .anime-preview {
        height: 280px;
    }

    .anime-card:hover {
        transform: translateY(-5px) scale(1.01);
    }

    header {
        margin-bottom: 30px;
        padding: 20px 0;
    }

    .search-input,
    .search-btn {
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .telegram-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
        border-radius: 10px;
    }

    .telegram-icon {
        width: 18px;
        height: 18px;
    }

    header::before,
    header::after {
        display: none;
    }
}

/* Дополнительные новогодние анимации */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 107, 107, 0.6);
    }
}

/* Добавляем снежинки через JavaScript */
function createSnowflakes() {
    const snowflakesContainer = document.createElement('div');
    snowflakesContainer.className = 'snowflakes';
    document.body.appendChild(snowflakesContainer);

    for (let i = 0; i < 50; i++) {
        const snowflake = document.createElement('div');
        snowflake.className = 'snowflake';
        
        const size = Math.random() * 5 + 3;
        const left = Math.random() * 100;
        const duration = Math.random() * 5 + 5;
        const delay = Math.random() * 5;
        
        snowflake.style.width = `${size}px`;
        snowflake.style.height = `${size}px`;
        snowflake.style.left = `${left}vw`;
        snowflake.style.animationDuration = `${duration}s`;
        snowflake.style.animationDelay = `${delay}s`;
        snowflake.style.opacity = Math.random() * 0.5 + 0.3;
        
        snowflakesContainer.appendChild(snowflake);
    }
}

// Добавляем конфетти при клике
function createConfetti(x, y) {
    for (let i = 0; i < 20; i++) {
        const confetti = document.createElement('div');
        confetti.className = 'confetti';
        
        const colors = ['#FF6B6B', '#4ECDC4', '#45B7D1', '#FFD166', '#06D6A0'];
        const color = colors[Math.floor(Math.random() * colors.length)];
        
        confetti.style.left = `${x + Math.random() * 100 - 50}px`;
        confetti.style.top = `${y}px`;
        confetti.style.backgroundColor = color;
        confetti.style.width = `${Math.random() * 10 + 5}px`;
        confetti.style.height = `${Math.random() * 10 + 5}px`;
        confetti.style.borderRadius = Math.random() > 0.5 ? '50%' : '0';
        
        document.body.appendChild(confetti);
        
        setTimeout(() => {
            confetti.remove();
        }, 1000);
    }
}

// Инициализация новогодних эффектов
document.addEventListener('DOMContentLoaded', () => {
    createSnowflakes();
    
    // Добавляем конфетти при клике на кнопки
    document.querySelectorAll('button').forEach(button => {
        button.addEventListener('click', (e) => {
            createConfetti(e.clientX, e.clientY);
        });
    });
});
