:root {
    --bg-main:          #05050a;
    --bg-panel:         rgba(12, 12, 18, 0.72);
    --bg-hover:         #141420;

    --text-primary:     #f0f0f4;
    --text-muted:       #6e6e80;
    --text-dim:         #32323f;

    --border-color:     rgba(255, 255, 255, 0.06);
    --border-hover:     rgba(255, 255, 255, 0.12);
    --border-focus:     rgba(255, 255, 255, 0.28);

    --accent:           #ffffff;
    --accent-dim:       rgba(255, 255, 255, 0.07);

    --error:            #ff4444;
    --error-glow:       rgba(255, 68, 68, 0.2);

    --radius-xl:        30px;
    --radius-lg:        20px;
    --radius-md:        13px;
    --radius-sm:        8px;

    --font-sans:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-size-xs:     11.5px;
    --font-size-sm:     13px;
    --font-size-md:     14.5px;
    --font-size-lg:     16px;
    --font-size-xl:     1.2rem;
    --font-size-2xl:    1.4rem;
    --font-size-4xl:    2.6rem;

    --space-1:  4px;
    --space-2:  8px;
    --space-3:  12px;
    --space-4:  16px;
    --space-5:  22px;
    --space-6:  28px;
    --space-8:  32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-14: 56px;

    --shadow-sm:    0 2px 10px -4px rgba(0, 0, 0, 0.5);
    --shadow-md:    0 10px 28px -8px rgba(0, 0, 0, 0.6);
    --shadow-lg:    0 36px 72px -18px rgba(0, 0, 0, 0.8);
    --shadow-inset: 0 0 0 0.5px rgba(255, 255, 255, 0.035) inset;

    --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-out:    cubic-bezier(0.0, 0.0, 0.2, 1);
    --transition:      all 0.45s var(--ease-spring);
    --transition-fast: all 0.22s var(--ease-spring);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

::-webkit-scrollbar          { width: 5px; }
::-webkit-scrollbar-track    { background: transparent; }
::-webkit-scrollbar-thumb    { background: var(--border-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.22); }

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    opacity: 0;
    transition: opacity 0.6s var(--ease-out);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body.loaded   { opacity: 1; }
body.fade-out { opacity: 0; }

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    pointer-events: none;
}

/* ═══════════════════════════════════════
   BACKGROUND GLOWS
═══════════════════════════════════════ */

.bg-glow {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    border-radius: 50%;
    filter: blur(90px);
    will-change: transform, opacity;
}

.bg-glow-1 {
    top: -15%;
    left: 18%;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(255,255,255,0.025) 0%, transparent 65%);
    /* NEW: orbitalFloat заменяет старый driftGlow1 */
    animation: orbitalFloat1 14s ease-in-out infinite alternate;
}

.bg-glow-2 {
    bottom: 8%;
    right: 12%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(180,180,255,0.018) 0%, transparent 65%);
    /* NEW: orbitalFloat заменяет старый driftGlow2 */
    animation: orbitalFloat2 18s ease-in-out infinite alternate;
}

.bg-glow-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, rgba(255,255,255,0.012) 0%, transparent 55%);
    animation: breathe 20s ease-in-out infinite alternate;
}

/* ═══════════════════════════════════════
   NAVBAR
═══════════════════════════════════════ */

.navbar {
    width: 100%;
    background: rgba(5, 5, 10, 0.88);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-bottom: 1px solid var(--border-color);
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 66px;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.logo {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    z-index: 1002;
}

.logo img {
    height: 42px;
    transition: opacity 0.2s ease, transform 0.3s var(--ease-spring);
}

.logo img:hover {
    opacity: 0.85;
    transform: scale(1.04);
}

.nav-links {
    display: flex;
    gap: 4px;
    align-items: center;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--font-size-md);
    font-weight: 400;
    letter-spacing: 0.012em;
    padding: var(--space-2) 14px;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 14px;
    height: 1px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: transform 0.35s var(--ease-spring);
}

