body { padding: 0; margin: 0; overflow: hidden; }
#unity-container { position: fixed; width: 100%; height: 100%; }
#unity-canvas { width: 100%; height: 100%; background: #c8b99a }
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
#unity-container.unity-mobile { width: 100%; height: 100% }
.unity-mobile #unity-canvas { width: 100%; height: 100% }

#unity-loading-bar { 
    position: absolute; 
    left: 50%; 
    top: 50%; 
    transform: translate(-50%, -50%); 
    display: none;
    width: 100%;
    height: 100%;
    background: url('background.jpg') no-repeat center center;
    background-size: cover;
    opacity: 1;
    transition: opacity 0.6s ease;
}

/* Loading content container */
.loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    width: 90%;
    max-width: 500px;
}

/* Portal container wrapper and image */
.portal-container-wrapper {
    width: 100%;
    max-width: 364px; /* 30% bigger than 280px */
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.portal-container-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    position: relative;
    z-index: 2;
}

/* Spinning portal image inside the circular border */
.portal-spinning-image {
    position: absolute;
    width: 49%;
    height: auto;
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    z-index: 1;
    animation: portalSpin 6s linear infinite;
}

@keyframes portalSpin {
    from { transform: translateX(-50%) rotate(0deg); }
    to   { transform: translateX(-50%) rotate(360deg); }
}

/* Nunito custom fonts */
@font-face {
    font-family: 'Nunito';
    src: url('../Nunito-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}
@font-face {
    font-family: 'Nunito';
    src: url('../Nunito-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

/* Loading text */
.loading-text {
    font-family: 'Nunito', 'Roboto', sans-serif;
    color: #443625;
    text-align: center;
    margin: 0 0 20px 0;
    padding: 0 20px;
    line-height: 1.15;
}

.loading-text-light {
    font-weight: 700;
    font-size: 28px;
    letter-spacing: 0.01em;
    display: block;
}

.loading-text-black {
    font-weight: 900;
    font-size: 28px;
    letter-spacing: 0.01em;
    display: block;
    line-height: 1.25;
}

/* Loading bar styles */
#unity-progress-bar-empty {
    position: relative;
    width: 300px;
    height: 40px;
    background: url('Loading_Bar_empty.png') no-repeat center center;
    background-size: 100% 100%;
    border-radius: 0;
    z-index: 10;
}

/* Clip wrapper — its width grows 0→100%, revealing the water image beneath */
#unity-progress-bar-clip {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    overflow: hidden;
}

/* Responsive - Tablets */
@media (min-width: 768px) {
    .loading-content {
        max-width: 600px;
    }
    
    .portal-container-wrapper {
        max-width: 455px;
        margin-bottom: 25px;
    }
    
    .loading-text { margin-bottom: 25px; }
    .loading-text-light { font-size: 32px; }
    .loading-text-black { font-size: 36px; }
    
    #unity-progress-bar-empty {
        width: 450px;
        height: 60px;
    }
    #unity-progress-bar-full { width: 450px; }
}

/* Responsive - Desktop/Large screens */
@media (min-width: 1024px) {
    .loading-content {
        max-width: 650px;
    }
    
    .portal-container-wrapper {
        max-width: 520px;
        margin-bottom: 30px;
    }
    
    .loading-text { margin-bottom: 30px; }
    .loading-text-light { font-size: 32px; }
    .loading-text-black { font-size: 36px; }
    
    #unity-progress-bar-empty {
        width: 500px;
        height: 66px;
    }
    #unity-progress-bar-full { width: 500px; }
}

/* Responsive - Small height devices (iPhone SE, etc.) */
@media (max-height: 735px) {
    .loading-content {
        max-width: 400px;
        transform: translate(-50%, -50%) scale(0.95);
    }
    
    .portal-container-wrapper {
        max-width: 299px;
        margin-bottom: 15px;
    }
    
    .loading-text { margin-bottom: 15px; }
    .loading-text-light { font-size: 32px; }
    .loading-text-black { font-size: 36px; }
    
    #unity-progress-bar-empty {
        width: 280px;
        height: 37px;
    }
    #unity-progress-bar-full { width: 280px; }
}

