:root {
  --ink: #07080c;
  --surface: #12141a;
  --line: #2a2e38;
  --text: #e8eceb;
  --muted: #8b9390;
  --teal: #9fd8d0;
  --teal-dim: #6aa39b;
}

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

html, body {
  height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

#stage {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(1rem, env(safe-area-inset-top))
           max(1rem, env(safe-area-inset-right))
           max(5.5rem, env(safe-area-inset-bottom))
           max(1rem, env(safe-area-inset-left));
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.brand h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 500;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
  color: var(--teal);
}

.brand p {
  color: var(--muted);
  font-size: 0.78rem;
}

.panel {
  pointer-events: auto;
  align-self: flex-end;
  width: min(360px, 100%);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 16px;
  backdrop-filter: blur(16px);
  padding: 0.85rem 1rem 1rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.7rem;
}

.panel-head button,
.actions button {
  appearance: none;
  border: 1px solid var(--line);
  background: #1a1d24;
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.panel-head button:hover,
.actions button:hover {
  border-color: var(--teal-dim);
  color: var(--teal);
}

.row {
  display: grid;
  grid-template-columns: 92px 1fr 36px;
  align-items: center;
  gap: 0.55rem;
  margin: 0.38rem 0;
  font-size: 0.75rem;
  color: var(--muted);
}

.row input[type="range"] {
  width: 100%;
  accent-color: var(--teal);
}

.row .val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.actions {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.hint {
  margin-top: 0.55rem;
  font-size: 0.68rem;
  color: var(--muted);
}

@media (max-width: 720px) {
  .panel { width: 100%; }
  .brand h1 { font-size: 1.35rem; }
}
