:root {
    --bg-color: #0b0b0b;
    --neon-blue: #00f3ff;
    --neon-red: #ff0055;
    --neon-green: #00ff9d;
    --neon-gold: #ffd700;
    --text-color: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; -webkit-user-select: none; font-family: 'Orbitron', sans-serif; }
body { background-color: var(--bg-color); color: var(--text-color); overflow: hidden; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; }
#game-container { position: relative; width: 100%; height: 100%; }
canvas { display: block; width: 100%; height: 100%; background: radial-gradient(circle at center, #1a1a1a 0%, #000000 100%); }

/* --- PROFILE UI --- */
#ui-profile {
    position: absolute; top: 15px; left: 15px;
    background: rgba(0, 0, 0, 0.6); border: 1px solid var(--neon-blue);
    padding: 10px 15px; border-radius: 8px; z-index: 20; min-width: 150px;
}
.profile-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
#player-name { color: var(--neon-blue); font-weight: bold; font-size: 1.1rem; text-transform: uppercase; }
.profile-stats { font-size: 0.9rem; color: #ccc; }
.coin-text { color: var(--neon-gold); font-weight: bold; }
.mini-btn { background: none; border: 1px solid #555; color: #fff; cursor: pointer; padding: 2px 6px; font-size: 0.8rem; border-radius: 4px; }
.mini-btn:hover { background: #333; }

/* --- PAUSE BUTTON --- */
#btn-pause-game {
    position: absolute; top: 15px; right: 15px;
    background: transparent; border: 2px solid #fff; color: #fff;
    width: 40px; height: 40px; border-radius: 50%;
    font-size: 1.2rem; cursor: pointer; z-index: 20;
    display: flex; justify-content: center; align-items: center;
}
#btn-pause-game:hover { background: #fff; color: #000; }

/* --- IN GAME MESSAGE --- */
#ingame-message {
    position: absolute; top: 80px; left: 50%; transform: translateX(-50%);
    font-size: 1.5rem; color: #fff; text-shadow: 0 0 10px var(--neon-red);
    z-index: 15; pointer-events: none; opacity: 1; transition: opacity 1s;
}

/* --- MAIN UI --- */
.ui-screen {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background: rgba(0, 0, 0, 0.9); z-index: 10;
}
.hidden { display: none !important; }

/* Typography & Buttons */
.neon-text { font-size: 3rem; color: var(--neon-blue); text-shadow: 0 0 10px var(--neon-blue); text-align: center; margin-bottom: 20px; }
.neon-text span { color: var(--neon-red); }
.red-neon { font-size: 3rem; color: var(--neon-red); text-shadow: 0 0 20px var(--neon-red); margin-bottom: 10px; }

.neon-btn {
    background: transparent; color: #fff; border: 2px solid var(--neon-blue);
    padding: 15px 40px; font-size: 1.2rem; margin: 8px; cursor: pointer;
    box-shadow: 0 0 10px var(--neon-blue); transition: all 0.2s;
    text-transform: uppercase; font-weight: bold; min-width: 200px;
}
.neon-btn:hover { background: var(--neon-blue); color: #000; box-shadow: 0 0 20px var(--neon-blue); }
.neon-btn.secondary { border-color: #888; box-shadow: none; color: #aaa; font-size: 1rem; padding: 10px 20px; }
.neon-btn.secondary:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.1); }
.store-color { border-color: var(--neon-gold); box-shadow: 0 0 10px var(--neon-gold); color: var(--neon-gold); }
.store-color:hover { background: var(--neon-gold); color: #000; }

/* --- SETTINGS FIXED LAYOUT --- */
.setting-container {
    width: 300px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.setting-row {
    display: flex;
    justify-content: space-between; /* Pushes text left, button right */
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}
.toggle-btn {
    background: transparent;
    border: 2px solid #fff;
    color: #fff;
    padding: 5px 15px;
    cursor: pointer;
    font-weight: bold;
    min-width: 80px; /* Fixed width prevents squashing */
    text-align: center;
}
.toggle-btn:hover {
    background: #fff;
    color: #000;
}

/* --- STORE GRID --- */
.store-balance { font-size: 1.5rem; margin-bottom: 20px; color: var(--neon-gold); }
#store-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px;
    max-height: 50vh; overflow-y: auto; padding: 10px;
}
.store-item {
    background: rgba(255,255,255,0.05); border: 1px solid #444;
    padding: 15px; border-radius: 8px; text-align: center; cursor: pointer;
    transition: transform 0.2s; width: 100px;
}
.store-item:hover { transform: scale(1.05); border-color: #fff; }
.store-item.owned { border-color: var(--neon-green); }
.store-item.equipped { border-color: var(--neon-blue); box-shadow: 0 0 10px var(--neon-blue) inset; background: rgba(0, 243, 255, 0.1); }
.skin-preview { width: 40px; height: 40px; margin: 0 auto 10px; display: block; }
.item-price { font-size: 0.8rem; color: var(--neon-gold); margin-top: 5px; }

/* --- MODAL --- */
.modal { position: absolute; top:0; left:0; width:100%; height:100%; background: rgba(0,0,0,0.8); z-index: 50; display: flex; justify-content: center; align-items: center; }
.modal-content { background: #111; border: 2px solid var(--neon-blue); padding: 30px; border-radius: 10px; text-align: center; }
input { background: #222; border: 1px solid #555; color: #fff; padding: 10px; font-size: 1.2rem; margin-bottom: 10px; text-align: center; width: 100%; }

/* --- GAME OVER & LEADERBOARD --- */
#leaderboard-section { margin: 10px 0; width: 80%; max-width: 300px; background: rgba(255,255,255,0.05); padding: 10px; border-radius: 8px; }
#lb-list { list-style: none; font-size: 0.9rem; text-align: left; }
#lb-list li { padding: 5px; border-bottom: 1px solid #333; display: flex; justify-content: space-between; }
#ui-hud { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); font-size: 2.5rem; font-weight: bold; color: rgba(255,255,255,0.5); pointer-events: none; }

/* Mobile */
@media (max-width: 600px) {
    .neon-text { font-size: 2.2rem; }
    #store-grid { grid-template-columns: repeat(2, 1fr); }
    #ui-hud { top: 80px; }
    #ui-profile { top: 10px; left: 10px; padding: 5px 10px; }
    #btn-pause-game { top: 10px; right: 10px; }
}