/* ============================================================================
   codename baby — Designsprache "Zwischenlicht"
   ----------------------------------------------------------------------------
   Ruhiges, redaktionelles Interface: eine Display-Serife traegt die Namen,
   eine warme Grotesk die Bedienung. Salbei fuehrt durch die App, der
   warme Funken-Akzent bleibt Matches und Favoriten vorbehalten.
   Aufbau: 1 Tokens · 2 Basis · 3 Steuerelemente · 4 Einrichtung · 5 Huelle
           6 Entdecken · 7 Favoriten · 8 Matches · 9 Dialoge · 10 Match-Moment
           11 Feinschliff
   ========================================================================= */

/* -- 1 Tokens ------------------------------------------------------------ */

:root {
  color-scheme: light dark;

  /* Flaechen — warmer Lehm und Leinen, eine einzige Farbfamilie (Ton 72).
     Hell und Dunkel teilen sich diese Winkel, damit beide Modi denselben
     Charakter haben und sich nur in der Helligkeit unterscheiden. */
  --paper: oklch(0.964 0.016 72);
  --paper-deep: oklch(0.938 0.024 72);
  --card: oklch(0.992 0.008 72);
  --sunken: oklch(0.945 0.022 72);
  --raised: oklch(0.998 0.005 72);
  --shell-surface: oklch(0.964 0.016 72 / 0.76);
  --shell-surface-soft: oklch(0.964 0.016 72 / 0.58);
  --backdrop-opacity: 0.88;
  --backdrop-wash: oklch(0.964 0.016 72 / 0.16);

  /* Schrift — tiefes Umbra */
  --ink: oklch(0.282 0.03 58);
  --ink-soft: oklch(0.442 0.028 62);
  --ink-mute: oklch(0.492 0.026 66);
  --ink-faint: oklch(0.528 0.024 68);
  --on-dark: oklch(0.975 0.009 72);

  /* Linien */
  --line: oklch(0.868 0.022 72);
  --line-soft: oklch(0.912 0.017 72);
  --line-strong: oklch(0.8 0.03 72);

  /* Lehm — fuehrt durch die App.
     --primary traegt Text, Symbole und Fokus; --primary-fill die Flaechen.
     Ein einziger Ton koennte beides nicht: helle Erde ist als Schrift zu hell. */
  --primary: oklch(0.452 0.083 44);
  --primary-deep: oklch(0.375 0.078 44);
  --primary-lift: oklch(0.535 0.09 44);
  --primary-fill: oklch(0.715 0.088 44);
  --primary-fill-hover: oklch(0.655 0.098 42);
  --primary-tint: oklch(0.918 0.04 48);
  --primary-veil: oklch(0.96 0.022 52);
  --on-primary: oklch(0.235 0.05 44);

  /* Ocker — ausschliesslich Matches und Favoriten */
  --spark: oklch(0.815 0.098 86);
  --spark-strong: oklch(0.76 0.115 82);
  --spark-deep: oklch(0.468 0.093 72);
  --spark-tint: oklch(0.92 0.05 86);
  --spark-veil: oklch(0.963 0.028 86);
  --on-spark: oklch(0.255 0.07 70);

  /* Olive — die Zustimmung: Like-Knopf und Like-Striche der Rundenleiste */
  --affirm: oklch(0.685 0.085 132);
  --affirm-hover: oklch(0.625 0.095 132);

  /* Ablehnung: gebrannter Ton, kein Alarmrot */
  --refuse: oklch(0.505 0.093 26);
  --refuse-tint: oklch(0.948 0.03 26);

  /* Geschlechtsreiter — bewusst klarer als die neutrale Grundpalette */
  --girl: oklch(0.485 0.145 20);
  --girl-tint: oklch(0.935 0.045 20);
  --boy: oklch(0.465 0.135 245);
  --boy-tint: oklch(0.93 0.045 245);

  /* Daemmerung — staerkster Treffer, Toast und Match-Moment */
  --night: oklch(0.305 0.04 58);
  --night-deep: oklch(0.238 0.034 58);
  --feature-glow: oklch(0.8 0.11 80 / 0.5);
  --on-feature: oklch(0.975 0.011 72);
  --on-feature-soft: oklch(0.86 0.024 76);
  --overlay-bg: oklch(0.225 0.036 58);
  --overlay-glow-a: oklch(0.72 0.12 78 / 0.42);
  --overlay-glow-b: oklch(0.55 0.095 44 / 0.5);
  --overlay-hairline: oklch(1 0 0 / 0.22);
  --overlay-wash: oklch(1 0 0 / 0.09);

  /* Einzelrollen */
  --scrim: oklch(0.265 0.035 60 / 0.44);
  --avatar-warm-bg: oklch(0.882 0.055 78);
  --avatar-warm-ink: oklch(0.375 0.085 56);
  --online: oklch(0.61 0.09 140);

  /* Typografie */
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --text-micro: 0.6875rem;
  --text-label: 0.8125rem;
  --text-small: 0.875rem;
  --text-body: 0.9375rem;
  --text-lead: 1.0625rem;
  --text-title: 1.1875rem;
  --text-head: clamp(1.5rem, 5vw, 1.875rem);
  --text-page: clamp(1.95rem, 7.2vw, 2.85rem);
  --text-hero: clamp(2.9rem, 15vw, 4.35rem);

  /* Raster */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-14: 3.5rem;
  --gutter: clamp(1.15rem, 5vw, 1.75rem);

  /* Radien */
  --r-xs: 7px;
  --r-sm: 11px;
  --r-md: 15px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-card: 28px;
  --r-pill: 999px;

  /* Tiefe — eine Lichtquelle, zwei Stufen */
  --lift-1: 0 1px 2px -1px oklch(0.28 0.035 92 / 0.1), 0 4px 10px -6px oklch(0.28 0.035 92 / 0.14);
  --lift-2: 0 1px 2px -1px oklch(0.28 0.035 92 / 0.08), 0 14px 32px -14px oklch(0.28 0.035 92 / 0.26);
  --lift-3: 0 2px 4px -2px oklch(0.28 0.035 92 / 0.1), 0 30px 60px -24px oklch(0.28 0.035 92 / 0.34);

  /* Bewegung */
  --ease: cubic-bezier(0.22, 0.61, 0.28, 1);
  --ease-soft: cubic-bezier(0.32, 0.08, 0.24, 1);
  --ease-spring: cubic-bezier(0.2, 1.3, 0.42, 1);

  --z-nav: 20;
  --z-sticky: 30;
  --z-dialog: 50;
  --z-overlay: 60;
  --z-toast: 70;

  /* Feines Korn — nimmt den Flaechen das Digitale */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain-strength: 0.05;
  --grain-blend: multiply;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: oklch(0.196 0.018 72);
    --paper-deep: oklch(0.166 0.016 72);
    --card: oklch(0.245 0.021 72);
    --sunken: oklch(0.22 0.019 72);
    --raised: oklch(0.275 0.023 72);
    --shell-surface: oklch(0.196 0.018 72 / 0.8);
    --shell-surface-soft: oklch(0.196 0.018 72 / 0.62);
    --backdrop-opacity: 0.85;
    --backdrop-wash: oklch(0.13 0.018 72 / 0.66);

    --ink: oklch(0.955 0.01 72);
    --ink-soft: oklch(0.79 0.018 72);
    --ink-mute: oklch(0.7 0.02 72);
    --ink-faint: oklch(0.628 0.022 72);
    --on-dark: oklch(0.97 0.009 72);

    --line: oklch(0.338 0.022 72);
    --line-soft: oklch(0.29 0.02 72);
    --line-strong: oklch(0.425 0.028 72);

    --primary: oklch(0.795 0.075 48);
    --primary-deep: oklch(0.865 0.06 52);
    --primary-lift: oklch(0.725 0.085 46);
    --primary-fill: oklch(0.655 0.098 44);
    --primary-fill-hover: oklch(0.715 0.09 44);
    --primary-tint: oklch(0.31 0.048 46);
    --primary-veil: oklch(0.262 0.03 48);
    --on-primary: oklch(0.175 0.035 44);

    --spark: oklch(0.825 0.1 86);
    --spark-strong: oklch(0.875 0.088 88);
    --spark-deep: oklch(0.862 0.092 88);
    --spark-tint: oklch(0.318 0.05 82);
    --spark-veil: oklch(0.265 0.03 82);
    --on-spark: oklch(0.2 0.048 70);

    --affirm: oklch(0.705 0.095 134);
    --affirm-hover: oklch(0.765 0.085 134);

    --refuse: oklch(0.735 0.095 30);
    --refuse-tint: oklch(0.302 0.042 28);

    --girl: oklch(0.77 0.105 20);
    --girl-tint: oklch(0.305 0.055 20);
    --boy: oklch(0.77 0.095 245);
    --boy-tint: oklch(0.3 0.05 245);

    --night: oklch(0.158 0.02 72);
    --night-deep: oklch(0.128 0.017 72);
    --feature-glow: oklch(0.78 0.12 80 / 0.45);
    --on-feature: oklch(0.97 0.009 72);
    --on-feature-soft: oklch(0.83 0.024 76);
    --overlay-bg: oklch(0.132 0.018 72);
    --overlay-glow-a: oklch(0.62 0.13 78 / 0.4);
    --overlay-glow-b: oklch(0.46 0.09 44 / 0.5);
    --overlay-hairline: oklch(1 0 0 / 0.2);
    --overlay-wash: oklch(1 0 0 / 0.08);

    --scrim: oklch(0.112 0.015 72 / 0.6);
    --avatar-warm-bg: oklch(0.45 0.065 78);
    --avatar-warm-ink: oklch(0.94 0.045 84);
    --online: oklch(0.7 0.1 140);

    --lift-1: 0 1px 2px -1px oklch(0 0 0 / 0.5), 0 4px 10px -6px oklch(0 0 0 / 0.55);
    --lift-2: 0 1px 2px -1px oklch(0 0 0 / 0.5), 0 16px 34px -16px oklch(0 0 0 / 0.7);
    --lift-3: 0 2px 4px -2px oklch(0 0 0 / 0.5), 0 34px 64px -26px oklch(0 0 0 / 0.8);

    --grain-strength: 0.055;
    --grain-blend: screen;
  }
}

/* -- 2 Basis ------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper-deep);
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background: var(--paper-deep);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  font-weight: 450;
  line-height: 1.55;
  letter-spacing: -0.003em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Das fotografische Motiv bleibt fest im Viewport. Die ruhige Bildmitte liegt
   hinter den Inhalten; Mobile, Sterne, Stoffe und Holz rahmen die App ein. */
/* Eine einzige fixierte Ebene, bewusst ohne filter und ohne mix-blend-mode:
   beides zwingt den Browser, die ganze Flaeche bei jedem Scrollschritt neu zu
   rastern – das war die Ursache fuer das Flimmern. Die Stimmung liefert jetzt
   eine Farbschicht im selben Hintergrund, die Ebene selbst wird per
   translateZ einmalig komponiert und danach nur noch verschoben.
   Das Korn liegt weiterhin auf Karte und Trefferflaeche, wo es lokal und
   damit guenstig ist. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(var(--backdrop-wash), var(--backdrop-wash)),
    url("/assets/baby-app-background.jpg?v=16");
  background-position: center top, center top;
  background-size: cover, cover;
  background-repeat: no-repeat, no-repeat;
  opacity: var(--backdrop-opacity);
  transform: translateZ(0);
  will-change: transform;
  backface-visibility: hidden;
  pointer-events: none;
}

.app-root {
  position: relative;
  z-index: 2;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-variation-settings: "SOFT" 24, "WONK" 0;
  letter-spacing: -0.022em;
  line-height: 1.08;
  text-wrap: balance;
  color: var(--ink);
}

p {
  margin: 0;
}

/* Browser geben <dd> von Haus aus 40px Einzug. In den schmalen Spalten des
   Namensprofils blieben davon nur 49 statt 90 Pixel uebrig – daher brachen
   Laendernamen dort mitten im Wort um. */
