body {
    padding: 0;
    margin: 0;
}

#unity-container {
    position: absolute;
    width: min(100vw, calc(100vh * 16 / 9));
    aspect-ratio: 16 / 9;
}

html:fullscreen,
html:-webkit-full-screen {
    background: #000;
}

#unity-container.unity-desktop {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%)
}

#unity-container.unity-mobile {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%)
}

#unity-canvas {
    background: white;
}

.unity-mobile #unity-canvas {
    width: 100%;
    height: 100%
}

#unity-loading-bar {
    --loader-size: min(300px, 50vh, 50vw);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
}

#unity-loader-ring {
    position: relative;
    width: var(--loader-size);
    height: var(--loader-size);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: calc(var(--loader-size) * 0.12);
}

#unity-loader-logo {
    width: 55%;
    margin-top: 5%;
    height: auto;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
}

/* Animatable custom properties so the conic sweep interpolates instead of snapping. */
@property --loader-start {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

@property --loader-end {
    syntax: '<angle>';
    inherits: false;
    initial-value: 0deg;
}

.loader {
    position: absolute;
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    user-select: none;
    pointer-events: none;
    -webkit-mask: conic-gradient(from -70deg, #0000 var(--loader-start), #000 var(--loader-start), #000 var(--loader-end), #0000 var(--loader-end));
    mask: conic-gradient(from -70deg, #0000 var(--loader-start), #000 var(--loader-start), #000 var(--loader-end), #0000 var(--loader-end));
    animation: loader-sweep 3.4s infinite linear;
}

/* 0-1.2s fill clockwise, 1.2-1.7s hold full, 1.7-2.9s unfill clockwise, 2.9-3.4s hold empty. */
@keyframes loader-sweep {

    0% {
        --loader-start: 0deg;
        --loader-end: 0deg
    }

    35.294% {
        --loader-start: 0deg;
        --loader-end: 360deg
    }

    50% {
        --loader-start: 0deg;
        --loader-end: 360deg
    }

    85.294% {
        --loader-start: 360deg;
        --loader-end: 360deg
    }

    100% {
        --loader-start: 360deg;
        --loader-end: 360deg
    }
}

#unity-progress-bar-empty {
    width: 141px;
    height: 18px;
    /* margin-top: 10px; */
    background: url('progress-bar-empty-light.png') no-repeat center
}

#unity-progress-bar-full {
    width: 0%;
    height: 18px;
    margin-top: 10px;
    background: url('progress-bar-full-light.png') no-repeat center
}

#unity-footer {
    bottom: 50px;
    position: relative
}

#unity-webgl-logo {
    float: left;
    width: 204px;
    height: 38px;
    /* background: url('webgl-logo.png') no-repeat center */
}

#unity-build-title {
    float: right;
    margin-right: 10px;
    line-height: 38px;
    font-family: arial;
    font-size: 18px
}

#unity-warning {
    position: absolute;
    left: 50%;
    top: 5%;
    transform: translate(-50%);
    background: white;
    padding: 10px;
    display: none
}

.unity-canvas {
    width: 100% !important;
    height: 100% !important;
}

#unity-fullscreen-button {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 10;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#unity-fullscreen-button:hover {
    background: rgba(0, 0, 0, 0.7);
}

#unity-fullscreen-button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    pointer-events: none;
}

#unity-fullscreen-button .icon-exit {
    display: none;
}

#unity-fullscreen-button.is-fullscreen .icon-enter {
    display: none;
}

#unity-fullscreen-button.is-fullscreen .icon-exit {
    display: block;
}
