@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Roboto:wght@400;700&display=swap');

:root {
    --primary-color: #e74c3c;
    --secondary-color: #3498db;
    --accent-color: #f39c12;
    --text-color: #ffffff;
    --dark-bg: #111111;
    --darker-bg: #0a0a0a;
    --player-color: #663300;
    --enemy-color: #2980b9;
    --ui-overlay-bg: rgba(0, 0, 0, 0.8);
    --ui-border: rgba(255, 255, 255, 0.2);
    --button-primary: linear-gradient(135deg, #e74c3c, #c0392b);
    --button-shadow: 0 6px 0 #7d261e, 0 10px 15px rgba(0, 0, 0, 0.3);
}

/* High contrast theme */
.high-contrast {
    --primary-color: #ff3b30;
    --secondary-color: #007aff;
    --accent-color: #ffcc00;
    --text-color: #ffffff;
    --dark-bg: #000000;
    --darker-bg: #000000;
    --player-color: #cc6600;
    --enemy-color: #0066cc;
    --ui-overlay-bg: rgba(0, 0, 0, 0.9);
    --ui-border: rgba(255, 255, 255, 0.4);
}

body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--dark-bg);
    touch-action: none;
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
}

#gameCanvas {
    display: block;
    touch-action: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Game Canvas Layers */
#gameStage {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#backgroundLayer, #gameLayer, #effectsLayer, #uiLayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    touch-action: none;
}

#backgroundLayer {
    z-index: 1; /* Background elements (static or rarely changing) */
}

#gameLayer {
    z-index: 2; /* Game entities like player, enemies */
}

#effectsLayer {
    z-index: 3; /* Particles, animations, and effects */
}

#uiLayer {
    z-index: 4; /* UI elements overlaid on the game */
    pointer-events: none; /* Allow touches to pass through to game layer */
}

/* SVG Power-up Styles */
#svgPowerupContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Add animation keyframes for SVG power-ups */
@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

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

@keyframes starPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Title Bar */
.titleBar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.7));
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    box-sizing: border-box;
    z-index: 50;
    color: var(--text-color);
    font-size: 18px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
}