dl,
dd {
  margin: 0;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

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

button {
  background: none;
  border: 0;
  cursor: pointer;
}

button,
summary,
label {
  -webkit-tap-highlight-color: transparent;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 0.28em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--raised);
  font-family: inherit;
  font-size: 0.92em;
  line-height: 1;
  color: var(--ink-soft);
}

.hidden,
[hidden] {
  display: none !important;
}

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

.view {
  position: relative;
  z-index: 0;
  min-height: 100dvh;
}

/* Marke */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  letter-spacing: -0.028em;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--primary-fill);
  color: var(--on-primary);
  box-shadow: inset 0 1px 0 oklch(1 0 0 / 0.28);
}

.brand-mark svg {
  width: 21px;
  fill: currentColor;
  stroke: none;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--paper);
  font-size: var(--text-micro);
  font-weight: 650;
  letter-spacing: 0.02em;
}

/* Bewusst keine geschlechtlich codierten Farben: zwei Toene derselben Familie. */
.avatar-you {
  background: var(--primary-fill);
  color: var(--on-primary);
}

.avatar-partner {
  background: var(--avatar-warm-bg);
  color: var(--avatar-warm-ink);
  margin-left: -0.5rem;
}

/* -- Einstieg in eine gemeinsame Runde ---------------------------------- */

.room-gate {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  padding-bottom: calc(var(--space-10) + env(safe-area-inset-bottom));
  background:
    radial-gradient(52% 32% at 88% 2%, var(--spark-veil) 0%, transparent 72%),
    radial-gradient(58% 42% at 6% 15%, var(--primary-veil) 0%, transparent 74%),
    var(--shell-surface-soft);
}

.room-gate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  width: min(100%, 980px);
  margin: 0 auto;
  padding: max(var(--space-5), env(safe-area-inset-top)) var(--gutter) var(--space-5);
}

.gate-tools,
.setup-header-tools {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.language-picker {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: var(--r-pill);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  color: var(--ink-soft);
}

.language-picker:focus-within {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.language-picker svg {
  position: absolute;
  left: 0.7rem;
  width: 16px;
  pointer-events: none;
}

.language-picker select {
  min-height: 44px;
  padding: 0.35rem 1.8rem 0.35rem 2rem;
  border: 0;
  border-radius: inherit;
  background: transparent;
  appearance: auto;
  font-size: var(--text-label);
  font-weight: 650;
  cursor: pointer;
}

.language-picker select:focus-visible {
  outline: 0;
}

.app-bar-language-picker {
  min-height: 40px;
}

.app-bar-language-picker select {
  min-height: 40px;
  min-width: 50px;
  padding: 0.3rem 0.45rem;
  text-align: center;
}

.private-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.7rem;
  border-radius: var(--r-pill);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-size: var(--text-micro);
  font-weight: 600;
  color: var(--ink-mute);
  white-space: nowrap;
}

.private-pill svg {
  width: 14px;
}

.room-gate-main {
  display: grid;
  gap: var(--space-8);
  width: min(100%, 980px);
  margin: 0 auto;
  padding: clamp(2rem, 8vh, 5.5rem) var(--gutter) 0;
}

.room-gate-copy h1 {
  max-width: 14ch;
  font-size: clamp(2.25rem, 10vw, 4.9rem);
  font-weight: 430;
  font-variation-settings: "SOFT" 35, "WONK" 1;
  letter-spacing: -0.04em;
}

.room-gate-copy > p {
  max-width: 46ch;
  margin-top: var(--space-5);
  font-size: var(--text-lead);
  line-height: 1.55;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.room-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--lift-2), inset 0 0 0 1px var(--line-soft);
}

.identity-field,
.join-code-field label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.identity-field > span,
.join-code-field label > span {
  font-size: var(--text-label);
  font-weight: 650;
}

.join-code-field {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
}

.room-actions {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.room-card button {
  width: 100%;
}

.solo-button {
  margin-top: var(--space-3);
}

.room-error {
  padding: 0.8rem 0.95rem;
  border-radius: var(--r-sm);
  background: var(--refuse-tint);
  font-size: var(--text-label);
  color: var(--refuse);
}

.room-waiting {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 260px;
  justify-content: center;
  text-align: center;
}

.room-waiting h2 {
  margin-top: var(--space-5);
  font-size: var(--text-head);
}

.room-waiting > p {
  max-width: 34ch;
  margin-top: var(--space-3);
  color: var(--ink-mute);
}

.room-waiting .room-actions {
  width: 100%;
}

.waiting-orbit {
  position: relative;
  width: 54px;
  height: 54px;
  animation: waiting-spin 2.8s linear infinite;
}

.waiting-orbit i {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: var(--r-pill);
  background: var(--primary);
}

.waiting-orbit i:nth-child(1) { top: 1px; left: 22px; }
.waiting-orbit i:nth-child(2) { right: 3px; bottom: 9px; background: var(--spark); }
.waiting-orbit i:nth-child(3) { left: 3px; bottom: 9px; opacity: 0.45; }

@keyframes waiting-spin { to { transform: rotate(360deg); } }

.room-trust-grid {
  display: grid;
  gap: var(--space-4);
}

.room-trust-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-left: var(--space-4);
  border-left: 2px solid var(--line);
}

.room-trust-grid strong {
  font-size: var(--text-label);
  font-weight: 650;
}

.room-trust-grid span {
  font-size: var(--text-label);
  color: var(--ink-mute);
}

.gate-legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2) var(--space-4);
  width: 100%;
  margin-top: var(--space-2);
  color: var(--ink-mute);
  font-size: var(--text-label);
}

.gate-legal-links a,
.settings-legal-links a {
  color: inherit;
  font-weight: 650;
  text-decoration-color: color-mix(in oklab, currentColor 42%, transparent);
  text-underline-offset: 0.2em;
}

.gate-legal-links a:hover,
.settings-legal-links a:hover {
  color: var(--primary);
  text-decoration-thickness: 2px;
}

/* -- 3 Steuerelemente ---------------------------------------------------- */

.primary-button,
.secondary-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 var(--space-5);
  border-radius: var(--r-md);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
    box-shadow 0.18s var(--ease), transform 0.14s var(--ease);
}

.primary-button {
  background: var(--primary-fill);
  color: var(--on-primary);
  box-shadow: var(--lift-1), inset 0 1px 0 oklch(1 0 0 / 0.2);
}

.primary-button:hover:not(:disabled) {
  background: var(--primary-fill-hover);
}

.primary-button:active:not(:disabled) {
  transform: translateY(1px);
}

.primary-button:disabled {
  background: var(--sunken);
  color: var(--ink-faint);
  box-shadow: none;
}

.primary-button svg {
  width: 17px;
  stroke-width: 2;
}

.secondary-button {
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line);
}

.secondary-button:hover {
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.secondary-button svg {
  width: 18px;
}

.small-button {
  min-height: 38px;
  padding: 0 var(--space-4);
  border-radius: var(--r-sm);
  font-size: var(--text-label);
  background: var(--primary-fill);
  color: var(--on-primary);
}

.small-button:hover {
  background: var(--primary-fill-hover);
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0;
  color: var(--primary);
  font-size: var(--text-label);
  font-weight: 600;
  transition: color 0.16s var(--ease);
}

.text-button:hover {
  color: var(--primary-deep);
}

.text-button svg {
  width: 16px;
  stroke-width: 2;
}

.quiet-link {
  color: var(--ink-mute);
  font-weight: 500;
}

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

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.icon-button svg {
  width: 19px;
}

.icon-button:hover {
  background: var(--sunken);
  color: var(--ink);
}

.icon-button.quiet {
  color: var(--ink-mute);
}

/* Felder */

input[type="text"],
input:not([type]),
select {
  width: 100%;
  min-height: 48px;
  padding: 0 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  font-size: var(--text-body);
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

input::placeholder {
  color: var(--ink-faint);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

input:disabled,
select:disabled {
  background: var(--sunken);
  color: var(--ink-faint);
  border-style: dashed;
  cursor: not-allowed;
}

select {
  appearance: none;
  padding-right: 2.4rem;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 1.15rem) calc(50% + 1px), calc(100% - 0.85rem) calc(50% + 1px);
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

/* Segmentierte Auswahl */

.segmented-control {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.segmented-control label {
  position: relative;
}

.segmented-control input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.segmented-control span {
  display: grid;
  place-items: center;
  min-height: 40px;
  padding: 0 0.35rem;
  border-radius: calc(var(--r-md) - 4px);
  font-size: var(--text-label);
  font-weight: 550;
  color: var(--ink-mute);
  white-space: nowrap;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.segmented-control input:checked + span {
  background: var(--card);
  color: var(--ink);
  font-weight: 650;
  box-shadow: var(--lift-1);
}

.segmented-control input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

/* Auswahlzeilen */

.choice-list {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-3);
  border-top: 1px solid var(--line-soft);
}

.choice-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.choice-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.choice-copy strong {
  font-size: var(--text-body);
  font-weight: 600;
}

.choice-copy small {
  font-size: var(--text-small);
  color: var(--ink-mute);
}

.choice-row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-dot {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  transition: box-shadow 0.18s var(--ease);
}

.choice-row input:checked ~ .radio-dot {
  box-shadow: inset 0 0 0 7px var(--primary);
}

.choice-row input:focus-visible ~ .radio-dot {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: var(--text-small);
  color: var(--ink-soft);
  cursor: pointer;
}

.checkbox-row input,
.multi-select-options input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Aufklappbare Mehrfachauswahl */

.multi-select,
.surname-details {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  overflow: hidden;
}

.multi-select {
  margin-top: var(--space-3);
}

.multi-select summary,
.surname-details summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: 0.7rem 0.95rem;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.16s var(--ease);
}

.multi-select summary::-webkit-details-marker,
.surname-details summary::-webkit-details-marker {
  display: none;
}

.multi-select summary:hover,
.surname-details summary:hover {
  background: var(--sunken);
}

.multi-select summary > span:first-child {
  font-size: var(--text-body);
  font-weight: 600;
}

.multi-select summary strong {
  margin-left: auto;
  font-size: var(--text-label);
  font-weight: 550;
  color: var(--ink-mute);
}

.multi-select summary svg,
.surname-details summary svg {
  flex: none;
  width: 18px;
  color: var(--ink-mute);
  stroke-width: 2;
  transition: transform 0.22s var(--ease);
}

.multi-select[open] summary svg,
.surname-details[open] summary svg {
  transform: rotate(180deg);
}

.multi-select-options {
  display: grid;
  gap: 1px;
  padding: 0 0.95rem 0.85rem;
  border-top: 1px solid var(--line-soft);
}

.multi-select-options label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.multi-select-options label:last-child {
  border-bottom: 0;
}

.multi-select-options span {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.multi-select-options strong {
  font-size: var(--text-small);
  font-weight: 600;
}

.multi-select-options small {
  font-size: var(--text-label);
  color: var(--ink-mute);
}

.multi-select-options label:has(input:checked) strong {
  color: var(--primary);
}

.compact-options small {
  display: none;
}

/* -- 4 Einrichtung ------------------------------------------------------- */

.setup-view {
  display: flex;
  flex-direction: column;
  background: var(--shell-surface);
}

.setup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-5) var(--gutter);
}

.setup-header-tools {
  justify-content: flex-end;
}

.rail-language-picker {
  margin-top: var(--space-3);
}

@media (max-width: 420px) {
  .room-gate-header .private-pill {
    display: none;
  }

  .setup-header .room-mini-label {
    display: none;
  }
}

.room-mini {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.room-mini-label {
  font-size: var(--text-label);
  color: var(--ink-mute);
}

.setup-main {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-4) var(--gutter) var(--space-14);
}

.setup-copy {
  margin-bottom: var(--space-8);
}

.step-count {
  display: block;
  margin-bottom: var(--space-4);
  font-size: var(--text-micro);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}

#setup-title {
  max-width: 17ch;
  font-size: var(--text-page);
  font-variation-settings: "SOFT" 40, "WONK" 1;
  outline: none;
}

.setup-description,
#setup-description {
  margin-top: var(--space-4);
  max-width: 46ch;
  font-size: var(--text-lead);
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  /* Der Scroll-Anchor des Browsers wuerde den Sprung nach oben zuruecknehmen. */
  overflow-anchor: none;
}

