/* ╔══════════════════════════════════════════════════╗
   ║       4D FIGURE BUILDER — Master Stylesheet      ║
   ╚══════════════════════════════════════════════════╝ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

/* ── TOKENS ─────────────────────────────────────── */
:root {
    --bg:          #050510;
    --panel-bg:    rgba(10, 10, 28, 0.82);
    --border:      rgba(255,255,255,0.08);
    --c1:          #00f3ff;
    --c2:          #ff00ea;
    --c3:          #9d00ff;
    --glow1:       rgba(0, 243, 255, 0.45);
    --text:        #eeeeff;
    --muted:       #7a7a9a;
    --slicer-h:    52px;
    --header-h:    58px;
}

/* ── RESET ───────────────────────────────────────── */
*, *::before, *::after {
    margin: 0; padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    user-select: none;
}

body {
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Animated starfield background */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 20% 20%, rgba(0,100,255,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 60% 80% at 80% 80%, rgba(157,0,255,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── GLASSMORPHISM ───────────────────────────────── */
.glass-panel {
    background: var(--panel-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border);
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

/* ── HEADER ──────────────────────────────────────── */
.top-bar {
    height: var(--header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    background: linear-gradient(180deg, rgba(0,0,0,0.85), transparent);
    border-bottom: 1px solid var(--border);
    z-index: 20;
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--c1), var(--c2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.hdr-btn {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s;
    white-space: nowrap;
}
.hdr-btn:hover { background: rgba(255,255,255,0.15); }
.hdr-btn.glow-cyan {
    border-color: var(--c1);
    color: var(--c1);
    box-shadow: 0 0 12px rgba(0,243,255,0.3);
}
.hdr-btn.glow-cyan:hover { box-shadow: 0 0 22px rgba(0,243,255,0.6); }
.lang-btn { font-size: 0.85rem; }

/* ── MAIN LAYOUT ─────────────────────────────────── */
.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ── PANELS ──────────────────────────────────────── */
.panel {
    width: 320px;
    min-width: 260px;
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    gap: 0.9rem;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
    flex-shrink: 0;
}
.panel::-webkit-scrollbar { width: 4px; }
.panel::-webkit-scrollbar-thumb {
    background: var(--c1);
    border-radius: 4px;
    opacity: 0.6;
}

.left-panel  { border-right: 1px solid var(--border); }
.right-panel { border-left: 1px solid var(--border); }

.panel h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--c1);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sub-heading {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.separator {
    height: 1px;
    background: var(--border);
    flex-shrink: 0;
}

/* ── TAB BUTTONS ─────────────────────────────────── */
.tab-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.tab-btn {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 5px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.2s;
    white-space: nowrap;
}
.tab-btn:hover { background: rgba(0,243,255,0.1); color: var(--c1); }
.tab-btn.active {
    background: var(--c1);
    color: #000;
    border-color: var(--c1);
    box-shadow: 0 0 12px var(--glow1);
}

/* ── FIGURE LIST ─────────────────────────────────── */
.figure-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 170px;
    min-height: 120px;
    flex-shrink: 0;
    overflow-y: auto;
    padding-right: 2px;
}
.figure-list::-webkit-scrollbar { width: 3px; }
.figure-list::-webkit-scrollbar-thumb { background: var(--c3); border-radius: 3px; }

.fig-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255,255,255,0.03);
}
.fig-item:hover {
    background: rgba(0,243,255,0.08);
    border-color: rgba(0,243,255,0.2);
}
.fig-item.active {
    background: rgba(0,243,255,0.12);
    border-color: var(--c1);
    box-shadow: 0 0 12px rgba(0,243,255,0.2);
}
.fig-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.fig-info { display: flex; flex-direction: column; }
.fig-name  { font-size: 0.82rem; font-weight: 700; color: var(--text); }
.fig-meta  { font-size: 0.65rem; color: var(--muted); }

/* ── PARAMETERS ──────────────────────────────────── */
.param-grid { display: flex; flex-direction: column; gap: 7px; }
.param-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    gap: 6px;
}
.param-row label { font-size: 0.72rem; color: var(--muted); }
.param-row input[type=range] { accent-color: var(--c1); cursor: pointer; }
.param-val { font-size: 0.68rem; font-weight: 700; color: var(--c1); min-width: 36px; text-align: right; }

/* ── BUTTON GROUP HORIZONTAL ─────────────────────── */
.btn-group-horiz {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.mode-btn {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s;
    white-space: nowrap;
}
.mode-btn:hover { background: rgba(255,0,234,0.12); color: #fff; }
.mode-btn.active {
    background: var(--c2);
    color: #fff;
    border-color: var(--c2);
    box-shadow: 0 0 10px rgba(255,0,234,0.4);
}

/* ── PRESET GRID ─────────────────────────────────── */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}
.preset-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 6px;
    padding: 6px 4px;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s;
    line-height: 1.3;
}
.preset-btn:hover {
    background: rgba(157,0,255,0.15);
    color: #fff;
    border-color: var(--c3);
}
.preset-btn.active {
    background: var(--c3);
    color: #fff;
    border-color: var(--c3);
    box-shadow: 0 0 10px rgba(157,0,255,0.5);
}

/* ── CENTER STAGE ────────────────────────────────── */
.center-stage {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #0a0a2a 0%, #000007 100%);
}
#stage-container canvas {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* HUD Overlay */
.hud-overlay {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    pointer-events: none;
    z-index: 5;
}
.hud-figure-name {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--c1), var(--c2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    animation: hud-pulse 3s ease-in-out infinite;
}
@keyframes hud-pulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.7; }
}
.hud-stats { font-size: 0.7rem; color: var(--muted); letter-spacing: 1px; margin-top: 2px; }

