﻿/* === ГЛОБАЛЬНЫЕ ОТКЛЮЧЕНИЯ АНИМАЦИЙ — без изменений === */
html.no-transitions *,
html.no-transitions *::before,
html.no-transitions *::after,
.drag-target,
.dragging,
html.loading * {
    transition: none !important;
    animation: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    will-change: auto !important;
}




/* === ЦВЕТОВЫЕ ТЕМЫ — без изменений === */
.theme-dark {
    --page-bg: #121212;
    --bg-main: #222;
    --text-color: #eee;
    --hover-bg: #333;
    --hover-text-color: #ddd;
    --hover-border-color: #ddd;
    --hover-bg-highlight: rgba(255, 255, 255, 0.1);
    --icon-color: #eee;
}

.theme-light,
body.light-mode {
    --page-bg: #f5f5f5;
    --bg-main: #fff;
    --text-color: #3d3c3c;
    --hover-bg: #ddd;
    --hover-text-color: #000;
    --hover-border-color: #000;
    --hover-bg-highlight: rgba(0, 0, 0, 0.1);
    --icon-color: #333;
}


/* === КРИТИЧЕСКИ ВАЖНЫЕ СВОЙСТВА ДЛЯ СКРОЛЛА === */
html {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}




/* === ФОН — ИСПРАВЛЕНО: clip-path и will-change === */
:root {
    --header-height: 44px;
}

body::before {
    content: "";
    position: relative;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    clip-path: inset(var(--header-height) 0 0 0);
    background: radial-gradient(circle at 20% 30%, rgba(0, 245, 255, 0.32), transparent 50%), radial-gradient(circle at 80% 60%, rgba(255, 30, 255, 0.32), transparent 50%);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    animation: liquid 12s infinite alternate;
    will-change: filter, background-position;
}

@keyframes liquid {
    0% {
        filter: blur(35px);
        background-position: 18% 28%, 82% 62%;
    }

    50% {
        filter: blur(55px);
        background-position: 22% 32%, 78% 58%;
    }

    100% {
        filter: blur(65px);
        background-position: 20% 30%, 80% 60%;
    }
}


/* === ШАБЛОННЫЙ БЛОК — СТАБИЛЬНОЕ ПОЗИЦИОНИРОВАНИЕ === */
.shablon {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(calc(25vh - 50%));
    font-size: 4rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 0 #ff005e, 5px 5px 0 #00d4ff, 0 0 20px #00d4ff;
    animation: premium3d 5s ease-in-out forwards;
    max-width: 90%;
    text-align: center;
    width: max-content;
    opacity: 1;
    transition: opacity 1s ease;
    z-index: 2;

}

    .shablon.hide {
        opacity: 0;
    }

    .shablon p {
        margin: 0;
    }

    .shablon .subtitle {
        font-size: 1.5rem;
        font-weight: 600;
        margin-top: 10px;
        color: #a0eaff;
        text-shadow: 1px 1px 3px #0099cc;
        opacity: 1;
        transition: opacity 1s ease;
    }

    .shablon.hide .subtitle {
        opacity: 0;
    }

    .shablon .highlight {
        color: #00d4ff;
        text-shadow: 2px 2px 6px #00b2d4;
        font-weight: 900;
        letter-spacing: 0.1em;
        transition: color 0.3s ease;
    }

        .shablon .highlight:hover {
            color: #ff005e;
            text-shadow: 2px 2px 8px #ff005e;
            cursor: default;
        }

@keyframes premium3d {
    0%, 100% {
        opacity: 0;
        transform: translateX(-50%) translateY(calc(25vh - 50%)) translateZ(-150px) scale(0.85);
    }

    30%, 70% {
        opacity: 1;
        transform: translateX(-50%) translateY(calc(25vh - 50%)) translateZ(0) scale(1);
    }
}


/* === КОНТЕНТ — без изменений === */
.image-description-section {
    
    margin-top: 300px;
    display: flex;
    gap: 20px;
}


/* === КНОПКИ В ШАПКЕ — без изменений === */
.auth-buttons,
.user-buttons {
    position: absolute;
    top: 10px;
    right: 80px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    font-size: 16px;
}

    .auth-buttons > *,
    .user-buttons > * {
        position: relative;
    }

        .auth-buttons > *:not(:last-child)::after,
        .user-buttons > *:not(:last-child)::after {
            content: "|";
            position: absolute;
            right: -12px;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-color);
            opacity: 0.6;
            pointer-events: none;
        }


/* === ОБЩИЕ СТИЛИ КНОПОК — без изменений === */
.login-button,
.register-button,
.profile-button,
.logout-button {
    background: none;
    border: none;
    padding: 6px 10px;
    color: var(--text-color);
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.3s, background-color 0.3s;
    display: inline-flex;
    align-items: center;
    border-radius: 4px;
    white-space: nowrap;
    position: relative;
}