/* Fortschritt der Einrichtung */

.funnel-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.funnel-progress li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.1rem;
}

.funnel-progress li span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--text-micro);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink-mute);
  transition: background-color 0.24s var(--ease), color 0.24s var(--ease),
    box-shadow 0.24s var(--ease);
}

.funnel-progress li strong {
  font-size: var(--text-micro);
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: color 0.24s var(--ease);
}

/* Verbindungslinie zwischen den Schritten */
.funnel-progress li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 13px;
  left: 34px;
  right: 10px;
  height: 1px;
  background: var(--line);
}

.funnel-progress li.complete span {
  background: var(--primary-tint);
  box-shadow: inset 0 0 0 1px transparent;
  color: var(--primary);
}

.funnel-progress li.complete strong {
  color: var(--ink-mute);
}

.funnel-progress li.active span {
  background: var(--primary-fill);
  box-shadow: inset 0 0 0 1px transparent, 0 0 0 4px var(--primary-veil);
  color: var(--on-primary);
}

.funnel-progress li.active strong {
  color: var(--ink);
}

.funnel-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.funnel-step.active {
  animation: step-in 0.36s var(--ease) both;
}

@keyframes step-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.legend-note {
  margin-left: 0.4rem;
  font-size: var(--text-micro);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field-hint {
  margin-top: var(--space-3);
  font-size: var(--text-label);
  color: var(--ink-mute);
  text-wrap: pretty;
}

/* Fester Name */

.fixed-name-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding: var(--space-5);
  border-radius: var(--r-lg);
  background: var(--primary-veil);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.fixed-name-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.fixed-name-copy strong {
  font-size: var(--text-body);
  font-weight: 600;
}

.fixed-name-copy span {
  font-size: var(--text-label);
  color: var(--ink-soft);
  text-wrap: pretty;
}

.fixed-name-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.fixed-name-field > span {
  font-size: var(--text-label);
  font-weight: 600;
}

.fixed-position {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
}

.fixed-position label {
  position: relative;
}

.fixed-position input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.fixed-position span {
  display: grid;
  place-items: center;
  min-height: 42px;
  padding: 0 0.6rem;
  border-radius: var(--r-sm);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--text-label);
  font-weight: 550;
  color: var(--ink-soft);
  text-align: center;
  transition: box-shadow 0.18s var(--ease), color 0.18s var(--ease);
}

.fixed-position input:checked + span {
  color: var(--primary);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.fixed-position input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Feinsuche */

.search-criteria {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.search-criteria label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.search-criteria label > span {
  font-size: var(--text-label);
  font-weight: 600;
}

.search-criteria small {
  font-size: var(--text-label);
  color: var(--ink-mute);
}

.surname-intro {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-top: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--r-md);
  background: var(--primary-veil);
}

.surname-intro strong {
  font-size: var(--text-body);
  font-weight: 600;
}

.surname-intro span {
  font-size: var(--text-label);
  color: var(--ink-soft);
  text-wrap: pretty;
}

.surname-fields {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.surname-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.surname-fields label > span {
  font-size: var(--text-label);
  font-weight: 600;
}

.surname-fields small {
  font-size: var(--text-micro);
  color: var(--ink-mute);
  text-wrap: pretty;
}

.surname-mode-fields {
  margin-top: var(--space-5);
}

.surname-mode-label {
  display: block;
  margin-bottom: var(--space-2);
  font-size: var(--text-label);
  font-weight: 600;
}

.surname-mode {
  display: grid;
  gap: var(--space-2);
}

.surname-mode label {
  position: relative;
  cursor: pointer;
}

.surname-mode input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.surname-mode label > span {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--line);
  background: var(--card);
  transition: background-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.surname-mode strong {
  font-size: var(--text-small);
  font-weight: 600;
}

.surname-mode small {
  font-size: var(--text-label);
  color: var(--ink-mute);
}

.surname-mode input:checked + span {
  background: var(--primary-veil);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.surname-mode input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.surname-example {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
}

.surname-example span {
  font-size: var(--text-micro);
  font-weight: 650;
  color: var(--ink-mute);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.surname-example strong {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 450;
  letter-spacing: -0.018em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Ergebnisvorschau */

.result-preview {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: var(--space-5) 0 0;
  border-top: 1px solid var(--line);
}

.result-preview strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  font-variation-settings: "SOFT" 30;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.result-preview span {
  font-size: var(--text-label);
  color: var(--ink-mute);
  text-wrap: pretty;
}

/* Aktionsleiste der Einrichtung */

.funnel-actions {
  position: sticky;
  bottom: 0;
  z-index: var(--z-sticky);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: var(--space-4) calc(var(--gutter) * -1) 0;
  padding: var(--space-4) var(--gutter) calc(var(--space-4) + env(safe-area-inset-bottom));
  background: color-mix(in oklab, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-top: 1px solid var(--line-soft);
}

.funnel-actions .primary-button {
  flex: 1;
  min-width: 0;
}

.funnel-actions .primary-button span:first-child,
.funnel-actions #start-button-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.funnel-back {
  flex: none;
  padding: 0 var(--space-5);
}

.settings-cancel {
  flex-basis: 100%;
  background: transparent;
  box-shadow: none;
  color: var(--ink-mute);
  font-weight: 500;
  min-height: 40px;
}

.settings-cancel:hover {
  background: transparent;
  box-shadow: none;
  color: var(--ink);
}

.room-management {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-top: var(--space-6);
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line);
}

.room-management > div {
  min-width: 0;
}

.room-management h2 {
  font-size: var(--text-title);
}

.room-management p {
  max-width: 44ch;
  margin-top: var(--space-1);
  color: var(--ink-mute);
  font-size: var(--text-label);
  line-height: 1.45;
  text-wrap: pretty;
}

.room-management .secondary-button {
  flex: none;
}

/* -- 5 App-Huelle -------------------------------------------------------- */

.main-view {
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  background: transparent;
}

.session-rail {
  display: none;
}

.mobile-app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  background: var(--shell-surface);
  overflow: hidden;
}

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  padding: max(var(--space-3), env(safe-area-inset-top)) var(--gutter) var(--space-3);
}

.app-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.mobile-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 500;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  letter-spacing: -0.028em;
}

.mobile-brand .brand-mark {
  width: 27px;
  height: 27px;
  border-radius: 9px;
}

.mobile-brand .brand-mark svg {
  width: 19px;
}

.screen-container {
  position: relative;
  flex: 1;
  min-height: 0;
}

.app-screen {
  display: none;
  flex-direction: column;
  height: 100%;
  padding: 0 var(--gutter);
}

.app-screen.active {
  display: flex;
  animation: screen-in 0.32s var(--ease) both;
}

#likes-screen.active,
#favorites-screen.active,
#matches-screen.active {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: var(--space-8);
}

/* In einer scrollenden Flex-Spalte wuerden die Bloecke sonst zusammengestaucht,
   statt die Spalte laenger zu machen. */
#likes-screen > *,
#favorites-screen > *,
#matches-screen > * {
  flex: none;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.screen-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex: none;
  padding: var(--space-2) 0 var(--space-5);
}

.screen-heading h1 {
  font-size: var(--text-head);
  font-variation-settings: "SOFT" 40, "WONK" 1;
  outline: none;
}

.screen-heading p {
  margin-top: 0.4rem;
  max-width: 34ch;
  font-size: var(--text-label);
  color: var(--ink-mute);
  text-wrap: pretty;
}

.count-badge {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 30px;
  height: 30px;
  padding: 0 0.5rem;
  border-radius: var(--r-pill);
  background: var(--primary-tint);
  color: var(--primary);
  font-size: var(--text-label);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.count-badge.match-count {
  background: var(--spark-tint);
  color: var(--spark-deep);
}

.count-badge.like-count {
  background: var(--primary-tint);
  color: var(--primary);
}

#favorite-count {
  background: var(--spark-tint);
  color: var(--spark-deep);
}

.heading-with-symbol {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: var(--space-3);
  min-width: 0;
}

.heading-symbol {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  margin-top: 0.1rem;
  border-radius: var(--r-sm);
}

.heading-symbol svg {
  width: 19px;
  stroke-width: 1.8;
}

.like-symbol {
  background: var(--primary-tint);
  color: var(--primary);
}

.like-symbol svg {
  fill: currentColor;
  stroke: none;
}

.favorite-symbol {
  background: var(--spark-tint);
  color: var(--spark-deep);
}

.favorite-symbol svg {
  fill: currentColor;
  stroke: none;
}

.match-symbol {
  background: var(--night);
  color: var(--spark);
}

.chat-symbol {
  background: var(--primary-tint);
  color: var(--primary);
}

.chat-count {
  background: var(--primary-tint);
  color: var(--primary);
}

/* Untere Navigation */

.bottom-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  flex: none;
  padding: var(--space-2) var(--space-2) calc(var(--space-2) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: blur(14px);
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.24rem;
  padding: 0.5rem 0.25rem 0.4rem;
  border-radius: var(--r-sm);
  color: var(--ink-mute);
  font-size: var(--text-micro);
  font-weight: 550;
  letter-spacing: 0.01em;
  transition: color 0.18s var(--ease);
}

.nav-item svg {
  width: 21px;
  stroke-width: 1.6;
  transition: transform 0.24s var(--ease-spring);
}

.nav-item:hover {
  color: var(--ink-soft);
}

.nav-item.active {
  color: var(--ink);
  font-weight: 650;
}

.nav-item.active svg {
  stroke-width: 1.9;
  transform: translateY(-1px);
}

.likes-nav.active {
  background: var(--primary-tint);
  color: var(--primary);
}

.likes-nav.active svg {
  fill: currentColor;
  stroke: none;
}

.favorites-nav {
  color: var(--spark-deep);
}

.favorites-nav.active {
  background: var(--spark-veil);
  color: var(--spark-deep);
}

.favorites-nav svg,
.favorites-nav.active svg {
  fill: currentColor;
  stroke: none;
}

.chat-nav.active {
  background: var(--primary-veil);
  color: var(--primary);
}

.matches-nav {
  color: var(--spark-deep);
}

.matches-nav.active {
  background: var(--night);
  color: var(--on-dark);
}

.nav-dot {
  position: absolute;
  top: 0.45rem;
  left: 50%;
  margin-left: 6px;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--primary);
  box-shadow: 0 0 0 2px var(--paper);
}

.nav-dot.match-dot {
  background: var(--spark);
}

.nav-dot.like-dot {
  background: var(--primary);
}

/* -- 8 Rundenchat -------------------------------------------------------- */

#chat-screen {
  padding-bottom: 0;
}

.chat-heading {
  padding-bottom: var(--space-3);
}

.chat-messages {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: var(--space-4);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-2) 0 var(--space-5);
  scroll-behavior: smooth;
  scrollbar-width: thin;
}

.chat-date-divider {
  align-self: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-pill);
  background: var(--sunken);
  color: var(--ink-mute);
  font-size: var(--text-micro);
  font-weight: 600;
}

.chat-message-row {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.chat-message-row.own {
  align-items: flex-end;
}

.chat-message-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.25rem;
  color: var(--ink-mute);
  font-size: var(--text-micro);
  font-variant-numeric: tabular-nums;
}

.chat-message-meta time {
  white-space: nowrap;
}

.chat-message-action {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -0.45rem -0.35rem -0.45rem 0;
  border-radius: var(--r-xs);
  color: var(--ink-faint);
}

.chat-message-action:hover,
.chat-message-action:focus-visible {
  background: var(--sunken);
  color: var(--ink);
}

.chat-message-action:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.chat-message-action svg {
  width: 17px;
}