.nav-links a:hover,
.nav-links a:focus-visible {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.038);
    outline: none;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
    transform: translateX(-50%) scaleX(1);
}

.menu-btn {
    display: none;
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 26px;
    cursor: pointer;
    z-index: 1002;
    color: var(--text-primary);
    transition: var(--transition-fast);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: none;
    border: none;
}

.menu-btn:hover,
.menu-btn:focus-visible {
    background: rgba(255, 255, 255, 0.055);
    outline: none;
}

/* ═══════════════════════════════════════
   CONTAINER
═══════════════════════════════════════ */

.container {
    background: var(--bg-panel);
    backdrop-filter: blur(36px) saturate(180%);
    -webkit-backdrop-filter: blur(36px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-14) 44px;
    margin-top: 8vh;
    width: 90%;
    max-width: 460px;
    text-align: center;
    box-shadow:
        var(--shadow-inset),
        var(--shadow-lg),
        0 0 0 0.5px rgba(0,0,0,0.4);
    animation: revealUp 1s var(--ease-spring) both;
    position: relative;
    overflow: hidden;
    /* NEW: живая граница */
    animation: revealUp 1s var(--ease-spring) both, morphBorder 4s ease-in-out 1.2s infinite;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 100%
    );
    pointer-events: none;
}

.container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30%;
    right: 30%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 100%
    );
    pointer-events: none;
}

.container h2 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    margin-bottom: var(--space-5);
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

/* ═══════════════════════════════════════
   TITLE  (+ NEW glitch-эффект)
═══════════════════════════════════════ */

.title {
    font-size: var(--font-size-4xl);
    font-weight: 800;
    margin-bottom: var(--space-12);
    color: var(--text-primary);
    letter-spacing: -0.045em;
    line-height: 1.04;
    position: relative;
    display: inline-block;
    /* NEW: периодический глитч */
    animation: glitchFlicker 7s infinite;
}

.title::after {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #ffffff 0%, #909090 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.title:hover::after { opacity: 0.35; }

/* NEW: глитч-срезы через псевдоэлемент — добавляем data-text в HTML: <h1 class="title" data-text="..."> */
.title[data-text]::before {
    content: attr(data-text);
    position: absolute;
    inset: 0;
    color: #ff4488;
    clip-path: polygon(0 28%, 100% 28%, 100% 46%, 0 46%);
    animation: glitchSliceA 7s infinite;
    pointer-events: none;
    -webkit-text-fill-color: #ff4488;
    background: none;
    opacity: 0;
}

/* ═══════════════════════════════════════
   BUTTONS
═══════════════════════════════════════ */

.buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.btn {
    background: rgba(255, 255, 255, 0.022);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 16px 24px;
    font-size: var(--font-size-md);
    font-weight: 400;
    letter-spacing: 0.012em;
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-decoration: none;
    width: 100%;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    opacity: 0;
    transform: translateY(18px);
    animation: revealUp 0.7s var(--ease-spring) both;
    animation-delay: calc(var(--anim-order, 0) * 0.08s + 0.15s);
    position: relative;
    overflow: hidden;
    will-change: transform;
}

/* NEW: бегущий свет — shimmerScan */
.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -110%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.07),
        transparent
    );
    animation: shimmerScan 3.2s var(--ease-spring) infinite;
    pointer-events: none;
}

/* NEW: верхний блик при hover */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg,
        rgba(255,255,255,0.06) 0%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.btn:hover,
.btn:focus-visible {
    background: rgba(255, 255, 255, 0.048);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow:
        var(--shadow-md),
        0 0 0 0.5px rgba(255,255,255,0.04) inset;
    outline: none;
}

.btn:hover::after,
.btn:focus-visible::after { opacity: 1; }

/* NEW: ripple-волна при клике */
.btn:active::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: waveRipple 0.55s var(--ease-out) forwards;
    /* ripple перекрывает shimmer при :active */
    background: radial-gradient(circle, rgba(255,255,255,0.22), transparent);
}

