body { 
    margin: 0; 
    overflow: hidden; 
    background-color: #050a10; /* Darker, bluer background */
    font-family: 'Rajdhani', sans-serif; /* Sleek Futuristic Font */
    font-weight: 500;
    user-select: none; 
    color: #00fff2;
}
.no-cursor { cursor: none; }
canvas { display: block; image-rendering: pixelated; } 

/* --- CRT Scanline Overlay (Subtler) --- */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        rgba(255,255,255,0),
        rgba(255,255,255,0) 50%,
        rgba(0,0,0,0.1) 50%, /* Reduced opacity */
        rgba(0,0,0,0.1)
    );
    background-size: 100% 4px;
    z-index: 9999;
    pointer-events: none;
    animation: scanlineAnim 0.2s linear infinite;
    opacity: 0.3; /* Much subtler */
}
@keyframes scanlineAnim {
    0% { background-position: 0 0; }
    100% { background-position: 0 4px; }
}

/* --- UI Layer --- */
#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    box-sizing: border-box;
    z-index: 5;
    overflow: hidden;
}

/* --- Tooltip --- */
#tooltip {
    position: absolute;
    background: rgba(5, 10, 16, 0.95);
    border: 1px solid #00fff2;
    box-shadow: 0 0 5px rgba(0, 255, 242, 0.3);
    color: #fff;
    padding: 10px;
    border-radius: 2px;
    pointer-events: none;
    z-index: 100;
    font-size: 14px;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --- Stat Box --- */
.stat-box {
    color: #00fff2;
    text-shadow: 0 0 5px rgba(0, 255, 242, 0.5);
    font-size: 18px;
    font-weight: 600;
    background: rgba(5, 10, 16, 0.6);
    padding: 8px 15px;
    width: fit-content;
    border-left: 2px solid #00fff2;
    backdrop-filter: blur(2px);
}

#fps-display {
    position: absolute;
    bottom: 10px;
    right: 10px;
    color: #0088aa;
    font-size: 12px;
    z-index: 10;
    font-family: 'Rajdhani', sans-serif;
}

/* --- Cheat Menu --- */
#cheat-menu {
    position: absolute;
    top: 80px;
    right: 20px;
    background: rgba(5, 10, 16, 0.95);
    border: 1px solid #00fff2;
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.1);
    color: #fff;
    padding: 15px;
    z-index: 50;
    width: 300px;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
}
#cheat-menu h2 {
    margin: 0 0 10px 0;
    color: #00fff2;
    text-align: center;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(0, 255, 242, 0.3);
    padding-bottom: 5px;
    font-family: 'Orbitron', sans-serif;
}
#cheat-menu label {
    display: block;
    margin-bottom: 4px;
    color: #aaccff;
    font-size: 12px;
}
#cheat-menu select, #cheat-menu input, #cheat-menu button {
    width: 100%;
    background: rgba(0, 255, 242, 0.05);
    color: #00fff2;
    border: 1px solid rgba(0, 255, 242, 0.3);
    padding: 6px;
    box-sizing: border-box;
    font-family: 'Rajdhani', sans-serif;
    font-size: 13px;
    transition: all 0.2s;
}
#cheat-menu select:hover, #cheat-menu input:hover, #cheat-menu button:hover {
    border-color: #00fff2;
    background: rgba(0, 255, 242, 0.1);
}
#cheat-menu button { 
    cursor: pointer; 
    background: rgba(0, 255, 242, 0.1);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}
#cheat-menu button:hover {
    background: #00fff2;
    color: #000;
}

/* --- Fullscreen Button --- */
#fullscreen-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: rgba(5, 10, 16, 0.6);
    border: 1px solid #00fff2;
    color: #00fff2;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    transition: all 0.2s;
    backdrop-filter: blur(2px);
}
#fullscreen-btn:hover {
    background: rgba(0, 255, 242, 0.2);
    box-shadow: 0 0 10px rgba(0, 255, 242, 0.3);
}

/* --- Bars Container --- */
.bars-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    pointer-events: auto;
}

.bar-wrap {
    width: 300px;
    height: 8px; /* Thinner bars */
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

#xp-label {
    color: #00fff2;
    font-size: 16px;
    margin-bottom: 2px;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

#xp-fill {
    width: 0%;
    height: 100%;
    background: #ffff00;
    box-shadow: 0 0 5px rgba(255, 255, 0, 0.5);
    transition: width 0.1s linear;
}

#health-fill {
    width: 100%;
    height: 100%;
    background: #ff3333; /* Kept red for health, but cleaner */
    box-shadow: 0 0 5px rgba(255, 51, 51, 0.5);
    transition: width 0.2s ease-out;
}

