html {
    box-sizing: border-box;
}

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

html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
    background: #000;
}

/* Адаптивный контейнер с сохранением пропорций */
#unity-container-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#unity-container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 16/9;
}

#unity-canvas {
    width: 100%;
    height: 100%;
    display: block;
    background: #000000;
}

/* Стили для экрана загрузки */
#loading-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: url('background.jpg') center / cover;
    z-index: 9999;
}

.loading-percentage {
    font-size: 48px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
    font-family: 'GameFont', sans-serif;
}

.progress-container {
    width: 80%;
    max-width: 500px;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    overflow: hidden;
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.2),
        inset 0 0 8px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: #9c27b0;
    border-radius: 15px;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow:
        inset 0 0 10px rgba(255, 255, 255, 0.3),
        0 0 15px rgba(156, 39, 176, 0.5);
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .loading-percentage {
        font-size: 36px;
    }

    .progress-container {
        height: 25px;
    }
}

/* Скрываем ненужные элементы */
#unity-logo,
#unity-progress-bar-empty,
.spinner {
    display: none !important;
}

/* Дополнительные стили для полноэкранного режима */
#unity-canvas:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
}

#unity-canvas:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
}

#unity-canvas:-moz-full-screen {
    width: 100vw !important;
    height: 100vh !important;
}

#unity-canvas:-ms-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
}