.btn:active {
    transform: translateY(1px) scale(0.98);
    transition: all 0.1s ease;
    box-shadow: none;
}

/* ═══════════════════════════════════════
   INPUT
═══════════════════════════════════════ */

.input-field {
    padding: 16px 22px;
    font-size: var(--font-size-md);
    font-weight: 400;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    background-color: rgba(255, 255, 255, 0.022);
    color: var(--text-primary);
    margin-bottom: 10px;
    outline: none;
    transition: var(--transition);
    caret-color: var(--accent);
    /* NEW: курсор мигает отдельной анимацией уже нативно,
       но добавляем тонкий pulse при появлении */
    animation: inputAppear 0.5s var(--ease-spring) both;
}

.input-field::placeholder { color: var(--text-dim); }

.input-field:focus,
.input-field:focus-visible {
    border-color: var(--border-focus);
    background-color: rgba(255, 255, 255, 0.038);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.042);
}

/* ═══════════════════════════════════════
   MISC COMPONENTS
═══════════════════════════════════════ */

.mini-info {
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    margin-bottom: var(--space-5);
    line-height: 1.55;
}

.result-box {
    margin-top: var(--space-5);
    padding: var(--space-5);
    background-color: rgba(255, 255, 255, 0.025);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.06);
    font-size: var(--font-size-md);
    color: var(--text-muted);
    animation: revealUp 0.5s var(--ease-spring) both;
    text-align: left;
    line-height: 1.65;
}

.result-box strong {
    color: var(--text-primary);
    font-weight: 500;
}

/* ═══════════════════════════════════════
   MODAL
═══════════════════════════════════════ */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal[style*="flex"] { animation: fadeIn 0.2s ease-out; }

.modal-content {
    background: rgba(10, 10, 16, 0.96);
    border: 1px solid var(--border-color);
    border-top-color: rgba(255, 255, 255, 0.1);
    padding: var(--space-10) 36px;
    border-radius: var(--radius-xl);
    text-align: center;
    max-width: 360px;
    width: 90%;
    box-shadow:
        var(--shadow-inset),
        0 40px 80px -16px rgba(0, 0, 0, 0.95);
    /* NEW: popIn вместо scaleReveal */
    animation: popIn 0.55s var(--ease-spring);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.14), transparent);
    pointer-events: none;
}

.modal-content p {
    font-size: 15px;
    margin-bottom: var(--space-6);
    line-height: 1.65;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   INFO PANELS
═══════════════════════════════════════ */

.info-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    width: 90%;
    max-width: 460px;
    margin: 3vh auto 0;
    z-index: 10;
    padding-bottom: 60px;
}

.dynamic-panel {
    display: block;
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    text-decoration: none;
    border: 1px solid var(--border-color);
    background-color: var(--bg-panel);
    background-size: cover;
    background-position: center;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    animation: revealUp 0.9s var(--ease-spring) both;
    will-change: transform;
    /* NEW: 3D-перспектива для magneticPull */
    perspective: 800px;
    transform-style: preserve-3d;
}

/* NEW: magneticPull — 3D-наклон при hover */
.dynamic-panel:hover,
.dynamic-panel:focus-visible {
    transform: translateY(-6px) rotateX(3deg) rotateY(-1.5deg);
    border-color: var(--border-hover);
    box-shadow:
        0 28px 56px -14px rgba(0, 0, 0, 0.7),
        0 0 0 0.5px rgba(255,255,255,0.05) inset;
    outline: none;
}

.dynamic-panel:hover .panel-arrow,
.dynamic-panel:focus-visible .panel-arrow {
    transform: translateY(-50%) translateX(5px);
    opacity: 0.85;
}

.dynamic-panel .panel-content {
    background: linear-gradient(140deg,
        rgba(5, 5, 10, 0.82) 0%,
        rgba(14, 14, 24, 0.58) 100%
    );
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: var(--space-6) 30px;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    position: relative;
}

