@font-face {
    font-family: "Poppins Regular";
    src: url("Poppins-Regular.ttf") format("truetype");
    font-display: swap;
}

@font-face {
    font-family: "Poppins SemiBold";
    src: url("Poppins-SemiBold.ttf") format("truetype");
    font-display: swap;
}

body {
    padding: 0;
    margin: 0
}

body.msq-compat-modal-open {
    overflow: hidden;
}

#unity-container {
    position: absolute
}

    #unity-container.unity-desktop {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%)
    }

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

    /* Grid only during loading (above WebGL; hidden after createUnityInstance resolves). */
    #unity-container.unity-loading-grid-visible::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: url("sprite_backgroundGrid.png");
        background-repeat: repeat;
        background-size: 32px 32px;
        opacity: 0.05;
        pointer-events: none;
        z-index: 1;
    }

#unity-canvas {
    position: relative;
    z-index: 0;
    /* Soft radial: center #51b046, edge #91cb8c (reversed from prior) */
    background: radial-gradient( ellipse 75% 75% at 50% 50%, #51b046 25%, #91cb8c 100% );
}

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

#unity-loading-bar {
    position: absolute;
    inset: 0;
    transform: none;
    width: 100%;
    height: 100%;
    --unity-loading-footer-inset: clamp(24px, 2.2vh, 24px);
    z-index: 2;
    color: #fff;
    font-family: Arial, Helvetica, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    text-align: center;
    user-select: none;
    padding: clamp(18px, 4vh, 42px) clamp(16px, 4vw, 48px);
    box-sizing: border-box;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
    display: none;
}

.unity-loading-top,
.unity-loading-center,
.unity-loading-bottom {
    width: 100%;
    display: grid;
    place-items: center;
}

.unity-loading-top {
    padding-top: clamp(6px, 1.2vh, 12px);
}

.unity-loading-center {
    /* One scale for title + subtitle: ~1.5× top logo cap area, subtitle ~44% of title (reference layout). */
    font-size: clamp(14px, 6vmin, 52px);
    margin-top: clamp(8px, 2.4vh, 28px);
    margin-bottom: clamp(8px, 2.4vh, 28px);
}

.unity-loading-bottom {
    padding-bottom: clamp(10px, 2.4vh, 24px);
}

.unity-loading-progress-wrap {
    display: grid;
    justify-items: center;
    row-gap: clamp(8px, 1.2vh, 12px);
    transform: translateY(clamp(-10px, -1.6vh, -6px));
}

.unity-loading-label {
    margin: 0;
    font-family: "Poppins Regular", Arial, Helvetica, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: clamp(11px, 2.8vmin, 14px);
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.2;
    opacity: 0.95;
}

.unity-loading-dots {
    display: inline-flex;
    margin-left: 0.1em;
}

    .unity-loading-dots > span {
        display: inline-block;
        opacity: 0;
        animation-timing-function: linear;
        animation-iteration-count: infinite;
        animation-duration: 1.35s;
    }

        /* Typing-style ellipsis: nothing → . → .. → ... → (repeat) */
        .unity-loading-dots > span:nth-child(1) {
            animation-name: unity-loading-dot-type-1;
        }

        .unity-loading-dots > span:nth-child(2) {
            animation-name: unity-loading-dot-type-2;
        }

        .unity-loading-dots > span:nth-child(3) {
            animation-name: unity-loading-dot-type-3;
        }

@keyframes unity-loading-dot-type-1 {
    0%, 24.9% {
        opacity: 0;
    }

    25%, 99.9% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes unity-loading-dot-type-2 {
    0%, 49.9% {
        opacity: 0;
    }

    50%, 99.9% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

@keyframes unity-loading-dot-type-3 {
    0%, 74.9% {
        opacity: 0;
    }

    75%, 99.9% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

#unity-logo {
    width: min(280px, 70vw);
    height: clamp(22px, 3.8vmin, 34px);
    margin: 0;
    background: url(logo_client.png) no-repeat center;
    background-size: contain;
}

.unity-loading-title {
    font-family: "Poppins SemiBold", Arial, Helvetica, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 1em;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.unity-loading-subtitle {
    font-family: "Poppins Regular", Arial, Helvetica, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    margin-top: 0.32em;
    font-size: 0.44em;
    font-weight: 400;
    letter-spacing: 0.02em;
    opacity: 0.95;
    line-height: 1.25;
}

.unity-loading-footer-left,
.unity-loading-footer-right {
    position: absolute;
    bottom: var(--unity-loading-footer-inset);
    margin: 0;
    font-family: "Poppins Regular", Arial, Helvetica, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: clamp(8px, 2.2vmin, 11px);
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 1.35;
    opacity: 0.95;
}

.unity-loading-footer-left {
    left: 30px;
    text-align: left;
}

.unity-loading-footer-right {
    right: 30px;
    text-align: right;
    max-width: min(20rem, 48%);
}

#unity-progress-bar-empty {
    width: min(360px, 64vw);
    height: 10px;
    margin-top: 0;
    margin-left: auto;
    margin-right: auto;
    background-color: rgba(145, 203, 140, 0.55);
    border-radius: 8px
}

#unity-progress-bar-full {
    background-color: white;
    width: 0%;
    height: 100%;
    border-radius: 8px;
}

#unity-footer {
    position: relative
}

