html {
    box-sizing: border-box;
}

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

html,
body {
    height: 100%;
    background: #4fc3f7;
}

canvas {
    display: block;
}

body {
    margin: 0;
    color: #073b5c;
    font-family: Arial, Helvetica, sans-serif;
}

body,
canvas,
#canvas {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -webkit-text-size-adjust: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow: hidden;
}

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

#unity-canvas {
    width: 100%;
    height: 100%;
    background: #4fc3f7;
}

#loading-cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background: linear-gradient(
        135deg,
        #4fc3f7 0%,
        #29b6f6 45%,
        #26c6da 100%
    );
    opacity: 1;
    pointer-events: auto;
    transition: opacity 360ms ease;
}

.play-screen {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(
        135deg,
        #4fc3f7 0%,
        #29b6f6 45%,
        #26c6da 100%
    );
    transition: opacity 280ms ease;
}

.play-screen.hide {
    opacity: 0;
    pointer-events: none;
}

.play-panel {
    width: min(560px, 100%);
    min-height: 280px;
    padding: clamp(28px, 6vw, 48px);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 60px rgba(7, 59, 92, 0.22);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.play-panel h1 {
    margin: 0 0 32px;
    color: #073b5c;
    font-size: clamp(34px, 8vw, 58px);
    line-height: 1.02;
    font-weight: 800;
}

.play-button {
    min-width: min(320px, 100%);
    min-height: 76px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #16c6b3 0%, #13a98f 62%, #b6df42 100%);
    box-shadow: 0 16px 32px rgba(7, 59, 92, 0.22);
    color: #fff;
    cursor: pointer;
    font: 800 clamp(30px, 7vw, 48px)/1 Arial, Helvetica, sans-serif;
}

.play-button:disabled {
    cursor: default;
    opacity: 0.72;
}

.play-button:focus {
    outline: 4px solid #fff;
    outline-offset: 4px;
}

#loading-cover.hide {
    opacity: 0;
    pointer-events: none;
}

#unity-loading-bar {
    width: min(560px, 100%);
    min-height: 280px;
    padding: clamp(28px, 6vw, 48px);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 60px rgba(7, 59, 92, 0.22);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#loading-cover:not(.loading):not(.error) #unity-loading-bar {
    display: none;
}

#unity-loading-bar h1 {
    margin: 0 0 22px;
    color: #073b5c;
    font-size: clamp(34px, 8vw, 58px);
    line-height: 1.02;
    font-weight: 800;
}

#loading-status {
    min-height: 30px;
    margin: 0 0 22px;
    color: #0b4f73;
    font-size: clamp(20px, 4.5vw, 28px);
    line-height: 1.2;
    font-weight: 700;
}

#unity-logo {
    text-align: center;
}

#unity-logo img {
    max-width: 80%;
    max-height: 80%;
}

#unity-progress-bar-empty {
    display: none;
    width: 100%;
    max-width: 440px;
    height: 24px;
    margin: 0;
    text-align: left;
    border: 0;
    border-radius: 999px;
    padding: 4px;
    background: #e8f8ff;
    box-shadow: inset 0 2px 6px rgba(7, 59, 92, 0.18);
}

#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00bcd4 0%, #18d59b 100%);
    border-radius: 999px;
    transition: width 180ms ease-out;
}

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

.light #unity-progress-bar-full {
    background: linear-gradient(90deg, #00bcd4 0%, #18d59b 100%);
}

.loading-percent {
    display: none;
    min-height: 28px;
    margin-top: 12px;
    color: #073b5c;
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 800;
}

.loading-dots:after {
    content: "";
    display: inline-block;
    width: 1.4em;
    text-align: left;
    animation: loading-dots 1.2s steps(4, end) infinite;
}

.loading-error-message {
    display: none;
    margin: 8px 0 18px;
    color: #0b4f73;
    font-size: 18px;
    line-height: 1.35;
}

#loading-refresh-button {
    display: none;
    min-width: 132px;
    min-height: 46px;
    border: 0;
    border-radius: 999px;
    background: #073b5c;
    color: #fff;
    font: 700 17px/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
}

#loading-refresh-button:focus {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

#loading-cover.error .loading-error-message {
    display: block;
}

.spinner,
.spinner:after {
    border-radius: 50%;
    width: 5em;
    height: 5em;
}

.spinner {
    margin: 6px 10px 0;
    font-size: 10px;
    position: relative;
    text-indent: -9999em;
    border-top: 1.1em solid rgba(7, 59, 92, 0.12);
    border-right: 1.1em solid rgba(7, 59, 92, 0.12);
    border-bottom: 1.1em solid rgba(7, 59, 92, 0.12);
    border-left: 1.1em solid #073b5c;
    transform: translateZ(0);
    animation: spinner-spin 1.1s infinite linear;
}

@media (max-width: 480px) {
    #loading-cover,
    .play-screen {
        padding: 16px;
    }

    #unity-loading-bar,
    .play-panel {
        min-height: 250px;
        border-radius: 20px;
    }
}

@media (max-height: 420px) {
    #unity-loading-bar,
    .play-panel {
        min-height: 0;
        padding: 20px 28px;
    }

    #unity-loading-bar h1,
    .play-panel h1 {
        margin-bottom: 12px;
        font-size: clamp(28px, 7vw, 42px);
    }

    #loading-status {
        margin-bottom: 14px;
    }

    .spinner,
    .spinner:after {
        width: 3.6em;
        height: 3.6em;
    }
}

@keyframes loading-dots {
    0% {
        content: "";
    }
    25% {
        content: ".";
    }
    50% {
        content: "..";
    }
    75%,
    100% {
        content: "...";
    }
}

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