/* ---------------------------------------------------------
   RESET
--------------------------------------------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Roboto", Arial, sans-serif;
    background: url('https://images.unsplash.com/photo-1544785349-c4a5301826fd') no-repeat center center fixed;
    background-size: cover;
    color: #fff;
    overflow-x: hidden;
}

/* Overlay sombre */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: -1;
}

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */
.header {
    text-align: center;
    margin: 20px 0;
}

.logo {
    width: 130px;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 2.4em;
    font-weight: 700;
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* ---------------------------------------------------------
   LAYOUT
--------------------------------------------------------- */
.container-flex {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 20px;
    width: 100%;
}

/* LEFT PANEL */
.left-panel {
    width: 320px;
    background: rgba(0,0,0,0.6);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.15);
}

.left-panel h2 {
    color: #ff4747;
    margin-bottom: 10px;
}

.left-panel ul {
    list-style: none;
    margin-bottom: 25px;
}

.left-panel ul li {
    margin: 6px 0;
    font-size: 1.05em;
}

.left-panel p {
    font-size: 0.95em;
    line-height: 1.5;
}

/* ---------------------------------------------------------
   CALENDRIER
--------------------------------------------------------- */
.right-panel {
    flex-grow: 1;
}

#calendrier {
    display: grid;
    grid-template-columns: repeat(6, 110px);
    gap: 18px;
    justify-content: center;
}

/* ---------------------------------------------------------
   CASES
--------------------------------------------------------- */
.case {
    width: 110px;
    height: 110px;
    padding: 20px;
    background: #111;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    border: 2px solid #333;
    transition: 0.2s ease-in-out;
    cursor: pointer;
}

.case:hover {
    border-color: #ff3d28;
    transform: scale(1.04);
}

/* ❌ VERROUILLÉ PAR DÉFAUT */
.case-locked {
    opacity: 0.25;
    pointer-events: none;
}

/* ✅ MAIS LES JOURS PASSÉS RESTENT CLIQUABLES */
.case.past {
    background: #4f4949;
    opacity: 0.6;
    pointer-events: auto !important;
    cursor: pointer;
}

.case.past:hover {
    opacity: 0.9;
    border-color: rgba(255,255,255,0.3);
}

/* Jour du jour */
.case.today {
    background: linear-gradient(135deg, #ff7a00, #ffae42);
    color: #fff;
    animation: pulse 1.5s infinite;
}

/* Jours futurs */
.case.future {
    background: #2E2E2E;
    color: #FFF;
    cursor: not-allowed;
}

/* Numéro */
.numero {
    font-size: 1.6em;
    font-weight: 700;
}

/* ---------------------------------------------------------
   ANIMATIONS
--------------------------------------------------------- */
@keyframes pulse {
    50% { transform: scale(1.05); }
}

/* ---------------------------------------------------------
   POPUP
--------------------------------------------------------- */
.popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.popup.hidden {
    display: none;
}

.popup-content {
    background: #fff;
    color: #222;
    padding: 25px 30px;
    border-radius: 12px;
    width: 360px;
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
    position: relative;
    animation: popupAnim 0.25s ease-out;
}

@keyframes popupAnim {
    from { transform: scale(0.8); opacity:0; }
    to   { transform: scale(1); opacity:1; }
}

.popup-close {
    position:absolute;
    right:12px;
    top:12px;
    background:none;
    border:none;
    font-size: 1.5em;
    cursor:pointer;
}

/* Boutons */
.btn {
    margin-top: 18px;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 6px;
    background: #ff3d32;
    color: #fff;
    cursor: pointer;
    font-size: 1em;
}

.btn:hover {
    background: #d82b21;
}

.btn.hidden {
    display: none;
}

/* ---------------------------------------------------------
   FORMULAIRE
--------------------------------------------------------- */
#gain-form label {
    display: block;
    margin-top: 10px;
    font-size: 0.9em;
}

#gain-form input {
    width: 100%;
    padding: 8px;
    margin-top: 4px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

/* ---------------------------------------------------------
   NEIGE
--------------------------------------------------------- */
#snow {
    pointer-events: none;
}

.snowflake {
    position: fixed;
    top: -10px;
    user-select: none;
    animation: snowfall linear infinite;
}

@keyframes snowfall {
    from { transform: translateY(0); }
    to   { transform: translateY(120vh); }
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */
@media (max-width: 1100px) {
    .container-flex {
        flex-direction: column;
        align-items: center;
    }

    .left-panel {
        width: 90%;
    }

    #calendrier {
        grid-template-columns: repeat(4, 90px);
    }

    .case {
        width: 90px;
        height: 90px;
    }
}

@media (max-width: 600px) {
    #calendrier {
        grid-template-columns: repeat(3, 85px);
    }

    .case {
        width: 85px;
        height: 85px;
    }
}