body{
    margin:0;
    background:#10151f;
    color:white;
    font-family:Segoe UI, sans-serif;
}

.page{
    display:flex;
    min-height:100vh;
}

/* =========================
   MENU
   ========================= */

.sidebar{
    width:280px;
    padding:20px;
    background:#1b2230;
    border-right:1px solid #39465d;
}

.menu-card{
    background:#232c3d;
    padding:20px;
    border-radius:10px;
}

.radio-line{
    display:block;
    margin-bottom:15px;
}

.draw-button{
    width:100%;
    margin-top:20px;
    padding:12px;
    border:none;
    border-radius:6px;
    background:#d4a843;
    color:white;
    font-size:16px;
    cursor:pointer;
}

.draw-button:hover{
    opacity:0.9;
}

/* =========================
   CONTENU
   ========================= */

.content{
    flex:1;
    padding:30px;
}

.content h1{
    text-align:center;
    margin-bottom:40px;
}

/* =========================
   TIRAGE EN CROIX
   ========================= */

.cross-layout{
    width:900px;
    margin:0 auto;

    display:grid;

    grid-template-columns: 250px 250px 250px;

    grid-template-areas:
        ". fortune ."
        "past present future"
        ". misfortune ."
        ". cause .";

    justify-content:center;
    align-items:center;

    row-gap:30px;
}

.cross-layout > div{
    text-align:center;
}

.fortune{ grid-area:fortune; }
.past{ grid-area:past; }
.present{ grid-area:present; }
.future{ grid-area:future; }
.misfortune{ grid-area:misfortune; }
.cause{ grid-area:cause; }

/* =========================
   TIRAGE 3 CARTES
   ========================= */

.three-layout{
    width:700px;
    margin:0 auto;

    display:grid;
    grid-template-columns: repeat(3, 1fr);

    gap:30px;
}

.three-layout > div{
    text-align:center;
}

/* =========================
   CARTES
   ========================= */

.card-image{
    width:120px;
    height:auto;

    display:block;
    margin:auto;

    cursor:pointer;

    /* IMPORTANT : rotation + animation propre */
    transform: rotate(var(--rot, 0deg));
    transition: transform .25s ease;
}

/* hover sans casser la rotation */
.card-image:hover{
    transform: rotate(var(--rot, 0deg)) scale(1.08);
}

/* fallback si tu utilises encore la classe reverse */
.card-image.reverse{
    --rot: 180deg;
}

/* =========================
   INTERPRETATIONS
   ========================= */

.interpretation{
    margin-top:30px;
    background:#1b2230;
    padding:20px;
    border-radius:10px;
}

.interpretation pre{
    white-space:pre-wrap;
    word-wrap: break-word;

    color:#e0e0e0;
    font-size:15px;
    line-height:1.6;

    font-family:inherit;
}

/* =========================
   MODALE
   ========================= */

.modal-overlay{
    display:none;

    position:fixed;
    top:0;
    left:0;

    width:100%;
    height:100%;

    background:rgba(0,0,0,0.88);

    z-index:9999;

    justify-content:center;
    align-items:center;
}

.modal-overlay.active{
    display:flex;
}

.modal-content{
    position:relative;

    width:90%;
    max-width:1300px;
    max-height:90vh;

    overflow-y:auto;

    padding:30px;
    border-radius:12px;

    background:#1b2230;

    display:flex;
    align-items:flex-start;
    gap:40px;

    box-shadow:0 0 30px rgba(0,0,0,0.6);
}

/* IMAGE ZOOMÉE */

.modal-card{
    display:block;

    max-width:350px;
    max-height:80vh;

    width:auto;
    height:auto;

    flex-shrink:0;
}

/* TEXTE */

.modal-description{
    flex:1;
    overflow-y:auto;
}

.modal-description h2{
    margin-top:0;
    color:#d4a843;
}

.modal-description pre{
    white-space:pre-wrap;
    word-wrap: break-word;

    color:#e0e0e0;
    font-size:15px;
    line-height:1.6;

    font-family:inherit;
}

/* FERMETURE */

.close-modal{
    position:absolute;
    top:10px;
    right:20px;

    color:white;
    font-size:42px;

    cursor:pointer;
}

.close-modal:hover{
    opacity:0.7;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width:1100px){

    .page{
        flex-direction:column;
    }

    .sidebar{
        width:auto;
        border-right:none;
        border-bottom:1px solid #39465d;
    }

    .cross-layout,
    .three-layout{
        width:100%;
    }

    .modal-content{
        flex-direction:column;
        align-items:center;
    }

    .modal-card{
        max-width:250px;
        max-height:60vh;
    }
}