:root {
    --primary-color: #00f0ff;
    --secondary-color: #ff0055;
    --bg-color: #050505;
    --ui-font: 'Orbitron', sans-serif;
    --panel-bg: #111;
}

* {
    box-sizing: border-box;
    touch-action: none;
    user-select: none;
}

body {
    margin: 0;
    padding: 0;
    background-color: #000;
    color: white;
    font-family: var(--ui-font);
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 20px;
}

#game-container {
    position: relative;
    width: 600px;
    height: 800px;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 3/4;
    background: #000;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    border: 1px solid #333;
    flex-shrink: 0; /* Prevent shrinking */
}

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

/* Side Panel */
.side-panel {
    width: 250px;
    height: 800px;
    max-height: 100%;
    background: var(--panel-bg);
    border: 1px solid #333;
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.panel-content h2 {
    color: var(--primary-color);
    font-size: 24px;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-top: 0;
    letter-spacing: 2px;
}

.control-group { margin-bottom: 20px; }
.control-group h3 { margin: 0 0 5px 0; font-size: 16px; color: #eee; display: flex; align-items: center; }
.control-group .icon { margin-right: 10px; font-size: 20px; }
.control-group p { margin: 2px 0; color: #aaa; font-size: 14px; padding-left: 34px; }
.control-group p strong { color: var(--secondary-color); font-size: 18px; }
.control-group p.sub { font-size: 12px; color: #666; }

.mobile-info { margin-top: auto; color: #888; }
.mobile-info h3 { font-size: 16px; color: #ccc; }

.credit { margin-top: 20px; font-size: 12px; color: #444; text-align: center; }

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

#score-display, #high-score-display {
    position: absolute;
    top: 10px;
    font-size: 20px;
    text-shadow: 0 0 5px var(--primary-color);
    z-index: 5;
}

#score-display { left: 20px; color: var(--primary-color); }
#high-score-display { right: 20px; color: #ffd700; }

#stage-display {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 24px;
    color: #ffffff;
    text-shadow: 0 0 5px #00f0ff;
    z-index: 5;
}

#boss-hp-container {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 400px;
    height: 20px;
    background: rgba(0,0,0,0.5);
    border: 2px solid #ff0000;
    display: none;
    z-index: 5;
}

#boss-hp-bar {
    width: 100%;
    height: 100%;
    background: #ff0000;
    transition: width 0.1s;
}

#mute-btn {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid #555;
    color: #aaa;
    font-size: 12px;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 20;
    pointer-events: auto;
    user-select: none;
}

/* Screens (Start / Game Over) */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 10;
}

.screen.active { opacity: 1; pointer-events: auto; }

h1.title {
    font-size: 48px;
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--primary-color), 2px 2px 0px var(--secondary-color);
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-align: center;
}

.subtitle { font-size: 18px; color: #aaa; margin-bottom: 40px; letter-spacing: 5px; }

button {
    background: transparent;
    color: var(--primary-color);
    font-family: var(--ui-font);
    font-size: 24px;
    padding: 15px 40px;
    border: 2px solid var(--primary-color);
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    margin: 10px;
}

button:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.8);
}

#game-over-screen h1 { color: var(--secondary-color); text-shadow: 0 0 10px var(--secondary-color); }

/* Mobile Controls */
#mobile-controls {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1; /* Behind buttons */
}

@media (max-width: 900px) {
    .side-panel { display: none; }
    .main-wrapper { flex-direction: column; }
    #game-container { width: 100%; height: 100%; border: none; }
    h1.title { font-size: 32px; }
    button { font-size: 18px; padding: 10px 20px; }
}
