@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-300-normal.woff2") format("woff2");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-300-italic.woff2") format("woff2");
  font-weight: 300; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Spectral";
  src: url("../fonts/spectral-latin-400-italic.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}

:root {
  --space: #050816;
  --space-deep: #02030a;
  --nebula: #121a3d;
  --starlight: #fff3da;
  --ink: #dde3f2;
  --ink-muted: #8b95b3;
  --ink-faint: #5a6485;
  --line: rgba(160, 178, 230, 0.18);
  --panel: rgba(9, 13, 32, 0.82);
  --danger: #f0a89a;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.75rem;
  --step-3: 2.75rem;
  --gutter: clamp(16px, 3vw, 32px);
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 70% 55% at 50% 47%, var(--nebula) 0%, rgba(18, 26, 61, 0) 70%),
    radial-gradient(ellipse 120% 90% at 50% 50%, var(--space) 40%, var(--space-deep) 100%);
  background-color: var(--space);
  color: var(--ink);
  font-family: "Spectral", Georgia, serif;
  font-weight: 300;
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.mode-own #sky, .mode-shared #sky { cursor: grab; }
#sky.is-dragging { cursor: grabbing; }
#sky.is-rotating { cursor: move; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 1px solid var(--starlight);
  outline-offset: 3px;
}

/* ---------- Sterne (Klickflächen über dem Canvas) ---------- */

.stars-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.star-hit {
  position: absolute;
  left: -22px;
  top: -22px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform;
}

.star-hit:focus-visible { outline-offset: -8px; }

.star-name,
.star-years {
  position: absolute;
  left: 34px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.6s ease, color 0.6s ease;
}

.star-name {
  top: 50%;
  transform: translateY(-58%);
  font-style: italic;
  font-size: 0.9375rem;
  color: var(--ink-muted);
  opacity: 0;
}

.star-years {
  top: 50%;
  transform: translateY(55%);
  font-size: var(--step--1);
  color: var(--ink-faint);
  opacity: 0;
  font-variant-numeric: oldstyle-nums;
}

.star-hit.label-left .star-name,
.star-hit.label-left .star-years { left: auto; right: 34px; text-align: right; }

.star-hit.is-me .star-name { color: var(--starlight); left: 38px; }

/* Namen: sichtbar, was die Platzvergabe freigibt (label-on), alles andere beim Darüberfahren. */
.star-hit.label-on .star-name { opacity: 0.72; }
.star-hit.is-me.label-on .star-name { opacity: 0.9; }
.star-hit[data-mode="eternal"].label-on .star-name { opacity: 0.95; color: var(--ink); }
.is-map .star-hit[data-mode="eternal"].label-on .star-years { opacity: 0.9; }

.star-hit:hover, .star-hit:focus-visible { z-index: 5; }
.star-hit:hover .star-name,
.star-hit:focus-visible .star-name { opacity: 1; color: var(--ink); }
.star-hit[data-mode="eternal"]:hover .star-years,
.star-hit[data-mode="eternal"]:focus-visible .star-years { opacity: 0.9; }

.is-map .star-hit[data-mode="living"] { pointer-events: none; }

/* ---------- Leisten ---------- */

.top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: calc(var(--gutter) + env(safe-area-inset-top)) var(--gutter) 0;
  pointer-events: none;
}

.top > * { pointer-events: auto; }

.wordmark {
  margin: 0;
  font-style: italic;
  font-size: var(--step-1);
  letter-spacing: 0.01em;
  color: var(--ink);
}

.top-actions { display: flex; gap: clamp(14px, 2.5vw, 28px); }

.link {
  background: none;
  border: 0;
  padding: 6px 0;
  color: var(--ink-muted);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  transition: color 0.4s ease, text-decoration-color 0.4s ease;
}

.link:hover { color: var(--ink); text-decoration-color: var(--line); }
.link[aria-pressed="true"] { color: var(--starlight); }
.link.quiet { color: var(--ink-faint); }
.link.quiet:hover { color: var(--danger); }

.bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
  transition: opacity 1.2s ease;
}

.add {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 22px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 12, 30, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.5s ease, background-color 0.5s ease;
}

