body {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #000033;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

.game-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
}

.game-container.playing {
    cursor: none;
}

.game-container:not(.playing) {
    cursor: default;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    border: none;
    background: linear-gradient(to bottom, #000033, #000066);
    position: relative;
}

/* Fixed starfield effect */
.game-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(1px 1px at 10% 10%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 20% 20%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 30% 30%, white 100%, transparent 100%),
        radial-gradient(1px 1px at 40% 40%, white 100%, transparent 100%),
        radial-gradient(2px 2px at 50% 50%, white 100%, transparent 100%),
        radial-gradient(2px 2px at 60% 60%, white 100%, transparent 100%),
        radial-gradient(2px 2px at 70% 70%, white 100%, transparent 100%),
        radial-gradient(2px 2px at 80% 80%, white 100%, transparent 100%),
        radial-gradient(2px 2px at 90% 90%, white 100%, transparent 100%);
    background-size: 400px 400px;
    opacity: 0.5;
    pointer-events: none;
}

/* Nebula glow effect */
.game-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(76, 0, 153, 0.1) 0%,
        rgba(28, 0, 89, 0.05) 40%,
        transparent 70%
    );
    filter: blur(8px);
    opacity: 0.3;
    border-radius: 10px;
    pointer-events: none;
}

#score {
    position: fixed;
    top: 30px;
    left: 30px;
    color: white;
    font-size: clamp(20px, 4vw, 32px);
    z-index: 1;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.start-screen, .game-over-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 51, 0.85);
    padding: clamp(20px, 5vw, 40px);
    border-radius: 20px;
    text-align: center;
    color: white;
    z-index: 1000;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 30px rgba(0, 0, 255, 0.3),
        inset 0 0 30px rgba(0, 0, 255, 0.3);
    width: min(80%, 400px);
    backdrop-filter: blur(15px);
    animation: popup 0.5s ease-out;
}

@keyframes popup {
    0% {
        transform: translate(-50%, -55%) scale(0.95);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.game-over-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(51, 0, 0, 0.95);
    padding: clamp(20px, 5vw, 40px);
    border-radius: 20px;
    text-align: center;
    color: white;
    z-index: 1000;
    border: 3px solid rgba(255, 51, 51, 0.2);
    box-shadow: 
        0 0 40px rgba(255, 0, 0, 0.4),
        inset 0 0 30px rgba(255, 0, 0, 0.3);
    width: min(80%, 400px);
    backdrop-filter: blur(15px);
    animation: popup 0.5s ease-out;
}

.game-over-screen h1 {
    font-size: clamp(40px, 10vw, 60px);
    margin: 0 0 20px 0;
    color: #ff3333;
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 900;
    text-shadow: 
        0 0 20px rgba(255, 0, 0, 0.8),
        0 0 40px rgba(255, 0, 0, 0.6),
        0 0 60px rgba(255, 0, 0, 0.4),
        3px 3px 0 rgba(0, 0, 0, 0.8);
    animation: gameOverAnimation 2s ease-in-out infinite;
    position: relative;
    z-index: 2;
    font-family: Arial Black, Arial Bold, Arial, sans-serif;
    background: none;
    padding: 0;
    border: none;
}

.game-over-screen h1::before,
.game-over-screen h1::after {
    display: none;
}

@keyframes gameOverAnimation {
    0% {
        transform: scale(1);
        text-shadow: 
            0 0 20px rgba(255, 0, 0, 0.8),
            0 0 40px rgba(255, 0, 0, 0.6),
            0 0 60px rgba(255, 0, 0, 0.4),
            3px 3px 0 rgba(0, 0, 0, 0.8);
    }
    50% {
        transform: scale(1.1);
        text-shadow: 
            0 0 30px rgba(255, 0, 0, 0.9),
            0 0 60px rgba(255, 0, 0, 0.7),
            0 0 90px rgba(255, 0, 0, 0.5),
            4px 4px 0 rgba(0, 0, 0, 0.9);
    }
    100% {
        transform: scale(1);
        text-shadow: 
            0 0 20px rgba(255, 0, 0, 0.8),
            0 0 40px rgba(255, 0, 0, 0.6),
            0 0 60px rgba(255, 0, 0, 0.4),
            3px 3px 0 rgba(0, 0, 0, 0.8);
    }
}

/* Add a subtle flicker effect */
.game-over-screen h1::before {
    content: 'GAME OVER';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    animation: textFlicker 0.08s infinite alternate;
    opacity: 0.7;
}

@keyframes textFlicker {
    0% {
        opacity: 0.7;
        transform: skew(-1deg);
    }
    100% {
        opacity: 0.8;
        transform: skew(1deg);
    }
}

/* Remove any conflicting styles */
.game-over-screen h1::before,
.game-over-screen h1::after {
    display: none;
}

.game-over-screen .final-score,
.game-over-screen .high-score {
    font-size: clamp(24px, 6vw, 32px);
    margin: 15px 0;
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

.game-over-screen .leaderboard {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 15px;
    margin: 25px 0;
    border: 2px solid rgba(255, 51, 51, 0.2);
}

.game-over-screen .leaderboard h2 {
    font-size: clamp(20px, 5vw, 28px);
    margin: 0 0 15px 0;
    color: #ff9999;
}

.game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 25px;
}

#restartButton, #backToMenuButton {
    padding: clamp(12px, 3vw, 18px) clamp(25px, 6vw, 40px);
    font-size: clamp(16px, 4vw, 22px);
    border-radius: 50px;
    cursor: pointer;
    border: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#restartButton {
    background: linear-gradient(45deg, #ff3333, #ff0066);
    color: white;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.3);
    animation: pulse 2s infinite;
    animation-delay: 0s;
}

