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

body {
    font-family: 'JetBrains Mono', monospace;
    background: #0a0a0a;
    color: #f5f0e6;
    overflow: hidden;
    height: 100vh;
}

#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 50%, #0f0f0f 100%);
}

#control-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: linear-gradient(180deg, #252525 0%, #1a1a1a 100%);
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 2px;
    color: #ff1493;
}

.logo span {
    color: #00ffff;
}

.controls {
    display: flex;
    gap: 10px;
}

.ctrl-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 700;
    padding: 8px 16px;
    background: linear-gradient(180deg, #333 0%, #222 100%);
    border: 1px solid #444;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ctrl-btn:hover {
    background: linear-gradient(180deg, #444 0%, #333 100%);
    color: #fff;
    border-color: #555;
}

.ctrl-btn.active {
    background: linear-gradient(180deg, #ff1493 0%, #cc1177 100%);
    color: #fff;
    border-color: #ff1493;
}

.ctrl-btn.play {
    background: linear-gradient(180deg, #2a4a2a 0%, #1a3a1a 100%);
    border-color: #3a5a3a;
}

.ctrl-btn.play:hover,
.ctrl-btn.playing {
    background: linear-gradient(180deg, #33ff66 0%, #22cc44 100%);
    color: #000;
    border-color: #33ff66;
}

.ctrl-btn.danger:hover {
    background: linear-gradient(180deg, #ff3333 0%, #cc2222 100%);
    border-color: #ff3333;
}

#workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

#module-palette {
    width: 180px;
    background: linear-gradient(180deg, #1f1f1f 0%, #151515 100%);
    border-right: 1px solid #333;
    padding: 15px;
    overflow-y: auto;
    flex-shrink: 0;
}

#module-palette h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #666;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.module-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.module-item {
    cursor: grab;
    transition: transform 0.2s;
}

.module-item:hover {
    transform: scale(1.05);
}

.module-item:active {
    cursor: grabbing;
}

.module-preview {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px solid;
    padding: 15px 10px;
    text-align: center;
}

.module-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
}

#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#cinematic-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

#cinematic-overlay.hidden {
    opacity: 0;
}

.letterbox {
    position: absolute;
    left: 0;
    right: 0;
    height: 40px;
    background: #000;
}

.letterbox.top {
    top: 0;
}

.letterbox.bottom {
    bottom: 0;
}

.rec-indicator {
    position: absolute;
    top: 50px;
    right: 20px;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #ff3333;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.film-grain {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.03;
    animation: grain 0.5s steps(10) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0, 0); }
    10% { transform: translate(-1%, -1%); }
    20% { transform: translate(1%, 1%); }
    30% { transform: translate(-1%, 1%); }
    40% { transform: translate(1%, -1%); }
    50% { transform: translate(-1%, 0); }
    60% { transform: translate(1%, 0); }
    70% { transform: translate(0, -1%); }
    80% { transform: translate(0, 1%); }
    90% { transform: translate(-1%, -1%); }
}

#oscilloscope-panel {
    background: linear-gradient(180deg, #1a1a1a 0%, #0f0f0f 100%);
    border-top: 1px solid #333;
    padding: 10px;
    flex-shrink: 0;
}

.scope-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.scope-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #33ff33;
}

.scope-btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    padding: 4px 10px;
    background: #1a1a1a;
    border: 1px solid #33ff33;
    color: #33ff33;
    cursor: pointer;
    transition: all 0.2s;
}

.scope-btn:hover,
.scope-btn.active {
    background: #33ff33;
    color: #000;
}

#scope-canvas {
    display: block;
    width: 100%;
    border: 1px solid #222;
    border-radius: 4px;
}

footer {
    text-align: center;
    padding: 10px;
    background: #0a0a0a;
    border-top: 1px solid #222;
    font-size: 12px;
    color: #555;
    flex-shrink: 0;
}

footer a {
    color: #ff1493;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #control-bar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }
    
    .controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .ctrl-btn {
        font-size: 10px;
        padding: 6px 12px;
    }
    
    #module-palette {
        width: 100px;
        padding: 10px;
    }
    
    #module-palette h2 {
        font-size: 10px;
    }
    
    .module-preview {
        padding: 10px 5px;
    }
    
    .module-name {
        font-size: 9px;
    }
    
    .letterbox {
        height: 25px;
    }
}

@media (max-width: 480px) {
    #module-palette {
        display: none;
    }
    
    .logo {
        font-size: 14px;
    }
    
    .ctrl-btn .icon {
        display: none;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}