/* Stage Control Buttons */
.stage-controls {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
    align-items: center;
}
.stage-btn {
    background: rgba(10,10,30,0.85);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 9px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
    white-space: nowrap;
}
.stage-btn:hover { transform: translateY(-2px); }
.stage-btn.primary {
    border-color: var(--c1);
    color: var(--c1);
    box-shadow: 0 0 18px rgba(0,243,255,0.3);
}
.stage-btn.primary:hover { box-shadow: 0 0 30px rgba(0,243,255,0.6); }
.stage-btn.primary.playing {
    background: rgba(0,243,255,0.15);
    animation: btn-pulse 1s infinite;
}
@keyframes btn-pulse { 0%,100%{box-shadow:0 0 18px rgba(0,243,255,.4)} 50%{box-shadow:0 0 35px rgba(0,243,255,.9)} }
.stage-btn.accent {
    border-color: #ff5500;
    color: #ff7722;
}
.stage-btn.accent:hover { box-shadow: 0 0 20px rgba(255,85,0,0.5); }
.stage-btn.purple {
    border-color: var(--c3);
    color: #cc88ff;
}
.stage-btn.purple:hover { box-shadow: 0 0 20px rgba(157,0,255,0.5); }

/* Axis labels floating */
.axis-label {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 800;
    color: rgba(255,255,255,0.2);
    pointer-events: none;
    letter-spacing: 1px;
}
#axis-x { bottom: 100px; right: 20px; color: rgba(255,80,80,0.4); }
#axis-y { top: 60px; right: 20px; color: rgba(80,255,80,0.4); }
#axis-w { bottom: 100px; left: 20px; color: var(--c1); opacity: 0.4; }

/* ── RIGHT PANEL SPECIFIC ────────────────────────── */
.glass-select {
    width: 100%;
    background: rgba(0,0,0,0.5);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 10px;
    border-radius: 8px;
    outline: none;
    font-family: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}
.glass-select option { background: #0a0a18; }

.fx-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    align-items: center;
    gap: 6px;
}
.fx-row label { font-size: 0.72rem; color: var(--muted); }
.fx-row input[type=range] { accent-color: var(--c1); cursor: pointer; }

/* Rotation Plane Grid */
.plane-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
}
.plane-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    transition: all 0.2s;
}
.plane-toggle:has(input:checked) {
    border-color: var(--c3);
    color: #cc88ff;
    background: rgba(157,0,255,0.12);
}
.plane-toggle input { display: none; }

/* Color Themes */
.theme-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.theme-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: var(--c);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 8px var(--c);
}
.theme-dot:hover { transform: scale(1.2); }
.theme-dot.active {
    border-color: #fff;
    transform: scale(1.25);
    box-shadow: 0 0 16px var(--c);
}

/* Full button */
.btn-full {
    width: 100%;
    background: rgba(157,0,255,0.12);
    border: 1px solid var(--c3);
    color: #cc88ff;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.25s;
}
.btn-full:hover { background: rgba(157,0,255,0.25); box-shadow: 0 0 15px rgba(157,0,255,0.4); }
.btn-full.active { background: var(--c3); color: #fff; }

/* Info box */
.info-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: auto;
}
.info-box h4 { font-size: 0.72rem; color: var(--c1); text-transform: uppercase; margin-bottom: 5px; letter-spacing: 1px; }
.info-box p { font-size: 0.72rem; color: var(--muted); line-height: 1.5; }

