/* ================================================================
   CSS-ПЕРЕМЕННЫЕ – НОВАЯ ЦВЕТОВАЯ СХЕМА (НА ОСНОВЕ ТВОЕЙ АВАТАРКИ)
   ================================================================ */
:root {
    /* Основной фон – градиент по всем 13 цветам (плавный переход) */
    --bg-gradient: linear-gradient(
        145deg,
        rgb(227, 0, 220) 0%,
        rgb(200, 0, 117) 10%,
        rgb(46, 0, 0) 20%,
        rgb(66, 0, 84) 30%,
        rgb(151, 0, 117) 40%,
        rgb(117, 0, 99) 50%,
        rgb(0, 0, 126) 60%,
        rgb(19, 0, 214) 70%,
        rgb(24, 0, 70) 80%,
        rgb(43, 0, 194) 85%,
        rgb(16, 0, 60) 90%,
        rgb(39, 0, 96) 95%,
        rgb(193, 0, 100) 100%
    );

    /* Панель – полупрозрачный фон с лёгким оттенком */
    --panel-bg: rgba(0, 0, 0, 0.7);
    --panel-border: rgba(227, 0, 220, 0.5);
    --panel-shadow: 0 15px 30px rgba(0, 0, 0, 0.8);

    /* Аватар */
    --avatar-border: rgb(227, 0, 220);
    --avatar-shadow: 0 0 30px rgba(227, 0, 220, 0.5), 0 0 60px rgba(200, 0, 117, 0.3);

    /* Текст */
    --text-primary: #fff;
    --text-secondary: #d4b0ff;

    /* Переключатель языков */
    --lang-bg: rgba(255, 255, 255, 0.1);
    --lang-slider-bg: rgba(227, 0, 220, 0.3);
    --lang-slider-shadow: 0 0 20px rgba(227, 0, 220, 0.3);
    --lang-btn-color: #ccc;
    --lang-btn-active-color: #e300dc;

    /* Плитки (НЕ ТРОГАЕМ – оставляем старые цвета) */
    /* Они заданы ниже в секции .link-tile */

    /* Кнопки внутри плиток – адаптируем под новую палитру */
    --btn-bg: rgba(255, 255, 255, 0.1);
    --btn-hover-bg: rgba(255, 255, 255, 0.2);

    /* Модальное окно */
    --modal-bg: rgba(0, 0, 0, 0.85);
    --modal-card-bg: rgba(20, 0, 40, 0.95);
    --modal-card-border: rgba(227, 0, 220, 0.4);

    --transition-speed: 0.3s;
}

/* ================================================================
   Базовые стили
   ================================================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-gradient);
    color: #eee;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 0;
    background-attachment: fixed;
}

/* ================================================================
   Оверлеи для фона (при наведении) – с прозрачностью через класс
   ================================================================ */
.hover-bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.4s ease;
    opacity: 0;
    /* Режим смешивания – можно выбрать screen, overlay или вообще убрать */
    mix-blend-mode: overlay;
    /* Размытие фона под оверлеем – даёт эффект стекла */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.hover-bg-overlay.active {
    opacity: 1; /* регулируй здесь прозрачность (0.3 – 0.9) */
}

.hover-bg-icon {
    position: fixed;
    top: 40%;
    left: 75%;
    transform: translate(-50%, -50%);
    font-size: 280px;
    z-index: 0;
    pointer-events: none;
    color: #fff;
    mix-blend-mode: screen;
}

.hover-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.6s ease, filter 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    filter: blur(12px);
}

.hover-bg-layer.active {
    opacity: 0.4; /* прозрачность логотипа */
    filter: blur(0px);
}

/* ================================================================
   Контейнер и панели
   ================================================================ */
.container {
    display: flex;
    gap: 30px;
    max-width: 1100px;
    width: 100%;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.left-panel {
    flex: 0 0 290px;
    background: var(--panel-bg);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    padding: 30px 25px;
    border: 2px solid var(--panel-border);
    box-shadow: var(--panel-shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 450px;
}

.avatar {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 16px;
    border: 3px solid var(--avatar-border);
    box-shadow: var(--avatar-shadow);
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 20px rgba(227, 0, 220, 0.4), 0 0 40px rgba(200, 0, 117, 0.2); }
    50% { box-shadow: 0 0 40px rgba(227, 0, 220, 0.8), 0 0 80px rgba(43, 0, 194, 0.4); }
    100% { box-shadow: 0 0 20px rgba(227, 0, 220, 0.4), 0 0 40px rgba(200, 0, 117, 0.2); }
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.left-panel h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(227, 0, 220, 0.3);
}
.left-panel .description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
    flex: 1;
}