.add:hover { border-color: rgba(255, 243, 218, 0.45); background: rgba(16, 22, 50, 0.55); }

.is-map .bottom { opacity: 0; pointer-events: none; }
.is-map .bottom .add { pointer-events: none; }

.map-hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + 6px);
  margin: 0 auto;
  max-width: 34ch;
  padding: 0 var(--gutter);
  text-align: center;
  font-style: italic;
  color: var(--ink-muted);
  visibility: hidden;
  opacity: 0;
}

/* ---------- Begrüßung ---------- */

.intro {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--gutter);
  gap: 0;
}

.intro h1 {
  margin: 0 0 0.6em;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--starlight);
}

.intro > p {
  margin: 0 0 2.4em;
  max-width: 36ch;
  font-size: var(--step-1);
  line-height: 1.55;
  color: var(--ink-muted);
}

/* ---------- Panel ---------- */

.panel {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(420px, 100%);
  height: 100%;
  max-height: none;
  max-width: none;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  overflow-y: auto;
}

.panel::backdrop { background: rgba(2, 3, 10, 0.25); }

.panel-inner {
  position: relative;
  padding: calc(var(--gutter) * 2 + env(safe-area-inset-top)) clamp(24px, 4vw, 40px) 40px;
}

.close {
  position: absolute;
  top: calc(var(--gutter) + env(safe-area-inset-top) - 6px);
  right: calc(var(--gutter) - 10px);
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--ink-muted);
  cursor: pointer;
}

.close:hover { color: var(--ink); }

.panel h2 {
  margin: 0 0 1rem;
  font-weight: 300;
  font-size: var(--step-2);
  line-height: 1.2;
  max-width: 18ch;
}

.panel h2:focus { outline: none; }

.panel h2.name {
  font-style: italic;
  font-size: var(--step-3);
  line-height: 1.05;
  color: var(--starlight);
  margin-bottom: 1.25rem;
}

.kicker {
  margin: 0 0 0.4rem;
  color: var(--ink-faint);
  font-size: var(--step--1);
  font-style: italic;
}

.meta { margin: 0 0 0.25rem; color: var(--ink-muted); }

.lede { margin: 0 0 1.75rem; color: var(--ink-muted); line-height: 1.7; max-width: 40ch; }

.note {
  margin: 1.25rem 0 0;
  white-space: pre-line;
  line-height: 1.7;
  max-width: 40ch;
}

blockquote {
  margin: 1.5rem 0 0;
  padding: 0 0 0 1rem;
  border-left: 1px solid var(--line);
  font-style: italic;
  line-height: 1.7;
  white-space: pre-line;
  max-width: 40ch;
}

/* ---------- Formulare ---------- */

.form { display: flex; flex-direction: column; gap: 1.35rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; padding: 0; border: 0; min-width: 0; }

.field > label, .field > legend { color: var(--ink); padding: 0; }

.opt { color: var(--ink-faint); font-size: var(--step--1); }

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 300;
}

.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.field select option { background: #0b1028; }

.field textarea { resize: vertical; line-height: 1.6; }

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: rgba(255, 243, 218, 0.55);
}

.field [aria-invalid="true"] { border-color: var(--danger); }
.error { margin: 0; color: var(--danger); font-size: var(--step--1); }

.radios { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.2rem; }

.radio { display: flex; align-items: center; gap: 0.6rem; cursor: pointer; color: var(--ink-muted); }
.radio input { appearance: none; width: 14px; height: 14px; margin: 0; border: 1px solid var(--ink-faint); border-radius: 50%; display: grid; place-items: center; }
.radio input::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--starlight); box-shadow: 0 0 8px var(--starlight); transform: scale(0); transition: transform 0.3s ease; }
.radio input:checked::after { transform: scale(1); }
.radio input:checked + span { color: var(--ink); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 2rem; }
.form .actions { margin-top: 0.5rem; }
.actions.column { flex-direction: column; align-items: flex-start; }

.primary, .secondary, .danger {
  padding: 10px 20px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.4s ease, border-color 0.4s ease, color 0.4s ease;
}