/* ── W-SLICER BAR ────────────────────────────────── */
.slicer-bar {
    height: var(--slicer-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 1.5rem;
    border-top: 1px solid rgba(0,243,255,0.2);
    box-shadow: 0 -4px 30px rgba(0,243,255,0.1);
    flex-shrink: 0;
    z-index: 20;
}
.slicer-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--c1);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
}
.slicer-track-wrap { flex: 1; }
.slicer-range {
    width: 100%;
    accent-color: var(--c1);
    cursor: pointer;
}
.slicer-val-display {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--c1);
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
    background: rgba(0,243,255,0.08);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0,243,255,0.2);
}

/* ── TOAST NOTIFICATION ──────────────────────────── */
#toast {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0,243,255,0.15);
    border: 1px solid var(--c1);
    color: var(--c1);
    padding: 10px 24px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
    z-index: 1000;
    white-space: nowrap;
}
#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── FULLSCREEN MODE ─────────────────────────────── */
body.fullscreen .panel,
body.fullscreen .top-bar,
body.fullscreen .slicer-bar,
body.fullscreen .stage-controls {
    display: none !important;
}
body.fullscreen .center-stage {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

/* ── SCROLLBAR ───────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,243,255,0.3); border-radius: 4px; }

/* ── MICRO-ANIMATIONS ────────────────────────────── */
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.fig-item { animation: fadeIn 0.3s ease both; }

/* ── REC BUTTON ──────────────────────────────────── */
.rec-btn {
    border-color: #ff3333 !important;
    color: #ff4444 !important;
    box-shadow: 0 0 10px rgba(255,50,50,0.3);
}
.rec-btn:hover { box-shadow: 0 0 20px rgba(255,50,50,0.6) !important; }
.rec-btn.recording {
    background: rgba(255,30,30,0.2) !important;
    animation: rec-pulse 1s infinite;
}
@keyframes rec-pulse {
    0%,100% { box-shadow: 0 0 10px rgba(255,50,50,0.4); }
    50%      { box-shadow: 0 0 28px rgba(255,50,50,1); }
}
.rec-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #ff3333;
    animation: rec-pulse 1s infinite;
}

/* ── GLOW PURPLE BUTTON ──────────────────────────── */
.hdr-btn.glow-purple {
    border-color: var(--c3);
    color: #cc88ff;
    box-shadow: 0 0 12px rgba(157,0,255,0.3);
}
.hdr-btn.glow-purple:hover { box-shadow: 0 0 22px rgba(157,0,255,0.7); }

/* ── MUSIC DRAWER ────────────────────────────────── */
.music-drawer {
    position: fixed;
    bottom: var(--slicer-h);
    left: 0; right: 0;
    z-index: 30;
    border-top: 1px solid rgba(157,0,255,0.3);
    box-shadow: 0 -8px 40px rgba(157,0,255,0.15);
    padding: 0;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.music-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-wrap: wrap;
}
.music-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--c3);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 160px;
}
.music-ai-section { display: flex; align-items: center; gap: 8px; flex: 1; }
.music-transport { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* Now playing indicator */
.music-now-playing {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 18px;
    background: rgba(157,0,255,0.08);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 0.8rem;
    font-weight: 700;
    color: #cc88ff;
}
.music-wave-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}
.music-wave-bars div {
    width: 3px;
    background: var(--c3);
    border-radius: 2px;
    animation: wave-bar 0.7s ease-in-out infinite;
}
.music-wave-bars div:nth-child(1) { animation-delay: 0s;    height: 60%; }
.music-wave-bars div:nth-child(2) { animation-delay: 0.1s;  height: 90%; }
.music-wave-bars div:nth-child(3) { animation-delay: 0.2s;  height: 40%; }
.music-wave-bars div:nth-child(4) { animation-delay: 0.15s; height: 80%; }
.music-wave-bars div:nth-child(5) { animation-delay: 0.05s; height: 55%; }
@keyframes wave-bar {
    0%,100% { transform: scaleY(1); }
    50%      { transform: scaleY(0.3); }
}

/* Melody Grid */
.melody-grid {
    display: flex;
    gap: 5px;
    padding: 10px 18px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: thin;
}
.melody-grid::-webkit-scrollbar { height: 3px; }
.melody-grid::-webkit-scrollbar-thumb { background: var(--c3); border-radius: 3px; }

