body {
    margin: 0;
    padding: 10px;
    background-color: #1a0c04;
    color: #c8922a;
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
}

.container {
    text-align: center;
    width: 100%;
    max-width: 800px;
}

h1 {
    color: #f5c842;
    text-shadow: 0 0 12px #c8720a, 0 0 24px #8b4000;
    margin-bottom: 10px;
    font-size: 2em;
    letter-spacing: 0.15em;
}

.info-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

#status, #playerCount {
    padding: 5px 10px;
    background-color: #1f0e04;
    border: 1px solid #c8722a;
    font-size: 12px;
}

#playerCount {
    color: #f5c842;
    border-color: #f5c842;
}

#gameCanvas {
    border: 2px solid #c8722a;
    background-color: #0d0800;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    max-width: 100%;
    display: block;
    margin: 0 auto;
}

.controls {
    margin-top: 10px;
    color: #7a5a2a;
    font-size: 12px;
}

.controls p {
    margin: 5px 0;
}

#nameInput {
    background: #1f0e04;
    border: 1px solid #c8722a;
    color: #c8922a;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 3px 6px;
    width: 120px;
}

#nameInput:focus {
    outline: none;
    border-color: #f5c842;
}

#nameBtn {
    background: #1f0e04;
    border: 1px solid #c8722a;
    color: #c8922a;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    padding: 3px 8px;
    cursor: pointer;
}

#nameBtn:hover {
    background: #2a1505;
    border-color: #f5c842;
    color: #f5c842;
}

#leaderboard {
    color: #c8922a;
    font-family: monospace;
    background: #1f0e04;
    padding: 10px;
    border: 1px solid #c8722a;
    margin: 20px auto;
    max-width: 400px;
}

#leaderboard h3 {
    margin: 0 0 10px 0;
    color: #f5c842;
    text-shadow: 0 0 8px #c8720a;
}

#leaderboardList {
    text-align: left;
    font-size: 12px;
}

#leaderboardList div {
    padding: 2px 0;
}

/* Mobile controls */
#mobileControls {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 20px 20px;
    background: linear-gradient(transparent, rgba(26,12,4,0.92));
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
}

#mobileControls.visible {
    display: flex;
}

#dpad {
    display: grid;
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(3, 56px);
    gap: 3px;
    pointer-events: auto;
}

.dpad-btn {
    background: rgba(200, 114, 42, 0.2);
    border: 2px solid #c8722a;
    color: #c8922a;
    font-size: 22px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.dpad-btn:active, .dpad-btn.pressed {
    background: rgba(200, 114, 42, 0.55);
    color: #f5c842;
}

#btnUp    { grid-column: 2; grid-row: 1; }
#btnLeft  { grid-column: 1; grid-row: 2; }
#btnRight { grid-column: 3; grid-row: 2; }
#btnDown  { grid-column: 2; grid-row: 3; }

#btnShoot {
    width: 80px;
    height: 80px;
    background: rgba(200, 114, 42, 0.2);
    border: 2px solid #c8722a;
    color: #c8922a;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    pointer-events: auto;
}

#btnShoot:active, #btnShoot.pressed {
    background: rgba(245, 200, 66, 0.45);
    border-color: #f5c842;
    color: #f5c842;
}

@media (max-width: 820px) {
    body {
        padding-bottom: 200px;
    }
}