.titleBar .statsGroupLeft {
    display: flex;
    align-items: center;
    height: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.titleBar .controlsGroupRight {
    display: flex;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
    gap: 10px;
}

.titleBar .statItem {
    display: flex;
    align-items: center;
    margin: 0 12px;
    height: 100%;
}

.titleBar .statIcon {
    margin-right: 5px;
    font-size: 20px;
}

/* Control Icons - updated for title bar */
.controlsGroupRight .controlIcon {
    position: relative;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s;
}

.controlsGroupRight .controlIcon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.controlsGroupRight .controlIcon:active {
    transform: scale(0.95);
}

/* Hide old UI elements */
.stats, .waveInfo, .highScore, .pauseBtn, .settingsBtn {
    display: none;
}

@media (max-width: 767px) {
    .titleBar {
        font-size: 16px;
    }
    
    .titleBar .statItem {
        margin: 0 8px;
    }
    
    .titleBar .statIcon {
        font-size: 18px;
    }

    .controlsGroupRight .controlIcon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

@media (max-width: 500px) {
    .titleBar {
        padding: 5px;
    }
    
    .titleBar .statItem {
        margin: 0 5px;
    }
    
    .titleBar .statIcon {
        font-size: 16px;
        margin-right: 3px;
    }

    .controlsGroupRight .controlIcon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

/* Improved Control Icons */
.controlIcon {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    z-index: 50;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.controlIcon:active {
    transform: scale(0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.pauseIcon {
    top: 70px;
    right: 15px;
}

.settingsIcon {
    top: 70px;
    right: 75px;
}

@media (max-width: 767px) {
    .controlIcon {
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
    
    .pauseIcon {
        top: 90px;
    }
    
    .settingsIcon {
        top: 90px;
    }
}

/* Game UI Elements */
.statsGroup, .waveGroup, .scoreGroup {
    display: flex;
    align-items: center;
    gap: 10px;
}

.statsGroup {
    justify-content: flex-start;
}

.waveGroup {
    justify-content: center;
    text-align: center;
}

.scoreGroup {
    justify-content: flex-end;
}

.statItem {
    display: inline-flex;
    align-items: center;
    margin: 0 8px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.statIcon {
    margin-right: 5px;
    font-size: 20px;
}

/* Control Icons */
.controlIcon {
    position: absolute;
    top: 7px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 20px;
    z-index: 51;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.2s;
}

.controlIcon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.controlIcon:active {
    transform: scale(0.95);
}

/* Joystick Controls */
.leftJoystickContainer, .rightJoystickContainer {
    position: absolute;
    bottom: 30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 50;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.leftJoystickContainer {
    left: 40px;
}

.rightJoystickContainer {
    right: 40px;
}

.joystickKnob {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.dynamicJoystickContainer {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    z-index: 50;
    pointer-events: auto;
    display: none;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

/* Special Attack Button */
.specialButton {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.6);
    border: 3px solid rgba(255, 255, 255, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    z-index: 51;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    animation: none;
    transition: transform 0.1s, box-shadow 0.2s;
}

.specialButton:active {
    transform: translateX(-50%) scale(0.9);
}

.specialButton.charged {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Power meter for special button */
.powerMeter {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, 50% 0%);
    background: linear-gradient(135deg, #f1c40f, #e74c3c);
    opacity: 0.6;
    transform-origin: center;
    transform: rotate(0deg);
    transition: transform 0.3s;
}

.powerMeterBg {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
}

.specialText {
    position: relative;
    z-index: 5;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
    font-family: 'Bangers', cursive;
    letter-spacing: 1px;
    font-size: 20px;
}

.specialHint {
    position: absolute;
    bottom: 125px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 14px;
    color: white;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
    z-index: 50;
}

.specialHint.visible {
    opacity: 1;
}

/* Game Screen Overlays */
#startScreen, #gameOverScreen, #waveCompleteScreen, #pauseScreen, #settingsScreen, #highScoresScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: var(--text-color);
    text-align: center;
    box-sizing: border-box;
    padding: 20px;
}

#gameOverScreen, #waveCompleteScreen, #pauseScreen, #settingsScreen, #highScoresScreen {
    display: none;
}

/* Start screen background */
.startScreenBackground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2c3e50; /* Match game background color */
    z-index: -1;
}

/* Corner icons for high scores and fullscreen */
.cornerIcons {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 105; /* Increase z-index to appear above the full-screen title image */
}

.cornerIcon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    transition: all 0.2s ease;
}

.cornerIcon:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

.cornerIcon:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Custom start button styling - adjusted position */
.startBtnCustom {
    font-size: 30px !important;
    padding: 5px 5px !important;
    background: linear-gradient(135deg, #ff5e3a, #ff2a68) !important;
    border: 3px solid #ffcc33 !important;
    border-radius: 15px !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 0 #c41b1b, 0 10px 20px rgba(0, 0, 0, 0.4) !important;
    letter-spacing: 3px;
    transform: rotate(-2deg);
    margin-top: 20px !important; /* Push button down slightly */
}

.startBtnCustom:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.pulsing.startBtnCustom {
    animation: pulseCustom 1.5s infinite ease-in-out;
}

@keyframes pulseCustom {
    0% { transform: scale(1) rotate(-2deg); filter: brightness(100%); }
    50% { transform: scale(1.05) rotate(-1deg); filter: brightness(110%); }
    100% { transform: scale(1) rotate(-2deg); filter: brightness(100%); }
}

/* Level Select Button positioning */
.levelSelectBtnCustom {
    position: absolute !important;
    bottom: 80px !important; 
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 24px !important;
    padding: 10px 20px !important;
    background: linear-gradient(135deg, #3498db, #2980b9) !important;
    border: 3px solid #ffcc33 !important;
    border-radius: 12px !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 110 !important;
    width: auto !important;
    max-width: 300px !important;
    letter-spacing: 2px;
    box-shadow: 0 6px 0 #195d82, 0 10px 20px rgba(0, 0, 0, 0.4) !important;
}

.levelSelectBtnCustom:hover {
    transform: translateX(-50%) translateY(-3px) !important;
}

.levelSelectBtnCustom:active {
    transform: translateX(-50%) translateY(2px) !important;
    box-shadow: 0 2px 0 #195d82, 0 5px 10px rgba(0, 0, 0, 0.4) !important;
}

/* Title image styling */
.titleContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.titleImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: drop-shadow(0 0 15px rgba(243, 156, 18, 0.7));
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
    /* Fix for right-side empty space */
    min-width: 100vw;
    max-width: 100vw;
}

.overlay-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 101; /* Ensure this is higher than the title image z-index */
}

@keyframes titleBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Button wrapper for centering game buttons */
.buttonWrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 300px;
}

.buttonWrapper .gameBtn {
    width: 100%;
    margin: 8px auto;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: 3px solid #f39c12;
    color: white;
    padding: 5px 5px;
    border-radius: 10px;
    font-size: 26px;
    font-family: 'Bangers', cursive;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 6px 0 #7d261e, 0 10px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.buttonWrapper .gameBtn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.buttonWrapper .gameBtn:hover {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #7d261e, 0 5px 10px rgba(0, 0, 0, 0.4);
}

.buttonWrapper .gameBtn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #7d261e, 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* Pulsing animation for start button */
@keyframes pulse {
    0% { transform: scale(1); filter: brightness(100%); }
    50% { transform: scale(1.05); filter: brightness(110%); }
    100% { transform: scale(1); filter: brightness(100%); }
}

.pulsing {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Ensure the width is correct even on mobile */
@media (max-width: 767px) {
    .titleContainer {
        max-width: 95%;
    }
    
    .buttonWrapper .gameBtn {
        min-width: 200px;
        width: 80%;
        max-width: 300px;
        padding: 15px 25px;
        font-size: 22px;
    }
}

.logo {
    font-family: 'Bangers', cursive;
    font-size: 60px;
    color: var(--text-color);
    text-shadow: 
        0 0 10px var(--accent-color),
        4px 4px 0 var(--primary-color),
        -4px -4px 0 var(--secondary-color);
    margin-bottom: 20px;
    text-align: center;
    letter-spacing: 2px;
    transform: rotate(-2deg);
}

.subheading {
    font-family: 'Bangers', cursive;
    font-size: 28px;
    color: var(--accent-color);
    margin-bottom: 30px;
    text-shadow: 2px 2px 0 #333;
    text-align: center;
    letter-spacing: 1px;
}

.gameBtn {
    background: var(--button-primary);
    border: none;
    color: white;
    padding: 18px 36px;
    margin: 10px 0;
    border-radius: 10px;
    font-size: 22px;
    font-family: 'Bangers', cursive;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: var(--button-shadow);
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.gameBtn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.gameBtn:hover {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #7d261e, 0 5px 8px rgba(0, 0, 0, 0.3);
}

.gameBtn:active {
    transform: translateY(6px);
    box-shadow: 0 0 0 #7d261e, 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* Tutorial Popups */
.tutorial {
    position: absolute;
    background: rgba(52, 152, 219, 0.9);
    border-radius: 10px;
    padding: 15px;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    z-index: 55;
    max-width: 250px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.tutorialBtn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    color: white;
    margin-top: 10px;
    cursor: pointer;
    pointer-events: auto;
}

/* Wave Announcement */
.waveAnnouncement {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(231, 76, 60, 0.9);
    border-radius: 15px;
    padding: 25px 50px;
    color: white;
    font-family: 'Bangers', cursive;
    font-size: 36px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    text-align: center;
    z-index: 60;
    letter-spacing: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s, transform 0.5s;
}

.waveAnnouncement.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* Special Effects */
.hitFlash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(231, 76, 60, 0.3);
    z-index: 45;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s;
}

/* Settings Screen Styles */
.settingsRow {
    width: 80%;
    max-width: 400px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.settingsLabel {
    flex: 1;
    text-align: left;
    font-size: 18px;
    margin-right: 10px;
}

.slider {
    -webkit-appearance: none;
    width: 50%;
    height: 10px;
    border-radius: 5px;
    background: #444;
    outline: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggleSlider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggleSlider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggleSlider {
    background-color: var(--secondary-color);
}

input:checked + .toggleSlider:before {
    transform: translateX(26px);
}

/* High Scores Screen */
#scoresContainer {
    width: 80%;
    max-width: 500px;
    max-height: 300px;
    overflow-y: auto;
    margin: 20px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.scoreRow {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    font-size: 18px;
}

.scoreRow:nth-child(odd) {
    background: rgba(255, 255, 255, 0.1);
}

.scoreRank {
    font-weight: bold;
    color: var(--accent-color);
}

.nameInput {
    padding: 10px 15px;
    font-size: 18px;
    width: 80%;
    max-width: 300px;
    border: none;
    border-radius: 5px;
    margin: 10px 0;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-align: center;
}

.nameInput::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Audio Info */
.audioInfo {
    display: none; /* Hide the song name display */
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: white;
    z-index: 40;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.audioInfo:hover {
    opacity: 1;
}

/* Animations */
@keyframes pulse {
    0% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
    100% { transform: translateX(-50%) scale(1); }
}

.pulsing {
    animation: pulse 1.5s infinite ease-in-out;
}

/* Modal overlay for confirmation dialogs */
.modalOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modalContent {
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6));
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    padding: 20px;
    width: 80%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    animation: modalAppear 0.3s;
}

.modalHeader {
    font-family: 'Bangers', cursive;
    font-size: 28px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.modalBody {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.modalButtons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.modalButtons .gameBtn {
    min-width: 100px;
}

@keyframes modalAppear {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive design */
@media (max-width: 767px) {
    .logo {
        font-size: 40px;
    }
    
    .subheading {
        font-size: 20px;
    }
    
    .gameBtn {
        padding: 15px 30px;
        font-size: 18px;
    }
    
    .leftJoystickContainer,
    .rightJoystickContainer {
        width: 100px;
        height: 100px;
        bottom: 30px;
    }
    
    .joystickKnob {
        width: 40px;
        height: 40px;
    }
    
    .specialButton {
        width: 70px;
        height: 70px;
        bottom: 35px;
    }
    
    .specialHint {
        bottom: 110px;
    }
    
    .settingsRow {
        width: 90%;
        padding: 8px;
    }
}

@media (max-height: 600px) {
    .leftJoystickContainer,
    .rightJoystickContainer {
        bottom: 20px;
    }
    
    .specialButton {
        bottom: 20px;
    }
    
    .specialHint {
        bottom: 95px;
    }
}

#levelSelectScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95));
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: var(--text-color);
    text-align: center;
    box-sizing: border-box;
    padding: 20px;
}

.levelGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    padding: 10px;
    overflow-y: auto;
    max-height: 60vh;
}

@media (max-width: 767px) {
    .levelGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .levelGrid {
        grid-template-columns: 1fr;
    }
}
/* Level Select Screen Styles */
#levelSelectScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.95));
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    color: var(--text-color);
    text-align: center;
    box-sizing: border-box;
    padding: 20px;
}

.levelGrid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 90%;
    max-width: 800px;
    margin: 20px auto;
    padding: 10px;
    overflow-y: auto;
    max-height: 60vh;
}

@media (max-width: 767px) {
    .levelGrid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .levelGrid {
        grid-template-columns: 1fr;
    }
}

.levelCard {
    background: rgba(255, 255, 255, 0.1);
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.levelCard.unlocked {
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

.levelCard.unlocked:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
    border-color: var(--accent-color);
}

.levelCard.locked {
    filter: grayscale(100%);
    opacity: 0.7;
    cursor: not-allowed;
}

.levelCard.locked::after {
    content: "🔒";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 40px;
    opacity: 0.8;
}

.levelNumber {
    font-family: 'Bangers', cursive;
    font-size: 36px;
    margin-bottom: 10px;
    color: var(--accent-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.levelTitle {
    font-family: 'Bangers', cursive;
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-color);
}

.starContainer {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.levelStar {
    width: 30px;
    height: 30px;
    font-size: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #aaa;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.levelStar.earned {
    color: #ffcc00;
    filter: drop-shadow(0 0 5px rgba(255, 204, 0, 0.7));
    animation: starPop 0.3s ease-in-out;
}

@keyframes starPop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.levelReward {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 16px;
    background: rgba(243, 156, 18, 0.3);
    border-radius: 10px;
    padding: 3px 8px;
}

.levelMetaData {
    width: 100%;
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.levelBestTime, .levelBestDamage {
    display: flex;
    align-items: center;
    gap: 5px;
}

.currentLevel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary-color);
}