:root {
    --primary: #9d4edd;
    --secondary: #7b2cbf;
    --bg: #0d0914;
    --black: #000;
    --text: #f8f9fa;
    --border: 1px;
}

body {
    background-color: var(--bg);
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    color: var(--text);
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: transparent;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border: var(--border) solid var(--primary);
    border-radius: 4px;
    transition: 0.2s;
    z-index: 100;
}
.back-btn:hover {
    background: rgba(123, 44, 191, 0.2);
    color: var(--text);
}

#game-container {
    position: relative;
    border: var(--border) solid var(--secondary);
    border-radius: 4px;
    box-shadow: 0 0 15px rgba(123, 44, 191, 0.3);
    background: #110c1b;
}

canvas {
    display: block;
    cursor: crosshair;
    max-width: 100%;
    height: auto;
    touch-action: none;
}

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    padding: 10px;
    box-sizing: border-box;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 10px;
}

.xp-bar-container {
    width: 100%;
    height: 10px;
    background: rgba(123, 44, 191, 0.1);
    border: 1px solid var(--secondary);
    margin-bottom: 5px;
    border-radius: 2px;
}
#xp-bar {
    height: 100%;
    width: 0%;
    background: var(--primary);
    transition: width 0.2s;
}

.hp-bar-container {
    width: 200px;
    height: 10px;
    background: rgba(123, 44, 191, 0.1);
    border: 1px solid var(--secondary);
    margin: 0 auto;
    border-radius: 2px;
}
#hp-bar {
    height: 100%;
    width: 100%;
    background: #e63946;
    transition: width 0.2s;
}

.overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(13, 9, 20, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: var(--text);
    z-index: 50;
}
#overlay { cursor: pointer; }
#game-over-overlay { cursor: pointer; }

h1 {
    font-size: 3rem;
    color: var(--text);
    line-height: 1.2;
    margin: 0 0 20px 0;
    font-weight: 700;
    letter-spacing: 2px;
}
h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin: 0 0 20px 0;
    font-weight: 700;
}

p {
    font-size: 1.2rem;
    font-weight: 400;
    margin: 0 0 20px 0;
    color: var(--primary);
}
.instructions {
    font-size: 1rem;
    font-weight: 400;
    background: transparent;
    padding: 10px 20px;
    border: var(--border) solid var(--secondary);
    border-radius: 4px;
    color: var(--text);
}

.upgrade-options {
    display: flex;
    gap: 20px;
    margin-top: 30px;
}

.upg-btn {
    background: transparent;
    color: var(--text);
    border: var(--border) solid var(--secondary);
    border-radius: 4px;
    padding: 20px;
    width: 200px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: 0.2s;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.upg-btn:hover {
    background: rgba(123, 44, 191, 0.2);
    border-color: var(--primary);
}
.upg-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}
.upg-desc {
    font-size: 0.9rem;
    font-weight: 400;
    color: #a9a9a9;
}

.virtual-controls { display: none; flex-direction: column; align-items: center; gap: 10px; margin-top: 20px; }
.v-row { display: flex; gap: 10px; }
.v-btn { width: 50px; height: 50px; background: rgba(157, 78, 221, 0.2); border: 2px solid #9d4edd; color: #fff; font-size: 20px; border-radius: 8px; user-select: none; }
.v-btn:active { background: rgba(157, 78, 221, 0.6); }
.action-btn { background: rgba(224, 170, 255, 0.2); border-color: #e0aaff; border-radius: 50%; }
@media (max-width: 768px) { 
    .virtual-controls { display: flex; } 
    #game-container { flex-direction: column; }
    .upg-btn { width: 150px; padding: 10px; }
    .upgrade-options { flex-direction: column; }
}
