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

body {
    font-family: 'Arial', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0F6FF 100%);
}

#game-container {
    position: relative;
    width: 400px;
    height: 600px;
}

#gameCanvas {
    display: block;
    border: 3px solid #333;
    border-radius: 10px;
    background: #87CEEB;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    color: white;
    z-index: 10;
}

.screen.hidden {
    display: none;
}

h1 {
    font-size: 48px;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
}

h2 {
    font-size: 36px;
    margin-bottom: 20px;
}

p {
    font-size: 20px;
    margin-bottom: 30px;
}

button {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    color: white;
    background: #FF6B6B;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

button:hover {
    background: #FF5252;
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(0,0,0,0.4);
}

button:active {
    transform: translateY(0);
}

#score-display {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    z-index: 5;
}

#score-display.hidden {
    display: none;
}

#audio-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 15px;
    border-radius: 25px;
    z-index: 15;
}

#mute-btn {
    padding: 8px 12px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    min-width: 50px;
}

#mute-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

#volume-slider {
    width: 100px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    outline: none;
    cursor: pointer;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

#volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Leaderboard styles */
#leaderboard-screen {
    overflow-y: auto;
    padding: 20px;
}

#leaderboard-container {
    width: 90%;
    max-height: 400px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

#leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
}

.leaderboard-entry:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(5px);
}

.leaderboard-entry.highlight {
    background: rgba(255, 215, 0, 0.3);
    border: 2px solid #FFD700;
}

.entry-rank {
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    font-size: 18px;
}

.entry-emoji {
    font-size: 24px;
    margin: 0 10px;
}

.entry-name {
    flex: 1;
    font-weight: bold;
    text-align: left;
}

.entry-score {
    font-weight: bold;
    font-size: 20px;
    color: #FFD700;
    min-width: 60px;
    text-align: right;
}

#leaderboard-buttons {
    display: flex;
    gap: 15px;
}

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

#player-name-input {
    padding: 10px 15px;
    font-size: 18px;
    border: 2px solid #FFD700;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    text-align: center;
    outline: none;
}

#player-name-input:focus {
    border-color: #FFA500;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

#submit-score-btn {
    background: #4CAF50;
}

#submit-score-btn:hover {
    background: #45a049;
}

#view-leaderboard-btn,
#view-leaderboard-btn-gameover {
    background: #FFD700;
    color: #333;
    margin-top: 10px;
}

#view-leaderboard-btn:hover,
#view-leaderboard-btn-gameover:hover {
    background: #FFC700;
}

#refresh-leaderboard-btn {
    background: #2196F3;
}

#refresh-leaderboard-btn:hover {
    background: #0b7dda;
}