.dynamic-panel h2 {
    margin: 0 0 5px;
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.dynamic-panel p {
    margin: 0;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: 1.55;
    font-weight: 400;
}

.panel-arrow {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.25;
    transition: var(--transition);
    font-size: 17px;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   SEASONS / PARTICLES
═══════════════════════════════════════ */

#season-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.particle {
    position: absolute;
    top: -20px;
    pointer-events: none;
    will-change: transform, opacity;
}

.winter-particle {
    background: rgba(255, 255, 255, 0.65);
    border-radius: 50%;
    animation: fallDrift linear infinite;
}

.spring-particle {
    background: #ffb7c5;
    border-radius: 50% 0 50% 0;
    animation: fallAndSway linear infinite;
}

.summer-particle {
    background: rgba(253, 253, 150, 0.55);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(253, 253, 150, 0.35);
    animation: floatUp ease-in-out infinite;
}

.autumn-particle {
    background: #c85a22;
    border-radius: 0 50% 50% 50%;
    animation: fallAndSpin linear infinite;
}

/* ═══════════════════════════════════════
   LOADER
═══════════════════════════════════════ */

.loader-container {
    display: none;
    justify-content: center;
    align-items: center;
    margin-top: var(--space-5);
    gap: 14px;
    animation: fadeIn 0.35s ease-out;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.75s cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite;
    will-change: transform;
}

.loader-text {
    color: var(--text-muted);
    font-size: var(--font-size-md);
    font-weight: 400;
    animation: pulseText 2s ease-in-out infinite alternate;
    letter-spacing: 0.01em;
}

/* ═══════════════════════════════════════
   LIMIT EXCEEDED
═══════════════════════════════════════ */

.limit-exceeded {
    color: var(--error) !important;
    text-shadow: 0 0 10px var(--error-glow);
    cursor: help;
    position: relative;
    display: inline-block;
}

.limit-exceeded::after {
    content: "Количество разбанов исчерпано у игрока";
    position: absolute;
    bottom: calc(100% + 14px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(10, 10, 16, 0.96);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 9px 16px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    white-space: nowrap;
    z-index: 200;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.28s var(--ease-spring), visibility 0.22s;
}

.limit-exceeded::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--border-color);
    z-index: 201;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s;
    pointer-events: none;
}

.limit-exceeded:hover::after,
.limit-exceeded:focus::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.limit-exceeded:hover::before,
.limit-exceeded:focus::before {
    opacity: 1;
    visibility: visible;
}

/* ═══════════════════════════════════════
   SIDE PANEL
═══════════════════════════════════════ */

.interactive-side-panel {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
}

.side-panel-trigger {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-left: none;
    padding: 15px 8px;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    backdrop-filter: blur(20px);
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    writing-mode: vertical-lr;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    user-select: none;
}

.side-panel-content {
    width: 0;
    height: auto;
    max-height: 80vh;
    overflow: hidden;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-left: none;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), padding 0.4s;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    backdrop-filter: blur(25px);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    box-shadow: var(--shadow-lg);
}

.interactive-side-panel:hover .side-panel-content,
.interactive-side-panel.active .side-panel-content {
    width: 140px;
    padding: 20px 10px;
}

.interactive-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    gap: 8px;
    transition: 0.2s;
    text-align: center;
}

.interactive-item:hover {
    transform: scale(1.05);
}

.interactive-item img {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-md);
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.interactive-item span {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-muted);
}

/* ═══════════════════════════════════════
   ██  ANIMATIONS  ██
═══════════════════════════════════════ */

/* ── Оригинальные ── */

