body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
        "Helvetica Neue", Arial;
    background: linear-gradient(180deg, #0f1724, #061022);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h3 {
    font-size: 1.1em;
    color: #b8bfc39f;
    font-weight: 400;
    text-align: center;
    margin-top: 0px;
}

#grid {
    width: 400px;
    height: 400px;
    box-shadow: 0 6px 20px rgba(2, 6, 23, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(13, 33, 51, 0.04);
    display: flex;
    flex-wrap: wrap;
    background-image: url(images/grass.gif);
    background-size: cover;
    background-position: center;
}

#grid div {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(0, 0, 0, 0.077);
    box-sizing: border-box;
}

.boneco {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.alien {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url(images/alien.png);
}

/* ===== D‑pad styles ===== */
#dpad {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 168px;
    height: 168px;
    z-index: 100;
    display: grid;
    grid-template-columns: 56px 56px 56px;
    grid-template-rows: 56px 56px 56px;
    gap: 8px;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

#dpad .up {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
}
#dpad .left {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
}
#dpad .right {
    grid-column: 3 / 4;
    grid-row: 2 / 3;
}
#dpad .down {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
}

.dpad-btn {
    width: 100%;
    height: 100%;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    -webkit-tap-highlight-color: transparent;
    outline: none;
    transition: transform 0.08s ease, background 0.08s ease;
    touch-action: manipulation;
}

.dpad-btn:active,
.dpad-btn.active {
    transform: translateY(2px) scale(0.985);
    background: rgba(255, 255, 255, 0.12);
}

.dpad-btn svg {
    filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.6));
}

/* esconder D‑pad no desktop */
@media (min-width: 900px) {
    #dpad {
        display: none;
    }
}

