:root {
  --ink: #e8edf6;
  --dim: #8a94a8;
  --bg: #0a0d14;
  --panel: #141926;
  --line: #232a3b;
  --accent: #8fb2e0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body.is-immersive {
  overflow: hidden;
  height: 100dvh;
  touch-action: none;
}

/* ---- gallery viewport ------------------------------------------------- */

.viewport {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.viewport__stage {
  position: absolute;
  inset: 0;
}

.viewport__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  padding: 1.4rem 1.6rem;
  pointer-events: none;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

.hud__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.hud__caption {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--dim);
}

.viewport__hint {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.78rem;
  color: var(--dim);
  pointer-events: none;
  text-align: center;
}

/* Show the touch hint on coarse-pointer devices, desktop hint otherwise. */
.viewport__hint-touch { display: none; }
@media (pointer: coarse) {
  .viewport__hint-desktop { display: none; }
  .viewport__hint-touch { display: inline; }
}

/* ---- studio ----------------------------------------------------------- */

.studio {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
}

.studio__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.studio__title { margin: 0; font-size: 1.2rem; }
.studio__links { display: flex; gap: 0.75rem; align-items: center; }

.studio__link,
.studio__link button,
.studio__link--plain button {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.studio__panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.studio__heading { margin: 0 0 1rem; font-size: 1rem; }

.studio__form { display: flex; flex-direction: column; gap: 1rem; }

.studio__field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.85rem; color: var(--dim); }

.studio__field input {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}

.studio__submit {
  align-self: flex-start;
  padding: 0.6rem 1.3rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(143, 178, 224, 0.12);
  color: var(--ink);
  cursor: pointer;
}

.studio__list { list-style: none; margin: 0; padding: 0; }

.studio__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}

.studio__date { font-variant-numeric: tabular-nums; }
.studio__meta { color: var(--dim); font-size: 0.85rem; margin-left: auto; }

.studio__remove button,
.studio__remove {
  background: none;
  border: 1px solid var(--line);
  color: var(--dim);
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.studio__flash { padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.9rem; }
.studio__flash--ok { background: rgba(120, 200, 160, 0.15); color: #9fe0c0; }
.studio__flash--warn { background: rgba(224, 143, 143, 0.15); color: #e0a0a0; }
.studio__empty { color: var(--dim); }
