:root {
    --deep-space: #050505;
    --studio-glass: rgba(20, 20, 20, 0.7);
    --electric-cyan: #00F5FF;
    --cyber-grape: #7B61FF;
    --ghost-white: #F8F9FA;
    --muted-slate: #6C757D;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--deep-space);
    color: var(--ghost-white);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .logo-container {
    font-family: 'Space Grotesk', sans-serif;
}

/* Glassmorphism */
.glass-panel {
    background: var(--studio-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
}

.glass-panel-flat {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Buttons */
.studio-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.studio-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.studio-btn-primary {
    background: linear-gradient(135deg, var(--cyber-grape), #5a44cc);
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(123, 97, 255, 0.3);
}

.studio-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 97, 255, 0.5);
}

.studio-btn-accent {
    background: linear-gradient(135deg, var(--electric-cyan), #00c4cc);
    color: #000;
    border-radius: 8px;
    padding: 0.5rem 1.25rem;
    font-weight: 700;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 245, 255, 0.3);
}

.studio-btn-accent:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 245, 255, 0.5);
}

/* Range Inputs */
.studio-range {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.studio-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--electric-cyan);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--electric-cyan);
    transition: transform 0.1s ease;
}

.studio-range::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

/* Switches */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .4s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--cyber-grape);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Inputs */
.studio-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: white;
    outline: none;
    transition: border-color 0.2s ease;
}

.studio-input:focus {
    border-color: var(--electric-cyan);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(8px);
    padding: 1rem;
}

.modal-content {
    animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-in {
    from { opacity: 0.5; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Preset Cards */
.preset-card {
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.preset-card:hover {
    transform: translateY(-5px);
    border-color: var(--electric-cyan);
    box-shadow: 0 10px 30px rgba(0, 245, 255, 0.1);
}

.preset-thumb {
    width: 100%;
    height: 120px;
    background: #111;
    border-radius: 8px;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.preset-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, var(--cyber-grape), var(--electric-cyan));
    opacity: 0.2;
}

/* Code Container */
.code-container pre {
    white-space: pre-wrap;
    word-break: break-all;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Hide UI Animation */
.ui-hidden {
    opacity: 0.1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#fps-bar {
    transition: width 0.3s ease, background-color 0.3s ease;
}