/* ================================================================
   Переключатель языков
   ================================================================ */
.lang-switch {
    margin-top: auto;
    display: flex;
    position: relative;
    background: var(--lang-bg);
    border-radius: 20px;
    padding: 3px;
    backdrop-filter: blur(5px);
    gap: 5px;
}
.lang-btn {
    background: transparent;
    border: none;
    color: var(--lang-btn-color);
    padding: 6px 14px;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    position: relative;
    z-index: 1;
    transition: color var(--transition-speed) ease, transform 0.2s ease;
}
.lang-btn:active { transform: scale(0.95); }
.lang-btn.active {
    color: var(--lang-btn-active-color);
    text-shadow: 0 0 15px rgba(227, 0, 220, 0.6);
}
.lang-slider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 0;
    width: 30px;
    background: var(--lang-slider-bg);
    border-radius: 18px;
    box-shadow: var(--lang-slider-shadow);
    transition: left 0.35s cubic-bezier(0.68, -0.25, 0.265, 1.25),
                width 0.35s cubic-bezier(0.68, -0.25, 0.265, 1.25);
    z-index: 0;
}

/* ================================================================
   Кнопки внутри плиток (копировать / подробнее) – с фикс. шириной и анимацией
   ================================================================ */
.link-tile .actions button {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.7rem;
    color: #eee;
    cursor: pointer;
    transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    font-weight: 500;
    min-height: 30px;
    white-space: nowrap;
    width: auto;
    min-width: 40px;
    box-sizing: border-box;
}

.link-tile .actions button .i18n-text {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* ================================================================
   Правая панель – сетка ссылок
   ================================================================ */
.right-panel {
    flex: 1;
    min-width: 0;
}
.links-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ================================================================
   Плитки – стекло + аддитивность + размытие
   ================================================================ */
.link-tile {
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    padding: 20px 10px 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-decoration: none;
    transition: all var(--transition-speed) ease;
    text-align: center;
    gap: 8px;
    min-height: 140px;
    cursor: pointer;
    position: relative;

    /* Аддитивное наложение */
    mix-blend-mode: screen;
    color: #fff;
    text-shadow: 0 0 12px rgba(0,0,0,0.6);
}

.link-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(12px);
}

.link-tile .icon {
    font-size: 2rem;
    width: 40px;
    height: 40px;
    pointer-events: none;
    filter: drop-shadow(0 0 8px rgba(0,0,0,0.5));
}

.link-tile .title {
    font-weight: 600;
    font-size: 1rem;
    pointer-events: none;
    margin-bottom: auto;
    color: #fff;
    text-shadow: 0 0 14px rgba(0,0,0,0.7);
}

/* ================================================================
   Кнопки внутри плиток (копировать / подробнее)
   ================================================================ */
.link-tile .actions {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding: 0 4px;
}

.link-tile .actions button {
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 8px;
    padding: 5px 12px;
    font-size: 0.7rem;
    color: #eee;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-family: inherit;
    font-weight: 500;
    min-height: 30px;
    min-width: 36px;
    white-space: nowrap;
}

.link-tile .actions button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.link-tile .actions .copy-btn i {
    font-size: 0.9rem;
}

/* ================================================================
   ЦВЕТА ПЛИТОК (акцентные границы и лёгкие оттенки)
   ================================================================ */
