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

body {
    background-color: #030f18;
    color: #fff;
    font-family: 'Segoe UI', Impact, 'Arial Black', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
}

#game-container {
    position: relative;
    width: 800px;
    height: 600px;
    background: linear-gradient(to bottom, #062b3d, #020c13);
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.15), inset 0 0 20px rgba(0, 255, 255, 0.1);
    border: 3px solid #00f0ff;
    border-radius: 12px;
    overflow: hidden;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#hud {
    display: flex;
    justify-content: space-between;
    padding: 20px 30px;
    font-size: 26px;
    font-weight: 900;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #004455, -1px -1px 0 #004455, 0 0 10px #00f0ff;
    letter-spacing: 2px;
}

.hud-item {
    display: flex;
    align-items: center;
    color: #00f0ff;
}

#score {
    color: #fff;
    margin-left: 10px;
}

.meter-container {
    gap: 15px;
}

#balance-bar-bg {
    width: 180px;
    height: 24px;
    background-color: rgba(255, 0, 0, 0.4);
    border: 3px solid #fff;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#balance-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff003c, #ffea00, #00ff73);
    transition: width 0.1s linear, background 0.2s;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(3, 15, 24, 0.8) 0%, rgba(1, 6, 10, 0.95) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    transition: opacity 0.4s ease, backdrop-filter 0.4s;
    backdrop-filter: blur(4px);
    pointer-events: auto; /* Allow clicks on overlay */
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
    backdrop-filter: blur(0px);
}

.overlay h1 {
    font-size: 72px;
    margin-bottom: 15px;
    color: #00f0ff;
    text-shadow: 0 0 15px #00f0ff, 0 0 30px #00f0ff, 5px 5px 0 #004455;
    letter-spacing: 6px;
    font-weight: 900;
}

.overlay p {
    font-size: 24px;
    margin-bottom: 25px;
    color: #e0ffff;
    font-weight: bold;
    text-shadow: 1px 1px 3px #000;
}

#final-score {
    color: #00ff73;
    font-size: 32px;
    text-shadow: 0 0 10px #00ff73;
}

.controls {
    background: rgba(0, 240, 255, 0.1);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid rgba(0, 240, 255, 0.4);
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.1);
    margin: 25px 0;
}

.controls p {
    font-size: 20px;
    margin: 12px 0;
    letter-spacing: 1px;
}

.controls span {
    color: #00f0ff;
    font-weight: 900;
    background: rgba(0,0,0,0.4);
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #005555;
}

.blink {
    animation: blinker 1.5s cubic-bezier(0.4, 0, 1, 1) infinite;
    font-size: 22px;
    color: #fff;
    margin-top: 35px;
    text-shadow: 0 0 8px #fff;
}

@keyframes blinker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}