.melody-btn {
    flex-shrink: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}
.melody-btn:hover { background: rgba(157,0,255,0.15); color: #fff; border-color: var(--c3); }
.melody-btn.active {
    background: var(--c3);
    color: #fff;
    border-color: var(--c3);
    box-shadow: 0 0 12px rgba(157,0,255,0.5);
}

/* ── TEXT STUDIO ─────────────────────────────────── */
.text-studio {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    padding: 8px 12px;
    border-top: 1px solid rgba(255,136,204,0.3);
    border-radius: 12px;
    animation: slideUp 0.3s ease;
    min-width: 420px;
    max-width: 90vw;
}
.text-studio-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── ALIEN & ROBOT TAB ACCENTS ───────────────────── */
.tab-btn.alien-tab { color: #ff4488; border-color: rgba(255,68,136,0.3); }
.tab-btn.alien-tab:hover, .tab-btn.alien-tab.active {
    background: rgba(255,68,136,0.2);
    color: #ff66aa;
    border-color: #ff4488;
    box-shadow: 0 0 12px rgba(255,68,136,0.4);
}
.tab-btn.robot-tab { color: #ffcc00; border-color: rgba(255,204,0,0.3); }
.tab-btn.robot-tab:hover, .tab-btn.robot-tab.active {
    background: rgba(255,204,0,0.15);
    color: #ffdd44;
    border-color: #ffcc00;
    box-shadow: 0 0 12px rgba(255,204,0,0.4);
}

/* ── PRO BADGE ───────────────────────────────────── */
.pro-badge {
    font-size: 0.5rem;
    font-weight: 800;
    background: linear-gradient(90deg, #ff00ea, #9d00ff, #00f3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
    vertical-align: super;
    line-height: 1;
}

/* ── PRO TOOLS BAR ───────────────────────────────── */
.pro-tools-bar {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pro-tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(10,10,30,0.75);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--muted);
    font-size: 0.78rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}
.pro-tool-btn:hover { color: var(--c1); border-color: var(--c1); box-shadow: 0 0 10px var(--glow1); }
.pro-tool-btn.active { color: var(--c2); border-color: var(--c2); box-shadow: 0 0 12px rgba(255,0,234,0.5); background: rgba(255,0,234,0.1); }

/* ── GALLERY PANEL ───────────────────────────────── */
.gallery-panel {
    position: fixed;
    top: var(--header-h);
    right: 0;
    width: 380px;
    max-height: calc(100vh - var(--header-h) - var(--slicer-h));
    z-index: 120;
    overflow-y: auto;
    border-radius: 0 0 0 16px;
    border: 1px solid rgba(68,255,170,0.25);
    padding: 12px;
    animation: slideUp 0.3s ease;
}
.gallery-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.gallery-title { font-size: 0.85rem; font-weight: 700; color: #44ffaa; flex: 1; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.gallery-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: transform 0.2s;
}
.gallery-item:hover { transform: scale(1.02); }
.gallery-item img { width: 100%; height: 90px; object-fit: cover; display: block; }
.gallery-label { font-size: 0.65rem; font-weight: 600; color: var(--text); padding: 2px 6px; background: rgba(0,0,0,0.6); }
.gallery-meta  { font-size: 0.55rem; color: var(--muted); padding: 0 6px 3px; background: rgba(0,0,0,0.6); }
.gallery-dl { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,0.6); border: none; color: #fff; cursor: pointer; border-radius: 4px; padding: 2px 5px; font-size: 0.7rem; }
.gallery-empty { color: var(--muted); font-size: 0.8rem; text-align: center; padding: 20px; }

/* ── QR MODAL ────────────────────────────────────── */
.qr-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}
.qr-modal-inner {
    padding: 24px;
    border-radius: 20px;
    text-align: center;
    min-width: 260px;
    border: 1px solid rgba(0,243,255,0.25);
    animation: zoomIn 0.3s ease;
}
.qr-title { font-size: 1rem; font-weight: 700; color: var(--c1); margin-bottom: 14px; }
.qr-container { display: flex; flex-direction: column; align-items: center; gap: 8px; }
@keyframes zoomIn { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ── MORPH ROW ───────────────────────────────────── */
.morph-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 2px;
}

/* ── FIGURE DNA BAR ──────────────────────────────── */
.fig-dna-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 0;
    margin-top: 6px;
}
.dna-label { font-size: 0.62rem; font-weight: 800; color: var(--muted); letter-spacing: 1px; }
.dna-hash  { font-size: 0.58rem; color: var(--muted); font-family: monospace; }

/* ── BPM BADGE ───────────────────────────────────── */
.bpm-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: rgba(157,0,255,0.3);
    border: 1px solid rgba(157,0,255,0.5);
    border-radius: 8px;
    padding: 2px 7px;
    color: #cc88ff;
    letter-spacing: 1px;
}

