/* TemplateData/style.css - modifica per Unity WebGL loading colors */

/* reset base (mantieni se gi� presente) */
body {
    padding: 0;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* container positioning (mantieni la tua logica attuale se diversa) */
#unity-container {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    overflow: hidden;
}

    #unity-container.unity-desktop {
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        position: absolute;
    }

    #unity-container.unity-mobile {
        position: fixed;
        width: 100%;
        height: 100%;
    }

/* CANVAS background durante il caricamento */
#unity-canvas {
    width: 100%;
    height: 100%;
    /* colore di background richiesto */
    background: #EFEFEF !important;
    display: block;
    outline: none;
}

/* Loading bar responsive - sostituisci il blocco precedente */
#unity-loading-bar {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    z-index: 1000;
    text-align: center;
    pointer-events: none;
    width: min(92vw, 380px); /* larghezza responsive: max 380px, altrimenti 92% viewport */
    max-width: 380px;
    padding: 6px 10px;
    box-sizing: border-box;
}

/* Outer (empty) bar */
#unity-progress-bar-empty {
    width: 100%;
    height: 18px;
    margin: 0 auto;
    background-color: #C4B0A9 !important;
    border-radius: 12px;
    padding: 2px;
    box-sizing: border-box;
    background-image: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12) inset;
    overflow: hidden; /* evita artefatti su piccoli schermi */
}

/* Inner (full) bar */
#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    border-radius: 10px;
    background-color: #985545 !important;
    background-image: none !important;
    transition: width 200ms linear;
    min-width: 6%; /* rende visibile anche progress molto piccolo */
    box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}

/* Logo, footer, warning ecc. (mantieni o personalizza) */
#unity-logo {
    width: 154px;
    height: 130px;
    background: url('logo.png') no-repeat center;
}

#unity-footer {
    position: relative;
    display: flex;
    flex-direction: row-reverse;
    gap: 4px;
    align-items: center;
    padding: 8px;
}

.unity-mobile #unity-footer {
    position: fixed;
    top: 0;
    right: 0;
    color: white;
}

#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;
    color: #222;
}

#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: 2000;
}

/* Mobile-specific tweaks */
@media (max-width: 640px) {
    /* Sposto leggermente la barra verso il basso per non sovrapporsi al footer / altri elementi fissi */
    #unity-loading-bar {
        position: fixed;
        top: auto;
        bottom: 18vh; /* lascia spazio verticale; regola se hai elementi fissi in basso */
        transform: translateX(-50%);
        width: calc(100vw - 40px); /* margine laterale */
        max-width: 520px;
        padding: 8px 12px;
    }

    #unity-progress-bar-empty {
        height: 16px;
        border-radius: 10px;
        padding: 2px;
    }

    #unity-progress-bar-full {
        border-radius: 8px;
        min-width: 8%;
    }
}

/* fallback per orientamento verticale stretto (es. telefono in portrait molto stretto) */
@media (max-height: 500px) and (max-width: 420px) {
    #unity-loading-bar {
        bottom: 14vh;
    }

    #unity-progress-bar-empty {
        height: 14px;
    }
}
