body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #121212; /* Deep Dark Background */
    color: #eee;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: radial-gradient(circle at 50% 50%, #1a2a3a 0%, #0d0d12 100%);
}

#center {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

/* Console Container */
.game-console {
    background: #1e293b;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.6),
        0 0 0 1px rgba(255,255,255,0.05) inset;
    display: flex;
    gap: 50px;
    align-items: center;
    position: relative;
    border-bottom: 5px solid #0f172a;
}

/* Left Panel: The Maze */
#maze-container {
    position: relative;
    width: 350px;
    height: 315px;
}

#maze {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d; 
    border: 4px solid #4ecca3; /* Neon Green Border */
    background: #0f172a; /* Dark Blue Maze Bg */
    box-shadow: 0 0 20px rgba(78, 204, 163, 0.2);
    border-radius: 4px;
}

/* Walls */
.wall {
    position: absolute;
    background-color: #4ecca3;
    box-shadow: 0 0 10px rgba(78, 204, 163, 0.4);
    transform-origin: top left;
    border-radius: 5px; /* Round caps for pipe-like connections */
}

/* Ball */
.ball {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #f43f5e; /* Rose Red */
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.8);
    z-index: 5;
}

/* End Zone */
#end {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 2px dashed #fbbf24; /* Amber */
    border-radius: 50%;
    background: rgba(251, 191, 36, 0.1);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.1);
    animation: pulse-goal 2s infinite;
}

@keyframes pulse-goal {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
}

.black-hole {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #000;
    box-shadow: 0 0 10px rgba(0,0,0,0.8), inset 0 0 5px #333;
    border: 1px solid #333;
}

/* Right Panel: Controls */
.controls-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 150px;
}

#joystick {
    position: relative;
    background: radial-gradient(circle at 30% 30%, #334155, #1e293b);
    border: 2px solid #475569;
    border-radius: 50%;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        inset 0 10px 20px rgba(0,0,0,0.5),
        0 5px 15px rgba(0,0,0,0.3);
}

#joystick-head {
    position: relative;
    background: radial-gradient(circle at 30% 30%, #4ecca3, #2a8a70);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    cursor: grab;
    box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    transition: transform 0.1s;
    z-index: 10;
}
#joystick-head:active { cursor: grabbing; }

/* Arrows on Joystick */
.joystick-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    border-right: 3px solid rgba(255,255,255,0.1);
    border-bottom: 3px solid rgba(255,255,255,0.1);
    z-index: 1;
}
.joystick-arrow:nth-of-type(1) { transform: rotate(45deg) translate(-35px, -35px); }
.joystick-arrow:nth-of-type(2) { transform: rotate(225deg) translate(-35px, -35px); }
.joystick-arrow:nth-of-type(3) { transform: rotate(135deg) translate(-35px, -35px); }
.joystick-arrow:nth-of-type(4) { transform: rotate(315deg) translate(-35px, -35px); }

#note {
    margin-top: 20px;
    color: #94a3b8;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Header / HUD */
.header-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    box-sizing: border-box;
    z-index: 100;
}

.game-logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: linear-gradient(to right, #4ecca3, #22d3ee);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.player-stats {
    font-size: 1rem;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-val { color: #f43f5e; font-weight: bold; margin-left: 5px; }

/* Mobile Responsive */
@media (max-width: 800px) {
    .game-console {
        flex-direction: column;
        padding: 20px;
        gap: 30px;
        width: 90%;
        max-width: 400px;
    }
    
    #maze-container {
        transform: scale(0.9);
    }
    
    .header-bar {
        position: relative;
        padding: 10px;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
    }
}