.profile-button {
    padding-left: 30px;
}

    .profile-button::before {
        content: "";
        position: absolute;
        left: 6px;
        top: 50%;
        transform: translateY(-50%);
        width: 18px;
        height: 18px;
        background-color: var(--icon-color);
        mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/></svg>") center / contain no-repeat;
        -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/></svg>") center / contain no-repeat;
    }

    .login-button:hover,
    .register-button:hover,
    .profile-button:hover,
    .logout-button:hover {
        color: var(--hover-text-color);
        background-color: var(--hover-bg-highlight);
    }


/* === НОВОГОДНИЙ ТАЙМЕР — ПОЛНОСТЬЮ ИСПРАВЛЕН === */
.ny-timer {
    position: absolute;
    left: 50% !important;
    transform: translateX(-50%) !important;

    /* 🔥 КЛЮЧЕВОЕ ИСПРАВЛЕНИЕ */
    bottom: calc(env(safe-area-inset-bottom, 0px) + 12px) !important;
    top: 80%;

    width: 90%;
    max-width: 600px;
    padding: 24px;
    border-radius: 18px;
    background: rgba(0, 255, 180, 0.05);
    backdrop-filter: blur(4px);
    box-shadow: 0 0 20px rgba(0,255,180,.2);
    color: #fff;
    z-index: 5;
}

    .ny-timer h2 {
        font-size: 28px;
        margin-bottom: 25px;
        margin-left: 50px;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
        color: #ffd700;
    }

.timer {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.time-block {
    padding: 18px 22px;
    border-radius: 16px;
    min-width: 85px;
    box-shadow: 0 0 15px;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    z-index: 1;
}

    .time-block:nth-child(1) {
        background: radial-gradient(circle, #ff0000, #9b0000);
        box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    }

    .time-block:nth-child(2) {
        background: radial-gradient(circle, #00c853, #007e33);
        box-shadow: 0 0 15px rgba(0, 255, 120, 0.5);
    }

    .time-block:nth-child(3) {
        background: radial-gradient(circle, #2962ff, #0039cb);
        box-shadow: 0 0 15px rgba(0, 90, 255, 0.5);
    }

    .time-block:nth-child(4) {
        background: radial-gradient(circle, #ff9100, #c56200);
        box-shadow: 0 0 15px rgba(255, 150, 0, 0.6);
    }

    .time-block:hover {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.7);
    }

    .time-block span {
        font-size: 34px;
        font-weight: bold;
        display: block;
    }

    .time-block small {
        font-size: 12px;
        opacity: 0.9;
    }


/* === АДАПТИВНАЯ ВЕРСТКА — ИСПРАВЛЕНО: ТОЛЬКО bottom, НИКАКИХ top:100% === */
@media (max-width: 1024px) {
    body::before {
        clip-path: inset(var(--header-height) 0 0 0);
        background: radial-gradient(circle at 50% calc(25% + 40px), rgba(0, 255, 255, 0.15), transparent 35%), radial-gradient(circle at 70% calc(65% + 60px), rgba(255, 0, 255, 0.15), transparent 35%);
        animation: liquid-mobile 15s infinite alternate;
        filter: blur(30px);
    }

    @keyframes liquid-mobile {
        0% {
            filter: blur(30px);
        }

        100% {
            filter: blur(50px);
        }
    }

    /* ✅ ГЛАВНОЕ ИСПРАВЛЕНИЕ: Таймер внизу, без влияния на фон */
    .ny-timer {
        position: relative;
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 80%; /* ← критически важно */
        bottom: auto; /* сохраните или переопределите осмысленно */
        width: 100vw;
        font-size: 1.1rem;
    }

    .shablon {
        position: absolute;
        top: 10%;
        transform: translateX(-50%) translateY(calc(15vh - 50%));
        font-size: 2.5rem;
        width: 100vw;
    }

        .shablon .subtitle {
            font-size: 1.25rem;
            margin-top: 8px;
        }

    .auth-buttons,
    .user-buttons {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 0;
        justify-content: center;
        flex-wrap: wrap;
        font-size: 14px;
        gap: 12px;
    }

    .login-button,
    .register-button,
    .profile-button,
    .logout-button {
        font-size: 14px;
        padding: 6px 10px;
    }

    .profile-button {
        padding-left: 25px;
    }

        .profile-button::before {
            left: 10px;
            width: 14px;
            height: 14px;
        }

    .auth-buttons > *:not(:last-child)::after,
    .user-buttons > *:not(:last-child)::after {
        right: -10px;
    }
}
@media (max-width: 600px) {
    .ny-timer {
  
        left: 50% !important;
        transform: translateX(-50%) !important;
        top: 78%; /* ← критически важно */
        bottom: auto; /* сохраните или переопределите осмысленно */
        width: 100vw;
    }


        .ny-timer h2 {
            font-size: 20px;
            margin-bottom: 12px;
            margin-left: 16px;
        }

    .timer {
        gap: 6px;
    }

    .time-block {
        padding: 14px 16px;
        min-width: 65px;
    }

        .time-block span {
            font-size: 26px;
        }

    .shablon {
        transform: translateX(-50%) translateY(calc(15vh - 50%));
        font-size: 2.5rem;
    }

        .shablon .subtitle {
            font-size: 1.1rem;
        }
}
