* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

body {
    font-family: 'Courier New', monospace;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

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

#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    z-index: 10;
}

#score, #highscore {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background: #000;
    padding: 10px 20px;
    border: 1px solid #fff;
}

#start-screen, #game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.hidden {
    display: none !important;
}

#start-screen h1, #game-over-screen h1 {
    font-size: 48px;
    color: #fff;
    margin-bottom: 20px;
    text-transform: uppercase;
}

#start-screen p, #game-over-screen p {
    font-size: 16px;
    color: #fff;
    margin-bottom: 30px;
}

button {
    font-size: 18px;
    font-family: 'Courier New', monospace;
    padding: 12px 30px;
    background: #000;
    color: #fff;
    border: 2px solid #fff;
    cursor: pointer;
}

button:hover {
    background: #fff;
    color: #000;
}

button:disabled {
    border-color: #555;
    color: #555;
    cursor: not-allowed;
}

#final-score {
    font-size: 32px;
    color: #fff;
    font-weight: bold;
}

#name-input-container {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}

#player-name {
    font-size: 16px;
    font-family: 'Courier New', monospace;
    padding: 10px 20px;
    border: 2px solid #fff;
    background: #000;
    color: #fff;
    outline: none;
    width: 200px;
}

#player-name::placeholder {
    color: #555;
}

#save-score-btn {
    font-size: 14px;
    padding: 10px 20px;
}

#leaderboard {
    border: 1px solid #fff;
    padding: 20px;
    margin: 20px 0;
    min-width: 280px;
    max-height: 200px;
    overflow-y: auto;
    background: #000;
}

#leaderboard h2 {
    color: #fff;
    margin-bottom: 15px;
    text-align: center;
    font-size: 18px;
}

#leaderboard-list {
    list-style: none;
    counter-reset: rank;
}

#leaderboard-list li {
    padding: 8px 15px;
    margin: 5px 0;
    background: #111;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #fff;
    border: 1px solid #333;
}

#leaderboard-list li::before {
    counter-increment: rank;
    content: counter(rank) ".";
    color: #fff;
    margin-right: 10px;
}

#restart-btn {
    margin-top: 10px;
}