@keyframes revealUp {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.975);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes breathe {
    from { transform: translate(-50%, -50%) scale(0.95); opacity: 0.8; }
    to   { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fallDrift {
    0%   { transform: translateY(-20px)  translateX(0); }
    50%  { transform: translateY(50vh)   translateX(14px); }
    100% { transform: translateY(110vh)  translateX(-6px); }
}

@keyframes fallAndSway {
    0%   { transform: translateY(-10px)  translateX(0)     rotate(0deg); }
    33%  { transform: translateY(33vh)   translateX(22px)  rotate(115deg); }
    66%  { transform: translateY(66vh)   translateX(-14px) rotate(235deg); }
    100% { transform: translateY(110vh)  translateX(8px)   rotate(360deg); }
}

@keyframes floatUp {
    0%   { transform: translateY(110vh) scale(0)   rotate(0deg);   opacity: 0; }
    20%  {                                                          opacity: 0.65; }
    80%  {                                                          opacity: 0.35; }
    100% { transform: translateY(-10px) scale(1.8) rotate(180deg); opacity: 0; }
}

@keyframes fallAndSpin {
    0%   { transform: translateY(-10px) rotate(0deg)    scale(1); }
    100% { transform: translateY(110vh) rotate(1080deg) scale(0.4); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulseText {
    from { opacity: 0.45; }
    to   { opacity: 1; }
}

@keyframes idleFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-9px); }
}

/* ── NEW 1: shimmerScan — бегущий свет на кнопках ── */
@keyframes shimmerScan {
    0%   { left: -110%; }
    55%  { left: 130%; }
    100% { left: 130%; }
}

/* ── NEW 2: glitchFlicker — глитч-мерцание заголовка ── */
@keyframes glitchFlicker {
    0%, 79%, 81%, 83%, 100% {
        opacity: 1;
        transform: skewX(0deg);
        filter: none;
    }
    80% {
        opacity: 0.92;
        transform: skewX(-3deg) translateX(2px);
        filter: brightness(1.2);
    }
    82% {
        opacity: 0.85;
        transform: skewX(2deg) translateX(-2px);
        filter: brightness(0.9);
    }
}

/* ── NEW 3: glitchSliceA — цветной срез A (розовый) ── */
@keyframes glitchSliceA {
    0%, 79%, 84%, 100% {
        transform: translateX(0);
        opacity: 0;
    }
    80%, 82% {
        transform: translateX(-5px);
        opacity: 0.75;
    }
    81%, 83% {
        transform: translateX(3px);
        opacity: 0.55;
    }
}

/* ── NEW 4: glitchSliceB — цветной срез B (бирюзовый) ── */
@keyframes glitchSliceB {
    0%, 79%, 84%, 100% {
        transform: translateX(0);
        opacity: 0;
    }
    80%, 82% {
        transform: translateX(5px);
        opacity: 0.65;
    }
    81%, 83% {
        transform: translateX(-3px);
        opacity: 0.45;
    }
}

/* ── NEW 5: morphBorder — живая пульсация границы контейнера ── */
@keyframes morphBorder {
    0%, 100% {
        border-color: rgba(255, 255, 255, 0.06);
        box-shadow:
            var(--shadow-inset),
            var(--shadow-lg),
            0 0 0 0.5px rgba(0, 0, 0, 0.4);
    }
    50% {
        border-color: rgba(255, 255, 255, 0.16);
        box-shadow:
            var(--shadow-inset),
            var(--shadow-lg),
            0 0 0 0.5px rgba(0, 0, 0, 0.4),
            0 0 32px -8px rgba(255, 255, 255, 0.06),
            0 0 0 3px rgba(255, 255, 255, 0.025);
    }
}

/* ── NEW 6: popIn — пружинное появление (модал, бейджи, карточки) ── */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.72) translateY(12px);
        filter: blur(4px);
    }
    65% {
        transform: scale(1.04) translateY(-3px);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

/* ── NEW 7: orbitalFloat1 — орбитальный дрейф bg-glow-1 ── */
@keyframes orbitalFloat1 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.8;
    }
    33% {
        transform: translate(28px, 18px) scale(1.08) rotate(4deg);
    }
    66% {
        transform: translate(44px, -10px) scale(1.14) rotate(-2deg);
    }
    100% {
        transform: translate(20px, 36px) scale(1.2) rotate(6deg);
        opacity: 1;
    }
}

