/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: 'Roboto', 'Segoe UI', 'Arial', 'Helvetica', sans-serif;
}

/* Background */
.loading-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, #1a2332 0%, #0f1419 100%);
    z-index: -1;
}

/* Character */
.character-container {
    position: absolute;
    left: 8%;
    top: 65%;
    transform: translateY(-50%);
    z-index: 2;
}

.character {
    height: 80vh;
    width: auto;
    max-width: none;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.5));
    animation: characterIdle 3s ease-in-out infinite;
    transition: transform 0.5s ease;
    position: relative;
    z-index: 3;
}

/* Character Ground Glow */
.character-glow {
    position: absolute;
    bottom: -15%;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 60%;
    z-index: 1;
    
    /* Базовое свечение (будет изменяться через JavaScript) */
    background: radial-gradient(
        ellipse 100% 100% at center bottom,
        rgba(255, 140, 0, 0.25) 0%,
        rgba(255, 140, 0, 0.12) 25%,
        rgba(255, 140, 0, 0.06) 50%,
        rgba(255, 140, 0, 0.02) 75%,
        transparent 100%
    );
    
    /* Убираем размытие - оно создает артефакты */
    /* filter: blur(8px); */
    
    /* Анимация пульсации */
    animation: glowPulse 4s ease-in-out infinite;
    
    /* Режим наложения для лучшего смешивания */
    mix-blend-mode: soft-light;
    
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.9;
        transform: translateX(-50%) scale(1.05);
    }
}

/* Мягкий слой подсветки */
.character-glow-soft {
    position: absolute;
    bottom: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 300%;
    height: 80%;
    z-index: 0;
    
    background: radial-gradient(
        ellipse 120% 100% at center bottom,
        rgba(255, 255, 255, 0.03) 0%,
        rgba(255, 255, 255, 0.01) 50%,
        transparent 100%
    );
    
    animation: glowPulseSoft 6s ease-in-out infinite;
    mix-blend-mode: overlay;
    pointer-events: none;
}

@keyframes glowPulseSoft {
    0%, 100% {
        opacity: 0.3;
        transform: translateX(-50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateX(-50%) scale(1.1);
    }
}

@keyframes characterIdle {
    0%, 100% { 
        transform: translateY(0) scale(1);
    }
    50% { 
        transform: translateY(-8px) scale(1.01);
    }
}

/* Logo */
.logo-container {
    position: absolute;
    right: 15%;
    top: 35%;
    transform: translateY(-50%);
    z-index: 3;
    width: 25%;
    max-width: 400px;
    /* Создаем контекст для обтравочной маски */
    overflow: hidden;
    border-radius: 10px;
}

.logo-background {
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.logo {
    width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
    filter: 
        drop-shadow(0 0 20px rgba(0, 212, 255, 0.3))
        drop-shadow(0 0 40px rgba(0, 212, 255, 0.1));
    transition: filter 0.3s ease;
    /* Создаем контекст для обтравочной маски */
    isolation: isolate;
}

.logo:hover {
    filter: 
        drop-shadow(0 0 30px rgba(0, 212, 255, 0.5))
        drop-shadow(0 0 60px rgba(0, 212, 255, 0.2));
}

/* Constellation Canvas */
.constellation-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
}

/* Quote */
.quote-container {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    text-align: center;
    max-width: 800px;
    width: 80%;
}

.quote-text {
    font-size: 36px;
    font-weight: 300;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    animation: quoteGlow 4s ease-in-out infinite;
    margin-bottom: 10px;
}

@keyframes quoteGlow {
    0%, 100% {
        opacity: 0.9;
        text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    }
    50% {
        opacity: 1;
        text-shadow: 
            0 0 10px rgba(0, 0, 0, 0.8),
            0 0 20px rgba(255, 255, 255, 0.1);
    }
}

.quote-author {
    font-size: 18px;
    font-weight: 400;
    color: #00d4ff;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    opacity: 0;
    font-style: italic;
    transition: opacity 0.3s ease;
}

/* Progress Bar */
.progress-container {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 600px;
    z-index: 3;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff 0%, #0099cc 100%);
    border-radius: 3px;
    width: 75%;
    transition: width 0.5s ease;
    box-shadow: 
        0 0 10px rgba(0, 212, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(0, 212, 255, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 0 20px rgba(0, 212, 255, 0.8),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

.progress-text {
    text-align: right;
    color: #ffffff;
    font-size: 24px;
    font-weight: 500;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.8);
    opacity: 0.9;
}

/* Character Rotation */
.character.fade-out {
    opacity: 0;
    transform: translateY(-50px) scale(0.95);
    transition: all 0.8s ease-in;
}

.character.fade-in {
    opacity: 1;
    transform: translateY(0) scale(1);
    transition: all 0.8s ease-out;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .character-container {
        left: 5%;
        top: 60%;
    }
    
    .logo-container {
        right: 8%;
        top: 30%;
        width: 30%;
    }
    
    .quote-text {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .character {
        height: 60vh;
    }
    
    .character-container {
        left: 50%;
        top: 40%;
        transform: translate(-50%, -50%);
    }
    
    .character-glow {
        width: 180%;
        height: 50%;
        /* filter: blur(6px); */
    }
    
    .character-glow-soft {
        width: 250%;
        height: 70%;
    }
    
    .logo-container {
        right: 50%;
        top: 60%;
        transform: translate(50%, -50%);
        width: 40%;
    }
    
    .quote-container {
        bottom: 25%;
    }
    
    .quote-text {
        font-size: 22px;
    }
    
    .quote-author {
        font-size: 16px;
    }
    
    .progress-container {
        bottom: 15%;
        width: 80%;
    }
    
    .progress-text {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .character {
        height: 50vh;
    }
    
    .character-glow {
        width: 200%;
        height: 40%;
        /* filter: blur(4px); */
    }
    
    .character-glow-soft {
        width: 280%;
        height: 60%;
    }
    
    .logo-container {
        width: 50%;
    }
    
    .quote-text {
        font-size: 18px;
    }
    
    .quote-author {
        font-size: 14px;
    }
    
    .progress-text {
        font-size: 18px;
    }
}

/* Ultra-wide Support */
@media (min-aspect-ratio: 21/9) {
    .character-container {
        left: 12%;
        top: 70%;
    }
    
    .logo-container {
        right: 20%;
        top: 30%;
        width: 20%;
    }
}

/* High DPI Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .character {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Preload Images */
.preload-images {
    display: none !important;
}