* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

/* Re-enable text selection only where the user actually needs to type or copy */
input, textarea, [contenteditable="true"], .console-output, pre, code {
    user-select: text;
    -webkit-user-select: text;
}

/* Animated gradient mesh background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 50% 50%, #1a1a28 0%, #0a0a0f 100%);
    z-index: -2;
}

body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(ellipse 800px 400px at 20% 30%, rgba(107, 138, 253, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse 600px 500px at 80% 70%, rgba(167, 139, 250, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse 500px 600px at 50% 50%, rgba(139, 92, 246, 0.04) 0%, transparent 50%);
    animation: editor-mesh-drift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes editor-mesh-drift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-2%, -1.5%) rotate(0.5deg); }
    66% { transform: translate(1.5%, 2%) rotate(-0.5deg); }
}

/* Toolbar - Premium Glassmorphism with Enhanced Readability */
#toolbar {
    height: 48px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(22, 22, 28, 0.85);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    padding: 0 16px;
    gap: 24px;
    position: relative;
    z-index: 1000;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

#toolbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(107, 138, 253, 0.5), 
        rgba(167, 139, 250, 0.5),
        transparent);
    box-shadow: 0 0 8px rgba(107, 138, 253, 0.3);
}

.menu-bar {
    display: flex;
    gap: 4px;
    position: relative;
    z-index: 100;
}

.menu {
    position: relative;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    z-index: 101;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.menu:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    z-index: 102;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    min-width: 200px;
    padding: 8px;
    background: rgba(18, 18, 26, 0.92);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.6),
        0 4px 16px rgba(107, 138, 253, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    z-index: 10000;
    /* Animation with visibility/opacity instead of display */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s 0.15s;
}

/* Invisible bridge to prevent hover gap */
.menu::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 8px;
    background: transparent;
}

.menu:hover .dropdown,
.menu:focus-within .dropdown,
.menu.open .dropdown {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s 0s;
}

.menu-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.menu-item:hover {
    background: rgba(107, 138, 253, 0.25);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.menu-item .shortcut {
    float: right;
    opacity: 0.5;
    font-size: 11px;
    margin-left: 20px;
}

.menu-icon {
    display: inline-block;
    width: 18px;
    text-align: center;
    font-size: 14px;
    margin-right: 6px;
}

.menu-item:active {
    background: rgba(99, 102, 241, 0.3);
}

.menu-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 6px 8px;
}

.toolbar-center {
    display: flex;
    gap: 6px;
    margin-left: auto;
    min-width: 120px;
    contain: layout;
    z-index: 50;
}

.btn-toolbar {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.btn-toolbar:hover {
    background: rgba(107, 138, 253, 0.2);
    border-color: rgba(107, 138, 253, 0.3);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 138, 253, 0.2);
}

.btn-toolbar:active {
    transform: translateY(0) scale(0.95);
}

.btn-toolbar.active {
    background: linear-gradient(135deg, rgba(107, 138, 253, 0.4) 0%, rgba(167, 139, 250, 0.4) 100%);
    border-color: rgba(107, 138, 253, 0.5);
    color: #fff;
    box-shadow: 
        0 0 20px rgba(107, 138, 253, 0.4),
        0 4px 12px rgba(107, 138, 253, 0.3);
}

.toolbar-right {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    min-width: 150px;
    min-height: 28px;
    contain: layout style size;
    color: var(--text-secondary);
    padding: 6px 12px;
    background: var(--bg-color);
    border-radius: 6px;
}

/* Main Layout - With proper gaps and borders */
#editor-layout {
    flex: 1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: 1fr auto;
    gap: 1px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    padding: 1px;
}

#panel-left {
    grid-column: 1;
    grid-row: 1;
    contain: layout style;
    min-width: 280px;
}

#panel-center {
    grid-column: 2;
    grid-row: 1;
    contain: layout;
    margin: 0 1px;
}

#panel-right {
    grid-column: 3;
    grid-row: 1;
    contain: layout style;
    min-width: 300px;
}

#panel-bottom {
    grid-column: 1 / 4;
    grid-row: 2;
    contain: layout;
    margin-top: 1px;
}

