/* ============================================================
   Layout & Komponenten
   ------------------------------------------------------------
   #lg-root ist gleichzeitig der LiquidGlass-Root UND der Layout-
   Container. Alle Kinder liegen flach darin (Direct-Child-Regel der
   Lib), die Bildschirm-Gruppierung laeuft ueber data-*-Attribute.
   Bewusst KEIN overflow:hidden hier - das wuerde den Schattenhof
   des Shaders abschneiden.
   ============================================================ */

#lg-root {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 18px 18px calc(36px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#lg-root > [hidden] { display: none !important; }

/* Ebenen explizit: .bg liegt auf 0, alle Inhalte auf 1.
   Ohne das uebermalt die fixierte .bg jeden statischen Inhalt
   (Ueberschriften verschwinden) - genau das ist hier schon passiert. */
#lg-root > * { position: relative; z-index: 1; }
/* Spezifitaet muss die ID-Regel darueber schlagen, sonst wird das
   position:fixed zu relative und die Flaeche kollabiert auf Hoehe 0. */
#lg-root > .bg { position: fixed; inset: 0; z-index: 0; }

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  min-height: 56px;
  border-radius: 28px;
}
.topbar__back {
  width: 38px; height: 38px; flex: 0 0 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit; font-size: 1.2rem; line-height: 1;
  cursor: pointer;
  display: none; align-items: center; justify-content: center;
  transition: transform 0.16s var(--ease);
}
.topbar__back:active { transform: scale(0.9); }
.topbar__back.is-visible { display: flex; }
.topbar__title { font-size: 1.02rem; font-weight: 650; margin: 0; flex: 1; text-align: center; }
.topbar__spacer { width: 38px; flex: 0 0 38px; }

/* ---------------- Text ---------------- */
.headline { font-size: 1.5rem; margin: 6px 0 0; text-align: center; }
.sub { text-align: center; color: var(--text-dim); font-size: 0.92rem; line-height: 1.5; margin: 0; }
.error { color: var(--danger); font-size: 0.85rem; text-align: center; min-height: 1.15em; margin: 0; }

