@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lexend', sans-serif;
}

:root {
    --main: #ffffff;
    --secondary: #3a3a3c;
    --accent: #7e7e7e;
    --green: #0fd34a;
    --yellow: #ddd123;
    --gray: #dad9d9;
}

body {
    background-color: var(--main);
    color: var(--secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;

    > h1 {
        font-size: 1rem;
    }

    > h1 span {
        font-size: 0.65rem;
        opacity: 0.6;
        margin-left: 0.25rem;
    }
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    gap: 1.5rem;
}

.grid {
    display: grid;
    gap: 6px;
    margin-top: 3rem 0;
    justify-content: center;
}

.tile {
    width: 60px;
    aspect-ratio: 1 / 1;
    border: 4px solid #3a3a3c;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    text-transform: uppercase;
    font-weight: bold;
    transition: 0.2s ease;
}

.hintbox {
    font-size: 14px;
    opacity: 0.8;
    text-align: center;
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.row {
    display: flex;
    justify-content: center;
    gap: 0.25rem;
}

button {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 3px solid #676868;
    background-color: var(--accent);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    min-width: 35px;
}

button.wide {
    min-width: 60px;
}

button:hover {
    filter: brightness(1.2);
    animation: wobble 0.4s ease;
}

button:active {
    filter: brightness(0.8);
    animation-direction: reverse;
}

.spacer {
    width: 2rem;
}

.information-panel {
    position: fixed;
    bottom: 1rem;
    left: 1rem;
    background-color: var(--secondary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: bold;

    > button {
        margin-top: 1rem;
        background-color: var(--accent);
        padding: 0.25rem 0.75rem;
        border: none;
        border-radius: 6px;
        color: white;
        font-size: 0.9rem;
        font-weight: bold;
        cursor: pointer;
    }
}

.popup {
    position: fixed;
    top: 0.5rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--secondary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.popup.show {
    opacity: 1;
}

dialog {
    border: none;
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    background-color: var(--main);
    color: var(--secondary);
    justify-self: center;
    align-self: center;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

dialog h2 {
    margin-bottom: 1rem;
}

dialog button {
    margin-top: 1rem;
    background-color: var(--accent);
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
}

.correct {
    background-color: var(--green) !important;
    border-color: var(--green) !important;
}

.present {
    background-color: var(--yellow) !important;
    border-color: var(--yellow) !important;
}

.wrong {
    background-color: var(--gray) !important;
    border-color: var(--gray) !important;
}

.pop {
    animation: pop 0.3s ease;
}

@keyframes wobble {
    0% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(5deg) scale(0.9);
    }
    50% {
        transform: rotate(0deg) scale(1);
    }
    75% {
        transform: rotate(-5deg) scale(0.9);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 600px) {
    .grid {
        margin-top: 5rem;
    }
    .tile {
        width: 70px;
        aspect-ratio: 1 / 1;
        font-size: 1rem;
    }

    .hintbox {
        font-size: 12px;
    }

    .information-panel {
        top: 1rem;
        bottom: unset;
        right: 1rem;
        left: unset;
        font-size: 1rem;
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.25rem;
        padding-left: 0.5rem;

        > button {
            font-size: 1rem;
            padding: 0.25rem 0.5rem;
            margin-top: 0;
        }
    }

    .keyboard {
        gap: 0.20rem;
        width: 100%;
        margin-top: auto;
        margin-bottom: 1rem;
    }

    .row {
        gap: 0.20rem;
    }

    button {
        padding: 0.25rem 0.55rem;
        font-size: 1rem;
        height: 50px;
    }
}