.chat-message-meta strong {
  color: var(--ink-soft);
  font-weight: 650;
}

.chat-bubble {
  max-width: min(84%, 31rem);
  padding: 0.72rem 0.9rem;
  border-radius: 0.35rem var(--r-md) var(--r-md) var(--r-md);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-soft), var(--lift-1);
  color: var(--ink);
  font-size: var(--text-body);
  line-height: 1.42;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.chat-message-row.own .chat-bubble {
  border-radius: var(--r-md) 0.35rem var(--r-md) var(--r-md);
  background: var(--primary-fill);
  box-shadow: none;
  color: var(--on-primary);
}

.chat-expiry-note {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0 0.25rem;
  color: var(--ink-faint);
  font-size: var(--text-micro);
}

.chat-expiry-note svg {
  width: 12px;
  stroke-width: 1.9;
}

.chat-empty {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: var(--space-8) var(--space-5);
  text-align: center;
}

.chat-empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-2);
  border-radius: var(--r-md);
  background: var(--primary-tint);
  color: var(--primary);
}

.chat-empty-icon svg {
  width: 23px;
}

.chat-empty strong {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 430;
}

.chat-empty > span:last-child {
  max-width: 31ch;
  color: var(--ink-mute);
  font-size: var(--text-label);
  text-wrap: pretty;
}

.chat-composer {
  flex: none;
  margin: 0 calc(var(--gutter) * -1);
  padding: var(--space-3) var(--gutter);
  border-top: 1px solid var(--line-soft);
  background: color-mix(in oklab, var(--paper) 94%, transparent);
  backdrop-filter: blur(14px);
}

.chat-message-field {
  display: block;
}

#chat-message {
  display: block;
  width: 100%;
  min-height: 46px;
  max-height: 112px;
  padding: 0.72rem 0.9rem;
  resize: none;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
  transition: border-color 0.16s var(--ease), box-shadow 0.16s var(--ease);
}

#chat-message::placeholder {
  color: var(--ink-faint);
}

#chat-message:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

.chat-compose-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.chat-expiry-field {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-expiry-field > span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ink-mute);
  font-size: var(--text-micro);
  font-weight: 600;
}

.chat-expiry-field > span svg {
  width: 13px;
}

#chat-expiry {
  width: auto;
  min-width: 9rem;
  min-height: 40px;
  padding-left: 0.75rem;
  font-size: var(--text-label);
}

.chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 7.2rem;
  min-height: 42px;
  padding: 0 var(--space-4);
  border-radius: var(--r-sm);
  background: var(--primary-fill);
  color: var(--on-primary);
  font-size: var(--text-label);
  font-weight: 650;
  transition: background-color 0.16s var(--ease), transform 0.14s var(--ease);
}

.chat-send:hover:not(:disabled) {
  background: var(--primary-fill-hover);
}

.chat-send:active:not(:disabled) {
  transform: translateY(1px);
}

.chat-send:disabled {
  background: var(--sunken);
  color: var(--ink-faint);
}

.chat-send svg {
  width: 17px;
  stroke-width: 2;
}

.chat-privacy {
  margin-top: var(--space-2);
  color: var(--ink-faint);
  font-size: var(--text-micro);
  line-height: 1.35;
}

#chat-solo-note {
  margin-top: var(--space-3);
}

/* -- 6 Entdecken --------------------------------------------------------- */

#discover-screen {
  padding-bottom: var(--space-3);
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex: none;
  padding: var(--space-2) 0 var(--space-4);
}

.progress-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.add-name-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 0.7rem;
  border-radius: var(--r-sm);
  background: var(--primary-veil);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-size: var(--text-label);
  font-weight: 650;
  white-space: nowrap;
  transition: background-color 0.16s var(--ease), box-shadow 0.16s var(--ease), transform 0.14s var(--ease);
}

.add-name-button:hover {
  background: var(--primary-tint);
  box-shadow: inset 0 0 0 1px var(--primary-fill);
}

.add-name-button:active {
  transform: translateY(1px);
}

.add-name-button svg {
  width: 16px;
  stroke-width: 2;
}

.quick-filters-button {
  background: var(--sunken);
  color: var(--ink-soft);
}

.filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding-inline: 0.25rem;
  border-radius: var(--r-pill);
  background: var(--primary);
  color: var(--card);
  font-size: var(--text-micro);
  font-variant-numeric: tabular-nums;
}

.screen-title {
  font-family: var(--font-display);
  font-size: var(--text-head);
  font-weight: 500;
  font-variation-settings: "SOFT" 40, "WONK" 1;
  letter-spacing: -0.024em;
  line-height: 1.1;
}

.screen-subtitle {
  margin-top: 0.2rem;
  font-size: var(--text-label);
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

/* Kartenstapel */

/* -- Runde: Fortschritt, Abschluss, Haptik ------------------------------- */

.round-rail {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: none;
  padding: 0 0 var(--space-4);
}

.round-ticks {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
}

.round-ticks i {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--line);
  transform-origin: 50% 100%;
  transition: background-color 0.28s var(--ease), transform 0.28s var(--ease);
}

/* Ein Nein ist kein Fehlschlag, nur eine getroffene Entscheidung: neutrales
   Grau statt Warnfarbe. In der Erdpalette liegen gedaempfte Mischtoene zu nah
   an der Olive der Likes – deshalb der klar entsaettigte Mittelton. */
.round-ticks i.is-reject {
  background: var(--ink-mute);
}

.round-ticks i.is-like {
  background: var(--affirm);
}

/* Der Favorit ist die staerkste Aussage der Runde – und bekommt den kraeftigeren
   Aprikosenton, damit er sich vom hellen leeren Strich klar abhebt. */
.round-ticks i.is-favorite {
  background: var(--spark-strong);
}

/* Der eben gesetzte Strich schlaegt einmal kurz aus. */
.round-ticks i.just-filled {
  animation: tick-pop 0.46s var(--ease-spring) both;
}

@keyframes tick-pop {
  0% {
    transform: scaleY(1);
  }
  38% {
    transform: scaleY(2.6);
  }
  100% {
    transform: scaleY(1);
  }
}

.round-remaining {
  flex: none;
  font-size: var(--text-micro);
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  transition: color 0.28s var(--ease);
}

.round-remaining.is-final {
  color: var(--ink);
}

/* Abschlusskarte liegt an der Stelle der Namenskarte */
.round-summary {
  position: absolute;
  inset: 0 0 22px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--lift-2), inset 0 0 0 1px var(--line-soft);
  overflow-y: auto;
  overscroll-behavior: contain;
  outline: none;
  animation: summary-in 0.46s var(--ease-spring) both;
}

@keyframes summary-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
}

.round-summary-kicker {
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--spark-deep);
}

#round-summary-title {
  font-size: clamp(1.5rem, 6.5vw, 1.95rem);
  font-variation-settings: "SOFT" 34, "WONK" 1;
  text-wrap: balance;
}

.round-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.round-chip {
  padding: 0.28rem 0.65rem;
  border-radius: var(--r-pill);
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 400;
  font-variation-settings: "SOFT" 30;
  color: var(--ink);
}

.round-chip.is-favorite {
  background: var(--spark-tint);
  box-shadow: none;
  color: var(--spark-deep);
}

.round-summary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin: var(--space-1) 0 0;
  padding: var(--space-3) 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.round-summary-stats div {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.1rem;
  align-items: center;
  text-align: center;
}

.round-summary-stats dt {
  font-size: var(--text-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.round-summary-stats dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--ink);
}

.round-fact {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: var(--space-4);
  border-radius: var(--r-md);
  background: var(--spark-veil);
  box-shadow: inset 0 0 0 1px var(--spark-tint);
}

.round-fact > span {
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--spark-deep);
}

.round-fact p {
  font-size: var(--text-small);
  line-height: 1.55;
  color: var(--ink-soft);
  text-wrap: pretty;
}

/* Auf kurzen Displays scrollt die Abschlusskarte – der Weiter-Knopf bleibt
   trotzdem immer erreichbar. Der Schatten in Kartenfarbe verdeckt den Inhalt,
   der darunter durchlaeuft. */
.round-continue {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  width: 100%;
  box-shadow: var(--lift-1), 0 0 0 var(--space-3) var(--card);
}

.round-continue:hover:not(:disabled) {
  box-shadow: var(--lift-1), 0 0 0 var(--space-3) var(--card);
}

/* Waehrend der Abschluss steht, ruht der Stapel darunter. */
.round-complete .name-card,
.round-complete .gesture-help,
.round-complete .action-row {
  display: none;
}

/* Der Stapel verliert sichtbar eine Lage, sobald die Karte wegfliegt. */
.card-stage.stack-advance .card-back-one {
  animation: stack-step-one 0.42s var(--ease-spring) both;
}

.card-stage.stack-advance .card-back-two {
  animation: stack-step-two 0.42s var(--ease-spring) both;
}

@keyframes stack-step-one {
  from {
    transform: translateY(11px) scale(0.962);
    opacity: 0.7;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes stack-step-two {
  from {
    transform: translateY(22px) scale(0.924);
    opacity: 0.42;
  }
  to {
    transform: translateY(11px) scale(0.962);
    opacity: 0.7;
  }
}

.card-stage {
  position: relative;
  flex: 1;
  min-height: 260px;
  margin-bottom: var(--space-4);
  perspective: 1400px;
}

/* Ruhiger Lichtschein hinter dem Stapel */
.card-stage::before {
  content: "";
  position: absolute;
  inset: -8% -14%;
  background: radial-gradient(60% 46% at 50% 34%, var(--primary-tint) 0%, transparent 72%);
  opacity: 0.75;
  pointer-events: none;
}

.name-card {
  position: absolute;
  inset: 0 0 22px;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-card);
  background: var(--card);
  box-shadow: var(--lift-2), inset 0 0 0 1px var(--line-soft);
  overflow: hidden;
}

.name-card-scroll {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: var(--space-5) var(--space-5) calc(var(--space-5) + 4rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  touch-action: pan-y;
}

.card-back {
  transform-origin: 50% 100%;
}

.card-back-one {
  transform: translateY(11px) scale(0.962);
  opacity: 0.7;
  box-shadow: var(--lift-1), inset 0 0 0 1px var(--line-soft);
}

.card-back-two {
  transform: translateY(22px) scale(0.924);
  opacity: 0.42;
  box-shadow: var(--lift-1), inset 0 0 0 1px var(--line-soft);
}

.active-card {
  z-index: 3;
  cursor: grab;
  touch-action: pan-y;
  outline-offset: 4px;
  transform: translate3d(var(--drag-x, 0px), var(--drag-y, 0px), 0) rotate(var(--rotation, 0deg));
  transition: transform 0.42s var(--ease-spring), box-shadow 0.24s var(--ease);
}

/* Kornstruktur nur auf der aktiven Karte */
.active-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  background-size: 160px 160px;
  opacity: calc(var(--grain-strength) * 0.8);
  mix-blend-mode: var(--grain-blend);
  pointer-events: none;
}

.active-card.dragging {
  cursor: grabbing;
  touch-action: none;
  transition: none;
  box-shadow: var(--lift-3), inset 0 0 0 1px var(--line-soft);
}

.active-card.dragging .name-card-scroll {
  overflow-y: hidden;
}

.active-card.entering {
  animation: card-enter 0.44s var(--ease-spring) both;
}

@keyframes card-enter {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.955);
  }
  60% {
    opacity: 1;
    transform: translateY(-3px) scale(1.006);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.active-card.exit-left,
.active-card.exit-right,
.active-card.exit-up {
  transition: transform 0.26s var(--ease-soft), opacity 0.26s var(--ease-soft);
  opacity: 0;
  pointer-events: none;
}

.active-card.exit-left {
  transform: translate3d(-135%, 4%, 0) rotate(-17deg);
}

.active-card.exit-right {
  transform: translate3d(135%, 4%, 0) rotate(17deg);
}

.active-card.exit-up {
  transform: translate3d(0, -125%, 0) scale(0.94);
}

.card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  flex: none;
}

