/* =========================================
   RESET
========================================= */

* {
    box-sizing: border-box;
}


/* =========================================
   BODY
========================================= */

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}


body {

    min-height: 100vh;

    background: #071722;

    color: white;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    padding: 25px 15px;

}


/* =========================================
   GENERATOR
========================================= */

.generator {

    width: 100%;

    max-width: 650px;

    margin: 0 auto;

}


/* =========================================
   HEADER
========================================= */

.header {

    text-align: center;

    margin-bottom: 20px;

}


.header h1 {

    margin: 0 0 8px;

    font-size: clamp(
        25px,
        6vw,
        40px
    );

    font-weight: 800;

}


.header p {

    margin: 0 0 8px;

    font-size: 18px;

    font-weight: 600;

}


.header small {

    display: block;

    max-width: 550px;

    margin: 0 auto;

    color: #b8c5cc;

    line-height: 1.5;

}


/* =========================================
   POSTER
========================================= */

.poster {

    position: relative;

    width: 100%;

    overflow: hidden;

    border-radius: 18px;

    background: #111;

    user-select: none;

}


/* =========================================
   BACKGROUND
========================================= */

.background {

    display: block;

    width: 100%;

    height: auto;

    position: relative;

    z-index: 1;

    pointer-events: none;

    user-select: none;

}


/* =========================================
   PHOTO ZONE
========================================= */

.photo-zone {


    position: absolute;
    z-index: 2;
    left: 370px;
    top: 22%;
    width: 38%;
    height: 56%;
    overflow: hidden;
    cursor: grab;
    touch-action: none;

}


/* =========================================
   PHOTO UTILISATEUR
========================================= */

.user-photo {

    position: absolute;

    left: 50%;

    top: 50%;

    width: 100%;

    height: 100%;

    object-fit: cover;

    transform:
        translate(-50%, -50%)
        scale(1)
        rotate(0deg);

    transform-origin: center center;

    pointer-events: none;

    user-select: none;

    -webkit-user-drag: none;

}


/* =========================================
   CONTROLES
========================================= */

.controls {

    margin-top: 20px;

    padding: 20px;

    background: #102838;

    border-radius: 20px;

}


/* =========================================
   UPLOAD
========================================= */

.upload-btn {

    display: block;

    width: 100%;

    padding: 17px;

    background: #38a9ff;

    color: #071722;

    text-align: center;

    font-size: 18px;

    font-weight: 700;

    border-radius: 50px;

    cursor: pointer;

    transition: transform 0.15s ease;

}


.upload-btn:hover {

    transform: scale(1.01);

}


/* =========================================
   STATUS
========================================= */

.status-message {

    text-align: center;

    color: #b8c5cc;

    line-height: 1.5;

    margin: 18px 0;

}


/* =========================================
   CONTROL
========================================= */

.control {

    margin-top: 20px;

}


.control-title {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 8px;

}


.control-title strong {

    color: #38a9ff;

}


.control input[type="range"] {

    width: 100%;

    cursor: pointer;

}


/* =========================================
   BUTTONS
========================================= */

.buttons {

    display: flex;

    gap: 10px;

    margin-top: 25px;

}


.buttons button {

    flex: 1;

    border: none;

    padding: 16px;

    border-radius: 50px;

    font-size: 16px;

    font-weight: 700;

    cursor: pointer;

    transition:
        transform 0.15s ease,
        opacity 0.15s ease;

}


#resetBtn {

    background: #294252;

    color: white;

}


#downloadBtn {

    background: #38a9ff;

    color: #071722;

}


.buttons button:hover:not(:disabled) {

    transform: translateY(-2px);

}


.buttons button:disabled {

    opacity: 0.4;

    cursor: not-allowed;

}


/* =========================================
   MOBILE
========================================= */

@media (max-width: 600px) {

    body {

        padding: 15px 10px;

    }


    .controls {

        padding: 15px;

    }


    .buttons {

        flex-direction: column;

    }


    .buttons button {

        width: 100%;

    }

}