.primary { background: var(--starlight); color: #10142b; border: 1px solid var(--starlight); font-weight: 400; }
.primary:hover { background: #fff; }
.secondary { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.secondary:hover { border-color: rgba(255, 243, 218, 0.45); }
.danger { background: transparent; border: 1px solid rgba(240, 168, 154, 0.5); color: var(--danger); }
.danger:hover { background: rgba(240, 168, 154, 0.1); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + 64px);
  margin: 0 auto;
  width: max-content;
  max-width: calc(100% - 2 * var(--gutter));
  text-align: center;
  font-style: italic;
  color: var(--ink);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Mobil ---------- */

@media (max-width: 640px) {
  .panel {
    inset: auto 0 0 0;
    width: 100%;
    height: auto;
    max-height: 86vh;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-radius: 18px 18px 0 0;
  }
  .panel-inner { padding-top: 2.6rem; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .close { top: 10px; right: 8px; }
  .star-name { font-size: 0.875rem; left: 30px; }
  .wordmark { font-size: 1.0625rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Konten, Teilen, Rechtliches ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.owner-only, .shared-only { display: none !important; }
.mode-own .owner-only { display: revert !important; }
.mode-own .add.owner-only, .mode-shared .add.shared-only { display: inline-flex !important; }
.mode-shared .shared-only { display: block !important; }
.mode-auth .top-actions, .mode-auth .bottom { display: none; }
body:not(.mode-own):not(.mode-shared) .top-actions { visibility: hidden; }

a.wordmark { text-decoration: none; color: var(--ink); }

.shared-title {
  margin: 0.15rem 0 0;
  color: var(--ink-muted);
  font-size: var(--step-0);
}

a.add { text-decoration: none; }
a.link { display: inline-block; text-decoration: underline; text-decoration-color: transparent; }

.legal {
  position: fixed;
  left: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + 10px);
  display: flex;
  gap: 18px;
  font-size: var(--step--1);
}

.legal a, .panel-legal a, .consent a { color: var(--ink-faint); text-underline-offset: 4px; }
.legal a:hover, .panel-legal a:hover { color: var(--ink-muted); }
.consent a { color: var(--ink-muted); }

.is-map .legal { opacity: 0.4; }

/* Auf schmalen Bildschirmen stehen die Links im Konto-Bereich und unter der Anmeldung. */
@media (max-width: 760px) {
  .mode-own .legal, .mode-shared .legal { display: none; }
}

.mode-auth .legal { left: 0; right: 0; justify-content: center; z-index: 1; }

.intro {
  overflow-y: auto;
  justify-content: safe center;
  padding-top: calc(var(--gutter) * 3);
  padding-bottom: calc(var(--gutter) * 4);
}

.intro .intro-text { margin-bottom: 2rem; }

.auth {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  width: min(100%, 340px);
}

.auth .primary { align-self: center; margin-top: 4px; }
.auth .link { align-self: center; }

.auth-field { display: flex; flex-direction: column; gap: 2px; text-align: left; }
.auth-field label { color: var(--ink-muted); font-size: var(--step-0); font-style: normal; }
.auth-field:first-child label { color: var(--ink); font-size: var(--step-1); font-style: italic; text-align: center; }

.auth input {
  width: 100%;
  font-size: var(--step-1);
  padding: 6px 2px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.auth-field:first-child input { text-align: center; }
.auth input:focus { outline: none; border-bottom-color: var(--starlight); }

.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  font-size: var(--step--1);
  line-height: 1.5;
  color: var(--ink-muted);
  cursor: pointer;
}

.consent input { margin-top: 3px; accent-color: var(--starlight); }

.form-error { margin: 0; min-height: 0; color: var(--danger); font-size: var(--step--1); text-align: center; }
.form-error:empty { display: none; }
.panel .form-error { text-align: left; }

.notice {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: var(--gutter);
  text-align: center;
  font-style: italic;
  font-size: var(--step-1);
  color: var(--ink-muted);
}

.notice p { max-width: 32ch; margin: 0; }

.portrait {
  display: block;
  width: 112px;
  height: 112px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 0 1.25rem;
  border: 1px solid var(--line);
  box-shadow: 0 0 40px rgba(255, 243, 218, 0.08);
}

.portrait.small { width: 56px; height: 56px; margin: 0; }

.label { color: var(--ink); }

.photo-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-top: 0.2rem; }

.file-btn { display: inline-flex; align-items: center; position: relative; }
.file-btn:focus-within { outline: 1px solid var(--starlight); outline-offset: 3px; }

.section { margin-top: 2.25rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.section h3 { margin: 0 0 0.75rem; font-weight: 400; font-size: var(--step-1); }
.section .lede { margin-bottom: 1rem; }
.section .radios { margin-bottom: 1rem; }

.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 0.75rem; }
.share-link {
  flex: 1 1 200px;
  min-width: 0;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-muted);
  font-size: var(--step--1);
}

.actions.column { gap: 4px; }

.panel-legal { display: flex; gap: 18px; margin: 2.5rem 0 0; font-size: var(--step--1); }

button:disabled { opacity: 0.5; cursor: progress; }

/* ---------- Rechtliche Seiten ---------- */

body.page { overflow: auto; }

.page-main {
  max-width: 68ch;
  margin: 0 auto;
  padding: calc(var(--gutter) * 4) var(--gutter) calc(var(--gutter) * 3);
  line-height: 1.7;
}

.page-main h1 { font-weight: 300; font-style: italic; font-size: var(--step-3); line-height: 1.1; color: var(--starlight); margin: 0 0 1.5rem; }
.page-main h2 { font-weight: 400; font-size: var(--step-1); margin: 2.5rem 0 0.5rem; }
.page-main h3 { font-weight: 400; font-size: var(--step-0); font-style: italic; margin: 1.5rem 0 0.25rem; }
.page-main p, .page-main li { color: var(--ink); }
.page-main a { color: var(--starlight); text-underline-offset: 4px; }
.page-main .todo { background: rgba(240, 168, 154, 0.12); color: var(--danger); padding: 0 4px; border-radius: 3px; }
.page-main .stand { color: var(--ink-muted); font-style: italic; }
.page-top { position: static; padding-bottom: 0; }

.page-legal { position: static; justify-content: center; padding: 0 var(--gutter) calc(var(--gutter) * 2); }

.auth .consent input { width: auto; flex: none; padding: 0; border: 0; }
.legal a, .panel-legal a { text-decoration-color: rgba(160, 178, 230, 0.25); }
.page-main h1 { font-size: clamp(2rem, 9vw, 2.75rem); hyphens: auto; overflow-wrap: anywhere; }

/* Geteilte Ansicht: der Weg zum eigenen Himmel bleibt sichtbar, auch auf der Karte. */
.mode-shared.is-map .bottom { opacity: 1; }
.mode-shared.is-map .bottom .add { pointer-events: auto; }
.mode-shared .map-hint { bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + 72px); }
.scope-eternal #btn-map { display: none; }

.form-note { margin: 0; color: var(--ink); font-size: var(--step--1); text-align: center; font-style: italic; }
.form-note:empty { display: none; }
.reset-hint { margin: -6px 0 0; text-align: center; }
.auth-field:first-child label[for="f-email"], .auth-field:first-child label[for="n-password"] { font-size: var(--step-0); }

/* ---------- Schwebender Erinnerungsraum ---------- */

@media (min-width: 641px) {
  .panel.room {
    inset: 0;
    margin: auto;
    width: min(580px, calc(100% - 48px));
    height: fit-content;
    max-height: 86vh;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(9, 13, 32, 0.78);
    box-shadow: 0 0 120px rgba(255, 243, 218, 0.05);
  }
  .panel.room .panel-inner { padding: 40px 44px 36px; }
  .panel.room .close { top: 14px; right: 14px; }
}

.panel.room::backdrop { background: rgba(2, 3, 10, 0.4); }

.room-head { display: flex; gap: 22px; align-items: center; }
.room-head .portrait { margin: 0; flex: none; width: 96px; height: 96px; }
.room-head .name { margin-bottom: 0.5rem; }

.sparks { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.sparks h3 { margin: 0 0 1rem; font-weight: 400; font-size: var(--step-1); }

.spark-list { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 1.4rem; }
.spark { position: relative; padding-left: 18px; }
.spark::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--starlight);
  box-shadow: 0 0 10px 2px rgba(255, 243, 218, 0.45);
}
.spark-date { margin: 0 0 0.2rem; color: var(--ink-faint); font-size: var(--step--1); font-style: italic; }
.spark-text { margin: 0; white-space: pre-line; line-height: 1.65; max-width: 46ch; }
.spark-photo { display: block; margin-top: 0.6rem; max-width: 100%; max-height: 320px; border-radius: 10px; border: 1px solid var(--line); }
.spark audio, .composer-media audio { display: block; margin-top: 0.6rem; width: 100%; max-width: 360px; height: 36px; }
.spark-del { font-size: var(--step--1); padding: 2px 0; }
.spark-empty { color: var(--ink-faint); font-style: italic; list-style: none; padding: 0; }
.spark-empty::before { display: none; }

.composer { display: flex; flex-direction: column; gap: 0.6rem; }
.composer textarea {
  width: 100%;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 300;
  line-height: 1.6;
  resize: vertical;
}
.composer textarea:focus, .composer input:focus { outline: none; border-color: rgba(255, 243, 218, 0.55); }
.composer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.composer-row input[type="date"] {
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-muted);
  font-size: var(--step--1);
}
.composer-media { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.composer-media img { max-height: 120px; border-radius: 8px; border: 1px solid var(--line); }
.composer .secondary { align-self: flex-start; }
#m-rec[aria-pressed="true"] { color: var(--danger); }

/* ---------- Formular: Nähe mit Vorschau ---------- */

.preview {
  display: block;
  width: 100%;
  height: 120px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(2, 3, 10, 0.35);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 24px;
  padding: 0;
  margin: 4px 0 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--line); }
