/* --- REGOLE GENERALI --- */
body { 
    padding: 0; 
    margin: 0; 
    background-color: #000; 
    font-family: Arial, sans-serif;
}

/* --- LAYER PUBBLICITÀ SOVRAPPOSTO (Sempre in primo piano) --- */
#ad-overlay-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center; /* Centra orizzontalmente */
    align-items: center;     /* Centra verticalmente */
    z-index: 999999;         /* Sopra a qualsiasi elemento Unity */
}

/* Sfondo scurito opaco al 90% con sfocatura */
.ad-dimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); 
    backdrop-filter: blur(10px); /* Sfoca il gioco dietro */
}

/* Box centrale che contiene l'annuncio */
.ad-centered-content {
    position: relative;
    background: #ffffff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.8);
    text-align: center;
    z-index: 1000000;
}

/* --- RISOLUZIONE FISSA GESTIBILE --- */
#ad-fixed-box {
    width: 750px;  /* Cambia la larghezza qui */
    height: 100px;  /* Cambia l'altezza qui */
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    margin: 10px auto;
    border: 1px solid #ddd;
}

/* Tasto X di chiusura */
.ad-close-button {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 48px;
    height: 48px;
    background-color: #ff0000;
    color: #fff;
    border: 3px solid #fff;
    border-radius: 50%;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    transition: transform 0.2s;
}

.ad-close-button:hover {
    transform: scale(1.1);
    background-color: #d00000;
}

/* Testi dell'overlay */
.ad-top-label { font-size: 11px; color: #999; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 8px; }
.ad-bottom-instruction { font-size: 13px; color: #555; margin-top: 15px; }

/* --- LAYOUT ORIGINALE UNITY (Modificato per centratura) --- */
#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% }

#unity-canvas { background: #231F20 }
.unity-mobile #unity-canvas { width: 100%; height: 100% }

#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
#unity-logo { width: 154px; height: 130px; background: url('unity-logo-dark.png') no-repeat center }
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-dark.png') no-repeat center }
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-dark.png') no-repeat center }

#unity-footer { position: relative; height: 38px; background: #231F20; color: #fff; }
.unity-mobile #unity-footer { display: none }
#unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center }
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; 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 }