:root {
    --primary: #1476c6;
    --primary-dark: #075c9f;
    --primary-light: #64b5f1;
    --orange: #f39224;
    --text: #162033;
    --muted: #697386;
    --track: #e5edf5
}

* {
    box-sizing: border-box
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000
}

#unity-container {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    transform: none !important;
    background: #000 !important
}

#unity-aspect-wrapper {
    position: relative !important;
    width: min(100vw,177.7777778vh) !important;
    height: min(100vh,56.25vw) !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    aspect-ratio: 16/9 !important;
    margin: auto !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #000 !important
}

#unity-canvas {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: #000 !important;
    z-index: 1
}

#custom-loading-overlay {
    position: fixed !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 24px !important;
    overflow: hidden !important;
    background: linear-gradient(145deg,#f5faff 0%,#eef7ff 50%,#fff8ef 100%) !important;
    z-index: 999999 !important;
    opacity: 1;
    visibility: visible;
    transition: opacity .4s ease,visibility .4s ease
}

    #custom-loading-overlay.loading-hidden {
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important
    }

    #custom-loading-overlay::before, #custom-loading-overlay::after {
        content: "";
        position: absolute;
        border-radius: 50%;
        pointer-events: none
    }

    #custom-loading-overlay::before {
        width: 500px;
        height: 500px;
        left: -200px;
        top: -220px;
        background: radial-gradient(circle,rgba(20,118,198,.17) 0%,rgba(20,118,198,0) 70%);
        animation: float-one 8s ease-in-out infinite
    }

    #custom-loading-overlay::after {
        width: 550px;
        height: 550px;
        right: -220px;
        bottom: -250px;
        background: radial-gradient(circle,rgba(243,146,36,.15) 0%,rgba(243,146,36,0) 70%);
        animation: float-two 9s ease-in-out infinite
    }

#custom-loading-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 470px;
    max-width: 92vw;
    min-height: 520px;
    padding: 46px 48px 40px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 30px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 28px 70px rgba(34,75,115,.14),0 8px 24px rgba(34,75,115,.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 2;
    animation: card-enter .6s cubic-bezier(.2,.8,.2,1) both
}

    #custom-loading-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 50%;
        width: 100px;
        height: 5px;
        transform: translateX(-50%);
        border-radius: 0 0 8px 8px;
        background: linear-gradient(90deg,var(--orange),var(--primary))
    }

#custom-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    font-family: "Segoe UI",Arial,sans-serif;
    text-align: center
}

#custom-loading-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 310px;
    max-width: 78vw;
    min-height: 125px;
    margin: 0 auto 24px;
    padding: 0
}

#custom-loading-logo {
    display: block;
    width: 275px;
    max-width: 100%;
    height: auto;
    max-height: 125px;
    margin: 0 auto;
    object-fit: contain;
    filter: drop-shadow(0 7px 10px rgba(0,0,0,.08));
    animation: logo-enter .7s .1s ease both
}

#custom-loading-logo-error {
    display: none;
    margin: 0 auto 24px;
    color: #c62828;
    font-size: 13px;
    line-height: 1.5
}

#custom-loading-spinner-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 66px;
    height: 66px;
    margin: 0 auto 23px
}

#custom-loading-spinner {
    position: absolute;
    width: 66px;
    height: 66px;
    border: 5px solid #e3ecf4;
    border-top-color: var(--primary);
    border-right-color: var(--primary-light);
    border-radius: 50%;
    animation: loading-spin .85s linear infinite
}

#custom-loading-spinner-core {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(145deg,#fff,#edf5fc);
    box-shadow: inset 0 0 0 1px rgba(20,118,198,.08),0 4px 12px rgba(20,118,198,.12)
}

#custom-loading-title {
    margin: 0 0 8px;
    color: var(--text);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.3px
}

#custom-loading-subtitle {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6
}

#custom-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600
}

#custom-progress-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

