@font-face {
  font-family: "Lazy Sunday Archivo Black";
  src: url("../../fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: block;
}

:root{
  --bg:#0b0d12;
  --panel:#101521;
  --panel2:#0f1320;
  --line:rgba(255,255,255,.10);
  --line2:rgba(255,255,255,.06);
  --text:rgba(255,255,255,.88);
  --muted:rgba(255,255,255,.62);
  --accent:rgba(120,180,255,.95);
  --good:rgba(120,255,180,.85);
  --bad:rgba(255,120,160,.85);
  --gold:rgba(255,200,100,.85);
}
html,body{margin:0;padding:0;width:100%;height:100%;background:var(--bg);color:var(--text);font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;overflow:hidden;}
#app{height:100%;display:flex;flex-direction:column;}
#viewportWrap{
  position:relative;
  flex: 0 0 42vh;
  min-height: 280px;
  border-bottom: 1px solid var(--line);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  contain: strict;
  isolation: isolate;
}
#canvasContainer{
  position: relative;
  background: #000;
}
#imageOverlayCanvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 1;
}
#splitter{
  flex: 0 0 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(0,0,0,0.0));
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(0,0,0,0.35);
  cursor: row-resize;
  position: relative;
  user-select: none;
}
#splitter::after{
  content:"";
  position:absolute;
  left:50%; top:50%;
  width: 64px; height: 3px;
  transform: translate(-50%,-50%);
  border-radius:999px;
  background: rgba(255,255,255,0.25);
}
#splitter:hover{ background: rgba(120,180,255,0.10); }
#splitter.dragging{ background: rgba(120,180,255,0.14); }
#threeCanvas{
  width:100%;
  height:100%;
  display:block;
}
/* Top navigation bar */
#topNav{
  display:flex;
  align-items:center;
  height: 52px;
  padding: 0 16px;
  box-sizing: border-box;
  background: linear-gradient(rgba(255,255,255,.03), rgba(255,255,255,.03)), rgba(16,21,33,1);
  border-bottom:1px solid var(--line);
  user-select:none;
  flex-shrink: 0;
}
#topNav .nav-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#topNav .brand-icon{
  height: 24px;
  width: auto;
}
#topNav .brand-title{
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
}
#topNav .nav-divider{
  width: 1px;
  height: 20px;
  background: var(--line);
  margin: 0 16px;
  flex-shrink: 0;
}
#topNav .nav-center{
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
}
.demo-name-label{
  font-size: 11px;
  color: var(--muted);
}
.nav-btn-solo{
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  transition: background 0.15s, color 0.15s;
}
.nav-btn-solo:hover{
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.share-menu-item:disabled{
  opacity: .5;
  cursor: wait;
}
#topNav .nav-right{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
/* Nav button group (similar to mode-toggle) */
.nav-btn-group{
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.nav-btn{
  padding: 6px 12px;
  box-sizing: border-box;
  background: transparent;
  border: none;
  border-right: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}
.nav-btn:last-child{
  border-right: none;
}
.nav-btn:hover{
  background: rgba(255,255,255,0.05);
  color: var(--text);
}
.nav-btn.user-menu-btn{
  border-right: none;
}
/* User menu adjustments */
#topNav .user-menu{
  position: relative;
}
#topNav .user-menu-dropdown{
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 120px;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
#topNav .user-menu.open .user-menu-dropdown{
  display: block;
}
/* Project name input */
#demoNameInput{
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  color: var(--text);
  font: inherit;
  font-size: 11px;
  width: 180px;
  transition: all 0.2s;
}
#demoNameInput:focus{
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,.08);
}
/* Save status indicator */
#saveStatus{
  font-size: 12px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
}
#saveStatus.saving{
  color: var(--gold);
  animation: spin 1s linear infinite;
}
#saveStatus.saved{
  color: var(--good);
}
#saveStatus.error{
  color: var(--bad);
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* User menu */
.user-menu{
  position: relative;
}
.user-menu-btn{
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  box-sizing: border-box;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
}
.user-menu-btn:hover{ background: rgba(255,255,255,.10); color: var(--text); }
.user-menu-dropdown{
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 150px;
  display: none;
  z-index: 1000;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.user-menu.open .user-menu-dropdown{ display: block; }
.user-menu-item{
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.user-menu-item:hover{ background: rgba(255,255,255,.08); }
.user-menu-item:first-child{ border-radius: 7px 7px 0 0; }
.user-menu-item:last-child{ border-radius: 0 0 7px 7px; }
.user-menu-divider{
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.user-menu-section-label{
  padding: 8px 14px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  opacity: 0.7;
}
.user-menu-item .icon{
  display: inline-block;
  width: 18px;
  text-align: center;
  margin-right: 4px;
}
/* Auth loading overlay */
#authLoading{
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  font-size: 1.2rem;
  color: var(--muted);
}
#authLoading.hidden{ display: none; }

/* Demo Management Modals */
.demo-modal-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}
.demo-modal-overlay.show{
  opacity: 1;
  visibility: visible;
}
.demo-modal{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 400px;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.2s;
}
.demo-modal-overlay.show .demo-modal{
  transform: scale(1);
}
.demo-modal-header{
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.demo-modal-header h2{
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}
.demo-modal-close{
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1.2rem;
  line-height: 1;
}
.demo-modal-close:hover{ color: var(--text); }
.demo-modal-body{
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.demo-modal-footer{
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
/* Add Object Modal Buttons */
.add-object-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}
.add-object-btn:hover {
  background: rgba(120,180,255,0.1);
  border-color: rgba(120,180,255,0.4);
  transform: translateY(-2px);
}
.add-object-btn:active {
  transform: translateY(0);
}
.add-obj-icon {
  font-size: 24px;
}
.add-obj-label {
  font-size: 11px;
  color: var(--muted);
}
.add-object-btn:hover .add-obj-label {
  color: var(--text);
}
.form-group{
  margin-bottom: 16px;
}
.form-group label{
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}
.form-group input[type="text"]{
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  font: inherit;
}
.form-group input[type="text"]:focus{
  outline: none;
  border-color: var(--accent);
}
.toggle-group{
  display: flex;
  gap: 8px;
}
.toggle-btn{
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  transition: all 0.15s;
}
.toggle-btn:hover{
  background: rgba(255,255,255,0.06);
}
.toggle-btn.active{
  background: rgba(120,180,255,0.15);
  border-color: var(--accent);
  color: var(--accent);
}
/* My Projects List */
.demos-list{
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.demo-item{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.15s;
}
.demo-item:hover{
  background: rgba(255,255,255,0.06);
}
.demo-item-info{
  flex: 1;
  min-width: 0;
}
.demo-item-name{
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.demo-item-meta{
  font-size: 0.8rem;
  color: var(--muted);
}
.demo-item-actions{
  display: flex;
  gap: 6px;
}
.demo-item-actions .nav-btn {
  padding: 5px 12px;
  font-size: 0.8rem;
}
.demo-item-actions .nav-btn.delete{
  color: var(--bad);
  border-color: rgba(255,120,160,0.3);
}
.demo-item-actions .nav-btn.delete:hover{
  background: rgba(255,120,160,0.15);
}
.demo-item-actions .nav-btn.unpublish{
  color: var(--warning, #f0a040);
  border-color: rgba(240,160,64,0.3);
}
.demo-item-actions .nav-btn.unpublish:hover{
  background: rgba(240,160,64,0.15);
}
.visibility-badge{
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.1);
  color: var(--muted);
}
.visibility-badge.public{
  background: rgba(120,255,180,0.15);
  color: var(--good);
}
.empty-state{
  text-align: center;
  padding: 32px;
  color: var(--muted);
}
/* Asset Browser Modal */
.asset-browser-modal{
  min-width: 700px;
  max-width: 900px;
  max-height: 85vh;
}
.asset-browser-header{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.asset-filter-tabs{
  display: flex;
  gap: 4px;
}
.asset-filter-tab{
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.asset-filter-tab:hover{ background: rgba(255,255,255,0.05); }
.asset-filter-tab.active{
  background: rgba(120,180,255,0.15);
  border-color: var(--accent);
  color: var(--accent);
}
.asset-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding: 4px;
}
.asset-item{
  aspect-ratio: 1;
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  background: rgba(0,0,0,0.3);
}
.asset-item:hover{
  border-color: var(--accent);
  transform: scale(1.02);
}
.asset-item.selected{
  border-color: var(--good);
  box-shadow: 0 0 0 2px rgba(120,255,180,0.3);
}
.asset-item img,
.asset-item video{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.asset-item-overlay{
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-item-icon{
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2.5rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}
.asset-item-type{
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  background: rgba(0,0,0,0.6);
}

/* List-style asset browser for audio, shaders, post-fx */
.asset-grid.list-view{
  display: flex;
  flex-direction: column;
  gap: 4px;
  grid-template-columns: none;
}
.asset-grid.list-view .asset-item{
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  height: auto;
}
.asset-grid.list-view .asset-item:hover{
  transform: none;
  background: rgba(120,180,255,0.08);
}
.asset-grid.list-view .asset-item-icon{
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 1.4rem;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
}
.asset-grid.list-view .asset-item-name{
  flex: 1;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asset-grid.list-view .asset-item-type{
  position: static;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
}
.asset-grid.list-view .asset-item-overlay{
  display: none;
}
.asset-grid.list-view .asset-item.selected{
  background: rgba(120,255,180,0.1);
  border-color: var(--good);
}
.asset-grid.list-view .asset-item.selected .asset-item-name{
  color: var(--good);
}
.asset-grid.list-view .asset-item.selected .asset-item-icon{
  background: rgba(120,255,180,0.15);
}
/* Different icon colors for different asset types */
.asset-grid.list-view[data-mode="audio"] .asset-item-icon{
  background: rgba(255,100,150,0.1);
}
.asset-grid.list-view[data-mode="shader"] .asset-item-icon{
  background: rgba(180,100,255,0.1);
}
.asset-grid.list-view[data-mode="postfx"] .asset-item-icon{
  background: rgba(255,200,100,0.1);
  border-radius: 4px;
  font-size: 0.65rem;
  text-transform: uppercase;
}
/* Cleaner postfx list items without icon */
.asset-grid.list-view[data-mode="postfx"] .asset-item {
  padding: 10px 14px;
}
.asset-grid.list-view[data-mode="postfx"] .asset-item-name {
  flex: 1;
}

/* Asset Preview Modal - Two column layout (Post FX, Shader, Scene) */
.asset-browser-modal.postfx-preview-mode,
.asset-browser-modal.shader-preview-mode,
.asset-browser-modal.scene-preview-mode {
  min-width: 1100px;
  max-width: 1300px;
}
.asset-preview-container {
  display: flex;
  gap: 20px;
  height: 500px;
}
.asset-preview-list-panel {
  width: 340px;
  min-width: 340px;
  display: flex;
  flex-direction: column;
}
.asset-preview-list-panel .asset-grid {
  flex: 1;
  max-height: none;
  overflow-y: auto;
}
.asset-preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(0,0,0,0.4);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.asset-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--line);
}
.asset-preview-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.asset-preview-name {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}
.asset-preview-canvas-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}
.asset-preview-canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
}
.asset-preview-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  color: var(--muted);
  font-size: 13px;
}
.asset-preview-loading.hidden { display: none; }
.asset-preview-hint {
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 16px;
}
.asset-preview-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  font-family: inherit;
  font-size: 10px;
  margin: 0 2px;
}
/* Legacy class names for backwards compatibility */
.postfx-preview-container { display: flex; gap: 20px; height: 500px; }
.postfx-list-panel { width: 340px; min-width: 340px; display: flex; flex-direction: column; }
.postfx-list-panel .asset-grid { flex: 1; max-height: none; overflow-y: auto; }
.postfx-preview-panel { flex: 1; display: flex; flex-direction: column; background: rgba(0,0,0,0.4); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.postfx-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--line); }
.postfx-preview-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.postfx-preview-effect-name { font-size: 13px; color: var(--accent); font-weight: 500; }
.postfx-preview-canvas-wrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px; }
#postfxPreviewCanvas { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.postfx-preview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); color: var(--muted); font-size: 13px; }
.postfx-preview-loading.hidden { display: none; }
.postfx-preview-hint { padding: 10px 14px; background: rgba(0,0,0,0.3); border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 16px; }
.postfx-preview-hint kbd { display: inline-block; padding: 2px 6px; background: rgba(255,255,255,0.1); border-radius: 3px; font-family: inherit; font-size: 10px; margin: 0 2px; }
/* LUT Preview Modal */
.asset-browser-modal.lut-preview-mode { min-width: 1100px; max-width: 1300px; }
.lut-preview-container { display: flex; gap: 20px; height: 500px; }
.lut-list-panel { width: 340px; min-width: 340px; display: flex; flex-direction: column; }
.lut-list-panel .asset-grid { flex: 1; max-height: none; overflow-y: auto; }
.lut-preview-panel { flex: 1; display: flex; flex-direction: column; background: rgba(0,0,0,0.4); border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.lut-preview-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--line); }
.lut-preview-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.lut-preview-name { font-size: 13px; color: var(--gold); font-weight: 500; }
.lut-preview-canvas-wrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; background: repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px; }
#lutPreviewCanvas { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lut-preview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); color: var(--muted); font-size: 13px; }
.lut-preview-loading.hidden { display: none; }
.lut-preview-hint { padding: 10px 14px; background: rgba(0,0,0,0.3); border-top: 1px solid var(--line); font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 16px; }
.lut-preview-hint kbd { display: inline-block; padding: 2px 6px; background: rgba(255,255,255,0.1); border-radius: 3px; font-family: inherit; font-size: 10px; margin: 0 2px; }
.trackRow.lut { background: rgba(255,200,100,0.03); }
.trackRow.lut .seg { background: linear-gradient(135deg, rgba(245,166,35,0.8), rgba(255,220,150,0.4)) !important; }
.asset-grid.list-view[data-mode="lut"] .asset-item { padding: 8px 12px; }
.asset-grid.list-view[data-mode="lut"] .asset-item-icon { display: none; }
.asset-grid.list-view[data-mode="lut"] .asset-item-name { flex: 1; }
/* Shader/Scene/Audio list item styles */
.asset-grid.list-view[data-mode="shader"] .asset-item,
.asset-grid.list-view[data-mode="scene"] .asset-item,
.asset-grid.list-view[data-mode="audio"] .asset-item {
  padding: 8px 12px;
}
.asset-grid.list-view[data-mode="shader"] .asset-item-icon,
.asset-grid.list-view[data-mode="scene"] .asset-item-icon,
.asset-grid.list-view[data-mode="audio"] .asset-item-icon {
  display: none;
}
.asset-grid.list-view[data-mode="shader"] .asset-item-name,
.asset-grid.list-view[data-mode="scene"] .asset-item-name,
.asset-grid.list-view[data-mode="audio"] .asset-item-name {
  flex: 1;
}
/* Highlight selected item in list for keyboard nav */
.asset-grid.list-view .asset-item.keyboard-focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Audio Preview Modal */
.asset-browser-modal.audio-preview-mode {
  min-width: 1100px;
  max-width: 1300px;
}
.audio-preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(ellipse at center, #0a0a15 0%, #050508 100%);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.audio-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(0,0,0,0.5);
  border-bottom: 1px solid var(--line);
}
.audio-preview-title {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.audio-preview-name {
  font-size: 13px;
  color: #ff6b9d;
  font-weight: 500;
}
.audio-preview-canvas-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}
#audioPreviewCanvas {
  max-width: 100%;
  max-height: 100%;
}
.audio-preview-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
  background: rgba(0,0,0,0.5);
  border-top: 1px solid var(--line);
}
.audio-preview-play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid #ff6b9d;
  background: rgba(255, 107, 157, 0.1);
  color: #ff6b9d;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.audio-preview-play-btn:hover {
  background: rgba(255, 107, 157, 0.3);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(255, 107, 157, 0.4);
}
.audio-preview-play-btn:active {
  transform: scale(0.95);
}
.audio-preview-play-btn.playing {
  border-color: #6bffb8;
  color: #6bffb8;
  background: rgba(107, 255, 184, 0.1);
  animation: audio-pulse 1s ease-in-out infinite;
}
.audio-preview-play-btn.playing:hover {
  background: rgba(107, 255, 184, 0.3);
  box-shadow: 0 0 20px rgba(107, 255, 184, 0.4);
}
@keyframes audio-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(107, 255, 184, 0.3); }
  50% { box-shadow: 0 0 25px rgba(107, 255, 184, 0.6); }
}
.audio-preview-time {
  font-size: 12px;
  color: var(--muted);
  font-family: monospace;
  min-width: 80px;
}
.audio-preview-hint {
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 16px;
}
.audio-preview-hint kbd {
  display: inline-block;
  padding: 2px 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  font-family: inherit;
  font-size: 10px;
  margin: 0 2px;
}

