/* ====== CSS UNITY PAR DÉFAUT ====== */

body {
    padding: 0;
    margin: 0;
}

#unity-container {
    position: absolute;
}

#unity-container.unity-desktop {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

#unity-container.unity-mobile {
    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: 300px;
    height: 130px;
    background: url('logo-inersio.png') no-repeat center;
    background-size: contain;
}

#unity-progress-bar-empty {
    width: 141px;
    height: 18px;
    margin: 10px auto 0 auto;
    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;
}

.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-family: arial;
    font-size: 18px;
}

#unity-fullscreen-button {
    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;
}

/* ====== DESIGN INERSIO AR ====== */

:root {
    --dark-blue: #041729;
    --cta-blue: #05A6D4;
    --text-white: #ffffff;
    --text-muted: #b9c1cc;
    --radius-card: 32px;
    --radius-button: 999px;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body {
    height: 100dvh;
    background: #041729;
    font-family: var(--font-main);
    color: var(--text-white);
    overscroll-behavior: none;
    touch-action: manipulation;
}

/* Page d’accueil AR */
.page {
    position: fixed;
    inset: 0;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100dvh;
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: #0d1724;
    overflow: hidden;
    z-index: 99;
    background-image: url("phone-ar-bg.png");
    background-size: cover;
    background-position: center bottom;
}

/* Bandeau haut avec pointe */
.header {
    background: var(--dark-blue);
    padding: 24px 16px 60px;
    position: relative;
    text-align: center;
    z-index: 2;
}

.header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -40px;
    margin: 0 auto;
    width: 0;
    height: 0;
    border-left: 50vw solid transparent;
    border-right: 50vw solid transparent;
    border-top: 40px solid var(--dark-blue);
}


/* Logo 80% largeur écran */
.logo {
    width: 80vw;
    max-width: 320px;
    height: auto;
}

/* Zone centrale – icône AR */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0 24px 0;
    z-index: 1;
}

.ar-icon {
    height: 90px;
    max-width: 80vw;
    width: auto;
    margin-top: 50px;
}

/* Panel bas avec blur */
.footer {
    padding: 24px 20px 32px;
    z-index: 2;
}

.cta-card {
    background: rgba(4, 23, 41, 0.55);
    border-radius: var(--radius-card);
    padding: 22px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.cta-text {
    display: flex;
    flex-direction: column;
}

.cta-title {
    margin: 0;
    font-weight: 600;
    font-size: 18px;
}

.cta-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-muted);
}

.cta-button {
    border: none;
    border-radius: var(--radius-button);
    background: var(--cta-blue);
    color: var(--text-white);
    padding: 12px 30px;
    font-weight: 600;
    font-size: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.1s ease-in-out, filter 0.1s ease-in-out;
}

.cta-button:hover {
    filter: brightness(1.05);
}

.cta-button:active {
    transform: scale(0.98);
}

/* Panneaux overlay */
.ctaDiv {
    z-index: 99;
}

/* Orientation paysage : message + blocage scroll */
@media screen and (orientation: landscape) {
    body::before {
        content: "Veuillez tourner votre appareil en mode portrait.";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 20px;
        text-align: center;
        background: rgba(4, 4, 4, 0.8);
        color: #f0f0f0;
        padding: 20px;
        border-radius: 10px;
        width: 80%;
        z-index: 9999;
    }

    #unity-container {
        display: none;
    }

    .cta-button {
        display: none;
    }

    html,
    body {
        overflow: hidden;
    }
}

/* Tablette : toujours plein écran */
@media (min-width: 768px) {
    .page {
        border-radius: 0;
        box-shadow: none;
    }
}