#backToMenuButton {
    padding: clamp(8px, 2vw, 12px) clamp(15px, 4vw, 25px);
    font-size: clamp(14px, 3vw, 18px);
    border-radius: 50px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    margin: 15px auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    background: linear-gradient(45deg, #3333ff, #0066ff);
    color: white;
    box-shadow: 0 0 20px rgba(0, 0, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
}

#backToMenuButton:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 0, 255, 0.6);
}

#restartButton:hover {
    transform: scale(1.05) translateY(-2px);
    filter: brightness(1.2);
}

#restartButton::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

#restartButton:hover::after {
    animation: shine 1s forwards;
}

.game-over-screen .score-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    margin: 8px 0;
    background: rgba(255, 51, 51, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.game-over-screen .score-item:hover {
    background: rgba(255, 51, 51, 0.2);
    transform: scale(1.02);
}

.game-over-screen .score-rank {
    color: #ff9999;
    font-weight: bold;
    font-size: clamp(16px, 4vw, 20px);
}

.game-over-screen .score-name {
    color: #ffffff;
    font-size: clamp(14px, 3vw, 18px);
}

.game-over-screen .score-value {
    color: #ffaa00;
    font-weight: bold;
    font-size: clamp(16px, 4vw, 20px);
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
}

.start-screen h1, .game-over-screen h1 {
    font-size: clamp(28px, 7vw, 42px);
    margin: 0 0 25px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.start-screen h1 {
    color: #ffff00;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { text-shadow: 0 0 15px rgba(255, 255, 0, 0.5); }
    50% { text-shadow: 0 0 30px rgba(255, 255, 0, 0.8); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.instructions {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    margin: 25px 0;
    font-size: clamp(14px, 3vw, 16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions h2 {
    font-size: clamp(20px, 5vw, 28px);
    margin: 0 0 15px 0;
    color: #ffff99;
}

.instructions li {
    margin: 12px 0;
    padding-left: 25px;
    position: relative;
    line-height: 1.5;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.instructions li:before {
    content: "★";
    position: absolute;
    left: 0;
    color: #ffff00;
}

.final-score, .high-score {
    font-size: clamp(22px, 5vw, 30px);
    margin: 20px 0;
    color: #ffff00;
    text-shadow: none;
}

#startButton, #restartButton {
    padding: clamp(12px, 3vw, 18px) clamp(25px, 6vw, 40px);
    font-size: clamp(18px, 4vw, 24px);
    border-radius: 50px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    margin-top: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

#startButton {
    background: linear-gradient(45deg, #ffff00, #ffaa00);
    color: #000033;
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.4);
}

#startButton:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 255, 0, 0.6);
}

#restartButton {
    background: linear-gradient(45deg, #ff3333, #ff0066);
    color: white;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

#restartButton:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.6);
}

/* Media Queries */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
    }

    .start-screen, .game-over-screen {
        width: 90%;
        padding: 15px;
    }

    .instructions li {
        margin: 6px 0;
    }
}

@media (max-height: 600px) {
    .instructions {
        max-height: 40vh;
        overflow-y: auto;
    }
}

/* Add to your existing CSS */
.mode-selection {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.mode-button {
    padding: 10px 20px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 51, 0.5);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.mode-button:hover {
    background: rgba(0, 0, 102, 0.7);
    transform: scale(1.05);
}

.mode-button.selected {
    background: rgba(0, 255, 255, 0.3);
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.game-over-screen .mode-selection {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 15px;
    border: 1px solid rgba(255, 0, 0, 0.2);
}

.game-over-screen .mode-selection h2 {
    font-size: clamp(16px, 4vw, 22px);
    margin: 5px 0 10px 0;
    color: #ff9999;
}

.game-over-screen .mode-button {
    padding: 8px 16px;
    font-size: 14px;
}

.game-over-screen .mode-button.selected {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.leaderboard {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 15px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard h2 {
    font-size: clamp(18px, 4vw, 24px);
    margin: 0 0 15px 0;
    color: #ffff99;
}

.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.tab-button {
    padding: 8px 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 51, 0.5);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-button:hover {
    background: rgba(0, 0, 102, 0.7);
}

.tab-button.selected {
    background: rgba(0, 255, 255, 0.3);
    border-color: rgba(0, 255, 255, 0.5);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.scores-list {
    display: none;
    max-height: 150px;
    overflow-y: auto;
}

.scores-list.active {
    display: block;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.score-rank {
    color: #ffff00;
    margin-right: 10px;
}

.score-value {
    color: #00ffff;
}

.game-over-screen .leaderboard {
    background: rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 0, 0, 0.2);
    margin: 15px 0;
}

.game-over-screen .score-item {
    background: rgba(255, 0, 0, 0.1);
}

/* Scrollbar styling */
.scores-list::-webkit-scrollbar {
    width: 8px;
}

.scores-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.scores-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.scores-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Add to your existing CSS */
.name-input {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

#playerName {
    padding: 8px 12px;
    border-radius: 20px;
    border: 2px solid rgba(255, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    font-size: 16px;
    width: 150px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

#playerName:focus {
    border-color: rgba(255, 0, 0, 0.6);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

#playerName::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#submitScore {
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(45deg, #ff3333, #ff0066);
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#submitScore:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.4);
}

#submitScore:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Add to your existing CSS */

.back-button {
    padding: clamp(8px, 2vw, 12px) clamp(15px, 4vw, 25px);
    font-size: clamp(14px, 3vw, 18px);
    border-radius: 50px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    margin: 15px auto;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    background: linear-gradient(45deg, #3333ff, #0066ff);
    color: white;
    box-shadow: 0 0 20px rgba(0, 0, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: fit-content;
}

.back-button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(0, 0, 255, 0.6);
}

/* Adjust button order in game over screen */
.game-over-screen {
    display: flex;
    flex-direction: column;
}

.game-over-screen button {
    margin: 10px 0;
}

#backToMenuButton {
    order: 2;
}

#restartButton {
    order: 1;
}

/* Add to your existing CSS */
.mute-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    padding: 0;
}

.mute-button:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
}

.mute-button span {
    line-height: 1;
}

.menu-screen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 51, 0.95);
    padding: clamp(20px, 5vw, 40px);
    border-radius: 20px;
    text-align: center;
    color: white;
    z-index: 1000;
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 30px rgba(0, 0, 255, 0.3),
        inset 0 0 30px rgba(0, 0, 255, 0.3);
    width: min(80%, 400px);
    backdrop-filter: blur(15px);
    animation: popup 0.5s ease-out;
}

.menu-screen h1 {
    font-size: clamp(32px, 8vw, 48px);
    margin: 0 0 30px 0;
    color: #ffff00;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 255, 0, 0.5);
    animation: glow 2s ease-in-out infinite;
}

.menu-screen h2 {
    font-size: clamp(24px, 6vw, 32px);
    margin: 0 0 20px 0;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.menu-screen h3 {
    font-size: clamp(18px, 4vw, 24px);
    margin: 10px 0;
    color: #ffff99;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 40px 0;
}

.menu-button {
    padding: clamp(15px, 3vw, 25px) clamp(30px, 6vw, 50px);
    font-size: clamp(18px, 4vw, 24px);
    border-radius: 50px;
    cursor: pointer;
    border: none;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: bold;
    transition: all 0.3s ease;
    overflow: hidden;
}

#playButton {
    background: linear-gradient(45deg, #00ff00, #00aa00);
    color: white;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

#highScoresButton {
    background: linear-gradient(45deg, #ffaa00, #ff6600);
    color: white;
    box-shadow: 0 0 20px rgba(255, 166, 0, 0.3);
}

#settingsButton {
    background: linear-gradient(45deg, #00ffff, #0088ff);
    color: white;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

#howToPlayButton {
    background: linear-gradient(45deg, #ff3399, #ff0066);
    color: white;
    box-shadow: 0 0 20px rgba(255, 51, 153, 0.3);
}

.menu-button:hover {
    transform: scale(1.05) translateY(-2px);
    filter: brightness(1.2);
}

.menu-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.1),
        transparent
    );
    transform: rotate(45deg);
    transition: all 0.3s ease;
}

.menu-button:hover::after {
    animation: shine 1s forwards;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) rotate(45deg);
    }
}

.menu-button {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    }
}

#playButton { animation-delay: 0s; }
#highScoresButton { animation-delay: 0.2s; }
#settingsButton { animation-delay: 0.4s; }
#howToPlayButton { animation-delay: 0.6s; }

.menu-button:active {
    transform: scale(0.98);
    filter: brightness(0.9);
}

/* Meteor types section in How to Play */
.meteor-types {
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
}

.meteor-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.meteor-info img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.meteor-info p {
    margin: 0;
    font-size: clamp(14px, 3vw, 16px);
    color: #ffffff;
}

/* Settings screen specific styles */
.settings-section {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 15px 0;
}

.setting-item label {
    font-size: clamp(14px, 3vw, 16px);
    color: #ffff99;
}

.setting-item input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.setting-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #00ffff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
} 

.score-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 51, 51, 0.2);
}

