/* Styling elements for the Wordle app */
/* Where possible, referenced the NY Times version of the game to get specific colors */
/* basic styling elements are structured for a mobile device in portrait mode */

* {
    margin: auto;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --page-font-family: "Times New Roman", "Clear Sans", "Helvetica Neue", Arial, sans-serif;
    --tile-border-color: #d3d6da;
    --tile-answer-wrong-place: #c9b458;
    --tile-answer-right: #6aaa64;
    --tile-answer-wrong: #3a3a3c;
    --btn-hover: #bf2e1a;
    --btn-color: rgb(91, 101, 246);
}

body {
    margin: 0;
    font-family: var(--page-font-family);
    background-color: #f8f9fa;
}

.game-title {
    font-family: var(--page-font-family);
    font-weight: bold;
    color: #212529;
    margin-bottom: 1rem;
}

.game-controls {
    margin-bottom: 1rem;
}

#answer {
    color: var(--btn-hover);
    font-weight: bold;
    min-height: 2rem;
}

hr{
    margin-top: 0;
    margin-bottom: 0;
}

.btn-game {
    border: none;
    font-family: var(--page-font-family);
    font-weight: bold;
    color: var(--btn-color);
    background-color: white;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    transition: all 0.2s ease;
}

.btn-game:hover {
    background-color: var(--btn-hover);
    color: white;
    transform: translateY(-1px);
}

.game-board {
    max-width: 400px;
    margin: 0 auto;
}

#board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    grid-gap: 0.5rem;
    margin-bottom: 2rem;
}

.rows {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 0.25rem;
    justify-content: center;
}

.tiles {
    width: 30px;
    height: 30px;
    border: 2px solid var(--tile-border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    background-color: white;
}

.virtual-keyboard {
    max-width: 500px;
    margin: 0 auto;
}

.keyBoardRow {
    display: flex;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.key {
    font-weight: bold;
    border: 0;
    padding: 0.75rem 0.25rem;
    margin: 0 0.125rem;
    border-radius: 0.25rem;
    cursor: pointer;
    background-color: var(--tile-border-color);
    flex: 1 1 0%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    font-size: 0.875rem;
    max-width: 2.5rem;
    min-height: 2.5rem;
}

.key[id="Enter"],
.key[id="Backspace"] {
    flex: 1.5 1 0%;
    max-width: 4rem;
    font-size: 0.75rem;
}

#Key {
    background-color: transparent;
    cursor: default;
}

.tile-wrong,
.key.key-wrong {
    background-color: var(--tile-answer-wrong);
    color: white;
    border: none;
}

.tile-right,
.key.key-right {
    background-color: var(--tile-answer-right);
    color: white;
    border: none;
}

.tile-wrong-place,
.key.key-wrong-place {
    background-color: var(--tile-answer-wrong-place);
    color: white;
    border: none;
}

/* Source for animation: https://www.w3schools.com/css/css3_animations.asp */
.animated {
    animation: flip 1s ease;
}

@keyframes flip {
    0% {
        transform: scaleY(1);
    }

    50% {
        transform: scaleY(0);
    }

    100% {
        transform: scaleY(1);
    }
}


/* Responsive adjustments */
@media (min-width: 768px) {
    .game-board {
        max-width: 450px;
    }

    .tiles {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }

    .key {
        font-size: 1rem;
        padding: 1rem 0.5rem;
        min-height: 3rem;
    }

    .key[id="Enter"],
    .key[id="Backspace"] {
        font-size: 0.875rem;
    }
}

@media (min-width: 992px) {
    .game-board {
        max-width: 500px;
    }

    .tiles {
        width: 50px;
        height: 50px;
        font-size: 2.25rem;
    }
}