* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --panel-opacity: 0.92;
}

body {
    font-family: 'Fira Code', 'Courier New', monospace;
    background: #000;
    color: #4df9ff; /* Cyan/Petrol highlight */
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    letter-spacing: 0.5px;
    cursor: crosshair;
}

/* Fullscreen Signature */
.fullscreen-signature {
    position: fixed;
    bottom: 20px;
    right: 30px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    font-weight: bold;
    color: #005f6a; /* Petrol */
    opacity: 0.8;
    z-index: 9999;
    pointer-events: none;
    display: none;
    text-shadow: 0 0 5px rgba(0, 95, 106, 0.5);
    letter-spacing: 2px;
}

/* Subtle cinematic atmosphere */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 50%, rgba(0, 40, 50, 0.1) 0%, rgba(5, 10, 15, 0.9) 100%);
    pointer-events: none;
    z-index: -1;
}

/* Vignette */
body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 150px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 10;
}

/* High-resolution visual canvas - crisp graphics */
#hydra-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Sit above background but below UI */
    background: #000;
    filter: contrast(1.1) saturate(1.2);
}

/* Add subtle cyber effect behind canvas */
#hydra-canvas::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 25% 25%, rgba(0, 255, 0, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(0, 255, 0, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* Top Toolbar - Industrial / Petrol Style */
.toolbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(8, 20, 24, 0.95);
    border-bottom: 1px solid #005f6a;
    padding: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 2000;
    height: 48px;
    backdrop-filter: blur(10px);
}

.brand {
    font-weight: 500;
    letter-spacing: 3px;
    color: #4df9ff;
    font-size: 13px;
    text-transform: uppercase;
}

