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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#root {
    width: 100%;
    max-width: 1400px;
}

.synthesizer {
    background: #e0e5ec;
    border-radius: 30px;
    padding: 40px;
    box-shadow: 20px 20px 60px #a3b1c6, -20px -20px 60px #ffffff;
}

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

.pattern-display {
    background: #e0e5ec;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: inset 5px 5px 10px #a3b1c6, inset -5px -5px 10px #ffffff;
}

.pattern-name {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 2px;
}

.berry-counter {
    background: #e0e5ec;
    padding: 15px 25px;
    border-radius: 15px;
    box-shadow: inset 5px 5px 10px #a3b1c6, inset -5px -5px 10px #ffffff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 18px;
    color: #2c3e50;
}

.berry-sync {
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    cursor: pointer;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.main-panel {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 40px;
    margin-bottom: 30px;
}

.left-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.canvas-wrapper {
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 8px 8px 16px #a3b1c6, -8px -8px 16px #ffffff;
    position: relative;
}

.canvas-info {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border-radius: 8px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: #2ecc71;
    line-height: 1.6;
}

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

.knob-row {
    display: flex;
    gap: 20px;
    justify-content: space-around;
}

.knob-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.knob {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e0e5ec;
    box-shadow: 8px 8px 16px #a3b1c6, -8px -8px 16px #ffffff;
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: box-shadow 0.2s;
}

.knob:active {
    box-shadow: inset 4px 4px 8px #a3b1c6, inset -4px -4px 8px #ffffff;
}

.knob-cap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.knob-indicator {
    position: absolute;
    width: 4px;
    height: 25px;
    background: #e0e5ec;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.knob-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #2c3e50;
}

.knob-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #7f8c8d;
}

.fader-section {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.fader-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.fader-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #2c3e50;
}

.fader-track {
    width: 40px;
    height: 200px;
    background: #e0e5ec;
    border-radius: 20px;
    box-shadow: inset 5px 5px 10px #a3b1c6, inset -5px -5px 10px #ffffff;
    position: relative;
    cursor: pointer;
}

.fader-handle {
    position: absolute;
    width: 36px;
    height: 30px;
    background: #e0e5ec;
    border-radius: 15px;
    box-shadow: 4px 4px 8px #a3b1c6, -4px -4px 8px #ffffff;
    left: 2px;
    transition: box-shadow 0.2s;
}

.fader-handle:active {
    box-shadow: 2px 2px 4px #a3b1c6, -2px -2px 4px #ffffff;
}

.fader-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #2c3e50;
}

.toggle-button {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #2c3e50;
    border: none;
    cursor: pointer;
    box-shadow: 4px 4px 8px #a3b1c6, -4px -4px 8px #ffffff;
    transition: all 0.3s;
}

.toggle-button.active {
    background: #2ecc71;
    box-shadow: inset 3px 3px 6px #239d57, inset -3px -3px 6px #3bff85;
    animation: toggle-pulse 1.5s ease-in-out infinite;
}

@keyframes toggle-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.toggle-button:active {
    transform: scale(0.95);
}

.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.control-button {
    padding: 12px 20px;
    background: #e0e5ec;
    border: none;
    border-radius: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #2c3e50;
    cursor: pointer;
    box-shadow: 6px 6px 12px #a3b1c6, -6px -6px 12px #ffffff;
    transition: all 0.2s;
}

.control-button:hover {
    box-shadow: 8px 8px 16px #a3b1c6, -8px -8px 16px #ffffff;
}

.control-button:active,
.control-button.active {
    box-shadow: inset 4px 4px 8px #a3b1c6, inset -4px -4px 8px #ffffff;
}

.control-button.rec.active {
    color: #e74c3c;
    animation: rec-blink 1s ease-in-out infinite;
}

@keyframes rec-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.control-button.play.active {
    color: #2ecc71;
}

.control-button.memory.saved {
    background: linear-gradient(135deg, #e0e5ec 0%, #c8d4e0 100%);
}

.footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(163, 177, 198, 0.3);
}

.footer-content {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #7f8c8d;
    margin-bottom: 15px;
}

.footer-link {
    display: inline-block;
    padding: 12px 30px;
    background: #e0e5ec;
    border-radius: 12px;
    text-decoration: none;
    color: #ff4757;
    font-weight: 600;
    box-shadow: 6px 6px 12px #a3b1c6, -6px -6px 12px #ffffff;
    transition: all 0.2s;
}

.footer-link:hover {
    box-shadow: 8px 8px 16px #a3b1c6, -8px -8px 16px #ffffff;
    transform: translateY(-2px);
}

.berry-boost-active {
    animation: berry-glow 0.5s ease-in-out infinite alternate;
}

@keyframes berry-glow {
    from {
        filter: drop-shadow(0 0 10px #ff4757);
    }
    to {
        filter: drop-shadow(0 0 20px #ff4757) brightness(1.2);
    }
}

@media (max-width: 1024px) {
    .main-panel {
        grid-template-columns: 1fr;
    }
    
    .knob-row {
        flex-wrap: wrap;
    }
    
    .fader-section {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .synthesizer {
        padding: 20px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .knob {
        width: 60px;
        height: 60px;
    }
    
    .knob-cap {
        width: 45px;
        height: 45px;
    }
    
    .fader-track {
        height: 150px;
    }
}