* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

.game-container {
    position: relative;
    background: #1a1a2e;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#gameCanvas {
    display: block;
    background: linear-gradient(to bottom, #87CEEB 0%, #98D8C8 50%, #7FB069 100%);
}

.ui-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 10;
}

.score-display {
    display: flex;
    gap: 20px;
}

.health-display {
    color: #ff6b6b;
}

.menu, .game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.95);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    color: white;
    z-index: 20;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
}

.menu h1, .game-over h2 {
    font-size: 48px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.controls-info {
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.8;
    color: #ccc;
}

.controls-info p:first-child {
    font-weight: bold;
    color: white;
    margin-bottom: 10px;
}

.btn {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    margin: 10px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn:active {
    transform: translateY(0);
}

.pause-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 15;
}

.pause-overlay h2 {
    font-size: 48px;
    margin-bottom: 20px;
}

.pause-overlay p {
    font-size: 24px;
    color: #ccc;
}

#gameOverMessage {
    font-size: 20px;
    margin: 20px 0;
    color: #ccc;
    white-space: pre-line;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.game-over-buttons .btn {
    width: 100%;
    margin: 0;
}

.btn-secondary {
    background: linear-gradient(45deg, #4a90e2, #357abd);
}

.btn-danger {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
}

.leaderboard {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.95);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    color: white;
    z-index: 25;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
    min-width: 500px;
    max-width: 600px;
}

.leaderboard h2 {
    font-size: 36px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.leaderboard-content {
    max-height: 400px;
    overflow-y: auto;
    margin: 20px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.leaderboard-content::-webkit-scrollbar {
    width: 8px;
}

.leaderboard-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.leaderboard-content::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.leaderboard-content::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

.leaderboard-entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin: 8px 0;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: background 0.2s;
}

.leaderboard-entry:hover {
    background: rgba(102, 126, 234, 0.3);
}

.leaderboard-entry.top-1 {
    border-left-color: #FFD700;
    background: rgba(255, 215, 0, 0.2);
}

.leaderboard-entry.top-2 {
    border-left-color: #C0C0C0;
    background: rgba(192, 192, 192, 0.2);
}

.leaderboard-entry.top-3 {
    border-left-color: #CD7F32;
    background: rgba(205, 127, 50, 0.2);
}

.leaderboard-rank {
    font-size: 24px;
    font-weight: bold;
    min-width: 40px;
    color: #667eea;
}

.leaderboard-entry.top-1 .leaderboard-rank {
    color: #FFD700;
}

.leaderboard-entry.top-2 .leaderboard-rank {
    color: #C0C0C0;
}

.leaderboard-entry.top-3 .leaderboard-rank {
    color: #CD7F32;
}

.leaderboard-info {
    flex: 1;
    text-align: left;
    margin-left: 15px;
}

.leaderboard-score {
    font-size: 20px;
    font-weight: bold;
    color: #4ECDC4;
}

.leaderboard-level {
    font-size: 14px;
    color: #ccc;
    margin-top: 4px;
}

.leaderboard-date {
    font-size: 12px;
    color: #888;
    margin-top: 2px;
}

.leaderboard-empty {
    padding: 40px;
    color: #888;
    font-size: 18px;
}