/* ── MOUSE GRAVITY CURSOR ────────────────────────── */
body.gravity-mode { cursor: crosshair; }
body.gravity-mode .center-stage { cursor: cell; }

/* ── PRESENTATION MODE ───────────────────────────── */
#btn-present.active {
    background: rgba(255,204,0,0.15);
    border-color: #ffcc00;
    box-shadow: 0 0 14px rgba(255,204,0,0.5);
    color: #ffdd44;
    animation: pulse-gold 1.5s ease-in-out infinite;
}
@keyframes pulse-gold {
    0%,100% { box-shadow: 0 0 8px rgba(255,204,0,0.4); }
    50%      { box-shadow: 0 0 22px rgba(255,204,0,0.8); }
}

/* ── GLASS SELECT ────────────────────────────────── */
.glass-select {
    background: rgba(10,10,30,0.8);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--text);
    border-radius: 8px;
    padding: 5px 10px;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
}
.glass-select:focus { border-color: var(--c1); }

/* ── FX-CROSS override ───────────────────────────── */
.fx-row { display: flex; align-items: center; gap: 8px; font-size: 0.78rem; color: var(--muted); }
.fx-row label { min-width: 58px; white-space: nowrap; }
.fx-row input[type=range] { flex: 1; accent-color: var(--c1); }
.fx-row .param-val { min-width: 34px; text-align: right; font-size: 0.7rem; color: var(--text); }

/* ── MIC VOICE SCULPTOR ──────────────────────────── */
#btn-mic.mic-active {
    background: rgba(255, 50, 120, 0.2) !important;
    border-color: #ff3278 !important;
    color: #ff3278 !important;
    box-shadow: 0 0 12px rgba(255, 50, 120, 0.5), 0 0 24px rgba(255, 50, 120, 0.2);
    animation: micPulse 1s ease-in-out infinite;
}
@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 50, 120, 0.4), 0 0 20px rgba(255, 50, 120, 0.15); }
    50%       { box-shadow: 0 0 18px rgba(255, 50, 120, 0.8), 0 0 36px rgba(255, 50, 120, 0.35); }
}
#mic-spectrum { image-rendering: pixelated; }

/* ── CINEMATIC SNAPSHOT ──────────────────────────── */
#cinematic-panel {
    font-family: var(--font);
}
.cinematic-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 136, 204, 0.35);
    box-shadow: 0 0 24px rgba(255, 136, 204, 0.2), inset 0 0 40px rgba(0,0,0,0.5);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.cinematic-card:hover {
    transform: scale(1.03) translateY(-3px);
    box-shadow: 0 0 40px rgba(255, 136, 204, 0.45);
}
.cinematic-card img {
    display: block;
    width: 320px;
    height: 200px;
    object-fit: cover;
}
.cinematic-card .card-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 18px 10px 8px;
    text-align: center;
}
.cinematic-card .dl-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
}
.cinematic-card:hover .dl-btn { opacity: 1; }
@keyframes cinematicFlash {
    0%   { opacity: 0; }
    15%  { opacity: 0.9; }
    100% { opacity: 0; }
}
.cinematic-flash {
    position: fixed;
    inset: 0;
    z-index: 8500;
    background: white;
    pointer-events: none;
    animation: cinematicFlash 0.6s ease-out forwards;
}

/* ── SKETCH STYLE BUTTONS ────────────────────────── */
.sketch-style-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--muted);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
    min-width: 65px;
}
.sketch-style-btn i { font-size: 1rem; }
.sketch-style-btn:hover {
    background: rgba(0,243,255,0.1);
    border-color: rgba(0,243,255,0.3);
    color: var(--c1);
}
.sketch-style-btn.active {
    background: rgba(0,243,255,0.2);
    border-color: var(--c1);
    color: var(--c1);
    box-shadow: 0 0 15px rgba(0,243,255,0.4);
}

/* ── PRESETS ─────────────────────────────────────── */
.sketch-preset:hover { transform: scale(1.15); box-shadow: 0 0 10px rgba(255,255,255,0.4); }
