/* Basic page setup */
body {
    margin: 0;
    padding: 0;
    /* Theme colors from default.css */
    background-color: #0B1020;
    background-image: radial-gradient(at 0% 0%, hsla(253, 60%, 25%, 0.4) 0px, transparent 50%),
        radial-gradient(at 100% 100%, hsla(280, 70%, 30%, 0.5) 0px, transparent 50%);
    background-attachment: fixed;
    color: #fff;
    /* Theme font from default.css */
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    /* Hide scrollbars */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

/* Star canvas styling from default.css */
#star-canvas {
    background-color: #000 !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Place canvas behind everything */
    pointer-events: none;
    /* Allow clicks to pass through */
}

.gameCanvas {
    max-height: 95vh;
    max-width: 95vw;
}

/* Canvas styling */
canvas {
    display: block;
    background-color: #1a1a1a;
    /* Dark arena, distinct from body */
    /* Theme border from default.css */
    border: 2px solid rgba(255, 255, 255, 0.1);
}

/* UI container to overlay on top of the canvas */
#ui-container {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 10;
    font-size: 1.2em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    user-select: none;
    /* Prevent text selection */
}

#ui-container>div {
    margin-bottom: 8px;
    /* Glass effect from --card-bg */
    background-color: rgba(30, 35, 55, 0.4);
    /* Border from --card-border */
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 10px;
    border-radius: 5px;
}

/* Health bar simulation - Theme Primary Color */
#health-display {
    color: rgb(162, 76, 255);
}

/* Ammo display - Theme Accent Color */
#ammo-display {
    color: rgb(255, 200, 0);
}

/* Reloading indicator */
#reload-indicator {
    color: #F44336;
    /* Red */
    font-weight: bold;
    display: none;
    /* Hidden by default */
}

/* Modal styles for Shop and Game Over */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    /* Glass effect from --card-bg, less transparent */
    background-color: rgba(30, 35, 55, 0.8);
    padding: 25px 35px;
    border-radius: 12px;
    text-align: center;
    /* Border from --card-border */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    max-width: 400px;
}

.modal-content h2 {
    margin-top: 0;
    /* Theme Primary Color */
    color: rgb(162, 76, 255);
    /* Theme Font */
    font-family: 'Comic Sans MS', 'Comic Sans', cursive;
}

.modal-content button {
    display: block;
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    font-size: 1.1em;
    font-weight: bold;
    /* Theme Primary Color */
    background-color: rgb(162, 76, 255);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.modal-content button:hover:not(:disabled) {
    /* Lighter primary color */
    background-color: rgb(180, 96, 255);
    transform: scale(1.02);
}

.modal-content button:disabled {
    background-color: #555;
    color: #999;
    cursor: not-allowed;
}

/* Specific style for "Start Next Wave" - Theme Secondary Color */
#start-next-wave {
    background-color: rgb(255, 125, 0);
}

#start-next-wave:hover {
    background-color: rgb(255, 145, 30);
}

/* Specific style for "Restart Game" - Theme Primary Color */
#restart-game {
    background-color: rgb(162, 76, 255);
}

#restart-game:hover {
    background-color: rgb(180, 96, 255);
}

/* Shop items container */
#shop-items {
    margin: 20px 0;
    display: grid;
    gap: 10px;
    /* *** NEW: More columns for upgrades *** */
    grid-template-columns: 1fr 1fr;
}

/* *** NEW: Make weapon buttons span 2 columns *** */
.shop-weapon-btn {
    grid-column: 1 / -1; /* Span all columns */
}

/* *** NEW: Style for upgrade buttons *** */
.shop-upgrade-btn {
    font-size: 0.9em;
    padding: 10px;
    background-color: #3a4a78; /* A different color */
}
.shop-upgrade-btn:hover:not(:disabled) {
    background-color: #4a5a88;
}


/* "Move to Start" indicator */
#move-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    /* Semi-transparent bg */
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 90;
    /* Below modals, above UI */
    color: white;
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
    user-select: none;
}

#move-indicator>div {
    padding: 20px;
    border-radius: 10px;
    background-color: rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

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

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}