* {
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', monospace;
    margin: 0;
    padding: 0;
}

.font-display {
    font-family: 'Bebas Neue', cursive;
}

.panel {
    background: #D5D1CA;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.knob {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4A4A4A, #1A1A1A);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 -2px 4px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    transition: transform 0.1s;
    user-select: none;
}

.knob:hover {
    transform: scale(1.05);
}

.knob.dragging {
    transform: scale(0.98);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 6px rgba(0, 0, 0, 0.6);
}

.knob-indicator {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%) rotate(var(--rotation, -135deg));
    transform-origin: center calc(100% + 32px);
    width: 4px;
    height: 30px;
    background: linear-gradient(to bottom, #FF6B5B, #FF4433);
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(255, 107, 91, 0.5);
    transition: transform 0.05s ease-out;
}

.toggle-switch {
    width: 50px;
    height: 26px;
    background: #8B8B8B;
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
}

.toggle-switch.active {
    background: #FF6B5B;
}

.toggle-switch-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.toggle-switch.active .toggle-switch-slider {
    transform: translateX(24px);
}

.swatch {
    aspect-ratio: 1;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    min-height: 32px;
}

.swatch:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.swatch-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 20;
}

.swatch:hover .swatch-tooltip {
    opacity: 1;
}

.control-btn {
    background: linear-gradient(to bottom, #FFFFFF, #E0E0E0);
    border: 2px solid #999;
    border-radius: 6px;
    padding: 10px 20px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.1s;
    text-transform: uppercase;
}

.control-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.control-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
    z-index: 1000;
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .swatch {
        min-height: 24px;
    }
}