:root {
    --bg-color: #0a0c14;
    --wall-color: #00ff96;
    --player-color: #ffe600;
    --star-color: #00ffff;
    --ammo-color: #b400ff;
    --enemy-color: #ff1e50;
    --mine-color: #ff6400;
    --bomb-color: #ffc800;
    --freeze-color: #00beff;
    --panel-bg: rgba(20, 22, 35, 0.9);
    --border-color: #323c50;
    --text-color: #dce6f0;
    --gate-off: #1e2837;
    --life-low: #ff3c3c;
    --life-full: #00ff78;
    --repair-color: #64ff64;
}

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

body {
    background-color: #000;
    color: var(--text-color);
    font-family: 'Consolas', monospace;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

#game-container {
    position: relative;
    box-shadow: 0 0 50px rgba(0, 255, 150, 0.1);
}

canvas {
    display: block;
    background-color: var(--bg-color);
}

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

#status-text {
    position: absolute;
    right: 20px;
    bottom: 75px;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 5px var(--text-color);
}

#star-text {
    position: absolute;
    right: 20px;
    bottom: 50px;
    font-size: 12px;
    font-weight: bold;
    color: var(--star-color);
    text-shadow: 0 0 5px var(--star-color);
}

#bottom-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: var(--panel-bg);
    border-top: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    padding-left: 15px;
    gap: 10px;
}

.ui-box {
    background: rgba(10, 12, 20, 0.8);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    height: 60px;
    padding: 5px 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#hull-box { width: 130px; border-color: var(--life-full); color: var(--life-full); }
#emp-box { width: 80px; border-color: var(--bomb-color); color: var(--bomb-color); }
#ice-box { width: 80px; border-color: var(--freeze-color); color: var(--freeze-color); }
#bit-box { width: 80px; border-color: var(--border-color); color: var(--ammo-color); }
#pdf-box { width: 80px; border-color: var(--star-color); color: var(--star-color); cursor: pointer; pointer-events: auto; }
#pdf-box:hover { background: rgba(0, 255, 255, 0.1); box-shadow: 0 0 8px var(--star-color); }

.ui-box.ready {
    border-width: 2px;
    box-shadow: 0 0 8px currentColor;
}

.ui-label {
    font-size: 12px;
    font-weight: bold;
}

.ui-val {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-color);
}

.hp-bar-bg {
    width: 100%;
    height: 15px;
    background: #280a0a;
    margin-top: 2px;
}

.hp-bar-fill {
    height: 100%;
    background: var(--life-full);
    width: 100%;
    transition: width 0.2s;
}

#overlay-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 40, 20, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s;
}

#overlay-layer.hidden {
    display: none;
    opacity: 0;
}

#overlay-title {
    font-size: 32px;
    color: var(--star-color);
    text-shadow: 0 0 10px var(--star-color);
    margin-bottom: 20px;
}

#overlay-desc {
    font-size: 18px;
}