/* AI Generation spinner and status */
@keyframes ai-spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes ai-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
@keyframes ai-glow {
  0%, 100% { box-shadow: 0 0 15px rgba(100,150,255,0.2); }
  50% { box-shadow: 0 0 25px rgba(100,150,255,0.4); }
}
.ai-status-container{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px 20px;
  border-radius: 10px;
  font-size: 13px;
  background: linear-gradient(135deg, rgba(60,80,140,0.15), rgba(80,60,140,0.15));
  border: 1px solid rgba(100,150,255,0.3);
  animation: ai-glow 2s ease-in-out infinite;
}
.ai-status-container.error{
  background: linear-gradient(135deg, rgba(140,60,60,0.15), rgba(140,80,60,0.15));
  border-color: rgba(255,100,100,0.35);
  animation: none;
}
.ai-status-container.success{
  background: linear-gradient(135deg, rgba(60,140,80,0.15), rgba(60,140,100,0.15));
  border-color: rgba(100,255,150,0.35);
  animation: none;
}
.ai-status-row{
  display: none; /* Hidden - status shown in textarea instead */
}
/* Textarea generating state */
textarea.ai-generating {
  opacity: 0.5;
  pointer-events: none;
  color: var(--muted) !important;
}
.ai-spinner{
  width: 18px;
  height: 18px;
  border: 2px solid rgba(100,150,255,0.2);
  border-top-color: rgba(100,180,255,1);
  border-radius: 50%;
  animation: ai-spinner 0.8s linear infinite;
  flex-shrink: 0;
}
.ai-status-container.error .ai-spinner{ display: none; }
.ai-status-container.success .ai-spinner{ display: none; }
.ai-status-text{
  flex: 0 0 auto;
  color: #93c5fd;
  font-weight: 500;
  font-size: 12px;
  animation: ai-pulse 1.5s ease-in-out infinite;
}
.ai-status-container.error .ai-status-text{
  color: #fca5a5;
  animation: none;
}
.ai-status-container.success .ai-status-text{
  color: #86efac;
  animation: none;
}
.ai-status-icon{
  font-size: 14px;
  flex-shrink: 0;
}
.ai-streaming-text{
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.6);
  max-height: 100px;
  overflow-y: auto;
  padding: 12px 14px;
  background: rgba(0,0,0,0.25);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Prominent AI Generate Button */
