#jogo-cobrinha {
    width: 100%;
    max-width: 500px;
}

.cobrinha-info-bar {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--cor-titulo);
}

#cobrinha-board {
    display: grid;
    width: 100%;
    aspect-ratio: 1 / 1;
    background-color: #c8e6c9; /* Verde claro de fundo */
    border: 5px solid #388e3c; /* Verde escuro */
    border-radius: 8px;
    /* Adiciona um padrão de grade sutil */
    background-image:
        linear-gradient(to right, #b2dfdb 1px, transparent 1px),
        linear-gradient(to bottom, #b2dfdb 1px, transparent 1px);
    background-size: calc(100% / 20) calc(100% / 20); /* 20 é o GRID_SIZE */
}

/* Célula base da grade (invisível) */
.cobrinha-cell {
    width: 100%;
    height: 100%;
}

/* Corpo da cobra com gradiente e sombra */
.snake-body {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    border-radius: 4px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}

/* Cabeça da cobra, destacada e com olhos */
.snake-head {
    background: linear-gradient(135deg, #1b5e20, #388e3c);
    border-radius: 4px;
    z-index: 10;
    position: relative;
    /* Animação de "comer" */
    transition: transform 0.1s;
}

.snake-head.eat-animation {
    transform: scale(1.3);
}

/* Olhos da cobra */
.snake-head::after {
    content: '';
    position: absolute;
    width: 20%;
    height: 20%;
    background-color: white;
    border-radius: 50%;
    top: 20%;
    right: 20%;
    box-shadow: 0 0 2px black;
}
.snake-head::before {
    content: '';
    position: absolute;
    width: 20%;
    height: 20%;
    background-color: white;
    border-radius: 50%;
    top: 20%;
    left: 20%;
    box-shadow: 0 0 2px black;
}


/* Comida com visual de maçã e animação */
.food {
    background-color: #e53935; /* Vermelho maçã */
    border-radius: 50%;
    box-shadow: inset -3px -3px 5px rgba(0,0,0,0.3);
    animation: pulse-food 1s infinite alternate;
}

@keyframes pulse-food {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.popup-container {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.popup-container.show {
    display: flex;
}

.popup {
    background: var(--cor-fundo);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
}
body, html {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center; /* Centraliza horizontalmente */
    align-items: center;     /* Centraliza verticalmente */
    background-color: #f1f8e9;
}

main {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    box-sizing: border-box;
}
