/* =====================================================
   ASCE BrainStorming - Wordle Module
   Joomla-scoped stylesheet
   ===================================================== */


/* ---------- Module Container ---------- */

#asce-wordle-game {
    width: 100%;
    max-width: 700px;

    margin: 0 auto;
    padding: 30px 20px;

    display: flex;
    flex-direction: column;
    align-items: center;

    color: #1f2937;
}


/* ---------- Header ---------- */

#asce-wordle-game h2 {
    margin: 0;

    font-size: 2rem;

    letter-spacing: 0.5px;

    text-align: center;
}


#asce-wordle-game h3 {
    margin: 8px 0 20px;

    font-size: 1rem;

    font-weight: normal;

    color: #6b7280;

    text-transform: uppercase;

    letter-spacing: 2px;

    text-align: center;
}

/* ---------- Wordle Rules Link ---------- */

#asce-wordle-game .wordle-rules-link {
    margin: 8px 0 12px;

    font-size: 0.9rem;

    text-align: center;

    color: #6b7280;
}


#asce-wordle-game .wordle-rules-link a {
    font-weight: bold;

    text-decoration: underline;
}


#asce-wordle-game .wordle-rules-link a:hover {
    opacity: 0.8;
}
/* ---------- Message Area ---------- */

#asce-wordle-game #message-area {
    min-height: 30px;

    margin-bottom: 15px;

    font-weight: bold;

    text-align: center;
}


/* =====================================================
   GAME BOARD
   ===================================================== */

#asce-wordle-game #game-board {
    display: grid;

    grid-template-columns: repeat(5, 60px);
    grid-template-rows: repeat(6, 60px);

    gap: 6px;

    margin-bottom: 35px;
}


/* ---------- Individual Tiles ---------- */

#asce-wordle-game .tile {
    width: 60px;
    height: 60px;

    border: 2px solid #d1d5db;

    display: flex;

    justify-content: center;
    align-items: center;

    font-size: 2rem;

    font-weight: bold;

    text-transform: uppercase;

    user-select: none;
}


/* Tile containing a typed letter */

#asce-wordle-game .tile.filled {
    border-color: #6b7280;
}


/* Correct letter and correct location */

#asce-wordle-game .tile.correct {
    background-color: #538d4e;

    border-color: #538d4e;

    color: white;
}


/* Correct letter but wrong location */

#asce-wordle-game .tile.present {
    background-color: #b59f3b;

    border-color: #b59f3b;

    color: white;
}


/* Letter is not in the answer */

#asce-wordle-game .tile.absent {
    background-color: #787c7e;

    border-color: #787c7e;

    color: white;
}


/* =====================================================
   KEYBOARD
   ===================================================== */

#asce-wordle-game #keyboard {
    width: 100%;
    max-width: 520px;

    display: flex;
    flex-direction: column;

    gap: 8px;
}


#asce-wordle-game .keyboard-row {
    display: flex;

    justify-content: center;

    gap: 6px;
}


/* ---------- Keyboard Keys ---------- */

#asce-wordle-game .key {
    min-width: 38px;
    height: 58px;

    border: none;

    border-radius: 4px;

    background-color: #d3d6da;

    color: #1f2937;

    font-weight: bold;

    cursor: pointer;

    text-transform: uppercase;

    flex: 1;

    transition: opacity 0.15s ease;
}


#asce-wordle-game .key:hover {
    opacity: 0.85;
}


/* Enter and Backspace */

#asce-wordle-game .key-wide {
    flex: 1.5;

    font-size: 0.75rem;
}


/* ---------- Keyboard Letter States ---------- */

#asce-wordle-game .key.correct {
    background-color: #538d4e;

    color: white;
}


#asce-wordle-game .key.present {
    background-color: #b59f3b;

    color: white;
}


#asce-wordle-game .key.absent {
    background-color: #787c7e;

    color: white;
}


/* =====================================================
   MOBILE RESPONSIVENESS
   ===================================================== */

@media (max-width: 500px) {

    #asce-wordle-game {
        padding: 20px 10px;
    }


    #asce-wordle-game #game-board {
        grid-template-columns: repeat(5, 52px);
        grid-template-rows: repeat(6, 52px);
    }


    #asce-wordle-game .tile {
        width: 52px;
        height: 52px;

        font-size: 1.6rem;
    }


    #asce-wordle-game .key {
        min-width: 28px;
        height: 54px;
    }

}