input[type="range"]::-moz-range-track { height: 1px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; margin-top: -7px;
  border-radius: 50%;
  background: var(--starlight);
  box-shadow: 0 0 12px 2px rgba(255, 243, 218, 0.5);
}
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border: 0; border-radius: 50%;
  background: var(--starlight);
  box-shadow: 0 0 12px 2px rgba(255, 243, 218, 0.5);
}
input[type="range"]:focus-visible { outline: 1px solid var(--starlight); outline-offset: 4px; }

.range-labels { display: flex; justify-content: space-between; color: var(--ink-faint); font-size: var(--step--1); }
.range-value { margin: 0; text-align: center; font-style: italic; color: var(--starlight); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }

.more { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0.75rem 0; }
.more summary { cursor: pointer; color: var(--ink-muted); }
.more[open] summary { margin-bottom: 1rem; color: var(--ink); }
.more .field + .field { margin-top: 1.1rem; }
.hint { margin: 0.1rem 0 0; color: var(--ink-faint); font-size: var(--step--1); line-height: 1.5; }


/* ---------- Zeitreise ---------- */

.timebar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 2 * var(--gutter)));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.time-year {
  margin: 0;
  font-style: italic;
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  line-height: 1;
  color: var(--starlight);
  font-variant-numeric: oldstyle-nums;
}
.time-summary { margin: 0; color: var(--ink-muted); font-size: var(--step--1); }
.link[aria-pressed="true"]#btn-time { color: var(--starlight); }
.is-time .bottom, .is-time .legal { opacity: 0; pointer-events: none; }
.is-time .bottom .add { pointer-events: none; }

