/* ==========================
   VARIABLES
========================== */

:root {
    --pink-light: #F9DDD8;
    --pink-mid:   #F8D0C8;
    --green-sage: #A7B59E;
    --green-dark: #5B744B;
    --green-deep: #0d4e0d;
    --text-dark:  #333;
    --slot-size:  36px;
    --radius-lg:  12px;
    --radius-sm:  8px;
    --shadow:     0 4px 14px rgba(0,0,0,0.18);
}

/* ==========================
   RESET
========================== */

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

/* ==========================
   BODY
========================== */

body {
    font-family: 'Georgia', serif;
    background-color: var(--pink-light);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(167,181,158,0.25) 0%, transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(248,208,200,0.4) 0%, transparent 50%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* ==========================
   MAIN CONTAINER
========================== */

.container {
    background: var(--green-sage);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    max-width: 450px;
    width: 100%;
}

h1 {
    text-align: center;
    color: var(--text-dark);
    font-size: 2rem;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

h2 {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--green-deep);
    font-size: 1.8rem;
}

/* ==========================
   INPUTS / BUTTONS
========================== */

input {
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 10px;
    border-radius: var(--radius-sm);
    border: 1px solid #bbb;
    background: rgba(255,255,255,0.75);
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(91,116,75,0.2);
}

button {
    width: 100%;
    background-color: var(--pink-mid);
    color: var(--green-deep);
    padding: 11px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    margin-top: 10px;
    font-weight: bold;
    font-family: inherit;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
    transition: background-color 0.2s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

button:hover {
    background-color: var(--pink-light);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

button:active {
    transform: scale(0.98);
}

/* ==========================
   MODAL
========================== */

#difficulty-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.modal-content {
    background: var(--green-sage);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    min-width: 300px;
    box-shadow: var(--shadow);
    animation: popIn 0.2s ease;
}

@keyframes popIn {
    from { transform: scale(0.92); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* ==========================
   PLAY SECTION
========================== */

#play-section {
    position: fixed;
    inset: 0;
    background: var(--pink-light);
    background-image:
        radial-gradient(circle at 20% 30%, rgba(167,181,158,0.25) 0%, transparent 55%),
        radial-gradient(circle at 80% 70%, rgba(248,208,200,0.4) 0%, transparent 50%);
    overflow-y: auto;
    padding: 2rem;
}

.game-container {
    max-width: 600px;
    margin: 0 auto;
    background: var(--green-sage);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ==========================
   COLOR PALETTE
========================== */

#color-palette {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.7);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.color-btn:hover {
    transform: scale(1.15);
    border-color: var(--green-dark);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.color-btn.selected {
    border-color: #fff;
    box-shadow: 0 0 0 3px var(--green-dark);
    transform: scale(1.1);
}

/* ==========================
   GUESS AREA
========================== */

#guess-area {
    background: rgba(255,255,255,0.35);
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2rem;
    text-align: center;
}

#guess-area p {
    font-weight: bold;
    color: var(--green-dark);
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

#guess-slots {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.guess-slot {
    width: var(--slot-size);
    height: var(--slot-size);
    border-radius: 50%;
    background-color: rgba(232,232,232,0.8);
    border: 2px solid #999;
    box-shadow: inset 0 3px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
}

.guess-slot:hover {
    border-color: var(--green-dark);
    transform: scale(1.05);
}

.guess-slot.filled {
    border-style: solid;
    border-color: rgba(255,255,255,0.6);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* ==========================
   BOARD
========================== */

#board {
    margin-top: 1rem;
}

.game-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 4px 0;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.slot {
    width: var(--slot-size);
    height: var(--slot-size);
    border-radius: 50%;
    background: rgba(128,128,128,0.28);
    border: 2px solid var(--green-dark);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);
    transition: box-shadow 0.2s;
}

/* ==========================
   FEEDBACK
========================== */

.feedback {
    display: flex;
    flex-wrap: wrap;
    width: 24px;
    gap: 4px;
    margin-left: 10px;
    align-content: flex-start;
}

.feedback div {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(180,180,180,0.5);
    border: 1px solid rgba(0,0,0,0.1);
}

/* Couleurs de feedback (à appliquer via JS) */
.feedback div.correct {
    background: #1a1a1a;
}

.feedback div.misplaced {
    background: #f0f0f0;
}

/* ==========================
   ACTIVE ROW
========================== */

.active-row {
    background: rgba(255,255,255,0.3);
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(91,116,75,0.15);
}

/* ==========================
   BEST SCORE BOX
========================== */

#best-score-box {
    text-align: center;
    background: var(--green-dark);
    color: var(--pink-light);
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    font-weight: bold;
    font-family: inherit;
    font-size: 1.2rem;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.15);
    margin-bottom: 1rem;
}

/* ==========================
   RESPONSIVE
========================== */

@media (max-width: 480px) {
    .game-container,
    .container {
        padding: 1.2rem;
    }

    #play-section {
        padding: 1rem;
    }

    :root {
        --slot-size: 30px;
    }

    .color-btn {
        width: 34px;
        height: 34px;
    }

}