#boost-fill {
    width: 100%;
    height: 100%;
    background: #00fff2;
    box-shadow: 0 0 5px rgba(0, 255, 242, 0.5);
    transition: width 0.1s linear;
}
.boost-overheat { background: #ffaa00 !important; }

#shield-fill {
    width: 100%;
    height: 100%;
    background: #0088ff;
    box-shadow: 0 0 5px rgba(0, 136, 255, 0.5);
    transition: width 0.2s ease-out;
}

.bar-label {
    position: absolute;
    left: 105%; /* Move label outside */
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
    font-size: 10px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* --- Stats Display --- */
#stats-display {
    position: absolute;
    bottom: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 600px;
}

.upgrade-badge {
    padding: 4px 8px;
    font-size: 12px;
    background: rgba(0, 255, 242, 0.05);
    border: 1px solid rgba(0, 255, 242, 0.2);
    color: #aaccff;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 1px;
}

/* --- Overlay --- */
#overlay, #loot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 10, 16, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    z-index: 10;
    backdrop-filter: blur(5px);
}

h1 {
    color: #00fff2;
    font-size: 60px;
    margin: 0 0 20px 0;
    text-shadow: 0 0 20px rgba(0, 255, 242, 0.5);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 8px;
    text-align: center;
    text-transform: uppercase;
}

p { 
    color: #aaccff; 
    font-size: 16px; 
    max-width: 600px; 
    text-align: center; 
    line-height: 1.8; 
    font-weight: 300;
    letter-spacing: 1px;
}

button {
    margin-top: 40px;
    padding: 12px 40px;
    font-size: 16px;
    background: transparent;
    color: #00fff2;
    border: 1px solid #00fff2;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 4px;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

button:hover { 
    background: rgba(0, 255, 242, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 242, 0.4);
    letter-spacing: 6px;
}

.hidden { display: none !important; }

#pause-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00fff2;
    font-size: 30px;
    letter-spacing: 10px;
    text-transform: uppercase;
    font-family: 'Orbitron', sans-serif;
    font-weight: 300;
    z-index: 11;
    pointer-events: none;
    background: rgba(0,0,0,0.8);
    padding: 20px 40px;
    border: 1px solid rgba(0, 255, 242, 0.3);
}

/* --- Loot Cards --- */
#loot-cards-container {
    display: flex;
    gap: 20px;
    margin-top: 40px;
}

.loot-card {
    width: 220px;
    height: 320px;
    background: rgba(10, 20, 30, 0.9);
    border: 1px solid rgba(0, 255, 242, 0.2);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    position: relative;
}

.loot-card:hover {
    transform: translateY(-5px);
    border-color: #00fff2;
    box-shadow: 0 0 15px rgba(0, 255, 242, 0.2);
}

.loot-card.selected {
    border-color: #00fff2;
    box-shadow: 0 0 30px rgba(0, 255, 242, 0.4);
    transform: scale(1.05);
    z-index: 20;
    background: rgba(10, 30, 40, 1);
}

.card-rarity { font-size: 10px; text-transform: uppercase; margin-bottom: 10px; color: rgba(255,255,255,0.5); letter-spacing: 2px; }
.card-title { font-size: 16px; color: #fff; margin-bottom: 10px; line-height: 1.4; font-family: 'Orbitron', sans-serif; }
.card-desc { font-size: 12px; color: #aaccff; line-height: 1.5; margin-bottom: auto; margin-top: 15px; font-weight: 300; }
.card-stat { font-size: 20px; margin-top: 15px; color: #00fff2; font-weight: 600; }

.card-icon-container {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rarity-normal { border-color: #aaaaaa; } .rarity-normal .card-rarity { color: #aaaaaa; }
.rarity-superior { border-color: #00ff00; } .rarity-superior .card-rarity { color: #00ff00; }
.rarity-elite { border-color: #0088ff; } .rarity-elite .card-rarity { color: #0088ff; }
.rarity-turbo { border-color: #ff00ff; } .rarity-turbo .card-rarity { color: #ff00ff; } /* Kept one magenta for variety but it's rare */
.rarity-legendary { border-color: #ffaa00; animation: pulsate 2s infinite alternate; } .rarity-legendary .card-rarity { color: #ffaa00; }

@keyframes pulsate { from { box-shadow: 0 0 10px rgba(255, 170, 0, 0.2); } to { box-shadow: 0 0 25px rgba(255, 170, 0, 0.6); } }

/* --- Hit Effect --- */
#hit-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 255, 242, 0.3); /* Cyan flash instead of red */
    z-index: 999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.1s ease-out;
    mix-blend-mode: screen;
}