/* Panel - Premium Glassmorphism with Enhanced Readability */
.panel {
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(18, 18, 26, 0.75);
    overflow: hidden;
    border-radius: 8px;
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(107, 138, 253, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Skeleton Loading States */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.04) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite ease-in-out;
    border-radius: 4px;
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 12px;
    margin: 4px 0;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-text.full { width: 100%; }

.skeleton-box {
    width: 100%;
    height: 60px;
    margin: 8px 0;
}

.skeleton-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Panel content padding and spacing */
.panel-content {
    padding: 8px;
}

.panel-header {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
    position: relative;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    gap: 16px;
}

.panel-header::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, 
transparent, 
rgba(107, 138, 253, 0.4), 
rgba(167, 139, 250, 0.4),
transparent);
box-shadow: 0 0 6px rgba(107, 138, 253, 0.2);
}

.playback-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.panel-toolbar {
display: flex;
gap: 4px;
align-items: center;
margin-left: auto;
}

/* Scene Selector - Modern Pill Design */
.scene-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 16px;
    padding: 4px 6px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.scene-selector {
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0.3px;
    cursor: pointer;
    outline: none;
    min-width: 120px;
    max-width: 180px;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.6)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.scene-selector:hover {
    background: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.scene-selector:focus {
    background: rgba(99, 102, 241, 0.4);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3), 0 0 16px rgba(99, 102, 241, 0.2);
}

.scene-selector option {
    background: #1a1a24;
    color: #fff;
    padding: 8px;
}

/* Scene Control Buttons */
.scene-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.scene-btn:hover {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}

.scene-btn:active {
    transform: scale(0.95);
}

.scene-btn.new-scene {
    background: rgba(34, 197, 94, 0.2);
    color: rgba(34, 197, 94, 0.9);
}

.scene-btn.new-scene:hover {
    background: rgba(34, 197, 94, 0.4);
    color: #fff;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.btn-icon {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.btn-icon:active {
    transform: translateY(0) scale(0.95);
}

.btn-icon.active {
    background: linear-gradient(135deg, rgba(107, 138, 253, 0.5) 0%, rgba(167, 139, 250, 0.5) 100%);
    border-color: rgba(107, 138, 253, 0.6);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(107, 138, 253, 0.4);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Inspector tab buttons */
.inspector-tab {
    padding: 6px 12px;
    font-size: 16px;
    min-width: 40px;
}

/* Popup Menu (Spawn Menu) - Modern Glassmorphism */
.popup-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 820px;
    max-width: 92vw;
    height: 620px;
    max-height: 85vh;
    background: rgba(16, 16, 22, 0.97);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    box-shadow: 
        0 32px 100px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset,
        0 0 80px rgba(99, 102, 241, 0.15),
        0 0 120px rgba(139, 92, 246, 0.08);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: popupFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -48%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: linear-gradient(180deg, rgba(45, 45, 55, 0.98) 0%, rgba(25, 25, 32, 0.98) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.4px;
    position: relative;
}

.popup-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 28px;
    right: 28px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.5), rgba(139, 92, 246, 0.4), transparent);
}

.popup-close {
    opacity: 0.6;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.popup-content {
    flex: 1;
    overflow: hidden;
    display: flex;
}

.popup-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
}

/* Spawn Menu Layout */
.spawn-menu-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.spawn-menu-sidebar {
    width: 200px;
    min-width: 200px;
    background: rgba(10, 10, 14, 0.7);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.spawn-category {
    padding: 14px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.spawn-category:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
}

.spawn-category.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    color: #fff;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.spawn-category-icon {
    font-size: 16px;
}

.spawn-menu-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.spawn-search {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.spawn-search input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.95);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.spawn-search input:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), 0 0 20px rgba(99, 102, 241, 0.1);
    background: rgba(0, 0, 0, 0.45);
}

.spawn-search input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.spawn-grid {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 18px;
    align-content: start;
}

.spawn-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.spawn-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 30px rgba(99, 102, 241, 0.2);
}

.spawn-item:hover .spawn-item-icon {
    transform: scale(1.1);
    box-shadow: 0 0 32px rgba(99, 102, 241, 0.4);
    border-color: rgba(99, 102, 241, 0.5);
}

.spawn-item:active {
    transform: translateY(-3px);
}

.spawn-item-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 14px;
    background: linear-gradient(145deg, rgba(40, 40, 52, 0.95) 0%, rgba(22, 22, 30, 0.95) 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.25s ease;
}

.spawn-item-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    text-align: center;
    line-height: 1.4;
    font-weight: 600;
    transition: color 0.2s ease;
    letter-spacing: 0.2px;
}

.spawn-item:hover .spawn-item-label {
    color: #fff;
}

