
/* =========================================
   RUSH TEAM - RESPONSIVE WEBGL
   Canvas original : 930 x 660
   ========================================= */

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #020911;
}

body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: #020911;
    color: white;
}

img {
    max-width: 100%;
    height: auto;
}

/* =========================================
   CONTENEUR DU JEU
   ========================================= */

#unity-container {
    position: relative;
    width: 100%;
    max-width: 930px;
    aspect-ratio: 930 / 660;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    background: #020911;
}

/* Ordinateur et mobile */
#unity-container.unity-desktop,
#unity-container.unity-mobile {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 930px;
    height: auto;
    aspect-ratio: 930 / 660;
    margin: 0 auto;
    transform: none;
}

/* =========================================
   CANVAS UNITY
   ========================================= */

#unity-canvas {
    position: absolute;
    top: 0;
    left: 0;
    display: block;

    width: 931px;
    height: 661px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none !important;

    background-color: #020911;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
	
	image-rendering: auto;

    -webkit-user-select: none;
    user-select: none;
}

/* Bouton de lancement centré et responsive */
#loading-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    z-index: 5;

    /* Limite selon la largeur ET la hauteur du conteneur */
    width: min(500px, 100cqw, 100cqh);
    height: min(500px, 100cqw, 100cqh);

    margin: 0;
    padding: 0;

    cursor: pointer;

    background-image: url("BtnGameLoad_1.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

#loading-button:focus-visible {
    outline: 2px solid white;
    outline-offset: -4px;
}

/* =========================================
   BARRE DE CHARGEMENT
   ========================================= */

#unity-loading-bar {
    position: absolute;
    inset: 0;
    z-index: 10;

    display: none;
    width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;
    transform: none;

    pointer-events: none;
}

/* Texte de chargement */
#unity-loading-text {
    position: absolute;
    right: 5%;
    bottom: 48px;
    left: 5%;

    width: 90%;
    margin: 0;
    padding: 0;

    font-family: Verdana, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;

    color: white;

    text-shadow:
        -1px -1px 0 #000,
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000;
}

/* Fond de la progression */
#unity-progress-bar-empty {
    position: absolute;
    bottom: 10px;
    left: 50%;

    width: min(588px, 90%);
    height: 17px;

    margin: 0;
    padding: 0;

    transform: translateX(-50%);
    overflow: hidden;

    background-image: url("progressEmpty.Dark.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

/* Progression réelle */
#unity-progress-bar-full {
    display: block;

    width: 0%;
    max-width: 100%;
    height: 100%;

    margin: 0;
    padding: 0;

    background-image: url("progressFull.Dark.png");
    background-position: left center;
    background-repeat: no-repeat;
    background-size: auto 100%;
}

/* =========================================
   LOGOS UNITY
   ========================================= */

#unity-logo {
    width: 154px;
    height: 130px;
    max-width: 100%;

    background-image: url("unity-logo-dark.png");
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

/* =========================================
   PIED DE PAGE UNITY
   ========================================= */

#unity-footer {
    position: relative;
    width: 100%;
    min-height: 38px;
    overflow: hidden;
}

.unity-mobile #unity-footer {
    display: none;
}

#unity-logo-title-footer {
    float: left;
    width: 102px;
    height: 38px;

    background-image: url("unity-logo-title-footer.png");
    background-position: center;
    background-repeat: no-repeat;
}

#unity-build-title {
    float: right;
    margin-right: 10px;

    font-family: Arial, sans-serif;
    font-size: 18px;
    line-height: 38px;
}

#unity-fullscreen-button {
    float: right;
    width: 38px;
    height: 38px;

    cursor: pointer;

    background-image: url("fullscreen-button.png");
    background-position: center;
    background-repeat: no-repeat;
}

/* =========================================
   AVERTISSEMENTS UNITY
   ========================================= */

#unity-warning {
    position: absolute;
    top: 5%;
    left: 50%;
    z-index: 20;

    display: none;
    width: max-content;
    max-width: 95%;

    padding: 10px;
    transform: translateX(-50%);

    background: white;
    color: black;
    overflow-wrap: anywhere;
}

/* =========================================
   SITE NON AUTORISÉ
   ========================================= */

#NotAllowed {
    width: 100%;
    min-height: 100vh;
    padding: 24px 16px;

    color: white;
    text-align: center;
    overflow-wrap: anywhere;
}

#NotAllowed center {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

#NotAllowed img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 16px auto;
}

/* =========================================
   ERREUR WEBGL 2
   ========================================= */

#NoWebGL2 {

    width: 100%;
    min-height: 100vh;


    overflow: hidden;

    background: #020911;
    color: white;
}

#NoWebGL2 center {
    width: 100%;
}

#NoWebGL2 .webgl-background {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
	
	z-index: 5;

    width: 100%;
    max-width: 930px;
    height: auto;
    margin: 0 auto;
}

#NoWebGL2 .webgl-error-message {
    position: relative;
    width: 100%;
    max-width: 600px;
	
	z-index: 6;

    margin: 100px auto;
    padding: 20px;

    background: rgba(2, 9, 17, 0.45);
    color: white;

    line-height: 1.6;
    overflow-wrap: anywhere;
}

#NoWebGL2 a {
    color: #8dc8ff;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* =========================================
   TABLETTES
   ========================================= */

@media screen and (max-width: 930px) {
    #unity-container,
    #unity-container.unity-desktop,
    #unity-container.unity-mobile {
        width: 100%;
        max-width: 100%;
    }

    #unity-canvas {
        width: 100% !important;
        height: 100% !important;
    }
}

/* =========================================
   MOBILES
   ========================================= */

@media screen and (max-width: 600px) {
    #unity-loading-text {
        bottom: 35px;
        font-size: 10px;
    }

    #unity-progress-bar-empty {
        bottom: 15px;
        width: 90%;
        height: 12px;
    }

    #unity-progress-bar-full {
        height: 100%;
    }

    #unity-build-title {
        font-size: 12px;
    }

    #unity-warning {
        top: 2%;
        padding: 6px;
        font-size: 12px;
    }

    #NotAllowed {
        padding: 16px 12px;
        font-size: 14px;
    }

    #NoWebGL2 {
        padding: 12px;
    }

    #NoWebGL2 .webgl-error-message {
        padding: 14px;
        font-size: 14px;
    }
}

/* =========================================
   TRÈ PETITS ÉCRANS
   ========================================= */

@media screen and (max-width: 360px) {
    #unity-loading-text {
        bottom: 27px;
        font-size: 9px;
    }

    #unity-progress-bar-empty {
        bottom: 10px;
        height: 9px;
    }

    #NoWebGL2 .webgl-error-message {
        padding: 10px;
        font-size: 13px;
    }
}