@media (max-width: 520px) {
  .top { flex-direction: column; gap: 6px; }
  .top-actions { gap: 16px; font-size: 0.9375rem; }
}

/* ---------- Schalter für die Umlaufbahnen ---------- */

.orbit-toggle {
  position: fixed;
  right: var(--gutter);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + 3px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(8, 12, 30, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.5s ease, border-color 0.5s ease, opacity 1.2s ease;
}
.orbit-toggle:hover { color: var(--ink); border-color: rgba(255, 243, 218, 0.35); }
.orbit-toggle[aria-pressed="true"] { color: var(--starlight); border-color: rgba(255, 243, 218, 0.45); }
.mode-auth .orbit-toggle, body:not(.mode-own):not(.mode-shared) .orbit-toggle { display: none; }
.is-map .orbit-toggle, .is-time .orbit-toggle { opacity: 0; pointer-events: none; }

.view-reset {
  position: fixed;
  right: calc(var(--gutter) + 54px);
  bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + 3px);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(8, 12, 30, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.5s ease, border-color 0.5s ease;
}
.view-reset:hover { color: var(--starlight); border-color: rgba(255, 243, 218, 0.35); }
.is-map .view-reset { right: var(--gutter); }
@media (max-width: 520px) {
  .view-reset { bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + 56px); right: var(--gutter); }
  .is-map .view-reset { bottom: calc(var(--gutter) + env(safe-area-inset-bottom) + 3px); }
}

