@font-face {
    font-family: 'Press Start 2P';
    src: url('../src/fonts/PressStart2P-Regular.woff2') format('woff2'),
        url('../src/fonts/PressStart2P-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

body {
    font-family: "Press Start 2P", sans-serif;
    background-color: #8b9bb4;
    color: #ffffff;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    grid-template-columns: 1fr;
    margin: 0 auto;
    padding-inline: 5px;
    height: 100dvh;
    max-width: 450px;
}

header {
    text-align: center;
    letter-spacing: 0.5rem;
    padding: 0.5rem;
    color: #f1c40f;
    text-shadow: 0.1rem 0.1rem 0 #000000;
    font-size: 1rem;
}

#game-info {
    display: grid;
    grid-template-rows: auto auto auto;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    margin-bottom: 5px;
}

#lives {
    border-radius: 10px 0px 0px 0px;
    grid-column: 1;
    text-align: left;
}

#cash {
    border-radius: 0px 10px 0px 0px;
    grid-column: 2;
    text-align: right;
}

#message {
    grid-column: 1 / span 2;
    text-align: center;
    font-size: 0.6rem;
}

#timer {
    grid-column: 1 / span 2;
    text-align: center;
    background-color: #000000;
}

.info-box {
    font-size: 0.5rem;
    padding: 0.5rem;
    color: #ffffff;
    background-color: #34495e;
    text-align: center;
}

.info-box.success {
    background-color: #4caf50;
}

.info-box.warning {
    background-color: #e74c3c;
}

.info-box.level-up {
    background-color: #f1c40f;
}

.letter-container {
    border: 0.2rem solid #000000;
    border-width: 0.2rem 0.2rem 0.8rem 0.2rem;
    background-color: #34495e;
    display: grid;
    grid-template-rows: 1fr 1fr 1fr 1fr;
    padding: 1rem;
    text-align: left;
    font-size: 0.6rem;
    margin-bottom: 5px;
    position: relative;
}

.letter-container p {
    text-align: center;
    margin: 5px;
}

.letter-name {
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    color: #f4d03f;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(4, auto);
    grid-template-rows: repeat(7, 1fr);
    background-color: #577590;
    width: 100%;
    padding: 0;
    margin: 0 auto;
    height: 80%;
}

.grid-item {
    background-color: #8b9bb4;
    border: 0.7px solid #ffffff;
    color: #ffffff;
    text-align: center;
    font-size: 8px;
    cursor: pointer;
    margin: 0;
    padding: 5px;
}

.grid-item-number {
    background-color: #7954a9;
}

.grid-item-text {
    background-color: #4a69bd;
}

.grid-item.disabled {
    border: 0.6px dashed #ffffff;
    cursor: default;
    pointer-events: none;
    background-color: #8b9bb4;
}

.grid-item:active {
    background-color: #82ccdd;
}

button {
    font-family: "Press Start 2P", sans-serif;
    font-size: 1em;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 12px 24px;
    cursor: pointer;
    margin: 20px auto 0;
    display: block;
}

@media (hover: hover) {
    button:hover {
        background-color: #82ccdd;
    }
}

dialog {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #34495e;
    color: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 8px;
    width: 300px;
    text-align: center;
    font-size: 13px;
    font-family: monospace;
    margin: auto;
    padding: 10px;
    animation: fade-in 0.3s ease-out;
    position: absolute;
}

.dialog-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

img {
    height: 15vh;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.6);
}

dialog p {
    margin: 0;
    margin: 8px;
    position: relative;
    text-align: center;
}

.dialog-button {
    font-family: "Press Start 2P", sans-serif;
    font-size: 0.8em;
    background-color: #4a69bd;
    color: #ffffff;
    border: 2px solid #ffffff;
    padding: 10px 20px;
    cursor: pointer;
    margin: 20px 0 10px;
    transition: background-color 0.3s, transform 0.2s;
    width: fit-content;
}

.dialog-button:hover {
    background-color: #82ccdd;
}

.dialog-button:focus {
    outline: 2px dashed #ffffff;
    outline-offset: 4px;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}