/**
 * I·V·O Framework — Interactive Visualization Code
 * View & Play License (Temporary)
 *
 * © 2025 Ivo van der Wal — Design by Authenticity
 * All rights reserved.
 */

:root {
  --bg: #000;
  --ui-bg: rgba(0,0,0,0.6);
  --ui-border: rgba(255,255,255,0.12);
  --ui-text: #fff;
  --ui-muted: rgba(255,255,255,0.7);
  --accent: rgba(255,255,255,0.85);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ui-text);
}

canvas {
  position: fixed;
  inset: 0;
  display: block;
}

#ui {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  width: 280px;
  max-width: 80vw;
  padding: 12px;

  background: var(--ui-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--ui-border);
  border-radius: 14px;

  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: transform 160ms ease, opacity 160ms ease;
  will-change: transform, opacity;
}

#ui.hidden {
  transform: translateX(calc(-100% - 14px));
  opacity: 0;
  pointer-events: none;
}

#hoverZone {
  position: fixed;
  left: 0;
  top: 0;
  width: 18px;
  height: 100vh;
  z-index: 50;
  background: transparent;
}

.row {
  display: block;
  margin: 10px 0;
}

.labelLine {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

.labelLine .label {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}

.labelLine .val {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: rgba(255,255,255,0.75);
}

.btns {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

button {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--ui-text);
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

button:hover {
  background: rgba(255,255,255,0.18);
}

@media (max-width: 680px) {
  #ui {
    width: calc(100vw - 16px);
    left: 8px;
    top: 8px;
  }
}

#uiHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

#uiTitle {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--ui-text);
  opacity: 0.95;
  user-select: none;
}

#uiBtns {
  display: flex;
  gap: 8px;
}

.btn {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--ui-text);
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
}

.btn:hover {
  background: rgba(255,255,255,0.18);
}

:root { color-scheme: dark; }

#ui select {
  width: 100%;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--ui-border);
  background: rgba(0,0,0,0.45);
  color: var(--ui-text);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

#ui select:focus {
  border-color: rgba(255,255,255,0.22);
}

#ui select option {
  background: #0b0b10;
  color: #fff;
}

#ui details.group {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.10);
}

#ui details.group > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;

  display: flex;
  align-items: center;
  justify-content: space-between;

  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ui-muted);

  padding: 6px 0 8px 0;
}

#ui details.group > summary::-webkit-details-marker { display: none; }

#ui details.group > summary::after {
  content: "▾";
  opacity: 0.7;
  transform: translateY(-1px);
}

#ui details.group[open] > summary::after {
  content: "▴";
}

#ui .row { margin-bottom: 9px; }