.name-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.name-tags span {
  padding: 0.25rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-size: var(--text-micro);
  font-weight: 550;
  letter-spacing: 0.015em;
  color: var(--ink-soft);
  white-space: nowrap;
}

.info-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: var(--r-pill);
  background: var(--sunken);
  color: var(--ink-soft);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease);
}

.info-button svg {
  width: 18px;
  stroke-width: 1.8;
}

.info-button:hover:not(:disabled) {
  background: var(--primary-tint);
  color: var(--primary);
}

.info-button:disabled {
  opacity: 0.4;
}

/* Der Name ist der Held der Flaeche */

.name-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: clamp(225px, 40vh, 320px);
  padding: var(--space-5) 0;
  text-align: center;
}

.name-kind {
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.name-kind.complete {
  color: var(--spark-deep);
}

#current-name {
  max-width: 100%;
  font-size: var(--text-hero);
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 120;
  letter-spacing: -0.035em;
  line-height: 0.98;
  overflow-wrap: anywhere;
}

.syllables {
  font-size: var(--text-label);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  color: var(--ink-mute);
}

.hero-variants {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  margin-top: 0.15rem;
}

.hero-variants > span {
  font-size: var(--text-micro);
  color: var(--ink-mute);
}

.compact-chip-list,
.detail-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.compact-chip-list {
  justify-content: center;
}

.compact-chip-list span,
.detail-chip-list span {
  padding: 0.27rem 0.62rem;
  border-radius: var(--r-pill);
  background: var(--primary-veil);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-size: var(--text-label);
  line-height: 1.25;
  color: var(--ink-soft);
}

.detail-chip-list .muted-chip {
  background: var(--sunken);
  color: var(--ink-mute);
}

.card-meaning {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  width: min(100%, 30ch);
  margin-top: 0.35rem;
  padding-top: 0.65rem;
  box-shadow: inset 0 1px 0 var(--line-soft);
}

.card-meaning > span {
  font-size: var(--text-micro);
  font-weight: 650;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--primary);
}

.card-meaning > p {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 350;
  font-variation-settings: "SOFT" 30;
  line-height: 1.35;
  color: var(--ink-soft);
  text-wrap: balance;
}

.full-name-preview {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: none;
  padding: var(--space-4);
  border-radius: var(--r-md);
  background: var(--sunken);
}

.full-name-preview small {
  font-size: var(--text-micro);
  line-height: 1.4;
  color: var(--ink-mute);
}

.full-name-preview > span {
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.full-name-variants {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.full-name-variants strong {
  font-family: var(--font-display);
  font-size: var(--text-lead);
  font-weight: 400;
  font-variation-settings: "SOFT" 30;
  letter-spacing: -0.018em;
  color: var(--ink);
}

.card-scroll-cue {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 74px;
  padding: 1.1rem var(--space-5) 0.75rem;
  /* Der Verlauf blendet nur die obersten 18 Pixel aus und ist darunter deckend.
     Vorher lag der Hinweis halbtransparent auf dem vollstaendigen Namen, der
     dadurch weder lesbar noch sauber verborgen war. */
  background: linear-gradient(to bottom, transparent 0, var(--card) 18px);
  color: var(--ink);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.card-scroll-cue.is-hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

.scroll-cue-symbol {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--primary-tint);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary-fill);
}

.scroll-cue-symbol svg {
  width: 20px;
  stroke-width: 2;
}

.scroll-cue-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
}

.scroll-cue-copy strong {
  font-size: var(--text-label);
  font-weight: 700;
}

.scroll-cue-copy small {
  margin-top: 0.18rem;
  color: var(--ink-mute);
  font-size: var(--text-micro);
}

.card-details {
  padding: var(--space-7) 0 var(--space-5);
  border-top: 1px solid var(--line);
  outline: none;
}

.detail-intro {
  max-width: 36ch;
}

.detail-kicker {
  margin-bottom: 0.35rem;
  color: var(--primary);
  font-size: var(--text-micro);
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.detail-intro h2 {
  font-size: clamp(1.9rem, 8vw, 2.55rem);
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 90;
  letter-spacing: -0.03em;
}

.detail-intro > p:last-child {
  margin-top: var(--space-2);
  color: var(--ink-soft);
  font-size: var(--text-small);
  line-height: 1.55;
  text-wrap: pretty;
}

/* Nur eine Linie nach oben: die untere Kante liefert der Rahmen des folgenden
   Abschnitts. Vorher standen beide Linien mit einer Luecke uebereinander. */
.detail-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--space-5) 0 0;
  border-top: 1px solid var(--line-soft);
}

.detail-stat-row > div {
  min-width: 0;
  padding: var(--space-3) 0.45rem;
}

.detail-stat-row > div + div {
  border-left: 1px solid var(--line-soft);
}

.detail-stat-row dt {
  font-size: var(--text-micro);
  color: var(--ink-mute);
}

.detail-stat-row dd {
  margin-top: 0.25rem;
  font-size: var(--text-label);
  font-weight: 650;
  line-height: 1.25;
  color: var(--ink);
  /* "anywhere" zerlegte Laendernamen mitten im Wort ("Griche|nland").
     Getrennt wird nur, wenn es sein muss – und dann an einer echten Fuge. */
  overflow-wrap: break-word;
  hyphens: auto;
}

.detail-section {
  padding: var(--space-5) 0;
  border-top: 1px solid var(--line-soft);
}

.detail-section h3 {
  margin-bottom: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.detail-section > p {
  color: var(--ink-soft);
  font-size: var(--text-small);
  line-height: 1.6;
  text-wrap: pretty;
}

.detail-section .detail-chip-list {
  margin-top: var(--space-3);
}

.detail-section .data-note {
  margin-top: var(--space-3);
  padding-left: var(--space-3);
  border-left: 2px solid var(--line-strong);
  font-size: var(--text-label);
  color: var(--ink-mute);
}

.source-links {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: var(--space-4);
}

.source-links a {
  color: var(--primary);
  font-size: var(--text-label);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.source-links a::after {
  content: " ↗";
}

.name-shape {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 var(--space-4);
}

.name-shape > div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line-soft);
}

/* Die untere Reihe braucht keine eigene Linie – der folgende Abschnitt bringt
   seine eigene mit, sonst stehen wieder zwei uebereinander. */
.name-shape > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.name-shape dt {
  color: var(--ink-mute);
  font-size: var(--text-micro);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.name-shape dd {
  font-size: var(--text-label);
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: break-word;
  hyphens: auto;
}

.speak-name {
  width: 100%;
  margin-top: var(--space-3);
}

/* Wischstempel */

.swipe-stamp {
  position: absolute;
  top: 3.9rem;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  opacity: 0;
  pointer-events: none;
}

.swipe-stamp svg {
  width: 17px;
  fill: currentColor;
  stroke: none;
}

.stamp-no {
  left: var(--space-5);
  transform: rotate(-9deg);
  color: var(--refuse);
  box-shadow: inset 0 0 0 2px currentColor;
}

.stamp-yes {
  right: var(--space-5);
  transform: rotate(9deg);
  color: var(--primary);
  box-shadow: inset 0 0 0 2px currentColor;
}

.gesture-help {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.9rem;
  flex: none;
  padding-bottom: var(--space-3);
  font-size: var(--text-micro);
  color: var(--ink-faint);
}

.gesture-help span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Aktionsreihe */

.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  flex: none;
  padding-bottom: var(--space-4);
}

.action-button {
  display: grid;
  place-items: center;
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: var(--lift-1), inset 0 0 0 1px var(--line-soft);
  transition: transform 0.18s var(--ease-spring), box-shadow 0.18s var(--ease),
    background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.action-button svg {
  stroke-width: 2;
}

.action-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--lift-2), inset 0 0 0 1px var(--line-soft);
}

.action-button:active:not(:disabled) {
  transform: translateY(0) scale(0.95);
}

.action-button:disabled {
  opacity: 0.38;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.undo-action {
  width: 44px;
  height: 44px;
  color: var(--ink-mute);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
}

.undo-action svg {
  width: 18px;
}

.reject-action {
  width: 58px;
  height: 58px;
  color: var(--refuse);
}

.reject-action svg {
  width: 23px;
}

.reject-action:hover:not(:disabled) {
  background: var(--refuse-tint);
}

.favorite-action {
  width: 52px;
  height: 52px;
  color: var(--spark-deep);
  background: var(--spark-tint);
  box-shadow: var(--lift-1), inset 0 0 0 1px transparent;
}

.favorite-action svg {
  width: 21px;
  fill: currentColor;
  stroke: none;
}

.favorite-action:hover:not(:disabled) {
  background: var(--spark);
  color: var(--on-primary);
}

.like-action {
  width: 62px;
  height: 62px;
  background: var(--affirm);
  color: var(--on-primary);
  box-shadow: var(--lift-2), inset 0 1px 0 oklch(1 0 0 / 0.22);
}

.like-action svg {
  width: 26px;
  fill: currentColor;
  stroke: none;
}

.like-action:hover:not(:disabled) {
  background: var(--affirm-hover);
}

/* -- 7 Likes und Favoriten ----------------------------------------------- */

.result-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

#likes-screen[data-result-gender="girl"],
#favorites-screen[data-result-gender="girl"] {
  --result-accent: var(--girl);
  --result-tint: var(--girl-tint);
}

#likes-screen[data-result-gender="boy"],
#favorites-screen[data-result-gender="boy"] {
  --result-accent: var(--boy);
  --result-tint: var(--boy-tint);
}

#likes-screen[data-result-gender="neutral"],
#favorites-screen[data-result-gender="neutral"] {
  --result-accent: var(--primary);
  --result-tint: var(--primary-tint);
}

.result-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  min-width: 0;
  padding: 0 var(--space-2);
  border-radius: calc(var(--r-md) - 4px);
  color: var(--ink-mute);
  font-size: var(--text-label);
  font-weight: 550;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.result-tabs button:hover {
  color: var(--ink);
}

.result-tabs button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.result-tabs button.active {
  background: var(--card);
  color: var(--result-accent, var(--primary));
  box-shadow: var(--lift-1);
  font-weight: 650;
}

.result-tabs button[data-result-gender="girl"]::before,
.result-tabs button[data-result-gender="boy"]::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: var(--r-pill);
  background: currentColor;
}

.result-tabs button[data-result-gender="girl"].active {
  color: var(--girl);
}

.result-tabs button[data-result-gender="boy"].active {
  color: var(--boy);
}

.result-tabs small {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.3rem;
  border-radius: var(--r-pill);
  background: var(--line-soft);
  color: var(--ink-soft);
  font-size: var(--text-micro);
  font-variant-numeric: tabular-nums;
}

.result-tabs button.active small {
  background: var(--result-tint, var(--primary-tint));
  color: var(--result-accent, var(--primary));
}

.ranking-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) 0 var(--space-3);
}

.ranking-heading h2 {
  font-size: var(--text-title);
}

.ranking-heading p {
  margin-top: 0.2rem;
  font-size: var(--text-label);
  color: var(--ink-mute);
}

.ranking-heading > span {
  flex: none;
  padding: 0.3rem 0.55rem;
  border-radius: var(--r-pill);
  background: var(--result-tint, var(--primary-tint));
  color: var(--result-accent, var(--primary));
  font-size: var(--text-micro);
  font-weight: 650;
}

.likes-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-soft);
}

.like-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.ranking-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) 0 var(--space-2);
  color: var(--ink-mute);
  font-size: var(--text-micro);
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.ranking-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.like-rank {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--result-tint, var(--primary-tint));
  color: var(--result-accent, var(--primary));
  font-size: var(--text-micro);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

#likes-screen .like-symbol {
  background: var(--result-tint, var(--primary-tint));
  color: var(--result-accent, var(--primary));
}

#likes-screen .like-rating > strong,
#likes-screen .rating-star.filled {
  color: var(--result-accent, var(--primary));
}

