html {
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

html, body {
    height: 100%;
}

canvas {
    display: block;
}

body {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
}

#unity-container {
    position: fixed;
    display: flex;
    aspect-ratio: 9/16;
    width: min(calc(100vh*(9/16)), 100vw);
    height: auto;
}

#unity-container.unity-mobile {
    width: 100%;
    height: 100%;
}

#unity-canvas {
    width: 100%;
    height: 100%;
    background: #231F20;
}

#loading-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#unity-loading-bar {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#unity-logo {
    text-align: center;
    pointer-events: none;
}

#unity-logo img {
    max-width: 80%;
    max-height: 80%;
    pointer-events: none;

    /* Анимация пульсации + подсветка */
    animation: pulse 2s infinite ease-in-out;
    filter: drop-shadow(0 0 15px rgba(63, 162, 255, 0.7));
}

@keyframes pulse {
    0%   { transform: scale(1);   opacity: 1; }
    50%  { transform: scale(1.1); opacity: 0.85; }
    100% { transform: scale(1);   opacity: 1; }
}

#unity-progress-bar-empty {
    width: 30%;
    height: 24px;
    margin: 10px 20px 20px 10px;
    border: 1px solid rgba(255, 211, 37, 0.7);
    padding: 2px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.05);
    position: relative;
}

#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    border-radius: 10px;
    position: relative;

    /* Улучшенный градиент */
    background: linear-gradient(90deg, 
        #0ad156, 
        #4600e9, 
        #ff2a6d, 
        #0ad156);
    background-size: 200% 100%;
    animation: loading-gradient 3s infinite linear;
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.4, 1);

    /* Свечение */
    box-shadow: 
        0 0 8px rgba(10, 209, 86, 0.5),
        0 0 16px rgba(70, 0, 233, 0.4);
}

@keyframes loading-gradient {
    0%   { background-position: 200% 50%; }
    100% { background-position: 0% 50%; }
}

.light #unity-progress-bar-empty {
    border-color: black;
}

.light #unity-progress-bar-full {
    background: black;
}

/* Спиннер */
.spinner,
.spinner:after {
    border-radius: 50%;
    width: 5em;
    height: 5em;
}

.spinner {
    margin: 10px;
    font-size: 10px;
    position: relative;
    text-indent: -9999em;
    border-top: 1.1em solid rgba(255, 211, 37, 0.2);
    border-right: 1.1em solid rgba(255, 211, 37, 0.2);
    border-bottom: 1.1em solid rgba(255, 211, 37, 0.2);
    border-left: 1.1em solid rgba(63, 162, 255, 1);
    transform: translateZ(0);
    animation: spinner-spin 1.1s infinite linear;
}

@keyframes spinner-spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