#custom-progress-percentage {
    min-width: 44px;
    margin-left: 12px;
    color: var(--primary);
    font-size: 14px;
    font-weight: 700;
    text-align: right
}

#custom-progress-empty {
    position: relative;
    width: 100%;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--track);
    box-shadow: inset 0 2px 4px rgba(34,75,115,.09)
}

#custom-progress-full {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    overflow: hidden;
    border-radius: 999px;
    background: linear-gradient(90deg,var(--primary-dark),var(--primary),var(--primary-light));
    box-shadow: 0 3px 10px rgba(20,118,198,.25);
    transition: width .2s ease
}

    #custom-progress-full::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(110deg,transparent 20%,rgba(255,255,255,.55) 45%,transparent 70%);
        transform: translateX(-100%);
        animation: loading-shimmer 1.5s linear infinite
    }

#custom-progress-text {
    min-height: 20px;
    margin-top: 13px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4
}

#custom-loading-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 28px;
    color: #9aa4b2;
    font-size: 11px;
    letter-spacing: .2px
}

#custom-loading-footer-dot {
    width: 5px;
    height: 5px;
    margin: 0 8px;
    border-radius: 50%;
    background: var(--orange)
}

#unity-loading-bar {
    display: none !important
}

#pdfViewerFrame, #wordViewerFrame, #pptViewerFrame, #videoViewer {
    display: none;
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    margin: 0;
    border: 2px solid #000;
    box-sizing: border-box;
    background: #fff;
    z-index: 20
}

#videoViewer {
    object-fit: contain;
    background: #000
}

#unity-warning {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000000
}

#unity-footer {
    position: absolute;
    right: 10px;
    bottom: 10px;
    z-index: 30
}

@keyframes loading-spin {
    to {
        transform: rotate(360deg)
    }
}

@keyframes loading-shimmer {
    to {
        transform: translateX(100%)
    }
}

@keyframes card-enter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.97)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

@keyframes logo-enter {
    from {
        opacity: 0;
        transform: translateY(-8px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

@keyframes float-one {
    0%,100% {
        transform: translate(0,0)
    }

    50% {
        transform: translate(35px,25px)
    }
}

@keyframes float-two {
    0%,100% {
        transform: translate(0,0)
    }

    50% {
        transform: translate(-30px,-20px)
    }
}

@media(max-width:600px) {
    #custom-loading-overlay {
        padding: 16px !important
    }

    #custom-loading-card {
        width: 100%;
        min-height: 480px;
        padding: 38px 28px 32px;
        border-radius: 24px
    }

    #custom-loading-logo-wrapper {
        width: 250px;
        min-height: 105px;
        margin-bottom: 20px
    }

    #custom-loading-logo {
        width: 225px;
        max-height: 105px
    }

    #custom-loading-title {
        font-size: 21px
    }

    #custom-loading-subtitle {
        font-size: 13px;
        margin-bottom: 24px
    }
}

@media(max-height:650px) {
    #custom-loading-card {
        min-height: 0;
        padding-top: 28px;
        padding-bottom: 25px
    }

    #custom-loading-logo-wrapper {
        min-height: 80px;
        margin-bottom: 14px
    }

    #custom-loading-logo {
        width: 190px;
        max-height: 80px
    }

    #custom-loading-spinner-wrapper {
        width: 54px;
        height: 54px;
        margin-bottom: 15px
    }

    #custom-loading-spinner {
        width: 54px;
        height: 54px
    }

    #custom-loading-spinner-core {
        width: 32px;
        height: 32px
    }

    #custom-loading-subtitle {
        margin-bottom: 18px
    }

    #custom-loading-footer {
        margin-top: 20px
    }
}

@media(prefers-reduced-motion:reduce) {
    #custom-loading-card, #custom-loading-logo, #custom-loading-overlay::before, #custom-loading-overlay::after, #custom-progress-full::after {
        animation: none
    }
}