.link-tile.youtube .icon { color: #FF0000; }
.link-tile.youtube { border-color: rgba(255, 0, 0, 0.3); background: rgba(255, 0, 0, 0.15); }

.link-tile.pinterest .icon { color: #e60060; }
.link-tile.pinterest { border-color: rgba(230, 0, 96, 0.3); background: rgba(230, 0, 96, 0.15); }

.link-tile.telegram .icon { color: #0088CC; }
.link-tile.telegram { border-color: rgba(0, 136, 204, 0.3); background: rgba(0, 136, 204, 0.15); }

.link-tile.bluesky .icon { color: #0560FF; }
.link-tile.bluesky { border-color: rgba(5, 96, 255, 0.3); background: rgba(5, 96, 255, 0.15); }

.link-tile.ibis .icon { color: #0560FF; }
.link-tile.ibis { border-color: rgba(5, 96, 255, 0.3); background: rgba(5, 96, 255, 0.15); }

.link-tile.github .icon { color: #ffffff; }
.link-tile.github { border-color: rgba(255, 255, 255, 0.2); background: rgba(51, 51, 51, 0.3); }

.link-tile.discord .icon { color: #5865F2; }
.link-tile.discord { border-color: rgba(88, 101, 242, 0.3); background: rgba(88, 101, 242, 0.15); }

.link-tile.steam .icon { color: #5b728d; }
.link-tile.steam { border-color: rgba(91, 114, 141, 0.3); background: rgba(0, 17, 58, 0.25); }

.link-tile.tiktok .icon { color: #ffffff; }
.link-tile.tiktok { border-color: rgba(255, 255, 255, 0.15); background: rgba(0, 0, 0, 0.15); }

.link-tile.itchio .icon { color: #FA5C5C; }
.link-tile.itchio { border-color: rgba(250, 92, 92, 0.3); background: rgba(250, 92, 92, 0.15); }

/* ================================================================
   GIF-заглушки
   ================================================================ */
.gif-placeholder {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    min-height: 140px;
    transition: background 0.3s;
}
.gif-placeholder:hover { background: rgba(255, 255, 255, 0.08); }
.gif-placeholder img {
    max-width: 80%;
    max-height: 70px;
    border-radius: 12px;
    object-fit: contain;
}
.gif-placeholder .desc {
    font-size: 0.8rem;
    opacity: 0.6;
}

/* ================================================================
   Модальное окно
   ================================================================ */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-bg);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

.modal.closing {
    animation: fadeOut 0.25s ease forwards;
}

.modal-content {
    background: var(--modal-card-bg);
    border: 1px solid var(--modal-card-border);
    border-radius: 24px;
    padding: 30px 35px;
    max-width: 420px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    position: relative;
}

.modal.active .modal-content {
    animation: slideUp 0.3s ease forwards;
}

.modal.closing .modal-content {
    animation: slideDown 0.25s ease forwards;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 18px;
    font-size: 2rem;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s ease;
    line-height: 1;
}
.modal-close:hover { color: #fff; }

#modalBody {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
#modalBody .modal-icon {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 4px;
}
#modalBody .modal-title {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    color: #fff;
}
#modalBody .modal-desc {
    font-size: 0.95rem;
    color: #ccc;
    line-height: 1.6;
    text-align: center;
}
#modalBody .modal-link {
    display: inline-block;
    background: rgba(255, 255, 255, 0.08);
    padding: 10px 16px;
    border-radius: 12px;
    color: #4d6bfe;
    text-decoration: none;
    text-align: center;
    font-weight: 500;
    transition: background 0.2s;
}
#modalBody .modal-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes slideDown {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(30px) scale(0.95); }
}

/* ================================================================
   Адаптивность
   ================================================================ */
@media (max-width: 768px) {
    .container { flex-direction: column; align-items: center; }
    .left-panel { flex: 0 0 auto; width: 100%; max-width: 400px; min-height: auto; margin-bottom: 20px; }
    .right-panel { width: 100%; max-width: 600px; }
    .lang-switch { margin-top: 20px; }
    .links-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .right-panel { max-width: 100%; }
    .links-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .modal-content { padding: 20px; }
    .link-tile .actions button { font-size: 0.6rem; padding: 4px 8px; min-height: 26px; min-width: 30px; }
}

/* ================================================================
   Анимация переключения текста
   ================================================================ */
.i18n-text {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.i18n-text.fading-out {
    opacity: 0 !important;
    transform: translateY(-5px);
}

/* ================================================================
   РАЗМЫТИЕ ДЛЯ ШЕЙДЕРНОГО ФОНА
   ================================================================ */
#bgShader {
    filter: blur(20px);
    -webkit-filter: blur(20px);
    transform: scale(0.95);
    transform-origin: center center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -2;
    pointer-events: none;
    display: block;
    background: #0a0a0a;
    animation: vignettePulse 6s ease-in-out infinite;
}

/* Анимация виньетки */
@keyframes vignettePulse {
    0% {
        transform: scale(0.92);
        filter: blur(16px) brightness(1.0);
        -webkit-filter: blur(16px) brightness(1.0);
    }
    50% {
        transform: scale(0.96);
        filter: blur(22px) brightness(1.1);
        -webkit-filter: blur(22px) brightness(1.1);
    }
    100% {
        transform: scale(0.92);
        filter: blur(16px) brightness(1.0);
        -webkit-filter: blur(16px) brightness(1.0);
    }
}

#trailCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: -1;
}