/* ---------------- Panels ---------------- */
.panel { padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.panel--tight { padding: 10px; gap: 0; }

/* ---------------- Hub ---------------- */
.hero { text-align: center; padding: 20px 8px 2px; }
.hero__title {
  font-size: 2.5rem; font-weight: 750; margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.tile {
  display: flex; align-items: center; gap: 16px;
  padding: 18px; width: 100%; text-align: left;
  border: none; font: inherit; color: var(--text);
  cursor: pointer; border-radius: 24px;
}
.tile__icon {
  width: 54px; height: 54px; flex: 0 0 54px;
  border-radius: 17px; display: grid; place-items: center;
  font-size: 1.7rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}
.tile__body { flex: 1; min-width: 0; display: block; }
.tile__name { font-size: 1.12rem; font-weight: 650; display: block; margin-bottom: 3px; }
.tile__desc { font-size: 0.85rem; color: var(--text-dim); display: block; line-height: 1.4; }
.tile__meta { font-size: 0.78rem; color: var(--text-faint); display: block; margin-top: 6px; }
.tile__chevron { color: var(--text-faint); font-size: 1.3rem; }

.tile--soon {
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
  cursor: default; opacity: 0.7;
}
.tile--soon .tile__icon { background: rgba(255, 255, 255, 0.07); box-shadow: none; font-size: 1.4rem; }

/* ---------------- Stepper ---------------- */
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper__btn {
  width: 46px; height: 46px; flex: 0 0 46px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text); font: inherit; font-size: 1.4rem; line-height: 1;
  cursor: pointer; transition: transform 0.14s var(--ease);
}
.stepper__btn:active { transform: scale(0.9); }
.stepper .input {
  text-align: center; font-size: 1.25rem; font-weight: 650;
  -moz-appearance: textfield;
}
.stepper .input::-webkit-outer-spin-button,
.stepper .input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.checkline { display: flex; align-items: center; gap: 11px; font-size: 0.94rem; cursor: pointer; }
.checkline input { width: 20px; height: 20px; accent-color: var(--accent); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------- Namensliste ---------------- */
.names { display: flex; flex-direction: column; }
.name-row {
  display: flex; align-items: center; gap: 12px;
  padding: 2px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.names .name-row:last-child { border-bottom: none; }
.name-row__idx { color: var(--text-faint); font-size: 0.85rem; min-width: 20px; }
.name-row input {
  flex: 1; background: transparent; border: none; color: var(--text);
  padding: 13px 0; font: inherit; font-size: 1rem;
}
.name-row input:focus { outline: none; }

/* ---------------- Flip-Karte ----------------
   Kein LiquidGlass-Element: liegt verschachtelt und rotiert in 3D,
   beides vertraegt sich nicht mit dem Direct-Child-Modell der Lib.
   Die Optik ist deshalb hier von Hand nachgebaut.
   ------------------------------------------------------------ */
.flip-wrap { display: flex; justify-content: center; padding: 6px 0; }

.flip {
  width: 100%; max-width: 300px;
  aspect-ratio: 3 / 4;
  perspective: 1500px;
  cursor: pointer; background: none; border: none; padding: 0;
}
.flip__inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform var(--flip-dur) cubic-bezier(0.3, 1.1, 0.35, 1);
}
.flip.is-flipped .flip__inner { transform: rotateY(180deg); }

.flip__face {
  position: absolute; inset: 0;
  border-radius: var(--r-lg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; padding: 24px; text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.flip__face--back {
  background:
    radial-gradient(circle at 30% 22%, rgba(255,255,255,0.20), transparent 58%),
    linear-gradient(150deg, #39414f 0%, #2b323d 55%, #222831 100%);
}
.flip__face--back::after {
  content: ""; position: absolute; inset: 12px;
  border-radius: calc(var(--r-lg) - 10px);
  border: 1px dashed rgba(255, 255, 255, 0.32);
  pointer-events: none;
}
.flip__mark { font-size: 2.6rem; filter: drop-shadow(0 3px 10px rgba(0,0,0,0.35)); }
.flip__name { font-size: 1.6rem; font-weight: 700; margin: 0; word-break: break-word; }
.flip__cta { font-size: 0.85rem; color: rgba(255,255,255,0.85); margin: 0; }

.flip__face--front {
  transform: rotateY(180deg);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.03) 45%, rgba(255,255,255,0.08)),
    rgba(22, 20, 46, 0.72);
}
.flip__label {
  font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--text-faint); margin: 0;
}
/* Schriftgroesse nach Wortlaenge gestaffelt (Klasse setzt imposter.js).
   Ohne das bricht "Bewerbungsgespraech" mitten im Wort um - haesslich und
   auf einer Karte, die man nur kurz sieht, auch schlecht lesbar.
   break-word statt anywhere: bricht nur, wenn es wirklich nicht passt. */
.flip__word {
  font-size: clamp(1.5rem, 8vw, 2.15rem); font-weight: 750;
  line-height: 1.18; margin: 0;
  overflow-wrap: break-word; hyphens: auto;
}
.flip__word.is-long  { font-size: clamp(1.25rem, 6.2vw, 1.72rem); }
.flip__word.is-xlong { font-size: clamp(1.02rem, 5.0vw, 1.38rem); }

.reveal__progress { color: var(--text-dim); font-size: 0.85rem; text-align: center; margin: 4px 0 0; }
.reveal__hint { color: var(--text-dim); font-size: 0.86rem; text-align: center; margin: 0; min-height: 1.3em; }

/* ---------------- Timer ---------------- */
.timer { align-items: center; }
.timer__display {
  font-size: 3.1rem; font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
}
.timer__display.is-done { color: var(--danger); }

/* ---------------- Auflösung ---------------- */
.words-out { text-align: center; color: var(--text-dim); line-height: 1.7; margin: 0; }
.words-out strong { color: var(--text); }

.result-list { display: flex; flex-direction: column; }
.result-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.result-list .result-row:last-child { border-bottom: none; }
.result-row__name { font-weight: 600; word-break: break-word; }
