/* =============================================
   STRANGER THINGS ANIMATION
   ============================================= */

/* Stranger Things - Red storm glow */
.stranger-things-overlay {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 98;
}

/* Только для тёмной темы */
html.stranger-things-enabled[data-theme="dark-mode"] .stranger-things-overlay {
    display: block;
}

/* Переключение логотипов */
.logo-stranger {
    display: none;
}

html.stranger-things-enabled[data-theme="dark-mode"] .logo-default {
    display: none;
}

html.stranger-things-enabled[data-theme="dark-mode"] .logo-stranger {
    display: block;
}

.stranger-storm {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse 120% 120% at 50% -40%, rgba(139, 0, 0, 0.6) 0%, transparent 50%),
        radial-gradient(ellipse 80% 100% at 20% -20%, rgba(178, 34, 34, 0.4) 0%, transparent 45%),
        radial-gradient(ellipse 80% 100% at 80% -20%, rgba(178, 34, 34, 0.4) 0%, transparent 45%);
    animation: stormPulse 3s ease-in-out infinite;
}

/* Lightning container */
.stranger-lightning {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* Lightning bolts */
.lightning-bolt {
    position: absolute;
    width: 2px;
    height: 0;
    background: linear-gradient(to bottom,
        transparent,
        rgba(255, 80, 80, 0.8),
        rgba(255, 200, 200, 1),
        rgba(255, 80, 80, 0.8),
        transparent);
    opacity: 0;
    filter: blur(0.5px);
    box-shadow:
        0 0 8px 3px rgba(255, 100, 100, 0.9),
        0 0 16px 6px rgba(255, 50, 50, 0.7),
        0 0 24px 8px rgba(139, 0, 0, 0.5);
}

.lightning-bolt::before {
    content: '';
    position: absolute;
    top: 30%;
    left: -6px;
    width: 2px;
    height: 50%;
    background: inherit;
    transform: rotate(-20deg);
    filter: blur(0.5px);
}

.lightning-bolt::after {
    content: '';
    position: absolute;
    top: 40%;
    right: -6px;
    width: 2px;
    height: 40%;
    background: inherit;
    transform: rotate(25deg);
    filter: blur(0.5px);
}

.lightning-bolt.strike {
    animation: lightningStrike 0.15s ease-out forwards;
}

/* Flash effect during lightning */
.lightning-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse 100% 120% at 50% -20%, rgba(255, 80, 80, 0.5) 0%, transparent 50%);
    opacity: 0;
}

.lightning-flash.active {
    animation: flashBurst 0.25s ease-out forwards;
}

@keyframes stormPulse {
    0%, 100% {
        opacity: 0.7;
        filter: brightness(1) saturate(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.3) saturate(1.2);
    }
}

@keyframes lightningStrike {
    0% {
        height: 0;
        opacity: 0;
        top: -10px;
    }
    15% {
        opacity: 1;
    }
    40% {
        height: 120%;
        opacity: 1;
    }
    100% {
        height: 120%;
        opacity: 0;
    }
}

@keyframes flashBurst {
    0% { opacity: 0; }
    15% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* =============================================
   MIND FLAYER вокруг логотипа
   ============================================= */

/* Скрыть по умолчанию, показать только на тёмной теме */
.mind-flayer-logo {
    display: none;
}

html.stranger-things-enabled[data-theme="dark-mode"] .mind-flayer-logo {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 120px;
    pointer-events: none;
    z-index: 1;
}

/* Тело монстра - над логотипом */
.mind-flayer-logo .mind-flayer-body {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 60px;
    background: radial-gradient(ellipse at center,
        rgba(30, 0, 0, 0.95) 0%,
        rgba(60, 0, 0, 0.7) 50%,
        transparent 100%);
    border-radius: 40% 40% 50% 50%;
    animation: bodyPulse 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(139, 0, 0, 0.6));
}

/* Глаз монстра */
.mind-flayer-logo .mind-flayer-body::before {
    content: '';
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 18px;
    background: radial-gradient(ellipse at center,
        rgba(255, 50, 50, 0.9) 0%,
        rgba(139, 0, 0, 0.6) 50%,
        transparent 100%);
    border-radius: 50%;
    animation: eyeGlow 2s ease-in-out infinite alternate;
}

/* Щупальца - охватывают логотип */
.mind-flayer-logo .mind-flayer-tentacle {
    position: absolute;
    width: 5px;
    background: linear-gradient(to bottom,
        rgba(80, 0, 0, 1),
        rgba(139, 20, 20, 0.95),
        rgba(100, 10, 10, 0.8),
        rgba(60, 0, 0, 0.4),
        transparent);
    border-radius: 3px;
    transform-origin: top center;
    box-shadow:
        0 0 8px rgba(139, 0, 0, 0.6),
        0 0 15px rgba(100, 0, 0, 0.4);
}