.ai-generate-btn {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%) !important;
  color: #fff !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  padding: 12px 24px !important;
  border-radius: 8px !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  transition: all 0.2s ease !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.ai-generate-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, #7c7ff7 0%, #9d6ff8 50%, #b76ef9 100%) !important;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.ai-generate-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(139, 92, 246, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
}
.ai-generate-btn:disabled {
  background: linear-gradient(135deg, #4b4d7a 0%, #5b4d7a 50%, #6b4d7a 100%) !important;
  color: rgba(255,255,255,0.5) !important;
  box-shadow: none;
  cursor: not-allowed;
}
.ai-generate-btn .btn-icon {
  margin-right: 6px;
}
/* Keyboard hint for prompt */
.ai-prompt-hint {
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
  opacity: 0.7;
  line-height: 1.5;
}
.ai-progress-bar{
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.ai-progress-fill{
  height: 100%;
  background: linear-gradient(90deg, rgba(100,150,255,0.9), rgba(180,100,255,0.9));
  border-radius: 2px;
  transition: width 0.3s ease-out;
}

/* Asset management buttons (delete, rename, default) */
.asset-actions{
  display: flex;
  gap: 4px;
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.15s;
}
.asset-item:hover .asset-actions,
.asset-item.selected .asset-actions{
  opacity: 1;
}
.asset-action-btn{
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.asset-action-btn:hover{
  background: rgba(255,255,255,0.15);
  color: var(--text);
}
.asset-action-btn.delete:hover{
  background: rgba(255,100,100,0.2);
  color: #f88;
}
.asset-action-btn.default{
  font-size: 14px;
}
.asset-action-btn.default.active{
  background: rgba(255,200,80,0.25);
  color: #fc8;
}
.asset-badge{
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: 6px;
}
.asset-badge.owner{
  background: rgba(120,180,255,0.2);
  color: rgba(120,180,255,0.9);
}
.asset-badge.default-badge{
  background: rgba(255,200,80,0.2);
  color: rgba(255,200,80,0.9);
}
/* Grid view asset actions */
.asset-grid:not(.list-view) .asset-actions{
  position: absolute;
  top: 4px;
  left: 4px;
  right: auto;
  z-index: 5;
}
.asset-grid:not(.list-view) .asset-badges{
  position: absolute;
  bottom: 28px;
  left: 4px;
  display: flex;
  gap: 2px;
}

/* Asset browser pagination */
.asset-pagination{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.asset-pagination button{
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  transition: all 0.15s;
}
.asset-pagination button:hover:not(:disabled){
  background: rgba(255,255,255,0.1);
  border-color: var(--accent);
}
.asset-pagination button:disabled{
  opacity: 0.3;
  cursor: not-allowed;
}
.asset-pagination .page-info{
  font-size: 11px;
  color: var(--muted);
  min-width: 80px;
  text-align: center;
}

.btn{
  appearance:none;border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding:8px 10px;
  border-radius:12px;
  cursor:pointer;
  font: inherit;
}
.btn:hover{background: rgba(255,255,255,.10);}
.btn:active{transform: translateY(1px);}
.btn:disabled{opacity:0.35; cursor:not-allowed;}
.btn.primary{border-color: rgba(120,180,255,.35); background: rgba(120,180,255,.10);}
.btn.primary:hover{background: rgba(120,180,255,.16);}
/* Rebuild button style - matches nav-btn-solo */
.rebuild-btn{
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rebuild-btn:hover{
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
/* Rebuild required section */
.rebuild-required-group{
  background: rgba(255,140,0,0.05);
  border-radius: 8px;
}
.rebuild-required-group .param-group-title{
  color: #ff9933;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
/* Compact number input for rebuild sections */
.rebuild-input{
  width: 80px !important;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 4px 8px;
  font-size: 11px;
}
.rebuild-input:focus{
  border-color: var(--accent);
  outline: none;
}
/* Dropdown styling for rebuild sections */
.rebuild-select{
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  padding: 4px 8px;
  font-size: 11px;
  width: 100%;
  cursor: pointer;
}
.rebuild-select:focus{
  border-color: var(--accent);
  outline: none;
}
.btn.icon-btn{
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  height: 36px;
  min-width: 36px;
  box-sizing: border-box;
}
.btn.icon-btn svg{
  flex-shrink: 0;
}
.btn.icon-btn.loop-active{
  background: linear-gradient(135deg, rgba(255,170,100,0.25), rgba(255,130,80,0.15));
  border-color: rgba(255,150,80,0.5);
  color: rgba(255,180,120,1);
}
.btn.icon-btn.loop-active:hover{
  background: linear-gradient(135deg, rgba(255,170,100,0.35), rgba(255,130,80,0.25));
}
.btn-divider{
  width: 1px;
  height: 24px;
  background: var(--line);
  margin: 0 4px;
}
.pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: 36px;
  box-sizing: border-box;
  border:1px solid var(--line);
  border-radius:12px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  font-size:12px;
  white-space:nowrap;
}
.spacer{flex:1;}