.brand::before {
    content: "///";
    color: #4a6a00; /* Moss green accent */
    margin-right: 8px;
    font-weight: bold;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.toolbar-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.separator {
    width: 1px;
    height: 20px;
    background: #00ff00;
    margin: 0 8px;
    box-shadow: 0 0 3px #00ff00;
}

/* Draggable Panels - Sleek Industrial Style */
.panel {
    position: fixed;
    background: rgba(5, 12, 15, var(--panel-opacity));
    border: 1px solid #005f6a;
    border-left: 2px solid #4df9ff;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    min-width: 220px;
    backdrop-filter: blur(12px);
    transition: box-shadow 0.3s ease, background-color 0.1s;
    z-index: 100;
    font-family: 'Fira Code', monospace;
    resize: both;
    overflow: hidden; /* Needed for resize handle to show correctly on some browsers */
}

.panel:hover {
    box-shadow: 0 8px 30px rgba(0, 20, 30, 0.6);
    border-color: #4df9ff;
}

/* No more aggressive corner decorations */
.panel::before, .panel::after { display: none; }

.panel.collapsed::before,
.panel.collapsed::after {
    display: none;
}

.panel-header {
    padding: 10px 12px;
    background: rgba(0, 95, 106, 0.15);
    border-bottom: 1px solid #005f6a;
    cursor: grab;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.panel-header:active {
    cursor: grabbing;
    background: rgba(0, 95, 106, 0.3);
}

.panel-title {
    font-size: 10px;
    font-weight: 600;
    color: #4df9ff;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.panel-controls {
    display: flex;
    gap: 6px;
}

.panel-btn {
    background: none;
    border: 1px solid #00ff00;
    color: #00ff00;
    cursor: pointer;
    font-size: 10px;
    padding: 2px 6px;
    font-family: inherit;
    text-shadow: 0 0 3px #00ff00;
}

.panel-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

.panel-content {
    padding: 12px;
    overflow: auto;
    color: #00ff00;
    background: rgba(0, 0, 0, 0.8);
}

.panel.collapsed .panel-content {
    display: none;
}

/* Common Button Styles - Terminal Retro */
.btn {
    background: rgba(0, 95, 106, 0.1);
    color: #4df9ff;
    border: 1px solid #005f6a;
    padding: 6px 12px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 10px;
    font-family: inherit;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    background: rgba(77, 249, 255, 0.1);
    border-color: #4df9ff;
    box-shadow: 0 0 10px rgba(77, 249, 255, 0.2);
}

.btn.primary {
    background: rgba(0, 95, 106, 0.4);
    border-color: #4df9ff;
    color: #fff;
}
.btn.primary:hover {
    background: rgba(0, 95, 106, 0.6);
}

.btn.success { 
    background: rgba(0, 80, 0, 0.6); 
    border-color: #00ff00; 
}
.btn.success:hover { 
    background: rgba(0, 120, 0, 0.8); 
}

.btn.warning { 
    background: rgba(80, 80, 0, 0.6); 
    border-color: #ffff00; 
    color: #ffff00;
}
.btn.warning:hover { 
    background: rgba(120, 120, 0, 0.8); 
}

.btn.danger { 
    background: rgba(100, 0, 0, 0.6); 
    border-color: #ff4444; 
    color: #ff4444;
}
.btn.danger:hover { 
    background: rgba(150, 0, 0, 0.8); 
}

.btn.active { 
    background: #00ff00; 
    color: #000;
    text-shadow: none;
}

.btn.recording-active {
    background: #ff0000;
    color: white;
    border-color: #ff0000;
    animation: terminal-pulse 1s infinite;
    text-shadow: 0 0 5px #ff0000;
}

@keyframes terminal-pulse {
    0% { box-shadow: 0 0 5px #ff0000; }
    50% { box-shadow: 0 0 20px #ff0000, 0 0 30px #ff0000; }
    100% { box-shadow: 0 0 5px #ff0000; }
}

/* EDITOR PANEL SPECIFIC */
#editor-panel {
    top: 60px;
    left: 20px;
    width: 380px;
    height: 300px; /* Start with a decent height */
}

.code-editor {
    width: 100%;
    height: 100%; /* Fill the scalable panel */
    min-height: 160px;
    background: rgba(2, 8, 10, 0.8);
    border: 1px solid #005f6a;
    color: #a8dce0;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 12px;
    padding: 10px;
    resize: vertical;
    margin-bottom: 10px;
}

.code-editor:focus {
    outline: none;
    box-shadow: 
        inset 0 0 10px rgba(0, 255, 0, 0.2),
        0 0 10px rgba(0, 255, 0, 0.3);
}

.editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* BANKS PANEL SPECIFIC */
#banks-panel {
    top: 60px;
    right: 20px;
    width: 300px;
}

.banks-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-bottom: 10px;
}

.bank-slot {
    aspect-ratio: 1;
    background: rgba(0, 20, 25, 0.6);
    border: 1px solid #005f6a;
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 9px;
    color: #4df9ff;
    overflow: hidden;
    transition: all 0.2s ease;
}

.bank-slot:hover {
    border-color: #4df9ff;
    box-shadow: 0 0 10px rgba(77, 249, 255, 0.3);
    background: rgba(0, 95, 106, 0.3);
}
.bank-slot.active {
    border-color: #4df9ff;
    box-shadow: 0 0 15px rgba(77, 249, 255, 0.4);
    color: #fff;
    background: rgba(0, 95, 106, 0.6);
}
.bank-slot.has-content {
    border-width: 2px;
    border-style: double;
}

/* Bank Colors - Petrol / Moss Palette */
.bank-slot.bank-0 { border-color: #4df9ff; color: #4df9ff; } /* Cyan */
.bank-slot.bank-0.active { background: rgba(77, 249, 255, 0.2); }

.bank-slot.bank-1 { border-color: #00a3b8; color: #00a3b8; } /* Teal */
.bank-slot.bank-1.active { background: rgba(0, 163, 184, 0.2); }

.bank-slot.bank-2 { border-color: #8cbf00; color: #8cbf00; } /* Moss Light */
.bank-slot.bank-2.active { background: rgba(140, 191, 0, 0.2); }

.bank-slot.bank-3 { border-color: #4a6a00; color: #6fa600; } /* Moss Dark */
.bank-slot.bank-3.active { background: rgba(74, 106, 0, 0.3); }

.bank-slot.bank-4 { border-color: #005f6a; color: #008c9e; } /* Petrol */
.bank-slot.bank-4.active { background: rgba(0, 95, 106, 0.3); }

.bank-slot.bank-5 { border-color: #b8e986; color: #b8e986; } /* Pale Green */
.bank-slot.bank-5.active { background: rgba(184, 233, 134, 0.2); }

.bank-slot.bank-6 { border-color: #50e3c2; color: #50e3c2; } /* Seafoam */
.bank-slot.bank-6.active { background: rgba(80, 227, 194, 0.2); }

.bank-slot.bank-7 { border-color: #9b9b9b; color: #ccc; } /* Grey */
.bank-slot.bank-7.active { background: rgba(155, 155, 155, 0.2); }

.bank-preview {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 2;
}

.bank-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 0;
}

.bank-slot:hover .bank-thumbnail {
    opacity: 1;
}

.bank-number-overlay {
    position: absolute;
    z-index: 1;
    text-shadow: 0 0 4px #000;
    font-weight: bold;
    font-size: 12px;
}

/* SEQUENCER PANEL SPECIFIC */
#sequencer-panel {
    bottom: 20px;
    left: 20px;
    width: 380px;
}

.sequencer-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    margin-bottom: 10px;
}

.seq-step {
    aspect-ratio: 1;
    background: rgba(0, 20, 25, 0.6);
    border: 1px solid #005f6a;
    border-radius: 1px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 7px;
    color: #005f6a;
    transition: all 0.1s ease;
}

.seq-step:hover {
    background: rgba(0, 95, 106, 0.3);
    box-shadow: 0 0 5px rgba(77, 249, 255, 0.3);
    color: #4df9ff;
}
.seq-step.active {
    background: rgba(0, 95, 106, 0.5);
    color: #4df9ff;
    border-color: #4df9ff;
}
.seq-step.playing {
    border-color: #fff;
    background: #4df9ff;
    color: #000;
    box-shadow: 0 0 10px rgba(77, 249, 255, 0.8);
    animation: step-glow 0.5s ease-in-out;
}

@keyframes step-glow {
    0% { opacity: 0.8; }
    50% { opacity: 1; box-shadow: 0 0 15px #4df9ff; }
    100% { opacity: 0.8; }
}

.seq-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.bpm-input {
    width: 45px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    color: #00ff00;
    padding: 3px;
    font-size: 10px;
    font-family: inherit;
    text-align: center;
}

.bpm-input:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

/* PERFORMANCE PANEL SPECIFIC */
#performance-panel {
    top: 60px;
    left: 420px;
    width: 280px;
}

.fader-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    height: 30px;
}

.fader-label {
    width: 50px;
    font-size: 10px;
    color: #4df9ff;
    font-family: 'Fira Code', monospace;
    font-weight: 500;
}

.fader-slider {
    flex: 1;
    -webkit-appearance: none;
    background: transparent;
    cursor: pointer;
    height: 20px;
}

.fader-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    background: #005f6a;
    border: none;
    border-radius: 0;
}

.fader-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    background: #4df9ff;
    border: none;
    border-radius: 50%;
    margin-top: -5px;
    box-shadow: 0 0 10px rgba(77, 249, 255, 0.5);
    transition: all 0.2s ease;
}

.fader-slider:focus {
    outline: none;
}

.fader-slider:hover::-webkit-slider-thumb {
    background: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(77, 249, 255, 0.8);
}

/* INFO OVERLAY - Clean Industrial Style */
.info-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: rgba(5, 12, 15, 0.98);
    border: 1px solid #4df9ff;
    z-index: 3000;
    display: none;
    animation: terminal-fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

@keyframes terminal-fadeIn {
    from { 
        opacity: 0; 
        transform: translate(-50%, -60%);
        box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, -50%);
        box-shadow: 0 0 30px rgba(0, 255, 0, 0.5);
    }
}

.info-header {
    background: rgba(0, 50, 60, 0.9);
    color: #4df9ff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid #005f6a;
}

.info-content {
    padding: 30px;
    color: #b0d0d3;
    line-height: 1.7;
    font-size: 13px;
    background: transparent;
}

.info-title {
    font-size: 24px;
    margin-bottom: 8px;
    color: #4df9ff;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 300;
}
.info-subtitle {
    color: #4a6a00;
    font-size: 12px;
    margin-bottom: 25px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: bold;
}
.section-title {
    border-left: 3px solid #4df9ff;
    padding-left: 15px;
    font-size: 16px;
    margin: 30px 0 15px 0;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.subsection-title {
    color: #4df9ff;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

.highlight-link {
    color: #4df9ff;
    text-decoration: none;
    border-bottom: 1px dotted #4df9ff;
    transition: all 0.2s;
}
.highlight-link:hover {
    color: #fff;
    border-bottom: 1px solid #fff;
    background: rgba(77, 249, 255, 0.1);
}

.info-list {
    list-style: none;
    padding-left: 10px;
}
.info-list li {
    margin: 8px 0;
    position: relative;
    padding-left: 20px;
}
.info-list li::before {
    content: "›";
    color: #4a6a00;
    position: absolute;
    left: 0;
    font-weight: bold;
    font-size: 16px;
    line-height: 14px;
}

.code-example {
    background: rgba(0, 20, 25, 0.5);
    padding: 15px;
    margin: 15px 0;
    border-radius: 2px;
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    border-left: 2px solid #4a6a00;
    color: #a8dce0;
}

.credits-list {
    background: rgba(0, 20, 25, 0.3);
    padding: 20px;
    border: 1px solid #005f6a;
}
.credits-item {
    margin: 10px 0;
    font-size: 12px;
    color: #b0d0d3;
}

.close-btn {
    background: none;
    border: 1px solid #4df9ff;
    font-size: 20px;
    cursor: pointer;
    color: #4df9ff;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.close-btn:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.5);
}

/* Remove scan line from overlay */
.info-overlay::before {
    display: none;
}

/* Mobile & Responsive Adjustments */
@media (max-width: 600px) {
    .panel {
        min-width: auto;
        width: 90vw;
        max-width: 350px;
        left: 5vw !important; /* Force centering horizontally on mobile open */
    }
    
    /* Adjust specific panels positions for mobile initial load */
    #editor-panel { top: 60px; }
    #banks-panel { top: 70px; left: 5vw; }
    #sequencer-panel { bottom: 10px; left: 5vw; top: auto; }
    #performance-panel { top: 80px; left: 5vw; }

    /* Smaller toolbar for mobile */
    .toolbar {
        padding: 5px 10px;
    }
    .btn {
        padding: 4px 8px;
        font-size: 9px;
    }
    
    .brand span {
        display: none; /* Hide 404 in toolbar on tiny screens to save space */
    }
}