/* Generated by scripts/build-loading-screen.py: edit that, not this. */

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    overflow: hidden;
    background: #000;
    transition: opacity 450ms ease;
}

.loading-screen.is-leaving {
    opacity: 0;
    pointer-events: none;
}

/* The middle of the stone ring. */
.ls-stage {
    position: absolute;
    left: 50%;
    top: 56%;
    width: 0;
    height: 0;
}

.ls-glow {
    position: absolute;
    left: -340px;
    top: -300px;
    width: 680px;
    height: 440px;
    background: radial-gradient(
        closest-side,
        rgba(255, 150, 64, 0.26),
        rgba(232, 96, 40, 0.08) 55%,
        rgba(0, 0, 0, 0) 100%
    );
    animation: ls-flicker 1.1s ease-in-out infinite alternate;
}

.ls-fire,
.ls-sprite {
    position: absolute;
    background-repeat: no-repeat;
    image-rendering: pixelated;
}

.ls-fire {
    left: -128px;
    top: -216px;
    width: 128px;
    height: 128px;
    z-index: 100;
    background-image: url(fire.png);
    background-size: 1024px 128px;
    transform: scale(2);
    transform-origin: 0 0;
    animation: ls-fire 720ms steps(8) infinite;
}

/* One goblin: z-index (in front of the fire or behind) > x > y > size and
   light > which way it faces > the sprite. Every layer runs on the same lap. */
.ls-dancer {
    position: absolute;
    left: 0;
    top: 0;
    animation: ls-z 11s step-end infinite;
}

.ls-x {
    animation: ls-x 11s infinite;
}

.ls-y {
    animation: ls-y 11s infinite;
}

.ls-depth {
    transform-origin: 0 0;
    animation: ls-depth 11s infinite;
}

.ls-face {
    transform-origin: 0 0;
    animation: ls-face 11s step-end infinite;
}

.ls-dancer,
.ls-x,
.ls-y,
.ls-depth,
.ls-face {
    animation-delay: var(--lap-delay);
}

.ls-sprite {
    left: -32px;
    top: -40px;
    width: 64px;
    height: 64px;
    background-image: url(dancers.png);
    background-size: 512px 320px;
    background-position-y: calc(var(--row) * -64px);
    animation: ls-dance 960ms steps(8) infinite;
    animation-delay: var(--step-delay);
}

.ls-d0 { --row: 0; --lap-delay: 0.00s; --step-delay: 0ms; }
.ls-d1 { --row: 1; --lap-delay: -2.20s; --step-delay: -360ms; }
.ls-d2 { --row: 2; --lap-delay: -4.40s; --step-delay: -720ms; }
.ls-d3 { --row: 3; --lap-delay: -6.60s; --step-delay: -120ms; }
.ls-d4 { --row: 4; --lap-delay: -8.80s; --step-delay: -480ms; }

@keyframes ls-fire {
    from { background-position-x: 0; }
    to { background-position-x: -1024px; }
}

@keyframes ls-dance {
    from { background-position-x: 0; }
    to { background-position-x: -512px; }
}

/* Round the ring: right-hand side at 0%, across the front (heading left)
   to 50%, back across the far side to 100%. */
@keyframes ls-x {
    0% { transform: translateX(166px); animation-timing-function: ease-in-out; }
    50% { transform: translateX(-166px); animation-timing-function: ease-in-out; }
    100% { transform: translateX(166px); }
}

@keyframes ls-y {
    0% { transform: translateY(0); animation-timing-function: ease-out; }
    25% { transform: translateY(58px); animation-timing-function: ease-in; }
    50% { transform: translateY(0); animation-timing-function: ease-out; }
    75% { transform: translateY(-58px); animation-timing-function: ease-in; }
    100% { transform: translateY(0); }
}

@keyframes ls-depth {
    0% { transform: scale(3.68); filter: brightness(0.81); animation-timing-function: ease-out; }
    25% { transform: scale(4.00); filter: brightness(1.0); animation-timing-function: ease-in; }
    50% { transform: scale(3.68); filter: brightness(0.81); animation-timing-function: ease-out; }
    75% { transform: scale(3.36); filter: brightness(0.62); animation-timing-function: ease-in; }
    100% { transform: scale(3.68); filter: brightness(0.81); }
}

/* In front of the fire across the front half, behind it round the back. */
@keyframes ls-z {
    0% { z-index: 200; }
    50% { z-index: 1; }
    100% { z-index: 1; }
}

/* The sprite faces right: flip it while it heads left. */
@keyframes ls-face {
    0% { transform: scaleX(-1); }
    50% { transform: scaleX(1); }
    100% { transform: scaleX(1); }
}

@keyframes ls-flicker {
    from { opacity: 0.8; }
    to { opacity: 1; }
}
