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

/*
 * The Unity UI is authored at 1080x1920 (aspect ratio 0.5625).
 * Keep the container at the viewport size and let JavaScript size the
 * canvas with a contain calculation so the unused area stays black.
 */
#unity-container {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    width: 100dvw;
    height: 100dvh;
    overflow: hidden;
    background: #000;
}

#unity-canvas {
    display: block;
    flex: 0 0 auto;
    width: min(56.25vh, 100vw);
    width: min(56.25dvh, 100dvw);
    height: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1080 / 1920;
    background: #231F20;
}

.unity-mobile #unity-canvas {
    object-fit: fill;
}
#unity-loading-bar {
    position: static;
    display: none;
    width: min(88vw, 520px);
    padding: 16px 18px;
    box-sizing: border-box;
    color: #fff;
    background: rgba(8, 20, 61, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.loading-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    font-family: Arial, sans-serif;
}

.loading-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1px;
}

.loading-progress {
    min-width: 40px;
    color: #9fe8ff;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.loading-spinner {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #71dcff;
    border-radius: 50%;
    animation: loadingSpin 0.8s linear infinite;
}

#unity-progress-bar-empty {
    width: 100%;
    height: 10px;
    margin: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #35bfff 0%, #70e0ff 48%, #ffe06b 100%);
    border-radius: inherit;
    box-shadow: 0 0 12px rgba(83, 210, 255, 0.7);
    transition: width 0.18s ease-out;
}

@keyframes loadingSpin {
    to { transform: rotate(360deg); }
}

#unity-footer { position: relative }
.unity-mobile #unity-footer { display: none }
#unity-logo-title-footer { float:left; width: 102px; height: 38px; background: url('unity-logo-title-footer.png') no-repeat center }
#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 }
#game-overlay{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:black;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    box-sizing: border-box;
    z-index:999999;
}

#game-overlay .overlay-image {
    display: block;
    width: min(180px, 56vw);
    max-width: 80%;
    height: auto;
}

#rotate-overlay{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:100%;
    background:white;
    display:none;
    align-items:center;
    justify-content:center;
    z-index:999998;
}

.rotate-content{
    text-align:center;
    font-size:20px;
}


#game-overlay,
#rotate-overlay{
    position:fixed;
    inset:0;
    width:100vw;
    height:100vh;
}

#fullscreen-overlay{
    position: fixed;
    top:0;
    left:0;
    width:100vw;
    height:100vh;
    background: rgba(0,0,0,0.65);
    display:flex;
    align-items:center;
    justify-content:center;
    z-index:9999;
    cursor:pointer;
}

.fullscreen-text{
    color:white;
    font-size:28px;
    font-weight:bold;
    text-align:center;
    padding:20px 40px;

    animation: blinkButton 1.2s infinite;
}

@keyframes blinkButton{
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}
