/* ============================================ */
/* re.Noir Control Modules                      */
/* Version: 1.0                                 */
/* ============================================ */

/* ===== CONTROL PANEL CONTAINER ===== */
#control-panel {
    position: fixed;
    right: 35px;
    bottom: 40px;
    z-index: 30;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

/* ===== JOYSTICK ===== */
/* EXACT replica of original joystick */
#joystick-container {
    position: fixed;
    left: 3%;
    bottom: 3%;
    width: 160px;
    height: 105px;
    z-index: 40;

}

.joystick {
    width: 50px;
    height: 50px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 4px; /* More rectangular */
    background: #333333; /* Simplified to a flat color for harder plastic look */
    box-shadow:
        5px 5px 6px rgba(0,0,0,0.4), /* More defined, darker shadow */
        -2px -2px 4px rgba(255,255,255,0.08); /* Crisper highlight */
    touch-action: none;
    pointer-events: auto;
    cursor: grab;
    transition: all 0.1s ease;
}

.joystick:active {
    background: #2e2e2e; /* Slightly darker flat color when active */
    box-shadow:
        inset 4px 4px 6px rgba(0,0,0,0.6), /* Deeper, more defined inset when pressed */
        inset -2px -2px 4px rgba(255,255,255,0.05); /* Sharper highlight for pressed state */
    cursor: grabbing;
}


/* Directional buttons over joystick */
.joy-direction-btn {
    position: absolute;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 41; /* Above joystick */
    opacity: 0.3; /* Semi-transparent for debugging */
    background: rgba(255,0,0,0.3); /* Remove in production */
}

/* Position the buttons */
.joy-up {
    top: -5px;
    left: 35%;
    transform: translateX(-50%);
}

.joy-down {
    bottom: -5px;
    left: 65%;
    transform: translateX(-50%);
}

.joy-left {
    left: -5px;
    top: 65%;
    transform: translateY(-50%);
}

.joy-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* Add this to your existing CSS */
.joystick-svg {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.joystick-interactive {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


/* Replace .joystick styles with: */
.joystick-circle {
    width: 40px;
    height: 40px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%; /* Circle instead of square */
    background: rgba(240, 197, 65, 0.7); /* Gold color with transparency */
    box-shadow:
        0 0 10px rgba(240, 197, 65, 0.5),
        inset 0 0 5px rgba(255, 255, 255, 0.3);
    touch-action: none;
    pointer-events: auto;
    cursor: grab;
    z-index: 42; /* Above everything */
    transition: all 0.1s ease;
}

.joystick-circle:active {
    cursor: grabbing;
    background: rgba(240, 197, 65, 0.9);
    box-shadow:
        0 0 15px rgba(240, 197, 65, 0.7),
        inset 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Hide old square joystick */
.joystick {
    display: none;
}





/* ===== ACTION BUTTONS ===== */
.action-buttons {
    position: relative;
    width: 40px;
    height: 105px;
}

.dual-button-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.dual-button-svg {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.action-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border: none;
    background: transparent;
    color: white;
    font-family: 'Share Tech Mono', monospace;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.action-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.action-btn.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(0.95);
}

.action-btn-left {
    left: 8px;
}

.action-btn-right {
    right: 8px;
}

/* ===== SYNTH TOGGLE ===== */
.synth-toggle-container {
    position: relative;
    width: 40px;
    height: 40px;

}

.synth-toggle-svg {
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.synth-toggle-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 35px;
    height: 35px;
    border: none;
    background: transparent;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.synth-toggle-btn:hover {
    color: #00ff9d;
}

.synth-toggle-btn.active {
    color: #00ff9d;
    transform: translate(-50%, -50%) scale(1.1);
}

.synth-toggle-placeholder {
    position: absolute;
    width: 50px;
    height: 50px;
    visibility: hidden;
}



/* ===== GLOBAL ACTIVE STATE ===== */
.active {
    transition: all 0.1s ease;
}

/* ===== DEBUG VISUALIZATION ===== */
.d-pad-interactive,
.action-btn,
.synth-toggle-btn {
    /* Remove this in production */
    /* outline: 1px dashed rgba(255, 0, 0, 0.3); */
}




/* ============================================ */
/* Audio AREA                                 */
/* ============================================ */
/* Alternative content container (backup/legacy) */

/* Main container layout */
#audio-container {
        display: none;
    max-width:340px;
    width:100%;
    flex-direction:column;
    align-items:center;
        position: fixed; /* Add this */
    top: 40px; /* Add this */
    left: 40px; /* Add this */
        z-index: 50 !important; /* ADD THIS */
    pointer-events: auto !important;
}
#audio-container.visible {
    display: flex; /* Show when toggled */
}

/* Mode containers - only one visible at a time */
.mode-container {
    display: none;
    width:100%;
}
.mode-container.active {
    display:flex;
    flex-direction:column;
}

/* SVG styling */
.mix-svg {
    width:100%;
    height:100%;
    pointer-events:all;
}

.audio-start-btn {
    margin-top: 5px; /* Space above button */
    padding: 0px 3px;
    left: 20px;
    bottom: 20px;
    background: #ffc82400;

    color: #FFC724;
    border: none;
    border-radius: 5px;
    font-family: 'Share Tech Mono', monospace;
    cursor: pointer;
    font-size: 12px;
    align-self: center; /* Center horizontally */
    writing-mode: vertical-rl;
    text-orientation: mixed;
        position: fixed;

}

.audio-start-btn:hover {
    background: #ffd966;
}


/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {

   
    #joystick-container {
        /* 1. STOP scaling - keep original size */
        width: 160px !important;
        height: 105px !important;
        
        /* 2. MOVE to center bottom */
        left: 40px;
        bottom: 40px; /* Above 35px border */
    }
    
    .action-buttons,
    .synth-toggle-container {

    }
    
    .action-btn {
        width: 40px;
        height: 40px;
        font-size: 12px;
    }


    h1{font-size:1.4rem}

    #audio-container {
    position: fixed;
    top: 40px;
    left: 20px; /* Instead of 36px */
    right: 20px; /* Instead of 0 */
    width: auto; /* Let left/right determine width */
    min-width: 333px;
    max-width: 340px;
    margin: 0 auto; /* Center it within left/right space */
    z-index: 50;
    }


}