/* ---- Modal ---- */

#modal-overlay {
    position: fixed;
    inset: 0;
    background-color: #f4f4f0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 32px;
}

#modal-logo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    width: 90px;
    height: 90px;
    border: 3px solid #1a1a1b;
    padding: 6px;
    border-radius: 10px;
    margin-bottom: 24px;
    background-color: #1a1a1b;
}

.logo-cell {
    background-color: white;
    border-radius: 2px;
}

.logo-cell.logo-green {
    background-color: var(--body-green);
}

.logo-cell.logo-yellow {
    background-color: var(--body-yellow);
}

.logo-cell.logo-pink {
    background-color: var(--body-pink);
}

.modal-title {
    font-size: 52px;
    font-weight: 900;
    margin: 0 0 16px;
    color: #1a1a1b;
    letter-spacing: 2px;
}

.modal-desc {
    font-size: 22px;
    color: #1a1a1b;
    margin: 0 0 36px;
    line-height: 1.45;
}

#play-btn {
    background-color: #1a1a1b;
    color: white;
    border: none;
    padding: 14px 48px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Schibsted Grotesk', sans-serif;
}

#play-btn:hover {
    opacity: 0.8;
}

#gameover-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(244, 244, 240, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

#gameover-overlay.active {
    display: flex;
}

#gameover-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 48px 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    gap: 28px;
}

#gameover-message {
    font-family: 'Schibsted Grotesk', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1b;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#play-again-btn {
    background-color: var(--body-pink);
    color: white;
    border: none;
    padding: 14px 48px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Schibsted Grotesk', sans-serif;
}

#play-again-btn:hover {
    opacity: 0.85;
}

/* ---- End Modal ---- */

body {
    background-color: white;
    font-family: 'Schibsted Grotesk', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    --body-grey: #e2e3eb;
    --body-charcoal:  #747479;
    --body-green: #83fad2;
    --body-yellow: #f5f6c6;
    --body-pink: #cd9ac6;
    --body-blue: #69c4f5;
    --body-purple:  #cb5ad7;
    --bvody-dark-green: #618e4a;
}


section#top {
    display: flex;
    justify-items: center;
    align-items: center;
    background-image: url(../assets/grass-copy.png);
    background-size: 100%;
}

section#top > div {
    font-size: 30px;
    padding: 20px;
}

div.center {
    display: flex;
    flex-direction: column;
    align-content: center;
    justify-content: center;
}


h1 {
    display: flex;
    flex-wrap: wrap;
    color: var(--body-purple);
    height: 100px;
    font-size: 80px;
    align-content: center;
    justify-content: center;
    margin: 0;
    font-weight: 900;
    letter-spacing: 2px;
    font-family: 'Schibsted Grotesk', sans-serif;
}

#message {
    position: fixed;
    top: 116px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--bvody-dark-green);
    font-size: 20px;
    font-weight: bold;
    font-family: 'Schibsted Grotesk', sans-serif;
    border-radius: 10px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 500;
    display: none;
}

#message:not(:empty) {
    display: block;
    background: white;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
    padding: 10px 24px;
}


section.board {
    display: flex;
    flex-direction: column;
    /* background-color: var(--body-grey); */
    /* border: 3px solid var(--body-grey); */
    /* padding: 6px; */
    justify-content: center;
    align-content: center;
    margin-top: 76px;
}

.sqr {
    display: flex;
    border: 3px solid var(--body-grey);
    font-size: 42px;
    font-weight: bold;
    color: var(--body-charcoal);
    height: 60px;
    width: 60px;
    text-transform: uppercase;
    align-items: center;
    justify-content: center;
    margin: 4px;
}

.flip {
    animation: 0.5s linear flipping;
}

@keyframes flipping {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

.pop {
    animation: popping 200ms ease-in-out;
}

@keyframes popping {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.wiggle {
    animation: wiggling 300ms ease-in-out;
}

@keyframes wiggling {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-7px); }
    40%  { transform: translateX(7px); }
    60%  { transform: translateX(-7px); }
    80%  { transform: translateX(7px); }
    100% { transform: translateX(0); }
}


#resetBtn {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.resetBtn {
    background-color: var(--body-pink);
    width: 180px;
    height: 36px;
    border-radius: 10px;
}

button {
    background-color: var(--body-pink);
    border: none;
    color: white;
    font-size: 20px;
}

.row {
    display: flex;
    justify-content: space-around;
}

section.keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 12px 0;
    gap: 6px;
}

.keyboard > div {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 56px;
    padding: 0 4px;
    color: black;
    font-weight: bold;
    background-color: var(--body-grey);
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Schibsted Grotesk', sans-serif;
    cursor: pointer;
}

.key-wide {
    min-width: 64px;
    font-size: 12px;
}

.green {
    border: 3px solid var(--body-green);;
    background-color: var(--body-green);
}

.yellow {
    border: 3px solid var(--body-yellow);;
    background-color: var(--body-yellow);
}

.black {
    border: 3px solid var(--body-charcoal);
    background-color: var(--body-charcoal);
    color: white;
}

.top-row {
    display: flex;
}


@media (max-width: 500px) {
    
    h1 {
        display: flex;
        font-size: 28px;
        height: 40px;
        align-content: center;
        margin: 0;
        font-weight: 900;
        letter-spacing: 2px;
        font-family: 'Schibsted Grotesk', sans-serif;
    }
    #message {
        font-size: 14px;
        top: 76px;
    }
    section.board {
        margin-top: 52px;
    }

    section#top > div {
        display: flex;
        background-image: none;
        font-size: 18px;
        height: 40px;
        padding: 10px;
    }

    .sqr {
        font-size: 24px;
        font-weight: bold;
        border: 1.5px solid var(--body-grey);
        height: 30px;
        width: 30px;
        margin: 1.5px;
    }

    section.keyboard {
        gap: 4px;
    }
    .keyboard > div {
        gap: 4px;
    }
    .key {
        min-width: 28px;
        height: 42px;
        font-size: 11px;
    }
    .key-wide {
        min-width: 46px;
        font-size: 10px;
    }
    
    #resetBtn {
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .resetBtn {
        background-color: var(--body-pink);
        width: 100px;
        height: 26px;
        border-radius: 10px;
    }
    
    button {
        background-color: var(--body-pink);
        border: none;
        color: white;
        font-size: 14px;
    }
}