:root {
  --demo-bg: #315c48;
  --demo-ink: #f7f1e6;
  --demo-ink-soft: #d7ccbd;
  --demo-accent: #fff7df;
  --demo-gold: #e8c574;
  --demo-gold-deep: #c9943a;
  --demo-panel: rgba(30, 61, 48, 0.88);
  --demo-border: rgba(247, 241, 230, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%;
  height: 100%;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  background: var(--demo-bg);
  color: var(--demo-ink);
  overflow: hidden;
}
#canvas-container { width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
.panel {
  position: absolute;
  background: var(--demo-panel);
  backdrop-filter: blur(20px);
  border: 1px solid var(--demo-border);
  border-radius: 10px;
}
.header { top: 12px; left: 12px; padding: 12px 16px; }
.header h1 { font-size: 13px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 2px; }
.header .sub { font-size: 10px; color: var(--demo-ink-soft); font-weight: 400; }
.metrics { top: 12px; right: 12px; padding: 10px 14px; min-width: 160px; }
.metric { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 0; border-bottom: 1px solid var(--demo-border); }
.metric:last-child { border-bottom: none; }
.metric-label { font-size: 9px; color: var(--demo-ink-soft); text-transform: uppercase; letter-spacing: 0.5px; }
.metric-value { font-family: inherit; font-size: 11px; font-weight: 500; }
.metric-value.accent { color: var(--demo-gold); }
.metric-value.cyan { color: var(--demo-ink); }
.position-panel { bottom: 70px; right: 12px; padding: 12px 16px; text-align: right; }
.position-label { font-size: 9px; color: var(--demo-ink-soft); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.position-value { font-family: inherit; font-size: 16px; font-weight: 400; letter-spacing: -0.5px; color: var(--demo-gold); line-height: 1.3; }
.position-value span { display: block; }
.controls { bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.play-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--demo-accent);
  color: var(--demo-bg); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}
.play-btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28); }
.scrubber { width: 200px; height: 4px; background: var(--demo-border); border-radius: 2px; cursor: pointer; position: relative; }
.scrubber-fill { height: 100%; background: linear-gradient(90deg, var(--demo-gold-deep), var(--demo-gold)); border-radius: 2px; width: 0%; transition: width 0.05s linear; }
.scrubber-handle { position: absolute; top: 50%; left: 0%; transform: translate(-50%, -50%); width: 10px; height: 10px; background: var(--demo-gold); border-radius: 50%; box-shadow: 0 2px 6px rgba(0,0,0,0.3); transition: left 0.05s linear; }
.time { font-family: inherit; font-size: 10px; color: var(--demo-ink-soft); min-width: 70px; }
.legend { position: absolute; bottom: 70px; left: 12px; padding: 10px 12px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 9px; color: var(--demo-ink-soft); margin-bottom: 4px; }
.legend-item:last-child { margin-bottom: 0; }
.legend-dot { width: 6px; height: 6px; border-radius: 50%; }
.legend-line { width: 12px; height: 2px; border-radius: 1px; }

.info-toggle {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--demo-panel);
  backdrop-filter: blur(20px);
  color: var(--demo-ink-soft);
  cursor: pointer;
  font-size: 14px;
  z-index: 10;
}
.info-toggle:hover { color: var(--demo-ink); }

html.embed .header {
  display: none;
}

@media (max-width: 600px) {
  .info-toggle { display: flex; align-items: center; justify-content: center; }
  .metrics, .position-panel, .legend {
    display: block;
    transition: opacity 0.2s;
  }
  .metrics.is-hidden, .position-panel.is-hidden, .legend.is-hidden {
    display: none;
  }
  .metrics { top: 50px; right: 12px; }
  .position-panel { top: auto; bottom: 70px; right: 12px; }
  .header { padding: 8px 12px; }
  .header h1 { font-size: 12px; }
  .header .sub { font-size: 9px; }
  .controls { padding: 8px 12px; gap: 10px; }
  .play-btn { width: 32px; height: 32px; }
  .scrubber { width: 140px; }
  .time { font-size: 9px; min-width: 60px; }
}
