
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700&family=Roboto+Mono:wght@400;700&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none; 
}

body {
    background: #000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Roboto Mono', monospace;
    overflow: hidden;
}


#paintCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
}

.scene {
    perspective: 1200px;
    padding: 20px;
}

.machine-case {
    position: relative;
    width: 960px;
    background: #2b2b2b;
    border-radius: 12px;
    padding: 30px;
    transform: rotateX(15deg); 
    box-shadow: 
        0 20px 0 #1a1a1a, 
        0 40px 60px rgba(0,0,0,0.6), 
        inset 0 1px 0 rgba(255,255,255,0.2);
    border-top: 1px solid #333;
}


.side-panel {
    position: absolute;
    top: 0; bottom: -20px;
    width: 25px;
    background: #5d4037;
    background-image: linear-gradient(to right, rgba(0,0,0,0.4), transparent);
    border-radius: 4px;
    z-index: -1;
}
.side-panel.left { left: -25px; border-radius: 8px 0 0 8px; transform: skewY(10deg); top: 10px;}
.side-panel.right { right: -25px; border-radius: 0 8px 8px 0; transform: skewY(-10deg); top: 10px;}


.screw {
    position: absolute;
    width: 12px; height: 12px;
    background: radial-gradient(circle, #888, #333);
    border-radius: 50%;
    box-shadow: 0 1px 0 rgba(255,255,255,0.2);
}
.screw::after {
    content: ''; position: absolute; top: 50%; left: 10%; width: 80%; height: 2px;
    background: #222; transform: translateY(-50%) rotate(45deg);
}
.tl { top: 10px; left: 10px; }
.tr { top: 10px; right: 10px; }
.bl { bottom: 10px; left: 10px; }
.br { bottom: 10px; right: 10px; }


.machine-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 2px solid #111;
    padding-bottom: 15px;
    box-shadow: 0 1px 0 #444;
}

.brand h1 {
    font-family: 'Orbitron', sans-serif;
    color: #e0e0e0;
    font-size: 2rem;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin: 0;
}
.brand span {
    color: #ff9800;
    font-size: 0.7rem;
    letter-spacing: 2px;
    font-weight: bold;
}

.lcd-display {
    background: #000;
    border: 4px solid #555;
    border-radius: 6px;
    padding: 10px 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.8);
}

.lcd-screen {
    background: #2f3a2f;
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lcd-screen .label {
    font-size: 0.6rem;
    color: #5d755d;
}

#bpmInput {
    background: transparent;
    border: none;
    color: #4aff4a;
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    width: 70px;
    text-align: center;
    outline: none;
    text-shadow: 0 0 5px rgba(74, 255, 74, 0.6);
}


.transport-controls {
    display: flex;
    align-items: center;
}

.transport-btn {
    width: 60px; height: 40px;
    background: #d32f2f;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    box-shadow: 0 4px 0 #8c1b1b, 0 6px 5px rgba(0,0,0,0.4);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    font-size: 0.7rem;
}

.transport-btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #8c1b1b, inset 0 2px 5px rgba(0,0,0,0.4);
}


.transport-btn.clear {
    background: #757575;
    box-shadow: 0 4px 0 #424242, 0 6px 5px rgba(0,0,0,0.4);
    margin-left: 10px;
}

.transport-btn.clear:active {
    box-shadow: 0 0 0 #424242, inset 0 2px 5px rgba(0,0,0,0.4);
    transform: translateY(4px);
}


.transport-btn.export {
    background: #0288d1;
    box-shadow: 0 4px 0 #01579b, 0 6px 5px rgba(0,0,0,0.4);
    margin-left: 10px;
}

.transport-btn.export:active {
    box-shadow: 0 0 0 #01579b, inset 0 2px 5px rgba(0,0,0,0.4);
    transform: translateY(4px);
}

.pad-section h3, .sequencer-container h3 {
    color: #888;
    font-size: 0.8rem;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.drum-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    background: #222;
    padding: 15px;
    border-radius: 8px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
    margin-bottom: 20px;
}

.drum-pad {
    aspect-ratio: 1/1;
    background: #37474f;
    border: none;
    border-radius: 6px;
    color: #b0bec5;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 5px 0 #263238, 0 7px 5px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
    transition: transform 0.05s, box-shadow 0.05s, background 0.1s;
}

.drum-pad:hover { background: #455a64; }

.drum-pad.active, .drum-pad:active {
    transform: translateY(5px);
    box-shadow: 0 0 0 #263238, inset 0 2px 5px rgba(0,0,0,0.5);
    background: #00bcd4;
    color: #000;
}


.sequencer-scroll-area {
    max-height: 320px; 
    overflow-y: auto;
    padding-right: 5px;
}


.sequencer-scroll-area::-webkit-scrollbar { width: 8px; }
.sequencer-scroll-area::-webkit-scrollbar-track { background: #1a1a1a; border-radius: 4px; }
.sequencer-scroll-area::-webkit-scrollbar-thumb { background: #444; border-radius: 4px; }

.seq-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}


.row-label {
    width: 40px;
    font-size: 0.7rem;
    color: #ff9800;
    font-weight: bold;
    text-align: center;
    margin-right: 10px;
    text-shadow: 0 0 3px rgba(255,152,0,0.4);
    cursor: pointer;
    transition: color 0.2s, transform 0.1s;
}

.row-label:hover {
    color: #fff !important;
}

.row-label:active {
    transform: scale(0.9);
}

.steps {
    display: grid;
    grid-template-columns: repeat(16, 1fr);
    gap: 4px;
    flex-grow: 1;
}

.step {
    width: 100%;
    padding-top: 100%;
    position: relative;
    background: #444;
    border-radius: 2px;
    cursor: pointer;
    box-shadow: 0 2px 0 #222;
    transition: background 0.1s, transform 0.1s, box-shadow 0.1s;
}

.step.active {
    background: #03a9f4;
    box-shadow: 0 0 8px #03a9f4, 0 2px 0 #0277bd;
    z-index: 1;
}

.step.playhead {
    border: 1px solid #fff;
    box-shadow: 0 0 10px #fff;
    z-index: 2;
}

.step:nth-child(4n+1) { background: #555; }

.legend {
    font-size: 0.65rem;
    color: #666;
    margin-bottom: 10px;
    text-align: right;
}
