* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

body {
    background-color: #050508;
    color: #ffffff;
    font-family: 'Press Start 2P', cursive, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
}

#hud {
    width: 100%;
    max-width: 448px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

.hud-column {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hud-label {
    font-size: 10px;
    color: #fdba74;
    letter-spacing: 1px;
}

.hud-value {
    font-size: 14px;
    color: #ffffff;
}

#audio-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 16px;
    transition: opacity 0.2s, background 0.2s;
}

#audio-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
}

#canvas-wrapper {
    width: 100%;
    max-width: 448px;
    aspect-ratio: 448 / 576;
    border: 3px solid #1e3a8a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(30, 58, 138, 0.5);
    background-color: #000000;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#status-bar {
    width: 100%;
    max-width: 448px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    min-height: 32px;
    padding: 0 4px;
}

#lives-box, #fruits-box {
    display: flex;
    gap: 6px;
    align-items: center;
}

.life-icon, .fruit-icon {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
}

#dpad-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    width: 100%;
    max-width: 280px;
}

.dpad-middle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 8px;
}

.dbtn {
    background: #1e293b;
    color: #e2e8f0;
    border: 2px solid #334155;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    padding: 14px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.1s, background-color 0.1s;
    touch-action: manipulation;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.dbtn:active {
    transform: scale(0.92);
    background-color: #3b82f6;
    border-color: #60a5fa;
}

.dbtn-up, .dbtn-down {
    width: 33%;
}

.dbtn-pause {
    background: #334155;
    font-size: 14px;
    flex: 0.8;
}

@media (min-width: 768px) {
    #dpad-container {
        display: none;
    }
}
