:root {
  --bg: #e9e9e9;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --glass: rgba(255, 255, 255, 0.62);
  --line: rgba(0, 0, 0, 0.08);
  --on: #1d1d1f;
  --on-ink: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  overscroll-behavior: none;
}

#stage { position: fixed; inset: 0; }

#c {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  outline: none;
}
#c.dragging { cursor: grabbing; }

/* delikatna winieta jak na renderach z Blendera */
.vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 60%);
}

.bar {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.bar.top {
  top: 0;
  justify-content: space-between;
  flex-wrap: wrap;
  padding-top: max(14px, env(safe-area-inset-top));
}
.bar.bottom {
  bottom: 0;
  flex-direction: column;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}

.seg button {
  appearance: none;
  border: 0;
  margin: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .18s ease, color .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.seg button:hover { background: rgba(0, 0, 0, 0.05); }
.seg button.on,
.seg button:active { background: var(--on); color: var(--on-ink); }
.seg button:focus-visible { outline: 2px solid #0a84ff; outline-offset: 1px; }

.hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
  text-align: center;
}

.loader, .note {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: none;
}
.loader { top: 50%; }
.note { top: 72px; color: var(--muted); font-size: 12px; }
[hidden] { display: none !important; }

@media (max-width: 560px) {
  .bar { padding-left: 10px; padding-right: 10px; }
  .bar.top { justify-content: center; }
  .seg button { font-size: 13px; padding: 8px 11px; }
  .note { top: 112px; }
}