/* Console styles - Modern */
.console-line {
    padding: 8px 12px;
    font-size: 11px;
    line-height: 1.5;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    transition: background 0.15s ease;
    border-radius: 4px;
    margin: 2px 0;
}

.console-line:hover {
    background: rgba(255, 255, 255, 0.04);
}

.console-line.log {
    color: rgba(255, 255, 255, 0.85);
}

.console-line .timestamp {
    color: rgba(255, 255, 255, 0.35);
    margin-right: 12px;
    font-size: 10px;
}

.console-line.warn {
    color: #fbbf24;
    border-left: 3px solid #fbbf24;
    padding-left: 12px;
    background: rgba(251, 191, 36, 0.08);
}

.console-line.error {
    color: #f87171;
    border-left: 3px solid #f87171;
    padding-left: 12px;
    background: rgba(248, 113, 113, 0.08);
}

.console-line.info {
    color: #60a5fa;
    border-left: 3px solid #60a5fa;
    padding-left: 12px;
    background: rgba(96, 165, 250, 0.05);
}

.separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 6px;
}

.panel-content {
    flex: 1;
    overflow: auto;
    padding: 12px;
}

/* Resizable Panels */
.panel-resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 6px;
    background: transparent;
    cursor: col-resize;
    z-index: 10;
    transition: background 0.15s;
}

.panel-resize-handle:hover,
.panel-resize-handle.dragging {
    background: var(--accent-color);
}

.panel-resize-handle.left {
    right: -3px;
}

.panel-resize-handle.right {
    left: -3px;
}

.panel-resize-handle.bottom {
    position: absolute;
    top: -3px;
    left: 0;
    right: 0;
    height: 6px;
    width: auto;
    cursor: row-resize;
}

#panel-left,
#panel-right {
    position: relative;
    min-width: 200px;
    max-width: 500px;
}

#panel-bottom {
    position: relative;
    min-height: 36px;
    max-height: 400px;
    transition: height 0.15s ease;
}

#panel-bottom.minimized .panel-content {
    display: none;
}

#panel-bottom.minimized .panel-resize-handle {
    display: none;
}

/* ── Bottom Panel Tabs ─────────────────────────────────────────── */
.bottom-tabs {
    display: flex;
    gap: 2px;
}

.bottom-tab {
    padding: 4px 14px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.45);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.bottom-tab:hover {
    color: rgba(255,255,255,0.7);
}

.bottom-tab.active {
    color: rgba(255,255,255,0.95);
    border-bottom-color: rgba(107,138,253,0.8);
}

.bottom-tab-content {
    flex: 1;
    min-height: 0;
}

.bottom-tab-content:not(.active) {
    display: none !important;
}

/* ── Material Strip (bottom tab) ───────────────────────────────── */
#materials-content {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 0;
    padding: 0 !important;
    overflow: hidden;
}

.mat-strip-list {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 6px 8px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    min-width: 0;
}

.mat-strip-list::-webkit-scrollbar {
    height: 4px;
}

.mat-strip-list::-webkit-scrollbar-track {
    background: transparent;
}

.mat-strip-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
}

.mat-strip-item {
    flex-shrink: 0;
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    user-select: none;
}

.mat-strip-item:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.12);
}

.mat-strip-item.selected {
    background: rgba(107,138,253,0.12);
    border-color: rgba(107,138,253,0.5);
}

.mat-strip-thumb {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.08);
    overflow: hidden;
    flex-shrink: 0;
}

.mat-strip-thumb canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.mat-strip-label {
    font-size: 9px;
    color: rgba(255,255,255,0.6);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 68px;
    line-height: 1.2;
}

/* ── Material strip sidebar (preview + actions) ────────────────── */
.mat-strip-sidebar {
    width: 160px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border-left: 1px solid rgba(255,255,255,0.08);
    background: rgba(0,0,0,0.15);
}

.mat-strip-preview {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    overflow: hidden;
}