.like-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.like-name-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.like-copy strong {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 400;
  font-variation-settings: "SOFT" 30;
  letter-spacing: -0.018em;
}

.like-copy > span:last-child {
  margin-top: 0.1rem;
  font-size: var(--text-label);
  color: var(--ink-mute);
  overflow-wrap: anywhere;
}

/* Ein Schalter, zwei Zustaende: leerer Stern = nur Like, gefuellter = Favorit.
   Mindestens 24 px hoch (WCAG 2.2, Target Size Minimum). */
.favorite-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 26px;
  padding: 0 0.5rem 0 0.42rem;
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-mute);
  font-family: var(--font-ui);
  font-size: var(--text-micro);
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}

.favorite-chip svg {
  width: 12px;
  stroke-width: 1.9;
}

.favorite-chip:hover {
  color: var(--spark-deep);
  box-shadow: inset 0 0 0 1px var(--spark);
}

.favorite-chip.is-favorite {
  background: var(--spark-tint);
  box-shadow: none;
  color: var(--spark-deep);
}

.favorite-chip.is-favorite svg {
  fill: currentColor;
  stroke: none;
}

.favorite-chip.is-favorite:hover {
  background: var(--spark);
  color: var(--on-primary);
}

.like-rating {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.18rem;
}

.like-rating > strong {
  font-family: var(--font-display);
  font-size: var(--text-lead);
  font-weight: 450;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  line-height: 1;
}

.like-rating > strong small {
  font-family: var(--font-ui);
  font-size: var(--text-micro);
  font-weight: 550;
  color: var(--ink-mute);
}

.rating-stars {
  display: flex;
  gap: 1px;
}

.rating-star {
  color: var(--line-strong);
}

.rating-star.filled {
  color: var(--primary);
}

.favorite-item .like-rating > strong,
.favorite-item .rating-star.filled {
  color: var(--spark-deep);
}

.favorite-item .rating-star {
  color: var(--spark-tint);
}

.favorite-item .favorite-chip {
  box-shadow: inset 0 0 0 1px var(--spark-tint);
}

.rating-star svg {
  width: 10px;
  fill: currentColor;
  stroke: none;
}

.favorites-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.favorite-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: 0.85rem var(--space-3);
  border-radius: var(--r-md);
  background: var(--spark-veil);
  box-shadow: inset 0 0 0 1px var(--spark-tint);
}

.favorite-leading {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  grid-row: 1 / span 2;
}

.favorite-rank {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--spark-tint);
  font-size: var(--text-micro);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--spark-deep);
}

#favorites-screen .favorite-rank {
  background: var(--result-tint, var(--spark-tint));
  color: var(--result-accent, var(--spark-deep));
}

.favorite-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.favorite-drag-handle {
  display: grid;
  place-items: center;
  width: 30px;
  height: 38px;
  border-radius: var(--r-sm);
  color: var(--ink-mute);
  cursor: grab;
  touch-action: none;
}

.favorite-drag-handle:hover {
  background: var(--spark-tint);
  color: var(--spark-deep);
}

.favorite-drag-handle:focus-visible {
  outline: 2px solid var(--spark-deep);
  outline-offset: 1px;
}

.favorite-drag-handle:active {
  cursor: grabbing;
}

.favorite-drag-handle svg {
  width: 18px;
  stroke-width: 1.8;
}

.favorite-order-actions {
  display: inline-flex;
  grid-column: 2 / 4;
  justify-self: end;
  gap: var(--space-1);
}

.favorite-order-actions button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border-radius: var(--r-sm);
  background: color-mix(in oklab, var(--card) 72%, transparent);
  color: var(--spark-deep);
}

.favorite-order-actions button:hover:not(:disabled) {
  background: var(--spark-tint);
}

.favorite-order-actions button:focus-visible {
  outline: 2px solid var(--spark-deep);
  outline-offset: 1px;
}

.favorite-order-actions button:disabled {
  color: var(--ink-faint);
  opacity: 0.5;
  cursor: default;
}

.favorite-order-actions svg {
  width: 17px;
  stroke-width: 2;
}

.favorite-item.is-dragging {
  opacity: 0.58;
}

.favorite-item.drop-before::before,
.favorite-item.drop-after::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--spark-deep);
}

.favorite-item.drop-before::before {
  top: -5px;
}

.favorite-item.drop-after::after {
  bottom: -5px;
}

.favorite-copy strong {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 400;
  font-variation-settings: "SOFT" 30;
  letter-spacing: -0.018em;
}

.favorite-copy > span:last-child {
  margin-top: 0.1rem;
  font-size: var(--text-label);
  color: var(--ink-mute);
  overflow-wrap: anywhere;
}

.combination-prompt {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-6);
  padding: var(--space-4);
  border-radius: var(--r-lg);
  background: var(--primary-veil);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.prompt-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--lift-1);
}

.prompt-icon svg {
  width: 20px;
  stroke-width: 2;
}

.combination-prompt > div:not(.prompt-icon) {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.combination-prompt strong {
  font-size: var(--text-body);
  font-weight: 600;
}

.combination-prompt span {
  font-size: var(--text-label);
  color: var(--ink-mute);
  text-wrap: pretty;
}

.combination-builder {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.section-title-row h2 {
  font-size: var(--text-title);
  font-variation-settings: "SOFT" 34, "WONK" 1;
}

.section-title-row p {
  margin-top: 0.25rem;
  font-size: var(--text-label);
  color: var(--ink-mute);
  text-wrap: pretty;
}

.section-title-row .text-button {
  flex: none;
  white-space: nowrap;
}

.combination-fields {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
}

.combination-fields label {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.combination-fields label > span {
  font-size: var(--text-label);
  font-weight: 600;
}

#swap-combination {
  margin-bottom: 4px;
  background: var(--sunken);
}

.join-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

.join-option {
  min-height: 40px;
  border-radius: calc(var(--r-md) - 4px);
  font-size: var(--text-label);
  font-weight: 550;
  color: var(--ink-mute);
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.join-option.active {
  background: var(--card);
  color: var(--ink);
  font-weight: 650;
  box-shadow: var(--lift-1);
}

.saved-combinations {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.saved-combination {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--r-sm);
  background: var(--spark-veil);
  box-shadow: inset 0 0 0 1px var(--spark-tint);
}

.saved-combination svg {
  flex: none;
  width: 15px;
  fill: var(--spark);
  stroke: none;
}

.saved-combination strong {
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 400;
  font-variation-settings: "SOFT" 30;
}

#save-combination.is-saved {
  background: var(--spark-deep);
}

/* -- 8 Matches ----------------------------------------------------------- */

.empty-message {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: var(--space-8) var(--space-5);
  border-radius: var(--r-lg);
  background: var(--sunken);
  text-align: center;
}

.empty-message strong {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 400;
  font-variation-settings: "SOFT" 34;
}

.empty-message span {
  font-size: var(--text-label);
  color: var(--ink-mute);
  text-wrap: pretty;
}

.top-match {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-5) var(--space-5);
  border-radius: var(--r-xl);
  background: var(--night);
  color: var(--on-dark);
  overflow: hidden;
  isolation: isolate;
}

/* Funkenlicht aus der oberen rechten Ecke */
.top-match::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -55%;
  right: -25%;
  width: 90%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--feature-glow) 0%, transparent 68%);
}

.top-match::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--grain);
  background-size: 160px 160px;
  opacity: 0.07;
  mix-blend-mode: screen;
}

.top-match-copy {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.match-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--spark);
}

.match-label svg {
  width: 13px;
  fill: currentColor;
  stroke: none;
}

.match-label .icon-heart,
.match-label.regular .icon-star {
  display: none;
}

.match-label.regular .icon-heart {
  display: block;
}

#top-match-name {
  font-size: clamp(2rem, 9vw, 2.6rem);
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 90;
  letter-spacing: -0.03em;
  color: var(--on-dark);
  overflow-wrap: anywhere;
}

.top-match-full {
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-size: var(--text-body);
  font-weight: 300;
  color: var(--on-feature-soft);
  overflow-wrap: anywhere;
}

.shared-score {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.05rem;
  padding-left: var(--space-3);
  color: var(--on-dark);
  text-align: right;
}

.shared-score strong {
  font-family: var(--font-display);
  font-size: 2.1rem;
  font-weight: 400;
  font-variation-settings: "SOFT" 30;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.shared-score span {
  font-size: var(--text-micro);
  letter-spacing: 0.02em;
  color: var(--on-feature-soft);
  white-space: nowrap;
}

/* Die Bedeutung des Werts steht sichtbar da, nicht hinter einem Fragezeichen. */
.score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.score-hint {
  font-size: var(--text-label);
  color: var(--ink-mute);
  text-wrap: pretty;
}

.score-row .text-button {
  flex: none;
  padding-top: 0;
}

.score-explanation {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--r-md);
  background: var(--sunken);
}

.score-explanation strong {
  font-size: var(--text-label);
  font-weight: 650;
}

.score-explanation p {
  font-size: var(--text-label);
  color: var(--ink-soft);
  text-wrap: pretty;
}

.comparison-section,
.match-list-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.name-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.name-comparison.single {
  grid-template-columns: 1fr;
}

.name-comparison .empty-message,
.favorites-list .empty-message {
  grid-column: 1 / -1;
  padding: var(--space-6) var(--space-5);
}

.comparison-option {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: var(--space-4);
  border-radius: var(--r-md);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition: box-shadow 0.18s var(--ease), background-color 0.18s var(--ease);
}

.comparison-option:hover {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

/* Eine einzelne Variante ist eine Anzeige, keine Wahl. */
.comparison-option.static,
.comparison-option.static:hover {
  cursor: default;
  background: var(--sunken);
  box-shadow: none;
}

.comparison-option > span {
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.comparison-option strong {
  font-family: var(--font-display);
  font-size: var(--text-lead);
  font-weight: 400;
  font-variation-settings: "SOFT" 30;
  letter-spacing: -0.018em;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.comparison-option small {
  font-size: var(--text-label);
  color: var(--ink-mute);
}

.comparison-option.selected {
  background: var(--primary-veil);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.comparison-option.selected small {
  color: var(--primary);
  font-weight: 600;
}

.match-list {
  display: flex;
  flex-direction: column;
}

.match-list-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  padding: 0.75rem 0.7rem;
  border-bottom: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
  text-align: left;
  transition: background-color 0.16s var(--ease);
}

.match-list-item:last-child {
  border-bottom: 0;
}

.match-list-item:hover {
  background: var(--sunken);
}

.match-list-item.active {
  background: var(--primary-veil);
}

/* Der ausgewaehlte Treffer ist zusaetzlich zur Farbe durch die Marke links
   und das gefuellte Symbol erkennbar. */
.match-list-item.active::before {
  content: "";
  position: absolute;
  top: 0.6rem;
  bottom: 0.6rem;
  left: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--primary);
}

.match-list-item.active .match-list-icon {
  background: var(--spark);
  color: var(--night);
}

.match-list-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--spark-tint);
  color: var(--spark-deep);
}

.match-list-icon svg {
  width: 15px;
  fill: currentColor;
  stroke: none;
}

.match-list-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.match-list-copy strong {
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 400;
  font-variation-settings: "SOFT" 30;
  letter-spacing: -0.018em;
}

.match-list-copy span {
  font-size: var(--text-label);
  color: var(--ink-mute);
  overflow-wrap: anywhere;
}

.match-score-pill {
  flex: none;
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-pill);
  background: var(--spark-tint);
  font-size: var(--text-label);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--spark-deep);
}

#matches-empty {
  background: var(--spark-veil);
  box-shadow: inset 0 0 0 1px var(--spark-tint);
}

/* -- 9 Dialoge ----------------------------------------------------------- */

dialog {
  border: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
}

dialog::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(6px);
}

