body {
    margin: 0;
    overflow: hidden;
    background-color: #050505;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Segoe UI', sans-serif;
}

#game-container {
    position: relative;
    border: 4px solid #00ffcc;
    box-shadow: 0 0 25px rgba(0, 255, 204, 0.3);
}

canvas {
    display: block;
    background: linear-gradient(180deg, #0a0a1a 0%, #000 100%);
}

#ui {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    pointer-events: none;
}

#controls-panel {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 15px;
    border: 1px solid #00ffcc;
    color: #fff;
    font-size: 12px;
    border-radius: 5px;
}

#controls-panel h3 {
    margin: 0 0 5px 0;
    color: #00ffcc;
    text-transform: uppercase;
    font-size: 14px;
}

#controls-panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

#credits {
    position: absolute;
    bottom: 10px;
    right: 20px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
}

/* --- POPUP UI --- */
#popup {
    display: none; /* Hidden by default */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 10, 20, 0.95);
    border: 2px solid #00ffcc;
    box-shadow: 0 0 30px #00ffcc;
    padding: 30px;
    text-align: center;
    color: white;
    border-radius: 10px;
    z-index: 100;
}

#popup h2 {
    margin-top: 0;
    color: #ffcc00;
}

#popup button {
    margin-top: 15px;
    padding: 10px 20px;
    background: #00ffcc;
    border: none;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    border-radius: 5px;
}

#popup button:hover {
    background: #fff;
}

/* Screen Shake */
.shake {
    animation: shake 0.15s cubic-bezier(.36,.07,.19,.97) both;
}

#death-screen {
    display: none; /* Hidden until death */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 5, 10, 0.95);
    border: 2px solid #ff3366;
    box-shadow: 0 0 30px #ff3366;
    padding: 30px;
    text-align: center;
    color: white;
    border-radius: 10px;
    z-index: 101;
}

#death-screen button {
    margin-top: 15px;
    padding: 10px 25px;
    background: #ff3366;
    border: none;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    font-size: 18px;
    border-radius: 5px;
    transition: 0.2s;
}

#death-screen button:hover {
    background: #fff;
    color: #ff3366;
    transform: scale(1.1);
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-3px, 0, 0); }
    40%, 60% { transform: translate3d(3px, 0, 0); }
}