/* =====================================================
   JOEMY EVEN'S PHOTObooth
   STYLE COMPLET - SANS ZOOM
   ===================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* =====================================================
   PAGE
   ===================================================== */

html,
body {

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

}


body {

    background:
        linear-gradient(
            #1b1400,
            #000
        );

    color: #fff;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    display: flex;

    justify-content: center;

    align-items: center;

    min-height: 100vh;

    overflow-x: hidden;

}


/* =====================================================
   CONTENEUR
   ===================================================== */

.container {

    width: 95%;

    max-width: 900px;

    margin: 20px auto;

    text-align: center;

}


/* =====================================================
   LOGO
   ===================================================== */

.logo {

    width: 220px;

    max-width: 80%;

    height: auto;

    display: block;

    margin: 0 auto 20px auto;

    object-fit: contain;

    filter:
        drop-shadow(
            0 0 18px #FFD000
        );

}


/* =====================================================
   TITRE
   ===================================================== */

h1 {

    color: #FFD000;

    font-size: 34px;

    margin-bottom: 10px;

}


/* =====================================================
   SOUS-TITRE
   ===================================================== */

.subtitle {

    color: #ddd;

    line-height: 28px;

    margin-bottom: 25px;

    font-size: 20px;

}


/* =====================================================
   CAMÉRA
   ===================================================== */

/*
IMPORTANT :

Aucun object-fit: cover
Aucun zoom
Aucun crop

La totalité de l'image caméra est affichée.
*/

video {

    display: block;

    width: 100%;

    max-width: 100%;

    height: auto;

    aspect-ratio: auto;

    object-fit: contain;

    object-position: center;

    border-radius: 20px;

    border: 4px solid #FFD000;

    background: #111;

}


/* =====================================================
   PHOTO FINALE
   ===================================================== */

/*
La photo finale conserve exactement
les proportions créées par camera.js.
*/

#photo {

    display: block;

    width: 100%;

    max-width: 100%;

    height: auto;

    object-fit: contain;

    object-position: center;

    border-radius: 20px;

    border: 4px solid #FFD000;

    background: #111;

}


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

#canvas {

    display: none;

}


/* =====================================================
   APERÇU
   ===================================================== */

#preview {

    width: 100%;

    max-width: 100%;

    height: auto;

    margin-top: 20px;

}


/* =====================================================
   SÉLECTEUR DE CADRES
   ===================================================== */

#frameSelector {

    width: 100%;

    margin: 15px auto 25px auto;

}


#frameSelector h2 {

    color: #FFD000;

    margin:
        8px
        0
        15px
        0;

}


/* =====================================================
   GRILLE DES CADRES
   ===================================================== */

.frames-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 10px;

    width: 100%;

}


/* =====================================================
   BOUTON CADRE
   ===================================================== */

.frame-choice {

    width: 100%;

    margin: 0;

    padding: 5px;

    border:
        2px solid
        rgba(
            212,
            175,
            55,
            .45
        );

    border-radius: 12px;

    background: #111;

    color: #fff;

    cursor: pointer;

    font-weight: bold;

    transition: .3s;

    box-shadow: none;

}


.frame-choice:hover {

    transform: translateY(-2px);

    border-color: #FFD700;

}


.frame-choice.selected {

    border-color: #D4AF37;

    box-shadow:
        0 0 12px
        rgba(
            212,
            175,
            55,
            .65
        );

}


/* =====================================================
   IMAGE DES CADRES
   ===================================================== */

.frame-choice img {

    width: 100%;

    height: auto;

    aspect-ratio: 3 / 2;

    object-fit: contain;

    object-position: center;

    border-radius: 8px;

    display: block;

}


/* =====================================================
   NOM DU CADRE
   ===================================================== */

.frame-choice span {

    display: block;

    padding:
        5px
        2px
        3px;

    font-size: 13px;

}


/* =====================================================
   BOUTONS PRINCIPAUX
   ===================================================== */

button {

    margin-top: 25px;

    padding:
        18px
        30px;

    border: none;

    border-radius: 40px;

    background: #FFD000;

    color: #000;

    font-size: 22px;

    font-weight: bold;

    cursor: pointer;

    box-shadow:
        0 0 25px
        #FFD000;

    transition: .3s;

}


button:hover {

    transform: scale(1.05);

    box-shadow:
        0 0 35px
        #FFD000;

}


button:disabled {

    opacity: .6;

    cursor: not-allowed;

    transform: none;

}


/* =====================================================
   BOUTONS REFAIRE / CONTINUER
   ===================================================== */

.buttons {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 15px;

    flex-wrap: wrap;

}


.buttons button {

    min-width: 160px;

}


/* =====================================================
   COMPTE À REBOURS
   ===================================================== */

#countdown {

    position: fixed;

    top: 50%;

    left: 50%;

    transform:
        translate(
            -50%,
            -50%
        );

    font-size: 120px;

    font-weight: bold;

    color: #FFD000;

    text-shadow:
        0 0 40px
        #FFD000;

    display: none;

    z-index: 9999;

    pointer-events: none;

}


/* =====================================================
   MOBILE
   ===================================================== */

@media (max-width: 600px) {


    .container {

        width: 95%;

        margin:
            15px
            auto;

    }


    .logo {

        width: 180px;

    }


    h1 {

        font-size: 28px;

    }


    .subtitle {

        font-size: 17px;

        line-height: 24px;

    }


    .frames-grid {

        grid-template-columns:
            repeat(2, 1fr);

    }


    video,
    #photo {

        width: 100%;

        height: auto;

        object-fit: contain;

    }


    #countdown {

        font-size: 100px;

    }


    button {

        font-size: 18px;

        padding:
            15px
            24px;

    }

}


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

@media (max-width: 400px) {


    .frames-grid {

        grid-template-columns:
            repeat(2, 1fr);

        gap: 7px;

    }


    .frame-choice span {

        font-size: 11px;

    }


    .container {

        width: 94%;

    }


    #countdown {

        font-size: 80px;

    }

}