.rating-dialog,
.add-name-dialog,
.app-settings-dialog,
.invite-dialog,
.onboarding-dialog,
.room-data-dialog,
.message-actions-dialog,
.community-consent-dialog {
  width: min(420px, calc(100vw - 2rem));
  margin: auto;
  padding: var(--space-6);
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--lift-3);
  animation: dialog-in 0.3s var(--ease) both;
}

.add-name-dialog {
  width: min(460px, calc(100vw - 2rem));
  max-height: min(760px, calc(100dvh - 2rem));
  overflow-y: auto;
}

.room-data-dialog,
.app-settings-dialog,
.invite-dialog,
.message-actions-dialog,
.community-consent-dialog {
  width: min(480px, calc(100vw - 2rem));
  max-height: min(800px, calc(100dvh - 2rem));
  overflow-y: auto;
}

.room-data-dialog h2,
.app-settings-dialog h2,
.invite-dialog h2,
.message-actions-dialog h2,
.community-consent-dialog h2 {
  font-size: 1.65rem;
  font-variation-settings: "SOFT" 30, "WONK" 1;
}

.onboarding-dialog {
  width: min(460px, calc(100vw - 2rem));
  overflow: hidden;
  padding: 0;
}

.onboarding-toolbar {
  position: absolute;
  z-index: 1;
  top: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.onboarding-skip {
  color: var(--ink-soft);
}

.onboarding-language-picker {
  background: color-mix(in oklab, var(--card) 78%, transparent);
}

.onboarding-visual {
  position: relative;
  display: grid;
  min-height: 10.5rem;
  place-items: center;
  overflow: hidden;
  background: var(--primary-tint);
}

.onboarding-visual svg {
  position: relative;
  width: 4rem;
  fill: var(--primary);
}

.onboarding-orbit,
.onboarding-orbit::before,
.onboarding-orbit::after {
  position: absolute;
  border: 1px solid color-mix(in oklab, var(--primary) 28%, transparent);
  border-radius: 50%;
}

.onboarding-orbit {
  width: 8rem;
  height: 8rem;
}

.onboarding-orbit::before,
.onboarding-orbit::after {
  content: "";
  inset: -2rem;
}

.onboarding-orbit::after {
  inset: -4rem;
  opacity: 0.55;
}

.onboarding-orbit i {
  position: absolute;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--primary-fill);
}

.onboarding-orbit i:nth-child(1) { top: 0.5rem; left: 1rem; }
.onboarding-orbit i:nth-child(2) { right: -1.25rem; bottom: 1.3rem; }
.onboarding-orbit i:nth-child(3) { bottom: -2.4rem; left: 0.8rem; }

.onboarding-content {
  min-height: 14rem;
  padding: var(--space-6) var(--space-6) var(--space-4);
}

.onboarding-step h2 {
  max-width: 15ch;
  font-size: clamp(1.65rem, 7vw, 2.1rem);
  font-variation-settings: "SOFT" 30, "WONK" 1;
  letter-spacing: -0.025em;
  line-height: 1.08;
  text-wrap: balance;
}

.onboarding-step p {
  max-width: 42ch;
  margin-top: var(--space-4);
  color: var(--ink-soft);
  font-size: var(--text-body);
  line-height: 1.55;
  text-wrap: pretty;
}

.onboarding-progress {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-6) var(--space-4);
}

.onboarding-progress span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--line-strong);
  transition: width 0.2s var(--ease), background-color 0.2s var(--ease);
}

.onboarding-progress span.active {
  width: 1.4rem;
  border-radius: var(--r-pill);
  background: var(--primary);
}

.onboarding-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6) var(--space-6);
  border-top: 1px solid var(--line-soft);
}

.onboarding-actions .primary-button {
  grid-column: 2;
}

.invite-description {
  margin-top: calc(var(--space-2) * -1);
  color: var(--ink-soft);
  font-size: var(--text-small);
  line-height: 1.5;
}

.invite-code-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--r-sm);
  background: var(--primary-veil);
}

.invite-code-block span,
.invite-link-field > span {
  color: var(--ink-mute);
  font-size: var(--text-label);
  font-weight: 600;
}

.invite-code-block strong {
  color: var(--primary);
  font-size: var(--text-title);
  letter-spacing: 0.08em;
}

.invite-link-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.invite-link-field input {
  min-height: 46px;
  padding: 0 var(--space-3);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--sunken);
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--text-label);
  text-overflow: ellipsis;
}

.invite-privacy-note {
  margin-top: var(--space-4);
  color: var(--ink-mute);
  font-size: var(--text-label);
  line-height: 1.45;
}

.invite-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
}

.room-data-description,
.settings-description,
.message-actions-description {
  margin-top: calc(var(--space-2) * -1);
  color: var(--ink-soft);
  font-size: var(--text-small);
  line-height: 1.5;
  text-wrap: pretty;
}

.settings-groups {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-4);
  border-top: 1px solid var(--line);
}

.settings-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--line-soft);
}

.settings-group-copy h3 {
  font-size: var(--text-body);
  font-weight: 650;
}

.settings-group-copy p {
  margin-top: var(--space-1);
  color: var(--ink-mute);
  font-size: var(--text-label);
  line-height: 1.4;
}

.settings-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  color: var(--ink-soft);
  font-size: var(--text-small);
}

.settings-select select {
  min-height: 42px;
  padding: 0 2.25rem 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--sunken);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 650;
}

.settings-audio {
  grid-template-columns: minmax(0, 1fr) minmax(9rem, 0.8fr);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.volume-control input {
  width: 100%;
  accent-color: var(--primary);
}

.volume-control output {
  min-width: 3.25rem;
  color: var(--ink-soft);
  font-size: var(--text-label);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.settings-action {
  min-height: 42px;
  padding-inline: var(--space-3);
  white-space: nowrap;
}

.settings-audio .settings-action {
  grid-column: 2;
}

.settings-login-action {
  grid-column: 1 / -1;
  justify-self: start;
}

.data-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
}

.data-summary div {
  display: grid;
  grid-template-columns: minmax(5.5rem, 0.34fr) minmax(0, 1fr);
  gap: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}

.data-summary dt {
  color: var(--ink);
  font-size: var(--text-label);
  font-weight: 650;
}

.data-summary dd {
  margin: 0;
  color: var(--ink-mute);
  font-size: var(--text-label);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.blocked-section,
.room-danger-zone {
  margin-top: var(--space-5);
  padding-top: var(--space-5);
  border-top: 1px solid var(--line);
}

.blocked-section h3,
.room-danger-zone h3 {
  font-size: var(--text-body);
  font-weight: 650;
}

.blocked-section .section-title-row p,
.room-danger-zone > p {
  margin-top: var(--space-1);
  color: var(--ink-mute);
  font-size: var(--text-label);
  line-height: 1.45;
}

.blocked-members-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.blocked-member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 0.65rem 0.75rem;
  border-radius: var(--r-sm);
  background: var(--sunken);
}

.blocked-member-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--text-label);
}

.blocked-member-row button {
  flex: none;
  color: var(--primary);
  font-size: var(--text-label);
  font-weight: 650;
}

.blocked-empty {
  color: var(--ink-faint);
  font-size: var(--text-label);
}

.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 var(--space-5);
  border-radius: var(--r-md);
  background: var(--refuse-tint);
  color: var(--refuse);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--refuse) 38%, transparent);
  font-size: var(--text-body);
  font-weight: 650;
  transition: background-color 0.18s var(--ease), transform 0.14s var(--ease);
}

.danger-button:hover:not(:disabled) {
  background: color-mix(in oklab, var(--refuse-tint) 76%, var(--refuse));
}

.danger-button:active:not(:disabled) {
  transform: translateY(1px);
}

.danger-button:disabled {
  opacity: 0.55;
}

.room-danger-zone > .danger-button {
  width: 100%;
  margin-top: var(--space-3);
}

.room-action-confirmation {
  margin-top: var(--space-3);
  padding: var(--space-4);
  border-left: 3px solid var(--refuse);
  background: var(--refuse-tint);
}

.room-action-confirmation strong {
  font-size: var(--text-body);
}

.room-action-confirmation p {
  margin-top: var(--space-1);
  color: var(--ink-soft);
  font-size: var(--text-label);
  line-height: 1.45;
}

.room-action-confirmation > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.message-actions-preview {
  max-height: 9rem;
  margin: var(--space-4) 0 0;
  padding: var(--space-3) var(--space-4);
  overflow-y: auto;
  border-left: 3px solid var(--line-strong);
  background: var(--sunken);
  color: var(--ink-soft);
  font-size: var(--text-small);
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.report-message-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-5);
}

.report-message-form label {
  font-size: var(--text-label);
  font-weight: 650;
}

.report-message-form .secondary-button,
.block-member-button,
.message-actions-dialog > #report-message-sender,
.message-actions-dialog > .danger-button {
  width: 100%;
  margin-top: var(--space-2);
}

.report-message-form .secondary-button {
  margin-top: var(--space-1);
}

.custom-name-safety {
  padding: var(--space-4);
  border-radius: var(--r-md);
  background: var(--primary-veil);
}

.custom-name-report-controls label {
  display: block;
  margin-top: var(--space-3);
  color: var(--ink-soft);
  font-size: var(--text-label);
  font-weight: 650;
}

.custom-name-report-controls select {
  width: 100%;
  margin-top: var(--space-2);
}

.custom-name-safety-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.custom-name-safety-actions .secondary-button {
  min-width: 0;
}

.community-consent-dialog form {
  display: flex;
  flex-direction: column;
}

#community-consent-description,
.community-consent-note {
  color: var(--ink-soft);
  font-size: var(--text-small);
  line-height: 1.5;
  text-wrap: pretty;
}

.community-consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  margin-top: var(--space-5);
  padding: var(--space-4);
  border-radius: var(--r-md);
  background: var(--primary-veil);
  color: var(--ink);
  font-size: var(--text-small);
  line-height: 1.45;
}

.community-consent-check input {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.05rem;
  accent-color: var(--primary);
}

.community-consent-check a {
  color: var(--primary);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.community-consent-note {
  margin-top: var(--space-3);
}

.community-consent-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

@media (max-width: 420px) {
  .custom-name-safety-actions,
  .community-consent-actions {
    grid-template-columns: 1fr;
  }

  .community-consent-actions .primary-button {
    grid-row: 1;
  }
}

@media (max-width: 560px) {
  .room-management {
    align-items: stretch;
    flex-direction: column;
  }

  .room-management .secondary-button {
    width: 100%;
  }

  .data-summary div {
    grid-template-columns: 1fr;
    gap: var(--space-1);
  }

  .settings-group,
  .settings-audio {
    grid-template-columns: 1fr;
  }

  .settings-audio .settings-action {
    grid-column: 1;
  }

  .settings-action {
    width: 100%;
  }

  .invite-actions {
    grid-template-columns: 1fr;
  }

  .invite-actions .primary-button {
    grid-row: 1;
  }
}

#add-name-title {
  font-size: 1.75rem;
  font-variation-settings: "SOFT" 30, "WONK" 1;
}

.add-name-description {
  max-width: 42ch;
  margin: calc(var(--space-2) * -1) 0 var(--space-5);
  color: var(--ink-soft);
  font-size: var(--text-small);
  text-wrap: pretty;
}

#add-name-form {
  display: flex;
  flex-direction: column;
}

.add-name-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.add-name-field > span,
.add-name-gender legend {
  font-size: var(--text-label);
  font-weight: 600;
}

.add-name-gender {
  margin-top: var(--space-4);
}

.add-name-gender .segmented-control {
  margin-top: var(--space-2);
}

.add-name-optional {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
}

.add-name-optional > p {
  font-size: var(--text-label);
  font-weight: 600;
}

.add-name-optional > p span {
  margin-left: 0.25rem;
  color: var(--ink-mute);
  font-weight: 500;
}

.custom-name-error {
  margin-top: var(--space-4);
  padding: 0.7rem 0.85rem;
  border-radius: var(--r-sm);
  background: var(--refuse-tint);
  color: var(--refuse);
  font-size: var(--text-label);
  font-weight: 550;
}

.add-name-footer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line-soft);
}

