/* ═══════════════════════════════════════════════════════════════════════
   generativeart.io — Playground Styles
   Requires global.css
   ═══════════════════════════════════════════════════════════════════════ */

body {
    overflow: hidden;
}

/* ─── Canvas fills the screen ─── */
#canvas-container {
    position: fixed;
    inset: 0;
    z-index: 0;
}

#canvas-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ─── FPS counter ─── */
.fps {
    position: fixed;
    top: calc(var(--nav-height) + 16px);
    left: 40px;
    z-index: 100;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-surface-elevated);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
}

/* ─── Control Panel ─── */
.panel {
    position: fixed;
    top: calc(var(--nav-height) + 24px);
    right: 40px;
    bottom: 24px;
    width: 340px;
    z-index: 100;
    background: rgba(18, 18, 22, 0.6);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    padding: 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    box-shadow: var(--shadow-soft);
}

html.light .panel {
    background: rgba(255, 255, 255, 0.8);
}

.panel.collapsed {
    transform: translateX(120%);
    opacity: 0;
    pointer-events: none;
}

.panel-toggle {
    position: fixed;
    top: calc(var(--nav-height) + 24px);
    right: 40px;
    z-index: 101;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-elevated);
    backdrop-filter: blur(16px);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.panel:not(.collapsed)~.panel-toggle {
    right: 396px;
}

.panel-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent-amber);
    background: var(--bg-surface-hover);
}

.panel h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.panel-section-label {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.panel select,
.panel input[type="number"] {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    margin-bottom: 20px;
    outline: none;
    transition: border-color var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

.panel select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%23a1a1aa' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.panel select:focus,
.panel input:focus {
    border-color: var(--accent-cyan);
}

/* ═══════════════════════════════════════════════════════════════════
   PRESET GRID
   ═══════════════════════════════════════════════════════════════════ */

.preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 10px;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    padding-right: 2px;
}

.preset-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

html.light .preset-chip {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.preset-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--chip-accent, #fff) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: inherit;
}

.preset-chip:hover {
    border-color: var(--chip-accent, var(--accent-amber));
    background: rgba(255, 255, 255, 0.06);
}

html.light .preset-chip:hover {
    background: rgba(0, 0, 0, 0.06);
}

.preset-chip:hover::before {
    opacity: 0.08;
}

.preset-chip.active {
    border-color: var(--chip-accent, var(--accent-amber));
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    box-shadow: 0 0 12px -4px var(--chip-accent, var(--accent-amber));
}

html.light .preset-chip.active {
    background: rgba(0, 0, 0, 0.05);
}

.preset-chip.active::before {
    opacity: 0.12;
}

.preset-icon {
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 3px var(--chip-accent, transparent));
}

.preset-chip.active .preset-icon {
    filter: drop-shadow(0 0 6px var(--chip-accent, transparent));
}

.preset-name {
    position: relative;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Shuffle button */
.btn-shuffle {
    width: 100%;
    padding: 9px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 0;
}

html.light .btn-shuffle {
    background: rgba(0, 0, 0, 0.03);
}

.btn-shuffle:hover {
    border-color: var(--accent-cyan);
    color: var(--text-primary);
    background: rgba(127, 183, 190, 0.08);
}

.btn-shuffle svg {
    opacity: 0.7;
    transition: transform 0.3s ease;
}

.btn-shuffle:hover svg {
    opacity: 1;
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════════════════════════════════ */

/* Sliders */
.slider-row {
    margin-bottom: 16px;
}

.slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.slider-label label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.slider-label span:last-child {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--accent-amber);
    background: rgba(212, 163, 115, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

input[type="range"] {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent-amber);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 0 4px var(--bg-surface);
    transition: transform var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent-amber);
    border-radius: 50%;
    border: 4px solid var(--bg-surface);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* Colors */
.color-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-color);
    padding: 6px 12px 6px 6px;
    border-radius: var(--radius-md);
}

.color-row input[type="color"] {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.color-row input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-row input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.color-row span {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.divider {
    height: 1px;
    background: var(--border-color);
    margin: 24px 0;
}

/* Buttons */
.btn-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: var(--accent-amber);
    color: var(--bg-base);
}

.btn-primary:hover {
    background: #e0b489;
}

.btn-secondary {
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-surface-hover);
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
    .panel {
        width: calc(100% - 40px);
        right: 20px;
    }

    .panel-toggle {
        right: 20px;
    }

    .panel:not(.collapsed)~.panel-toggle {
        display: none;
    }

    .fps {
        left: 20px;
    }

    .preset-grid {
        max-height: 180px;
    }
}