.final-score {
    font-size: clamp(28px, 6vw, 36px);
    color: #ff3333;
    text-shadow: 0 0 10px rgba(255, 51, 51, 0.5);
}

.personal-best {
    font-size: clamp(20px, 5vw, 28px);
    color: #ffaa00;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

.mode-info {
    font-size: clamp(16px, 4vw, 20px);
    color: #ffffff;
    margin: 10px 0;
    padding: 5px 15px;
    background: rgba(255, 51, 51, 0.2);
    border-radius: 20px;
    display: inline-block;
}

.game-over-screen .leaderboard {
    margin: 20px 0;
}

.game-over-screen .leaderboard h2 {
    color: #ff9999;
    margin-bottom: 15px;
}

.game-over-screen .score-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 15px;
    align-items: center;
    padding: 12px 20px;
    margin: 8px 0;
    background: rgba(255, 51, 51, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.game-over-screen .score-item:hover {
    background: rgba(255, 51, 51, 0.2);
    transform: scale(1.02);
}

.game-over-screen .score-rank {
    color: #ff9999;
    font-weight: bold;
    font-size: clamp(18px, 4vw, 22px);
}

.game-over-screen .score-name {
    color: #ffffff;
    font-size: clamp(16px, 3vw, 20px);
    text-align: left;
}

.game-over-screen .score-value {
    color: #ffaa00;
    font-weight: bold;
    font-size: clamp(18px, 4vw, 22px);
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .menu-screen, .game-over-screen {
        width: 75%;
        max-height: 90vh;
        padding: 15px;
        overflow-y: auto;
    }

    .menu-screen h1 {
        font-size: clamp(24px, 7vw, 32px);
        margin-bottom: 15px;
    }

    .menu-screen h2 {
        font-size: clamp(20px, 6vw, 28px);
        margin-bottom: 10px;
    }

    .menu-button {
        padding: 12px 20px;
        font-size: clamp(14px, 4vw, 18px);
        margin: 5px 0;
    }

    .menu-buttons {
        gap: 10px;
        margin: 20px 0;
    }

    .mode-buttons {
        gap: 8px;
    }

    .mode-button {
        padding: 8px 15px;
        font-size: clamp(12px, 3.5vw, 16px);
    }

    .instructions {
        font-size: clamp(12px, 3.5vw, 14px);
        padding: 12px;
        margin: 15px 0;
        max-height: 200px;
        overflow-y: auto;
    }

    .instructions li {
        margin: 8px 0;
        padding-left: 20px;
    }

    .meteor-types {
        padding: 10px;
    }

    .meteor-info {
        padding: 8px;
        gap: 10px;
    }

    .meteor-info img {
        width: 30px;
        height: 30px;
    }

    .meteor-info p {
        font-size: clamp(12px, 3.5vw, 14px);
    }

    .settings-section {
        padding: 15px;
        margin: 15px 0;
    }

    .setting-item {
        gap: 8px;
        margin: 10px 0;
    }

    .setting-item label {
        font-size: clamp(12px, 3.5vw, 14px);
    }

    /* Game Over Screen Adjustments */
    .game-over-screen h1 {
        font-size: clamp(28px, 8vw, 36px);
        margin-bottom: 15px;
    }

    .score-container {
        padding: 10px;
        margin: 15px 0;
    }

    .final-score {
        font-size: clamp(20px, 6vw, 28px);
    }

    .personal-best {
        font-size: clamp(16px, 5vw, 22px);
    }

    .mode-info {
        font-size: clamp(14px, 4vw, 18px);
        padding: 5px 10px;
    }

    .game-over-buttons {
        gap: 10px;
        margin-top: 15px;
    }

    #restartButton, #backToMenuButton {
        padding: 10px 20px;
        font-size: clamp(14px, 4vw, 18px);
    }
}

/* Extra Small Screens */
@media (max-width: 360px) {
    .menu-screen, .game-over-screen {
        width: 70%;
        padding: 10px;
    }

    .menu-button {
        padding: 10px 15px;
        font-size: clamp(12px, 4vw, 16px);
    }

    .mode-button {
        padding: 6px 12px;
        font-size: clamp(11px, 3.5vw, 14px);
    }
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 500px) {
    .menu-screen, .game-over-screen {
        padding: 10px 20px;
        max-height: 85vh;
    }

    .menu-buttons {
        margin: 10px 0;
    }

    .instructions {
        max-height: 120px;
    }

    .meteor-types {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
    }

    .settings-section {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

/* Prevent text selection on mobile */
@media (hover: none) {
    * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
    }
}

/* Prevent pull-to-refresh on mobile */
html, body {
    overscroll-behavior-y: contain;
    position: fixed;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Landscape Mode and Small Height Screens */
@media (max-height: 600px) {
    .menu-screen, .game-over-screen {
        padding: 10px 20px;
        max-height: 90vh;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }

    .menu-screen h1 {
        font-size: clamp(20px, 6vw, 28px);
        margin: 5px 0;
    }

    .menu-screen h2 {
        font-size: clamp(18px, 5vw, 24px);
        margin: 5px 0;
    }

    .menu-screen h3 {
        font-size: clamp(16px, 4vw, 20px);
        margin: 5px 0;
    }

    .menu-buttons {
        gap: 8px;
        margin: 10px 0;
    }

    .menu-button {
        padding: 8px 15px;
        font-size: clamp(14px, 3vw, 18px);
    }

    .mode-buttons {
        gap: 5px;
    }

    .mode-button {
        padding: 6px 12px;
        font-size: clamp(12px, 2.5vw, 14px);
    }

    .instructions {
        max-height: 120px;
        padding: 10px;
        margin: 10px 0;
    }

    .instructions li {
        margin: 5px 0;
        font-size: clamp(12px, 2.5vw, 14px);
    }

    .meteor-types {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 5px;
        padding: 8px;
        margin: 8px 0;
    }

    .meteor-info {
        padding: 5px;
        gap: 5px;
    }

    .meteor-info img {
        width: 25px;
        height: 25px;
    }

    .meteor-info p {
        font-size: clamp(11px, 2.5vw, 13px);
    }

    .settings-section {
        padding: 10px;
        margin: 8px 0;
    }

    .back-button {
        padding: 6px 12px;
        margin: 8px 0;
        font-size: clamp(12px, 2.5vw, 14px);
    }

    /* Game Over screen adjustments */
    .game-over-screen h1 {
        font-size: clamp(24px, 6vw, 32px);
        margin: 5px 0;
    }

    .score-container {
        padding: 8px;
        margin: 8px 0;
    }

    .final-score {
        font-size: clamp(18px, 4vw, 24px);
    }

    .personal-best {
        font-size: clamp(16px, 3.5vw, 20px);
    }

    .game-over-buttons {
        gap: 8px;
        margin: 8px 0;
    }

    #restartButton, #backToMenuButton {
        padding: 8px 15px;
        font-size: clamp(14px, 3vw, 16px);
    }

    /* Name input adjustments */
    .name-input {
        margin: 8px 0;
    }

    #playerName {
        padding: 6px 10px;
        font-size: clamp(12px, 2.5vw, 14px);
    }
}

/* Extra small height */
@media (max-height: 400px) {
    .menu-screen, .game-over-screen {
        padding: 5px 15px;
    }

    .menu-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }

    .meteor-types {
        grid-template-columns: repeat(3, 1fr);
    }

    .settings-section {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* Play screen button container for small screens */
.play-screen-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* Media query for small screens */
@media (max-width: 768px) {
    .play-screen-buttons {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        margin-top: 15px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .play-screen-buttons {
        gap: 8px;
    }

    .back-button {
        width: 35px;
        height: 35px;
        padding: 8px;
    }
    
    .back-icon {
        font-size: 20px;
    }
}

.touch-instruction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 20px;
    z-index: 1000;
    animation: fadeInOut 3s forwards;
    pointer-events: none;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}