/* ── NEW 8: orbitalFloat2 — орбитальный дрейф bg-glow-2 ── */
@keyframes orbitalFloat2 {
    0% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 0.7;
    }
    33% {
        transform: translate(-22px, -30px) scale(1.1) rotate(-5deg);
    }
    66% {
        transform: translate(-36px, 12px) scale(1.18) rotate(3deg);
    }
    100% {
        transform: translate(-18px, -44px) scale(1.24) rotate(-7deg);
        opacity: 1;
    }
}

/* ── NEW 9: waveRipple — волна-ripple при клике на btn ── */
@keyframes waveRipple {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(30);
        opacity: 0;
    }
}

/* ── NEW 10: inputAppear — мягкое появление инпута ── */
@keyframes inputAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
        border-color: rgba(255, 255, 255, 0);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        border-color: var(--border-color);
    }
}

/* ── NEW 11: scanLine — сканирующая горизонтальная линия (опционально, добавь класс .scan-effect) ── */
@keyframes scanLine {
    0%   { top: -2px; opacity: 0; }
    5%   { opacity: 0.4; }
    95%  { opacity: 0.15; }
    100% { top: 100%; opacity: 0; }
}

.scan-effect {
    position: relative;
    overflow: hidden;
}

.scan-effect::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.25) 30%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0.25) 70%,
        transparent 100%
    );
    animation: scanLine 4s linear infinite;
    pointer-events: none;
    z-index: 10;
}

/* ── NEW 12: floatBadge — всплывающий тег/бейдж ── */
@keyframes floatBadge {
    0%, 100% {
        transform: translateY(0) rotate(-1deg);
    }
    50% {
        transform: translateY(-6px) rotate(1deg);
    }
}

.float-badge {
    animation: floatBadge 3.5s ease-in-out infinite;
}

/* ── NEW 13: borderTrace — обводка-трассировка (для акцентных блоков) ── */
@keyframes borderTrace {
    0%   { clip-path: inset(0 100% 98% 0); }
    25%  { clip-path: inset(0 0 98% 0); }
    50%  { clip-path: inset(0 0 0 98%); }
    75%  { clip-path: inset(98% 0 0 0); }
    100% { clip-path: inset(0 100% 0 0); }
}

.border-trace {
    position: relative;
}

.border-trace::before {
    content: '';
    position: absolute;
    inset: -1px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: inherit;
    animation: borderTrace 2.5s linear infinite;
    pointer-events: none;
}

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */

@media (max-width: 768px) {
    .menu-btn { display: flex; }

    .nav-links {
        position: fixed;
        top: 0;
        left: -100%;
        width: 260px;
        height: 100vh;
        background: rgba(5, 5, 10, 0.98);
        backdrop-filter: blur(28px);
        flex-direction: column;
        padding: 88px 0 40px;
        transition: left 0.48s var(--ease-spring);
        z-index: 1001;
        border-right: 1px solid var(--border-color);
        align-items: flex-start;
        gap: 0;
    }

    .nav-links.active { left: 0; }

    .nav-links a {
        width: 100%;
        padding: var(--space-4) 28px;
        border-radius: 0;
        font-size: var(--font-size-lg);
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links a::after { display: none; }

    .buttons { gap: 9px; }

    .btn,
    .input-field { width: 100%; }

    .main-card,
    .container {
        width: 92%;
        padding: var(--space-8) 22px;
        margin: 14px auto;
    }

    .dynamic-panel { width: 100%; margin: 6px 0; }

    .title { font-size: 2.1rem; }

    .interactive-side-panel {
        top: auto;
        bottom: 100px;
        transform: none;
    }

    .interactive-side-panel:hover .side-panel-content,
    .interactive-side-panel.active .side-panel-content {
        width: 110px;
    }

    .interactive-item img {
        width: 60px;
        height: 60px;
    }

    .side-panel-trigger {
        padding: 12px 6px;
        font-size: 10px;
    }
}