body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background-color: #f0f0f0;
    margin: 0;
    overflow: hidden; 
    padding-top: 5px; /* Reduzido para economizar espaço no topo */
    overscroll-behavior-y: contain;
}

h1 {
    color: #333;
    font-size: 1.1em; /* Reduzido de 1.5em */
    margin: 4px 0; /* Margem minimizada */
}

#game-container {
    position: relative;
    border: 2px solid #333;
    overflow: hidden; 
    width: 88vw; /* Reduzido ligeiramente para ajustar proporção */
    max-width: 340px; /* Reduzido de 400px para garantir ajuste vertical */
    aspect-ratio: 1 / 1;
}

canvas {
    display: block;
    background-color: transparent; 
    width: 100%; 
    height: 100%;
    touch-action: none; 
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

#game-over-screen.hidden {
    display: none;
}

#restart-button {
    padding: 8px 16px;
    font-size: 1em;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    background-color: #4CAF50;
    color: white;
    margin-top: 10px;
}

/* CONTROLES MOBILE COMPACTOS */
#mobile-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 6px;
    width: 100%;
    max-width: 340px;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 4px;
}

.control-btn {
    width: 42px; /* Reduzido de 50px */
    height: 42px; /* Reduzido de 50px */
    font-size: 20px;
    font-weight: bold;
    background-color: #3c78d8;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
    box-shadow: 0 3px #2a5393;
}

.control-btn:active {
    background-color: #2a5393;
    box-shadow: 0 0 #2a5393;
    transform: translateY(3px);
}

/* MARCAÇÃO DE LETRAS COMPACTA */
#alphabet-tracker {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px; 
    padding: 4px; /* Reduzido */
    background-color: #ddd;
    border-radius: 5px;
    width: 90vw; 
    max-width: 340px;
    box-sizing: border-box;
}

.letter-box {
    width: 18px; /* Reduzido de 25px */
    height: 18px; /* Reduzido de 25px */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1px; /* Reduzido */
    background-color: #fff;
    border: 1px solid #ccc;
    font-weight: bold;
    font-size: 0.75em; /* Fonte reduzida de 1em para 0.75em */
    border-radius: 2px;
}

.letter-box.correct {
    background-color: #4CAF50; 
    color: white;
}

.letter-box.incorrect {
    background-color: #f44336; 
    color: white;
}

html, body {
  overflow: hidden;
}