.mat-strip-preview canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.mat-strip-info {
    font-size: 10px;
    color: rgba(255,255,255,0.7);
    text-align: center;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mat-strip-actions {
    display: flex;
    gap: 4px;
    width: 100%;
}

.mat-strip-actions button {
    flex: 1;
    padding: 4px 6px;
    font-size: 9px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    background: rgba(107,138,253,0.15);
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: background 0.12s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mat-strip-actions button:hover {
    background: rgba(107,138,253,0.3);
}

.mat-strip-actions button.primary {
    background: rgba(107,138,253,0.35);
    border-color: rgba(107,138,253,0.5);
}

.mat-strip-actions button.primary:hover {
    background: rgba(107,138,253,0.5);
}

.mat-strip-drop-zone {
    flex-shrink: 0;
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px;
    border-radius: 6px;
    border: 1px dashed rgba(255,255,255,0.15);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    color: rgba(255,255,255,0.3);
    font-size: 18px;
}

.mat-strip-drop-zone:hover {
    border-color: rgba(107,138,253,0.4);
    background: rgba(107,138,253,0.06);
    color: rgba(255,255,255,0.5);
}

.mat-strip-drop-zone span {
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Viewport */
.viewport-container {
    position: relative;
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.viewport-container.viewport-active {
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.45),
                0 0 18px rgba(96, 165, 250, 0.18);
}

#viewport {
    width: 100%;
    height: 100%;
    display: block;
}

.viewport-overlay {
    position: absolute;
    top: 8px;
    left: 8px;
    pointer-events: none;
}

/* Minimized stats icon */
.viewport-stats-min {
    display: none;
    background: rgba(18, 18, 24, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    pointer-events: auto;
    font-size: 14px;
    opacity: 0.7;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.viewport-stats-min:hover {
    opacity: 1;
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.viewport-stats-min.visible {
    display: block;
}

/* Stats panel - Modern Glassmorphism */
.viewport-stats {
    background: rgba(18, 18, 24, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 11px;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    color: rgba(255, 255, 255, 0.9);
    min-width: 160px;
    pointer-events: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 40px rgba(99, 102, 241, 0.08);
}

.viewport-stats.hidden {
    display: none;
}

/* Stats header with mode buttons */
.stats-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-mode-buttons {
    display: flex;
    gap: 4px;
}

.stats-mode-btn {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    line-height: 22px;
    padding: 0;
    transition: all 0.2s ease;
}

.stats-mode-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    transform: translateY(-1px);
}

.stats-mode-btn.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.4) 100%);
    border-color: rgba(99, 102, 241, 0.5);
    color: #fff;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

/* Compact stats */
.stats-compact > div {
    margin: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.stats-compact > div > span:first-child {
    color: rgba(255, 255, 255, 0.5);
}

.stats-compact > div > span:last-child {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

/* Full stats section */
.stats-full {
    display: none;
}

.stats-full.visible {
    display: block;
}

.stats-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 10px 0;
}

.stats-section {
    margin: 8px 0;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.stats-section-title {
    color: rgba(255, 255, 255, 0.4);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.stats-section > div:not(.stats-section-title) {
    margin: 4px 0;
    color: rgba(255, 255, 255, 0.85);
    display: flex;
    justify-content: space-between;
}

/* Modal - Premium Glassmorphism */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modal-backdrop-fade-in 0.3s ease-out;
}

@keyframes modal-backdrop-fade-in {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px) saturate(100%);
        -webkit-backdrop-filter: blur(0px) saturate(100%);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(16px) saturate(120%);
        -webkit-backdrop-filter: blur(16px) saturate(120%);
    }
}

.modal.hidden {
    display: none;
}

.modal.closing {
    animation: modal-backdrop-fade-out 0.3s ease-out forwards;
}

.modal.closing .modal-content,
.modal.closing .settings-dialog,
.modal.closing .editor-dialog-box {
    animation: modal-content-fade-out 0.25s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes modal-backdrop-fade-out {
    from { 
        opacity: 1;
        backdrop-filter: blur(16px) saturate(120%);
        -webkit-backdrop-filter: blur(16px) saturate(120%);
    }
    to { 
        opacity: 0;
        backdrop-filter: blur(0px) saturate(100%);
        -webkit-backdrop-filter: blur(0px) saturate(100%);
    }
}

@keyframes modal-content-fade-out {
    from { 
        opacity: 1; 
        transform: scale(1) translateY(0);
        filter: blur(0px);
    }
    to { 
        opacity: 0; 
        transform: scale(0.95) translateY(10px);
        filter: blur(8px);
    }
}

.modal-content {
    background: rgba(18, 18, 26, 0.85);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    padding: 32px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    max-width: 500px;
    text-align: center;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.7),
        0 8px 32px rgba(107, 138, 253, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    animation: modal-content-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modal-content-fade-in {
    from { 
        opacity: 0; 
        transform: scale(0.95) translateY(-20px);
        filter: blur(10px);
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0);
        filter: blur(0px);
    }
}

.modal-content h2 {
    margin-bottom: 16px;
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.modal-content p {
    margin-bottom: 24px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.btn-primary {
    padding: 12px 28px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 1) 0%, rgba(139, 92, 246, 1) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Custom Dialog Styles - Modern Glassmorphism */
.editor-dialog {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: dialog-backdrop-fade-in 0.3s ease-out;
}

.editor-dialog.closing {
    animation: dialog-backdrop-fade-out 0.3s ease-out forwards;
}

.editor-dialog.closing .editor-dialog-box {
    animation: dialog-box-fade-out 0.25s cubic-bezier(0.4, 0, 0.6, 1) forwards;
}

@keyframes dialog-backdrop-fade-in {
    from { 
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
}

@keyframes dialog-backdrop-fade-out {
    from { 
        opacity: 1;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
    to { 
        opacity: 0;
        backdrop-filter: blur(0px);
        -webkit-backdrop-filter: blur(0px);
    }
}

.editor-dialog-box {
    background: rgba(22, 22, 30, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    animation: dialog-box-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes dialog-box-fade-in {
    from { 
        opacity: 0; 
        transform: scale(0.95) translateY(-20px);
        filter: blur(10px);
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0);
        filter: blur(0px);
    }
}

@keyframes dialog-box-fade-out {
    from { 
        opacity: 1; 
        transform: scale(1) translateY(0);
        filter: blur(0px);
    }
    to { 
        opacity: 0; 
        transform: scale(0.95) translateY(10px);
        filter: blur(8px);
    }
}

.editor-dialog-header {
    padding: 20px 24px 16px;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    border-radius: 16px 16px 0 0;
}

.editor-dialog-body {
    padding: 20px 24px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
    line-height: 1.6;
}

.editor-dialog-input {
    width: 100%;
    padding: 12px 16px;
    margin-top: 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.editor-dialog-input:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15), 0 0 16px rgba(99, 102, 241, 0.1);
    background: rgba(0, 0, 0, 0.4);
}

.editor-dialog-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.editor-dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 0 16px 16px;
}

.editor-dialog-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-dialog-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.editor-dialog-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.editor-dialog-btn-primary {
    background: linear-gradient(135deg, rgba(99, 102, 241, 1) 0%, rgba(139, 92, 246, 1) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.editor-dialog-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.editor-dialog-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.editor-dialog-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* ============================================================================
   TOAST NOTIFICATIONS
   ============================================================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10002;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(22, 22, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    color: #fff;
    font-size: 13px;
    pointer-events: auto;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-hiding {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    font-size: 16px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
}

.toast-info .toast-icon { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.toast-success .toast-icon { background: rgba(34, 197, 94, 0.2); color: #4ade80; }
.toast-warning .toast-icon { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.toast-error .toast-icon { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.toast-info { border-left: 3px solid #3b82f6; }
.toast-success { border-left: 3px solid #22c55e; }
.toast-warning { border-left: 3px solid #f59e0b; }
.toast-error { border-left: 3px solid #ef4444; }

.toast-message {
    flex: 1;
    line-height: 1.4;
}

.toast-action {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    color: var(--accent-color, #6366f1);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.toast-action:hover {
    background: rgba(255, 255, 255, 0.2);
}

.toast-close {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.15s;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* ============================================================================
   CONTEXT MENU
   ============================================================================ */

.context-menu {
    position: fixed;
    z-index: 10003;
    min-width: 180px;
    background: rgba(22, 22, 30, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 6px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    animation: context-menu-appear 0.15s ease-out;
}

@keyframes context-menu-appear {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    transition: all 0.15s;
}

.context-menu-item:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.3) 100%);
    color: #fff;
}

.context-menu-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.context-menu-item.disabled:hover {
    background: transparent;
}

.context-menu-icon {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.context-menu-label {
    flex: 1;
}

.context-menu-shortcut {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    font-family: 'SF Mono', 'Consolas', monospace;
}

.context-menu-arrow {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

.context-menu-separator {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    margin: 6px 8px;
}

/* ============================================================================
   CUSTOM TOOLTIPS
   ============================================================================ */

.custom-tooltip {
    position: fixed;
    z-index: 10004;
    padding: 8px 12px;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 12px;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translateY(4px);
    transition: all 0.15s ease;
    pointer-events: none;
}

.custom-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================================
   THEME PICKER
   ============================================================================ */

.theme-picker-box {
    min-width: 420px;
}

.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 24px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.theme-option.active {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.theme-icon {
    font-size: 28px;
}

.theme-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
}

.theme-option.active .theme-name {
    color: #fff;
}

/* ============================================================================
   SHORTCUTS DIALOG
   ============================================================================ */

.shortcuts-dialog {
    min-width: 380px;
}

.shortcuts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 24px;
    max-height: 400px;
    overflow-y: auto;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.shortcut-key {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.2);
}

.shortcut-action {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================================================
   SCENE PICKER DIALOG (improved)
   ============================================================================ */

.scene-picker-dialog {
    min-width: 400px;
    max-width: 500px;
}

.scene-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px;
    max-height: 350px;
    overflow-y: auto;
}

.scene-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.scene-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(99, 102, 241, 0.3);
}

.scene-item-icon {
    font-size: 20px;
}

.scene-item-info {
    flex: 1;
}

.scene-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.scene-item-meta {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.scene-item-actions {
    display: flex;
    gap: 6px;
}

.scene-item-btn {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scene-item-btn.open {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

.scene-item-btn.open:hover {
    background: rgba(99, 102, 241, 0.4);
    color: #fff;
}

.scene-item-btn.delete {
    background: rgba(239, 68, 68, 0.15);
    color: rgba(239, 68, 68, 0.8);
}

.scene-item-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
    color: #fff;
}

/* ============================================================================
   HOTKEY EDITOR
   ============================================================================ */

.hotkey-editor-dialog {
    min-width: 500px;
    max-width: 600px;
}

.hotkey-editor-dialog .editor-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hotkey-editor-actions {
    display: flex;
    gap: 6px;
}

.hotkey-action-btn {
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
}

.hotkey-action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.hotkey-editor-body {
    max-height: 450px;
    overflow-y: auto;
    padding: 16px 20px;
}

.hotkey-category {
    margin-bottom: 20px;
}

.hotkey-category:last-child {
    margin-bottom: 0;
}

.hotkey-category-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hotkey-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: background 0.15s;
}

.hotkey-row:hover {
    background: rgba(255, 255, 255, 0.06);
}

.hotkey-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.hotkey-key-btn {
    min-width: 80px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.hotkey-key-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
}

.hotkey-key-btn.listening {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.6);
    color: #fff;
    animation: hotkey-pulse 1s infinite;
}

/* Mode badges for hotkey rows */
.hotkey-mode-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
}
.hotkey-mode-edit {
    background: rgba(59, 130, 246, 0.2);
    color: rgba(96, 165, 250, 0.9);
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.hotkey-mode-play {
    background: rgba(34, 197, 94, 0.2);
    color: rgba(74, 222, 128, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.3);
}
.hotkey-mode-both {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes hotkey-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(107, 138, 253, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(107, 138, 253, 0); }
}

/* ============================================================================
   SETTINGS DIALOG - Modern Glassmorphism Design
   ============================================================================ */

.settings-dialog {
    width: 90vw;
    max-width: 1400px;
    height: 90vh;
    max-height: 900px;
    background: rgba(18, 18, 26, 0.85);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.7),
        0 8px 32px rgba(107, 138, 253, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    animation: settings-dialog-fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes settings-dialog-fade-in {
    from { 
        opacity: 0; 
        transform: scale(0.96) translateY(-30px);
        filter: blur(10px);
    }
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0);
        filter: blur(0px);
    }
}

.settings-dialog .editor-dialog-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.settings-header-actions {
    display: flex;
    gap: 8px;
}

.settings-action-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-action-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.settings-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.settings-sidebar {
    width: 260px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
    overflow-y: auto;
}

.settings-search-wrap {
    padding: 0 4px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
}

.settings-search {
    width: 100%;
    padding: 10px 14px 10px 32px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 12px;
    outline: none;
    transition: all 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cline x1='9.5' y1='9.5' x2='13' y2='13'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
}

.settings-search:focus {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.settings-search::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.settings-tab {
    position: relative;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-tab-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
}

.settings-tab-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.settings-tab-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
}

.settings-tab-desc {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.3;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-tab::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%) scaleY(0);
    width: 3px;
    height: 60%;
    background: linear-gradient(180deg, #6b8afd 0%, #a78bfa 100%);
    border-radius: 0 3px 3px 0;
    transition: transform 0.2s ease;
    box-shadow: 0 0 8px rgba(107, 138, 253, 0.5);
}

.settings-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.settings-tab:hover .settings-tab-desc {
    color: rgba(255, 255, 255, 0.45);
}

.settings-tab.active {
    background: linear-gradient(135deg, rgba(107, 138, 253, 0.25) 0%, rgba(167, 139, 250, 0.2) 100%);
    color: #ffffff;
    box-shadow: 0 2px 12px rgba(107, 138, 253, 0.2);
}

.settings-tab.active .settings-tab-label {
    font-weight: 600;
}

.settings-tab.active .settings-tab-desc {
    color: rgba(255, 255, 255, 0.5);
}

.settings-tab.active::before {
    transform: translateY(-50%) scaleY(1);
}

.settings-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01) 0%, transparent 100%);
    transition: opacity 0.15s ease, transform 0.15s ease;
    opacity: 1;
    transform: translateY(0);
}

.settings-content::-webkit-scrollbar {
    width: 6px;
}

.settings-content::-webkit-scrollbar-track {
    background: transparent;
}

.settings-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.settings-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Collapsible Sections */
.settings-section {
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
    overflow: hidden;
    transition: all 0.2s ease;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s ease;
    border-bottom: 1px solid transparent;
}

.settings-section-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.settings-section:not(.collapsed) .settings-section-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.settings-section-chevron {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    width: 14px;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.15s ease;
}

.settings-section-header:hover .settings-section-chevron {
    color: rgba(255, 255, 255, 0.7);
}

.settings-section-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    flex: 1;
}

.settings-section-count {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 500;
}

.settings-section-body {
    padding: 8px 12px 12px;
}

/* Color Picker */
.settings-color-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-color-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-color-input {
    width: 40px;
    height: 32px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.settings-color-input::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.settings-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

.settings-color-input:hover {
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.2);
}

.settings-color-hex {
    font-size: 11px;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: rgba(255, 255, 255, 0.5);
    min-width: 60px;
}

/* Search highlight */
.settings-content mark {
    background: rgba(99, 102, 241, 0.35);
    color: #fff;
    border-radius: 2px;
    padding: 0 2px;
}

/* Footer info */
.settings-footer-info {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
}

/* Title text */
.settings-title-text {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.settings-header {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-primary, #8b5cf6);
    margin: 16px 0 8px 0;
    padding: 8px 12px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 6px;
    border-left: 3px solid var(--accent-primary, #8b5cf6);
}

.settings-header:first-child {
    margin-top: 0;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.settings-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.settings-row:last-child {
    margin-bottom: 0;
}

.settings-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.settings-input {
    width: 100px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #ffffff;
    font-size: 13px;
    font-family: 'SF Mono', 'Consolas', monospace;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.settings-input:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.settings-input:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.settings-select {
    min-width: 130px;
    padding: 10px 14px;
    background: #1a1a2e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-select option {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 8px;
}

.settings-select:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.settings-select:focus {
    outline: none;
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.settings-slider-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.settings-slider-track {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-tick-row {
    display: flex;
    justify-content: space-between;
    padding: 0 9px;
    pointer-events: none;
}

.settings-tick {
    width: 1px;
    height: 4px;
    background: rgba(255, 255, 255, 0.18);
}

.settings-tick-default {
    height: 7px;
    background: rgba(99, 102, 241, 0.6);
}

.settings-slider-wrap input[type="range"] {
    width: 160px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-slider-wrap input[type="range"]:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.4) 0%, rgba(255, 255, 255, 0.15) 100%);
}

.settings-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
    transition: all 0.2s ease;
}

.settings-slider-wrap input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(99, 102, 241, 0.5);
}

.settings-slider-value {
    min-width: 55px;
    padding: 6px 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'SF Mono', 'Consolas', monospace;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    text-align: center;
}

/* Toggle Switch - Premium Design */
.settings-toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.settings-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border-radius: 13px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.settings-toggle:hover .toggle-slider {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.15);
}

.settings-toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, #6b8afd 0%, #a78bfa 100%);
    border-color: rgba(107, 138, 253, 0.6);
    box-shadow: 0 0 16px rgba(107, 138, 253, 0.4);
}

.settings-toggle input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* Hotkey settings inside settings panel - Premium Design */
.hotkey-settings {
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
}

.hotkey-settings .hotkey-category {
    margin-bottom: 20px;
}

.hotkey-settings .hotkey-category:last-child {
    margin-bottom: 0;
}

.hotkey-settings .hotkey-category-title {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(107, 138, 253, 0.9);
    margin-bottom: 12px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(107, 138, 253, 0.15) 0%, rgba(167, 139, 250, 0.1) 100%);
    border-radius: 8px;
    border-left: 3px solid rgba(107, 138, 253, 0.7);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hotkey-settings .hotkey-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.hotkey-settings .hotkey-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.hotkey-settings .hotkey-description {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.hotkey-settings .hotkey-key-btn {
    min-width: 80px;
    padding: 8px 14px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.hotkey-settings .hotkey-key-btn:hover {
    background: linear-gradient(135deg, rgba(107, 138, 253, 0.25) 0%, rgba(167, 139, 250, 0.15) 100%);
    border-color: rgba(107, 138, 253, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 138, 253, 0.2);
}

.hotkey-settings .hotkey-key-btn.listening {
    background: linear-gradient(135deg, rgba(107, 138, 253, 0.4) 0%, rgba(167, 139, 250, 0.3) 100%);
    border-color: rgba(107, 138, 253, 0.7);
    color: #ffffff;
    animation: hotkey-pulse 1s infinite;
    box-shadow: 0 0 20px rgba(107, 138, 253, 0.4);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Settings dialog footer */
.settings-dialog .editor-dialog-footer {
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-footer-left {
    display: flex;
    gap: 8px;
}

.settings-footer-right {
    display: flex;
    gap: 12px;
}

.editor-dialog-btn-text {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.15s;
}

.editor-dialog-btn-text:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
}

/* Settings close button */
.settings-close-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ============================================================================
   ABOUT DIALOG - Keygen/Demoscene Style
   ============================================================================ */

.about-dialog-fullscreen {
    background: transparent !important;
}

.about-dialog-fullscreen #about-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.about-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    pointer-events: none;
}

.about-logo {
    font-size: 80px;
    margin-bottom: 20px;
    animation: aboutFloat 3s ease-in-out infinite;
    filter: 
        drop-shadow(0 0 30px rgba(107, 138, 253, 0.5))
        drop-shadow(0 0 60px rgba(167, 139, 250, 0.3));
}

@keyframes aboutFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.about-title {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 12px;
    background: linear-gradient(135deg, #6b8afd 0%, #a78bfa 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    margin-bottom: 0;
    animation: aboutGlow 2s ease-in-out infinite alternate;
}

@keyframes aboutGlow {
    0% { filter: drop-shadow(0 0 10px rgba(107, 138, 253, 0.3)); }
    100% { filter: drop-shadow(0 0 25px rgba(167, 139, 250, 0.5)); }
}

.about-subtitle {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: 20px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 20px;
}

.about-version {
    font-size: 14px;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: rgba(107, 138, 253, 0.9);
    padding: 6px 16px;
    background: rgba(107, 138, 253, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(107, 138, 253, 0.4);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 0 16px rgba(107, 138, 253, 0.2);
}

.about-author {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.about-author-name {
    font-weight: 700;
    background: linear-gradient(135deg, #6b8afd 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.about-tech {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.about-links {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.about-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: rgba(107, 138, 253, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(107, 138, 253, 0.4);
    border-radius: 25px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    pointer-events: auto;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.about-link:hover {
    background: rgba(107, 138, 253, 0.3);
    border-color: rgba(107, 138, 253, 0.6);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(107, 138, 253, 0.4);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ============================================================================
   THEME PICKER - Enhanced with categories
   ============================================================================ */

.theme-picker-box {
    min-width: 500px;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.theme-picker-categories {
    overflow-y: auto;
    padding: 16px 20px;
    flex: 1;
}

.theme-category {
    margin-bottom: 20px;
}

.theme-category:last-child {
    margin-bottom: 0;
}

.theme-category-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.theme-option:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.theme-option.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.theme-option .theme-icon {
    font-size: 24px;
    line-height: 1;
}

.theme-option .theme-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.theme-option .theme-author {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: -2px;
}

.about-credits {
    position: fixed;
    bottom: 40px;
    left: 0;
    right: 0;
    overflow: hidden;
    height: 30px;
}

.about-scroll-text {
    white-space: nowrap;
    font-size: 14px;
    font-family: 'SF Mono', 'Consolas', monospace;
    color: rgba(99, 102, 241, 0.7);
    letter-spacing: 1px;
    padding-left: 100%;
    animation: aboutScroll 20s linear infinite;
}

@keyframes aboutScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}
