:root {
  --bg: #1a1533;
  --panel: rgba(30, 24, 62, 0.72);
  --panel-solid: #241c46;
  --border: rgba(120, 100, 200, 0.28);
  --accent: #00e0c0;
  --accent2: #ff66cc;
  --text: #e8e4ff;
  --muted: #9a92c8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Bricolage Grotesque', sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-user-select: none; user-select: none;
  touch-action: none;
}

#scene-container { position: fixed; inset: 0; z-index: 0; }

/* ---- Top bar ---- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(20,14,45,0.9), rgba(20,14,45,0.5));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: -0.5px; }
.brand-name { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.actions { display: flex; gap: 8px; }

.btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700;
  padding: 8px 12px; border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  color: var(--text); cursor: pointer;
  transition: transform .12s, background .2s, box-shadow .2s;
}
.btn:hover { background: rgba(255,255,255,0.12); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-accent {
  background: linear-gradient(90deg, var(--accent), #00b8d4);
  color: #04201c; border: none;
  box-shadow: 0 4px 14px rgba(0,224,192,0.3);
}
.btn.small { padding: 7px 10px; font-size: 11px; }
.btn-danger { color: #ff8b8b; border-color: rgba(255,80,80,0.4); }
.btn-danger:hover { background: rgba(255,80,80,0.15); }

/* ---- Panels ---- */
.panel {
  position: fixed; z-index: 15;
  top: 58px; bottom: 68px;
  width: 210px;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  overflow-y: auto;
  transition: transform .28s ease;
}
#parts { left: 12px; }
#inspector { right: 12px; }
.panel::-webkit-scrollbar { width: 6px; }
.panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.panel-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; text-transform: uppercase; letter-spacing: 2px;
  color: var(--muted); margin-bottom: 10px;
}

.shape-btn {
  display: block; width: 100%;
  padding: 9px 12px; margin-bottom: 6px;
  text-align: left;
  font-family: 'Bricolage Grotesque'; font-weight: 400; font-size: 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
  color: var(--text); cursor: pointer;
  transition: all .15s;
}
.shape-btn:hover { background: rgba(0,224,192,0.14); border-color: var(--accent); transform: translateX(3px); }
.shape-btn.preset:hover { background: rgba(255,102,204,0.14); border-color: var(--accent2); }

/* ---- Inspector body ---- */
.hint-empty { color: var(--muted); font-size: 13px; line-height: 1.5; padding: 6px 0; }
.insp-name {
  font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 13px;
  color: var(--accent); margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.row-group { margin-bottom: 12px; }
.row-group > label {
  display: block; font-size: 11px; color: var(--muted);
  margin-bottom: 5px; font-family: 'JetBrains Mono', monospace;
}
.mini { font-size: 9px; opacity: 0.6; }
.triple { display: flex; gap: 4px; }
.triple input, .row-group > input[type=number] {
  width: 100%; min-width: 0;
}
input[type=number], select {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  padding: 6px 6px; border-radius: 7px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25); color: var(--text);
}
select { width: 100%; }
input[type=range] {
  width: 100%; accent-color: var(--accent);
  margin: 3px 0;
}
input[type=color] {
  width: 100%; height: 30px; margin-top: 6px;
  border: 1px solid var(--border); border-radius: 7px;
  background: transparent; cursor: pointer;
}
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.sw {
  width: 22px; height: 22px; border-radius: 6px; cursor: pointer;
  transition: transform .1s;
}
.sw:hover { transform: scale(1.15); }
.insp-actions { display: flex; gap: 6px; margin-top: 6px; }
.insp-actions .btn { flex: 1; }

/* ---- Bottom toolbar ---- */
#toolbar {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 20;
  display: flex; align-items: center; gap: 6px;
  padding: 8px;
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 14px;
}
.tool {
  font-family: 'Bricolage Grotesque'; font-size: 13px; font-weight: 700;
  padding: 8px 12px; border-radius: 9px;
  border: 1px solid transparent;
  background: rgba(255,255,255,0.05); color: var(--text);
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.tool:hover { background: rgba(255,255,255,0.12); }
.tool.active {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #1a1030; border-color: transparent;
}
.divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

/* ---- Poly count ---- */
#poly-count {
  position: fixed; bottom: 14px; right: 14px; z-index: 18;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--muted);
  background: var(--panel); padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border);
}

/* ---- Empty hint ---- */
#empty-hint {
  position: fixed; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; pointer-events: none;
  font-size: 20px; font-weight: 200; color: var(--muted);
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.wobble { font-size: 46px; animation: wobble 1.4s ease-in-out infinite; }
@keyframes wobble {
  0%,100% { transform: rotate(-12deg) translateX(-10px); }
  50% { transform: rotate(8deg) translateX(10px); }
}

/* ---- Footer ---- */
#footer {
  position: fixed; bottom: 0; left: 12px; z-index: 6;
  font-size: 10px; color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  display: none;
}
#footer a { color: var(--accent); text-decoration: none; }

/* ---- Toast ---- */
#toast {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%) translateY(-20px);
  z-index: 40;
  background: var(--panel-solid); color: var(--text);
  padding: 10px 18px; border-radius: 10px;
  border: 1px solid var(--accent);
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- Mobile toggles ---- */
.mobile-toggle { display: none; }

@media (max-width: 760px) {
  .brand-name { display: none; }
  .actions .btn { padding: 7px 9px; font-size: 11px; }

  .panel {
    top: auto; bottom: 0; width: 78%; max-width: 300px;
    border-radius: 16px 16px 0 0;
    height: 55vh;
  }
  #parts { left: 0; transform: translateX(-105%); }
  #parts.open { transform: translateX(0); }
  #inspector { right: 0; transform: translateX(105%); }
  #inspector.open { transform: translateX(0); }

  .mobile-toggle {
    display: block; position: fixed; z-index: 21; bottom: 70px;
    font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
    padding: 9px 12px; border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel); backdrop-filter: blur(10px); color: var(--text);
  }
  #toggle-parts { left: 10px; }
  #toggle-inspector { right: 10px; }

  #toolbar { bottom: 6px; padding: 6px; gap: 3px; }
  .tool { padding: 7px 8px; font-size: 11px; }
  #poly-count { display: none; }
}
</parameter>