:root {
  --panel-bg: rgba(24, 27, 34, 0.82);
  --panel-border: rgba(255, 255, 255, 0.12);
  --accent: #ff4d6d;
  --accent-2: #ffca3a;
  --text: #f2f4f8;
  --muted: #a7b0bd;
  --active: #3ba7ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Bricolage Grotesque', sans-serif;
  background: #3ba7ff;
  color: var(--text);
  user-select: none;
}

#scene-container { position: fixed; inset: 0; }
canvas { display: block; cursor: crosshair; }

/* ---- Panels ---- */
.panel {
  position: fixed;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 14px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  z-index: 10;
  animation: slideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

#toolbar { top: 16px; left: 16px; width: 220px; }
#actionbar { top: 16px; right: 16px; width: 190px; display: flex; flex-direction: column; gap: 8px; animation-delay: 0.08s; }

.brand {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  line-height: 1;
}
.brand span { color: var(--accent-2); }

.group { margin-bottom: 12px; }
.group:last-child { margin-bottom: 0; }
.group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 6px;
}

.btn-row { display: flex; gap: 6px; }
.btn-row.wrap { flex-wrap: wrap; }

/* Tool buttons */
.tool-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
}
.tool-btn span { font-size: 10px; font-weight: 700; }
.tool-btn:hover { background: rgba(255, 255, 255, 0.12); }
.tool-btn:active { transform: scale(0.92); }
.tool-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.5);
}

/* Material buttons */
.mat-btn {
  flex: 1;
  padding: 8px 0;
  font-size: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.mat-btn:hover { background: rgba(255, 255, 255, 0.12); }
.mat-btn:active { transform: scale(0.9); }
.mat-btn.active {
  background: var(--active);
  border-color: var(--active);
  box-shadow: 0 4px 14px rgba(59, 167, 255, 0.5);
}

/* Swatches */
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin-bottom: 8px; }
.swatch {
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent-2); }

.custom-color {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
}
.custom-color input[type=color] {
  width: 34px; height: 26px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  padding: 0;
}

/* mini buttons */
.mini-btn {
  flex: 1;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
}
.mini-btn:hover { background: rgba(255, 255, 255, 0.12); }
.mini-btn:active { transform: scale(0.94); }
.mini-btn.on { background: var(--accent-2); color: #222; border-color: var(--accent-2); }

/* action buttons */
.act-btn {
  padding: 9px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  flex: 1;
  transition: transform 0.12s, background 0.15s;
}
.act-btn.wide { font-size: 13px; }
.act-btn:hover { background: rgba(255, 255, 255, 0.14); }
.act-btn:active { transform: scale(0.93); }
.act-btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(255, 77, 109, 0.45);
}

#auth-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  margin-top: 2px;
}
#auth-status a { color: var(--accent-2); text-decoration: none; }

/* Badge */
#badge {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 999px;
  padding: 8px 18px;
  display: flex;
  gap: 14px;
  align-items: center;
  z-index: 10;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.5s 0.16s both;
}
#badge .hint {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 10px;
  color: var(--muted);
}

/* Toast */
#toast {
  position: fixed;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%);
  width: min(340px, 90vw);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 18px;
  padding: 18px;
  z-index: 20;
  text-align: center;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.4);
  transition: opacity 0.4s, transform 0.4s;
}
#toast strong { font-size: 17px; }
#toast p { font-size: 13px; color: var(--muted); margin: 8px 0 14px; line-height: 1.5; }
#toast button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.12s;
}
#toast button:active { transform: scale(0.94); }
#toast.hidden { opacity: 0; transform: translateX(-50%) translateY(20px); pointer-events: none; }

/* Notification */
#notify {
  position: fixed;
  top: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--accent-2);
  color: #1a1a1a;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 999px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}
#notify.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Remix link */
#remix {
  position: fixed;
  bottom: 10px;
  right: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  z-index: 10;
  background: rgba(0,0,0,0.25);
  padding: 4px 8px;
  border-radius: 8px;
}
#remix:hover { color: #fff; }

/* Mobile */
@media (max-width: 640px) {
  #toolbar { width: 44vw; max-width: 200px; top: 10px; left: 10px; padding: 10px; }
  #actionbar { width: 42vw; max-width: 170px; top: 10px; right: 10px; padding: 10px; }
  .brand { font-size: 15px; margin-bottom: 8px; }
  .tool-btn { font-size: 14px; padding: 6px 2px; }
  .act-btn { font-size: 13px; padding: 7px; }
  .act-btn.wide { font-size: 11px; }
  #badge { flex-direction: column; gap: 2px; padding: 6px 14px; bottom: 10px; }
  #badge .hint { font-size: 9px; }
  canvas { cursor: default; }
}
</parameter>
</invoke>