/* Responsive - Extra small heights */
@media (max-height: 667px) {
    .loading-content {
        max-width: 350px;
        transform: translate(-50%, -50%) scale(0.85);
    }
    
    .portal-container-wrapper {
        max-width: 260px;
        margin-bottom: 12px;
    }
    
    .loading-text { margin-bottom: 12px; }
    .loading-text-light { font-size: 32px; }
    .loading-text-black { font-size: 36px; }
    
    #unity-progress-bar-empty {
        width: 260px;
        height: 35px;
    }
    #unity-progress-bar-full { width: 260px; }
}

/* Very small devices */
@media (max-width: 375px) {
    .portal-container-wrapper {
        max-width: 312px;
    }
    
    .loading-text { padding: 0 15px; }
    .loading-text-light { font-size: 32px; }
    .loading-text-black { font-size: 36px; }
    
    #unity-progress-bar-empty {
        width: 280px;
    }
    #unity-progress-bar-full { width: 280px; }
}

#unity-progress-bar-full {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 300px; /* always full bar width — clipped by #unity-progress-bar-clip */
    background: url('Loading_Bar_water.png') no-repeat left center;
    background-size: 100% 100%;
    border-radius: 0;
}

#unity-logo { display: none; }
#unity-footer { position: relative }
.unity-mobile #unity-footer { display: none }
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

#orientation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #00483F;
    z-index: 10000;
}

#orientation-overlay img {
    max-width: 100%;
    max-height: 100%;
}

/* Water decoration styling */
.water-decoration {
    position: absolute;
    width: auto;
    height: auto;
    max-width: 190px;
    max-height: 190px;
    pointer-events: none;
    z-index: 1;
}

@media (min-width: 768px) {
    .water-decoration {
        max-width: 300px;
        max-height: 300px;
    }
}

@media (min-width: 1024px) {
    .water-decoration {
        max-width: 350px;
        max-height: 350px;
    }
}

.water-top-left {
    top: 0;
    left: 0;
}

.water-top-right {
    top: 0;
    right: 0;
    transform: scaleX(-1);
}

.water-bottom-left {
    bottom: 0;
    left: 0;
}

.water-bottom-right {
    bottom: 0;
    right: 0;
    transform: scaleX(-1);
}

/* CTA div styles */
.ctaDiv {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 99;
    transition: opacity 0.5s ease;
}

/* Screen content container */
.screen-content {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    width: 100%;
    max-width: 550px;
    margin-top: 10%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

/* Visible state — toggled via JS */
.screen-content.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Tutorial image */
.tutorial-image {
    width: 95%;
    max-width: 500px;
    height: auto;
}

/* FreshFX developed-by screen */
.freshfx-image {
    width: 80%;
    max-width: 400px;
    height: auto;
}

/* Start screen - speech bubble and character */
.speech-bubble {
    width: 80%;
    max-width: 350px;
    height: auto;
    margin-bottom: -30px;
    z-index: 6;
}

.character {
    width: 95%;
    max-width: 400px;
    height: auto;
    z-index: 5;
}

/* Responsive sizing for tablets */
@media (min-width: 768px) {
    .screen-content {
        max-width: 600px;
        margin-top: 5%;
    }
    
    .tutorial-image {
        max-width: 550px;
    }
    
    .speech-bubble {
        max-width: 450px;
        margin-bottom: -40px;
    }
    
    .character {
        max-width: 500px;
    }
}

/* Adjust for smaller height devices (iPhone SE, etc.) */
@media (max-height: 735px) {
    .screen-content {
        max-width: 400px;
        margin-top: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .tutorial-image {
        max-width: 380px;
    }
    
    .speech-bubble {
        max-width: 280px;
        margin-bottom: -25px;
    }
    
    .character {
        max-width: 320px;
    }
}

/* Extra small heights */
@media (max-height: 667px) {
    .screen-content {
        width: 100%;
        max-width: 350px;
        margin-top: 0;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .tutorial-image {
        max-width: 340px;
    }
    
    .speech-bubble {
        max-width: 250px;
        margin-bottom: -20px;
    }
    
    .character {
        max-width: 280px;
    }
}

* {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}
