:root {
    --bg-color: #050505;
    --neon-blue: #0ff;
    --neon-pink: #f0f;
    --neon-red: #f33;
    --neon-green: #3f3;
    --text-color: #fff;
    --font-family: 'Courier New', Courier, monospace;
}

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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-color);
    font-family: var(--font-family);
    color: var(--text-color);
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    /* Hide cursor while playing */
    cursor: crosshair; 
}

/* UI Layer overlaying the canvas */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through to canvas when appropriate */
}

.hidden {
    display: none !important;
}

/* HUD elements */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2vh 4vw;
    font-size: clamp(14px, 2vw, 24px);
    text-shadow: 0 0 10px var(--neon-blue);
    width: 100%;
}

#xp-bar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: clamp(5px, 1.5vh, 15px);
    background: rgba(255, 255, 255, 0.1);
}

#xp-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
    transition: width 0.2s ease-out;
}

.bottom-bar {
    position: absolute;
    bottom: 4vh;
    left: 50%;
    transform: translateX(-50%);
    width: clamp(300px, 60vw, 800px);
    text-align: center;
}

#boss-name {
    color: var(--neon-red);
    text-shadow: 0 0 10px var(--neon-red);
    margin-bottom: 1vh;
    font-size: clamp(14px, 2vw, 20px);
    letter-spacing: 2px;
}

#boss-hp-bar {
    width: 100%;
    height: clamp(10px, 3vh, 25px);
    background: rgba(255,0,0,0.2);
    border: 2px solid var(--neon-red);
}

#boss-hp-fill {
    width: 100%;
    height: 100%;
    background: var(--neon-red);
    box-shadow: 0 0 15px var(--neon-red);
    transition: width 0.1s linear;
}

#player-hp-container {
    display: flex;
    align-items: center;
    gap: 1vw;
    width: clamp(150px, 40vw, 500px);
}

#player-hp-text {
    color: var(--neon-blue);
    font-size: clamp(12px, 1.8vw, 20px);
    font-weight: bold;
}

#player-hp-bar {
    flex-grow: 1;
    height: clamp(10px, 2vh, 20px);
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid var(--neon-blue);
}

#player-hp-fill {
    width: 100%;
    height: 100%;
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
    transition: width 0.1s linear;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto; /* Catch clicks for buttons */
}

h1 {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 20px var(--neon-blue);
}

.highlight {
    color: var(--neon-pink);
    text-shadow: 0 0 20px var(--neon-pink);
}

p {
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: #ccc;
}

h2 {
    color: var(--neon-green);
    text-shadow: 0 0 15px var(--neon-green);
    margin-bottom: 30px;
    font-size: 2.5rem;
}

.neon-btn {
    background: transparent;
    color: var(--neon-blue);
    border: 2px solid var(--neon-blue);
    padding: 15px 40px;
    font-size: 1.5rem;
    font-family: inherit;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    box-shadow: 0 0 10px var(--neon-blue) inset, 0 0 10px var(--neon-blue);
    transition: all 0.2s ease;
}

.neon-btn:hover {
    background: var(--neon-blue);
    color: #000;
    box-shadow: 0 0 20px var(--neon-blue) inset, 0 0 30px var(--neon-blue);
}

.upgrade-container {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 80%;
}

.upgrade-card {
    background: rgba(10, 10, 10, 0.9);
    border: 2px solid var(--neon-pink);
    border-radius: 8px;
    padding: 20px;
    width: 250px;
    text-align: center;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-pink);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.upgrade-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px var(--neon-pink);
}

.upgrade-card h3 {
    color: var(--neon-blue);
    margin-bottom: 10px;
}

.upgrade-card p {
    font-size: 1rem;
    margin-bottom: 0;
}