/* ---------- Alle Sterne ---------- */

@media (min-width: 641px) {
  .panel.wide { width: min(860px, 100%); }
}

.list-tools { display: flex; flex-direction: column; gap: 12px; margin: 1.25rem 0 1rem; }
.list-tools input[type="search"] {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 300;
}
.list-tools input[type="search"]:focus { outline: none; border-color: rgba(255, 243, 218, 0.55); }
.list-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; }
.list-filters select {
  padding: 6px 30px 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 300;
  font-size: var(--step--1);
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-muted) 50%), linear-gradient(135deg, var(--ink-muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.list-filters select option { background: #0b1028; }
.segs { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.seg {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  font-size: var(--step--1);
  cursor: pointer;
}
.seg[aria-pressed="true"] { background: rgba(255, 243, 218, 0.12); color: var(--starlight); }

.table-wrap { overflow-x: auto; margin: 0 -8px; }
.star-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.star-table thead th { text-align: left; font-weight: 400; padding: 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.star-table thead button {
  background: none;
  border: 0;
  padding: 8px;
  color: var(--ink-faint);
  font-size: var(--step--1);
  cursor: pointer;
}
.star-table thead button:hover { color: var(--ink); }
.star-table th[aria-sort="ascending"] button, .star-table th[aria-sort="descending"] button { color: var(--starlight); }
.star-table th[aria-sort="ascending"] button::after { content: " ↑"; }
.star-table th[aria-sort="descending"] button::after { content: " ↓"; }
.star-table tbody tr { cursor: pointer; transition: background-color 0.3s ease; }
.star-table tbody tr:hover, .star-table tbody tr:focus-visible { background: rgba(255, 243, 218, 0.05); outline: none; }
.star-table tbody tr:focus-visible th { box-shadow: inset 2px 0 0 var(--starlight); }
.star-table tbody th, .star-table tbody td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(160, 178, 230, 0.08);
  text-align: left;
  font-weight: 300;
  color: var(--ink-muted);
  white-space: nowrap;
}
.star-table tbody th { color: var(--ink); font-style: italic; }
.star-table td[data-col="memories"] { text-align: center; }
.cell-name { display: inline-flex; align-items: center; gap: 10px; }
.cell-sub { display: none; }
.list-empty { text-align: center !important; font-style: italic; padding: 2rem 8px !important; color: var(--ink-faint) !important; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: rgb(var(--c)); box-shadow: 0 0 8px 1px rgba(var(--c), 0.6); }
.dot.is-eternal { box-shadow: 0 0 0 2px rgba(var(--c), 0.18), 0 0 8px 1px rgba(var(--c), 0.5); }
.dot.rel-familie { --c: 255, 214, 156; }
.dot.rel-partner { --c: 255, 186, 152; }
.dot.rel-freund { --c: 244, 244, 255; }
.dot.rel-bekannt { --c: 170, 192, 255; }
.dot.rel-tier { --c: 200, 230, 255; }

/* Schmale Bildschirme: kompakte Liste statt breiter Tabelle */
@media (max-width: 640px) {
  .star-table thead, .star-table td { display: none; }
  .star-table tbody tr { display: block; border-bottom: 1px solid rgba(160, 178, 230, 0.08); }
  .star-table tbody th { display: block; border: 0; white-space: normal; padding: 10px 6px; }
  .cell-sub { display: block; margin: 2px 0 0 17px; font-style: normal; font-size: var(--step--1); color: var(--ink-faint); }
  .list-empty { display: table-cell !important; }
}

@media (max-width: 520px) {
  .top-actions { flex-wrap: wrap; gap: 4px 16px; }
}