@media (max-width: 380px) {
  .progress-actions .add-name-button span {
    display: none;
  }

  .add-name-button {
    width: 44px;
    padding: 0;
  }

  .add-name-footer {
    grid-template-columns: 1fr;
  }

  .add-name-footer .primary-button {
    grid-row: 1;
  }
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.dialog-kicker {
  display: block;
  margin-bottom: 0.3rem;
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Bewertung */

.rating-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.rating-dialog:focus {
  outline: none;
}

.rating-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: var(--space-2);
  border-radius: var(--r-pill);
  background: var(--primary-tint);
  color: var(--primary);
}

.rating-icon svg {
  width: 22px;
  fill: currentColor;
  stroke: none;
}

.rating-content > p {
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

#rating-name {
  font-size: clamp(1.75rem, 8vw, 2.15rem);
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 80;
  letter-spacing: -0.03em;
}

.rating-content > span {
  margin-bottom: var(--space-4);
  font-size: var(--text-small);
  color: var(--ink-mute);
}

.rating-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-2);
  width: 100%;
}

.rating-buttons button {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  background: var(--sunken);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  touch-action: manipulation;
  transition: background-color 0.16s var(--ease), color 0.16s var(--ease),
    transform 0.16s var(--ease-spring), box-shadow 0.16s var(--ease);
}

.rating-buttons button:active {
  transform: scale(0.96);
  background: var(--primary-fill);
  color: var(--on-primary);
  box-shadow: var(--lift-1);
}

@media (hover: hover) and (pointer: fine) {
  .rating-buttons button:hover {
    transform: translateY(-2px);
    background: var(--primary-fill);
    color: var(--on-primary);
    box-shadow: var(--lift-1);
  }
}

.rating-scale {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 0.4rem;
  font-size: var(--text-micro);
  color: var(--ink-faint);
}

.rating-footer {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

/* -- 10 Match-Moment ----------------------------------------------------- */

.match-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background: var(--overlay-bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.34s var(--ease), visibility 0.34s;
}

.match-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 40% at 50% 38%, var(--overlay-glow-a) 0%, transparent 70%),
    radial-gradient(70% 55% at 50% 108%, var(--overlay-glow-b) 0%, transparent 72%);
}

.match-overlay.active {
  opacity: 1;
  visibility: visible;
}

.match-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  width: min(400px, 100%);
  text-align: center;
  color: var(--on-dark);
}

.match-badge {
  padding: 0.3rem 0.85rem;
  margin-bottom: var(--space-2);
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--overlay-hairline);
  font-size: var(--text-micro);
  font-weight: 650;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--spark);
  animation: match-copy-in 0.5s var(--ease) 0.1s both;
}

.match-avatars {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: var(--space-3);
  animation: avatars-in 0.6s var(--ease-spring) 0.16s both;
}

.match-avatars .avatar {
  width: 46px;
  height: 46px;
  margin: 0;
  border-color: transparent;
  font-size: var(--text-body);
}

.heart-link {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: var(--r-pill);
  background: var(--spark);
  color: var(--night-deep);
}

.heart-link svg {
  width: 14px;
  fill: currentColor;
  stroke: none;
}

.match-intro {
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-feature-soft);
  animation: match-copy-in 0.5s var(--ease) 0.24s both;
}

#match-title {
  font-size: clamp(3rem, 15vw, 4.4rem);
  font-weight: 400;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 130;
  letter-spacing: -0.038em;
  line-height: 1;
  color: var(--on-dark);
  overflow-wrap: anywhere;
  animation: match-fly 0.72s var(--ease-spring) 0.28s both;
}

.match-full-name {
  font-family: var(--font-display);
  font-size: var(--text-lead);
  font-weight: 300;
  color: var(--on-feature-soft);
  animation: match-copy-in 0.5s var(--ease) 0.42s both;
}

.match-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
  margin-top: var(--space-6);
  animation: match-copy-in 0.5s var(--ease) 0.54s both;
}

.match-primary,
.match-secondary {
  min-height: 50px;
  border-radius: var(--r-md);
  font-size: var(--text-body);
  font-weight: 600;
  transition: background-color 0.18s var(--ease), transform 0.14s var(--ease);
}

.match-primary {
  background: var(--spark);
  color: var(--on-spark);
}

.match-primary:hover {
  background: var(--spark-strong);
}

.match-secondary {
  color: var(--on-feature);
  box-shadow: inset 0 0 0 1px var(--overlay-hairline);
}

.match-secondary:hover {
  background: var(--overlay-wash);
}

.match-primary:active,
.match-secondary:active {
  transform: translateY(1px);
}

@keyframes match-fly {
  from {
    opacity: 0;
    transform: translateY(26px) scale(0.9);
  }
}

@keyframes match-copy-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes avatars-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}

/* Funkenflug */

.spark-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.spark-field i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 1.5px;
  background: var(--spark);
  opacity: 0;
}

.match-overlay.active .spark-field i {
  animation: spark-burst 1.5s var(--ease) 0.3s both;
}

.spark-field i:nth-child(1) { --spark-x: -34vw; --spark-y: -30vh; --spark-r: 65deg; }
.spark-field i:nth-child(2) { --spark-x: -21vw; --spark-y: -38vh; --spark-r: 12deg; background: var(--spark-strong); }
.spark-field i:nth-child(3) { --spark-x: 8vw; --spark-y: -36vh; --spark-r: 110deg; }
.spark-field i:nth-child(4) { --spark-x: 30vw; --spark-y: -22vh; --spark-r: 32deg; background: var(--primary-fill); }
.spark-field i:nth-child(5) { --spark-x: 37vw; --spark-y: 6vh; --spark-r: 80deg; }
.spark-field i:nth-child(6) { --spark-x: 26vw; --spark-y: 31vh; --spark-r: 135deg; background: var(--spark-strong); }
.spark-field i:nth-child(7) { --spark-x: 6vw; --spark-y: 39vh; --spark-r: 44deg; }
.spark-field i:nth-child(8) { --spark-x: -19vw; --spark-y: 33vh; --spark-r: 95deg; background: var(--primary-fill); }
.spark-field i:nth-child(9) { --spark-x: -38vw; --spark-y: 11vh; --spark-r: 27deg; }
.spark-field i:nth-child(10) { --spark-x: -32vw; --spark-y: -7vh; --spark-r: 120deg; background: var(--spark-strong); }

@keyframes spark-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
  }
  22% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(0.5)
      rotate(var(--spark-r));
  }
}

/* -- 11 Feinschliff ------------------------------------------------------ */

.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 3.9rem);
  z-index: var(--z-toast);
  max-width: min(340px, calc(100vw - 2.5rem));
  padding: 0.65rem 1.05rem;
  border-radius: var(--r-pill);
  background: var(--night);
  color: var(--on-dark);
  box-shadow: var(--lift-2);
  font-size: var(--text-label);
  font-weight: 550;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none;
  transition: opacity 0.26s var(--ease), transform 0.26s var(--ease);
}

.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Seitenleiste ab Desktop */

@media (min-width: 1024px) {
  .main-view {
    align-items: stretch;
    gap: clamp(2rem, 5vw, 5rem);
    padding: 0 clamp(1.5rem, 4vw, 3.5rem);
    background:
      radial-gradient(48% 38% at 12% 8%, var(--primary-veil) 0%, transparent 70%),
      var(--shell-surface-soft);
  }

  .session-rail {
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    width: min(300px, 26vw);
    flex: none;
    padding: var(--space-8) 0;
  }

  .rail-brand {
    margin-bottom: var(--space-2);
  }

  .rail-block {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .rail-label {
    font-size: var(--text-micro);
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-faint);
  }

  .participant-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
  }

  .participant-row .avatar {
    margin: 0;
  }

  .participant-copy {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
  }

  .participant-copy strong {
    font-size: var(--text-small);
    font-weight: 600;
  }

  .participant-copy small {
    font-size: var(--text-label);
    color: var(--ink-mute);
    font-variant-numeric: tabular-nums;
  }

  .status-dot {
    flex: none;
    width: 7px;
    height: 7px;
    border-radius: var(--r-pill);
    background: var(--line-strong);
  }

  .status-dot.online {
    background: var(--online);
  }

  .invite-button {
    align-self: flex-start;
  }

  .filter-summary {
    padding-top: var(--space-5);
    border-top: 1px solid var(--line);
  }

  .summary-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    font-size: var(--text-small);
    color: var(--ink-soft);
  }

  .summary-row strong {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    color: var(--ink);
  }

  .summary-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: var(--space-2);
  }

  .summary-tags span {
    padding: 0.2rem 0.55rem;
    border-radius: var(--r-pill);
    background: var(--sunken);
    box-shadow: inset 0 0 0 1px var(--line-soft);
    font-size: var(--text-micro);
    font-weight: 550;
    color: var(--ink-soft);
  }

  .summary-tags .all-styles {
    background: var(--primary-tint);
    color: var(--primary);
    box-shadow: none;
  }

  .privacy-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: auto;
    font-size: var(--text-label);
    color: var(--ink-mute);
    text-wrap: pretty;
  }

  .privacy-note svg {
    flex: none;
    width: 15px;
    margin-top: 2px;
  }

  /* Die App bekommt eine ruhige, praezise Rahmung statt eines Geraetebildes. */
  .mobile-app {
    width: min(430px, 100%);
    height: min(880px, calc(100dvh - 4rem));
    margin: auto 0;
    border-radius: 34px;
    box-shadow: var(--lift-3), inset 0 0 0 1px var(--line-soft);
  }

  .app-bar {
    padding-top: var(--space-4);
  }

  /* Rail und App sind als Gruppe zentriert – der Toast folgt der App-Mitte
     und der oberen Kante des Panels, das vertikal zentriert steht. */
  .toast {
    left: calc(50% + (min(300px, 26vw) + clamp(2rem, 5vw, 5rem)) / 2);
    top: calc(50% - min(880px, 100dvh - 4rem) / 2 + 4.2rem);
  }
}

@media (min-width: 900px) {
  body::after {
    background-position: center;
    background-size: auto 100dvh;
  }

  .room-gate-main {
    grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
    align-items: center;
  }

  .room-card {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding: var(--space-8);
  }

  .room-trust-grid {
    grid-column: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .setup-header,
  .setup-main {
    max-width: 720px;
  }

  .setup-main {
    padding-top: var(--space-8);
  }

  .funnel-actions {
    position: static;
    margin: var(--space-2) 0 0;
    padding: var(--space-5) 0 0;
    background: none;
    backdrop-filter: none;
    border-top: 1px solid var(--line);
  }

  .search-criteria {
    grid-template-columns: 1fr 1fr;
  }

  .search-criteria label:first-child {
    grid-column: 1 / -1;
  }

  .surname-fields,
  .surname-mode {
    grid-template-columns: 1fr 1fr;
  }
}

/* Sehr schmale oder sehr flache Geraete */

@media (max-width: 360px) {
  .action-row {
    gap: var(--space-3);
  }

  .segmented-control span {
    font-size: var(--text-micro);
  }

  .result-tabs button {
    flex-direction: column;
    gap: 0.1rem;
    min-height: 52px;
  }

  .favorite-item {
    padding-inline: var(--space-2);
  }

  .favorite-drag-handle {
    width: 26px;
  }
}

@media (max-height: 700px) and (max-width: 900px) {
  .round-summary {
    gap: var(--space-2);
    padding: var(--space-4);
  }

  .round-summary-stats {
    padding: var(--space-2) 0;
  }

  .round-summary-stats dd {
    font-size: 1.25rem;
  }

  .name-hero {
    min-height: 200px;
    padding: var(--space-2) 0;
  }

  .gesture-help {
    display: none;
  }

  .action-row {
    padding-bottom: var(--space-2);
  }

  .full-name-preview {
    padding: var(--space-3);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .spark-field {
    display: none;
  }

  .active-card.exit-left,
  .active-card.exit-right,
  .active-card.exit-up {
    transform: none;
  }
}