.unity-mobile #unity-footer {
    display: none
}

#unity-logo-title-footer {
    float: left;
    width: 102px;
    height: 38px;
    background: url('MSQ.png') no-repeat center;
    background-size: contain;
}

#unity-build-title {
    float: right;
    margin-right: 10px;
    line-height: 38px;
    font-family: arial;
    font-size: 18px
}

#unity-fullscreen-button {
    cursor: pointer;
    float: right;
    width: 38px;
    height: 38px;
    background: url('fullscreen-button.png') no-repeat center
}

#unity-warning {
    position: absolute;
    left: 50%;
    top: 5%;
    transform: translate(-50%);
    background: white;
    padding: 10px;
    display: none;
    z-index: 3
}

.msq-compat-modal-backdrop {
    /* Theme defaults (override these to style). */
    --msq-compat-accent: #51B046;
    --msq-compat-accent-2: #91CB8C;
    --msq-compat-backdrop-color: rgba(0, 0, 0, 0.45);
    --msq-compat-modal-bg: rgba(255, 255, 255, 0.96);
    --msq-compat-modal-text: #0f1b12;
    --msq-compat-modal-border: rgba(145, 203, 140, 0.55);
    --msq-compat-modal-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    --msq-compat-modal-radius: 16px;
    --msq-compat-modal-max-width: 440px;
    --msq-compat-modal-padding: 22px;
    --msq-compat-modal-gap: 14px;
    --msq-compat-button-bg: var(--msq-compat-accent);
    --msq-compat-button-text: #ffffff;
    --msq-compat-button-border: rgba(255, 255, 255, 0.65);
    --msq-compat-button-radius: 12px;
    --msq-compat-button-padding: 10px 16px;

    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--msq-compat-backdrop-color);
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

.msq-compat-modal-backdrop[hidden] {
    display: none !important;
}

.msq-compat-modal {
    width: min(var(--msq-compat-modal-max-width), 100%);
    background: var(--msq-compat-modal-bg);
    color: var(--msq-compat-modal-text);
    border-radius: var(--msq-compat-modal-radius);
    box-shadow: var(--msq-compat-modal-shadow);
    border: 1px solid var(--msq-compat-modal-border);
    padding: var(--msq-compat-modal-padding);
    box-sizing: border-box;
    display: grid;
    gap: var(--msq-compat-modal-gap);
    font-family: "Poppins Regular", Arial, Helvetica, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    backdrop-filter: blur(6px);
}

.msq-compat-modal__title {
    margin: 0;
    font-size: 18px;
    font-family: "Poppins SemiBold", "Poppins Regular", Arial, Helvetica, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

.msq-compat-modal__message {
    margin: 0;
    font-size: 14px;
    line-height: 1.45;
    opacity: 0.95;
}

.msq-compat-modal__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.msq-compat-modal__button {
    appearance: none;
    border: none;
    border-radius: var(--msq-compat-button-radius);
    padding: var(--msq-compat-button-padding);
    background: var(--msq-compat-button-bg);
    color: var(--msq-compat-button-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.msq-compat-modal__button:hover {
    filter: brightness(1.05);
}

.msq-compat-modal__button:active {
    filter: brightness(0.98);
    transform: translateY(0.5px);
}

.msq-compat-modal__button:focus,
.msq-compat-modal__button:focus-visible {
    outline: none;
    box-shadow: none;
}

/* Portrait: letterboxed landscape (no rotation) so canvas aspect and input work correctly */
@media (orientation: portrait) {
    #unity-container.unity-mobile {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 100vw;
        height: auto;
        aspect-ratio: 16 / 9;
        max-height: 100vh;
    }
}