.mind-flayer-logo .mind-flayer-tentacle::after {
    display: none;
}

/* Левые щупальца - свисают и охватывают */
.mind-flayer-logo .mind-flayer-tentacle.t1 {
    top: -30px;
    left: 15%;
    height: 80px;
    animation: tentacleLeft1 4s ease-in-out infinite;
}

.mind-flayer-logo .mind-flayer-tentacle.t2 {
    top: -20px;
    left: 5%;
    height: 90px;
    animation: tentacleLeft2 4.5s ease-in-out infinite;
}

.mind-flayer-logo .mind-flayer-tentacle.t3 {
    top: -25px;
    left: -5%;
    height: 70px;
    animation: tentacleLeft3 3.5s ease-in-out infinite;
}

/* Центральные щупальца */
.mind-flayer-logo .mind-flayer-tentacle.t4 {
    top: -35px;
    left: 48%;
    height: 50px;
    animation: tentacleCenter 5s ease-in-out infinite;
}

/* Правые щупальца */
.mind-flayer-logo .mind-flayer-tentacle.t5 {
    top: -30px;
    right: 15%;
    left: auto;
    height: 80px;
    animation: tentacleRight1 4s ease-in-out infinite;
}

.mind-flayer-logo .mind-flayer-tentacle.t6 {
    top: -20px;
    right: 5%;
    left: auto;
    height: 90px;
    animation: tentacleRight2 4.5s ease-in-out infinite;
}

.mind-flayer-logo .mind-flayer-tentacle.t7 {
    top: -25px;
    right: -5%;
    left: auto;
    height: 70px;
    animation: tentacleRight3 3.5s ease-in-out infinite;
}

/* Анимации щупалец - левые */
@keyframes tentacleLeft1 {
    0%, 100% { transform: rotate(-30deg) scaleY(1); }
    50% { transform: rotate(-20deg) scaleY(1.1); }
}

@keyframes tentacleLeft2 {
    0%, 100% { transform: rotate(-45deg) scaleY(1); }
    50% { transform: rotate(-35deg) scaleY(1.15); }
}

@keyframes tentacleLeft3 {
    0%, 100% { transform: rotate(-60deg) scaleY(1); }
    50% { transform: rotate(-50deg) scaleY(1.1); }
}

/* Центральное */
@keyframes tentacleCenter {
    0%, 100% { transform: rotate(0deg) scaleY(1); }
    25% { transform: rotate(-5deg) scaleY(1.1); }
    75% { transform: rotate(5deg) scaleY(1.1); }
}

/* Правые */
@keyframes tentacleRight1 {
    0%, 100% { transform: rotate(30deg) scaleY(1); }
    50% { transform: rotate(20deg) scaleY(1.1); }
}

@keyframes tentacleRight2 {
    0%, 100% { transform: rotate(45deg) scaleY(1); }
    50% { transform: rotate(35deg) scaleY(1.15); }
}

@keyframes tentacleRight3 {
    0%, 100% { transform: rotate(60deg) scaleY(1); }
    50% { transform: rotate(50deg) scaleY(1.1); }
}

/* Пульсация тела */
@keyframes bodyPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
    }
    50% {
        transform: translateX(-50%) scale(1.08);
    }
}

/* Свечение глаза */
@keyframes eyeGlow {
    0% {
        opacity: 0.6;
        box-shadow: 0 0 8px rgba(139, 0, 0, 0.5);
    }
    100% {
        opacity: 1;
        box-shadow: 0 0 20px rgba(255, 50, 50, 0.9);
    }
}

/* Споры/частицы вокруг логотипа */
.mind-flayer-logo::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background-image:
        radial-gradient(circle at 10% 20%, rgba(139, 0, 0, 0.5) 1px, transparent 1px),
        radial-gradient(circle at 90% 30%, rgba(178, 34, 34, 0.4) 1px, transparent 1px),
        radial-gradient(circle at 20% 80%, rgba(139, 0, 0, 0.4) 1px, transparent 1px),
        radial-gradient(circle at 80% 70%, rgba(178, 34, 34, 0.5) 1px, transparent 1px),
        radial-gradient(circle at 50% 10%, rgba(255, 50, 50, 0.3) 1px, transparent 1px);
    animation: sporeFloat 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sporeFloat {
    0%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-5px);
        opacity: 0.7;
    }
}
