/* app-huddle.com – ein Stylesheet für alle Seiten.
   Farben und Maße wie in der App (lib/theme/): Cream-Grund, Midnight-Text, weiße Karten mit großem
   Radius, Coral für die eine Aktion. Schriften liegen auf dem eigenen Server (keine Abrufe bei Dritten,
   DSGVO/TDDDG). Immer hell, auch wenn das System dunkel ist – wie die App. */

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka.woff2") format("woff2");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-display: swap;
}

:root {
  color-scheme: light only;
  --cream: #F6F3EE;
  --midnight: #15132B;
  --slate: #5B586E;
  --coral: #FF6B6B;
  --coral-light: #FF8080;
  --coral-shade: #E24F5B;
  --white: #FFFFFF;
  --hairline: rgba(21, 19, 43, 0.08);
  --line: #E4DFD7;
  --sand: #E9E4DC;
  --stage-top: #FFE9B5;
  --stage-bottom: #FFF4DA;
  --display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --text: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --card-shadow: 0 1px 2px rgba(21, 19, 43, 0.04), 0 4px 8px rgba(21, 19, 43, 0.05), 0 12px 24px rgba(21, 19, 43, 0.06);
  /* Personenfarben (PersonColor): Grund, hell, tint (12 %), soft (30 %), ink (55 % zu Midnight) */
  --p-base: #FF6B6B; --p-light: #FF9090; --p-tint: #FFEDED; --p-soft: #FFD3D3; --p-ink: #7E3B48;
}

* { box-sizing: border-box; }
/* Der Kopf ragt auf dem Handy über das Seiten-Padding hinaus; das darf nie seitlich scrollen. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--cream); overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  color: var(--midnight);
  font-family: var(--text);
  font-size: 17px;
  line-height: 25px;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  padding: 0 max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}
a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 8px; }

.wrap { width: 100%; max-width: 440px; margin: 0 auto; }
.wrap-wide { max-width: 640px; }

/* Kopf wie in der Login-Mail: Konfetti fällt vom oberen Rand, in der Mitte die Wortmarke. */
.masthead {
  /* Auf dem Handy bis an den Rand (über das Seiten-Padding hinaus), sonst 440 px breit, mittig */
  align-self: center;
  width: min(calc(100% + 48px), 440px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  margin-bottom: 8px;
  padding-top: env(safe-area-inset-top);
}
.masthead .confetti { width: 100%; max-width: 150px; height: auto; aspect-ratio: 150 / 112; }
.masthead .confetti.r { margin-left: auto; }
.wordmark {
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 92%;
  font-size: 34px;
  line-height: 40px;
  letter-spacing: -0.5px;
  color: var(--coral);
  text-decoration: none;
  padding: 26px 8px 0;
  white-space: nowrap;
}
.wordmark:hover { color: var(--coral-shade); }

main { flex: 1; display: flex; flex-direction: column; }

h1, h2, .display {
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 92%;
  color: var(--midnight);
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: 32px; line-height: 38px; letter-spacing: -0.3px; }
h2 { font-size: 20px; line-height: 24px; }
p { margin: 0; }
.lead { color: var(--slate); text-wrap: pretty; }
.lead + .lead { margin-top: 10px; }
.center { text-align: center; }
.br { white-space: pre-line; }

.card {
  background: var(--white);
  border-radius: 28px;
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
}

/* Bühne mit Maskottchen, wie StepScaffold/MascotPrompt in der App */
.stage {
  width: 168px;
  height: 168px;
  margin: 8px auto 24px;
  border-radius: 48px;
  background: linear-gradient(var(--stage-top), var(--stage-bottom));
  box-shadow: 0 10px 28px rgba(226, 79, 91, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage img { width: 150px; height: 150px; }
@media (prefers-reduced-motion: no-preference) {
  .stage img { animation: breathe 3.6s ease-in-out infinite; transform-origin: 50% 80%; }
}
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03, 0.985); }
}

/* Buttons wie HuddleButton: 56 pt, Stadion, Coral mit Lippe; sekundär weiß mit Haarlinie */
.actions { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; }
.button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 56px;
  border: 0;
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 96%;
  font-size: 18px;
  line-height: 22px;
  color: var(--midnight);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease-out, box-shadow 120ms ease-out;
}
.button.primary {
  background: linear-gradient(var(--coral-light), var(--coral));
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.35), 0 4px 0 var(--coral-shade), 0 6px 8px rgba(255, 107, 107, 0.28), 0 14px 24px rgba(255, 107, 107, 0.22);
  margin-bottom: 4px;
}
.button.primary:active { transform: translateY(4px); box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, 0.35), 0 0 0 var(--coral-shade), 0 2px 4px rgba(255, 107, 107, 0.25); }
.button.secondary {
  background: var(--white);
  box-shadow: inset 0 0 0 1.5px var(--hairline), 0 4px 0 var(--line);
  margin-bottom: 4px;
}
.button.secondary:active { transform: translateY(4px); box-shadow: inset 0 0 0 1.5px var(--hairline), 0 0 0 var(--line); }
.button[aria-disabled="true"] { background: var(--sand); color: var(--slate); box-shadow: none; cursor: default; }
.button[aria-disabled="true"]:active { transform: none; }
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
.hint { color: var(--slate); font-size: 15px; line-height: 21px; text-align: center; white-space: pre-line; }

/* Fuß */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 18px;
  margin: 40px auto 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--slate);
}
.foot a { color: var(--slate); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(91, 88, 110, 0.4); padding: 12px 0; min-height: 44px; }
.foot a:hover { color: var(--midnight); }

/* Startseite */
.hero { text-align: center; padding-top: 4px; }
.hero h1 { font-size: 36px; line-height: 42px; margin-bottom: 12px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 10px 18px;
  border-radius: 40px;
  background: var(--white);
  box-shadow: var(--card-shadow);
  font-family: var(--display);
  font-weight: 600;
  font-stretch: 96%;
  font-size: 17px;
  line-height: 22px;
}
.pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.features { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; }
.features li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
  background: var(--white);
  border-radius: 24px;
  padding: 14px 18px 14px 14px;
  box-shadow: var(--card-shadow);
}
.features img { width: 52px; height: 52px; }
.features strong { display: block; font-family: var(--display); font-weight: 600; font-stretch: 92%; font-size: 18px; line-height: 22px; }
.features span { display: block; color: var(--slate); font-size: 15px; line-height: 21px; margin-top: 2px; }

/* Rechtstexte */
.legal h1 { margin: 8px 0 8px; }
.legal .draft {
  margin: 12px 0 0;
  padding: 12px 16px;
  border-radius: 16px;
  background: #FFF1EF;
  border: 1px solid #FFE1DC;
  color: var(--midnight);
  font-size: 15px;
  line-height: 21px;
}
.legal section { margin-top: 28px; }
.legal h2 { margin-bottom: 8px; }
.legal p { color: var(--midnight); white-space: pre-line; overflow-wrap: break-word; hyphens: manual; }
.legal p + p { margin-top: 10px; }
.legal .card { padding: 4px 24px 28px; margin-top: 20px; }

/* Einladung (wie InviteCard in der App) */
.invite {
  position: relative;
  border-radius: 32px;
  padding: 26px 24px 22px;
  background: linear-gradient(135deg, var(--p-tint), var(--p-soft));
  box-shadow: 0 2px 4px color-mix(in srgb, var(--p-base) 28%, transparent), 0 10px 24px color-mix(in srgb, var(--p-base) 22%, transparent);
  margin-top: 28px;
}
.invite .sticker { position: absolute; top: -20px; right: -10px; width: 96px; height: 96px; transform: rotate(11.5deg); filter: drop-shadow(0 6px 8px rgba(21, 19, 43, 0.18)); }
.invite h1 { padding-right: 72px; overflow-wrap: break-word; }
.invite h1.long { font-size: 24px; line-height: 28px; }
.invite .when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 14px; }
.invite .day { font-family: var(--display); font-weight: 600; font-stretch: 92%; font-size: 20px; line-height: 24px; color: var(--p-ink); }
.invite .time { padding: 3px 10px; border-radius: 20px; background: rgba(255, 255, 255, 0.85); font-weight: 600; font-size: 16px; line-height: 22px; }
.invite .place { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; font-weight: 600; font-size: 16px; line-height: 22px; overflow-wrap: anywhere; }
.invite .place svg { flex: none; width: 18px; height: 18px; margin-top: 2px; fill: var(--p-ink); }
.invite .host { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-weight: 600; font-size: 16px; line-height: 22px; }
.invite .going { display: flex; align-items: center; gap: 12px; margin-top: 18px; color: var(--slate); font-size: 15px; line-height: 21px; }
.invite .faces { display: flex; flex: none; }
.invite .faces .avatar + .avatar { margin-left: -10px; }
.invite .rule { height: 1px; margin: 18px 0 14px; background: color-mix(in srgb, var(--p-ink) 12%, transparent); }
.invite .label { font-weight: 600; font-size: 14px; line-height: 18px; color: var(--slate); }
.invite .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.invite .chips li { padding: 6px 12px; border-radius: 20px; background: rgba(255, 255, 255, 0.85); font-weight: 600; font-size: 14px; line-height: 18px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invite .chips li.more { background: rgba(255, 255, 255, 0.6); }

/* Avatar wie GuestAvatar: Figur auf dem Farbverlauf, weißer Ring, auf Wunsch mit Partyhut */
.avatar {
  --s: 36px;
  position: relative;
  flex: none;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  padding: 2px;
  background: var(--white);
  box-shadow: 0 2px 6px rgba(21, 19, 43, 0.12);
}
.avatar.big { --s: 44px; padding: 3px; }
.avatar .face { width: 100%; height: 100%; border-radius: 50%; overflow: hidden; background: linear-gradient(var(--p-light), var(--p-base)); }
.avatar .face img { width: 100%; height: 100%; }
.avatar .hat { position: absolute; width: calc(var(--s) * 0.36); height: calc(var(--s) * 0.45); top: calc(var(--s) * -0.3); left: calc(var(--s) * 0.44); transform: rotate(20deg); }

.c-coral    { --p-base: #FF6B6B; --p-light: #FF9090; --p-tint: #FFEDED; --p-soft: #FFD3D3; --p-ink: #7E3B48; }
.c-mint     { --p-base: #5FD3B8; --p-light: #8CE5D1; --p-tint: #ECFAF6; --p-soft: #CFF2EA; --p-ink: #36696A; }
.c-sun      { --p-base: #FFD166; --p-light: #FFE199; --p-tint: #FFF9ED; --p-soft: #FFF1D1; --p-ink: #7E6846; }
.c-sky      { --p-base: #5CB8FF; --p-light: #9AD4FF; --p-tint: #EBF6FF; --p-soft: #CEEAFF; --p-ink: #355D8A; }
.c-lavender { --p-base: #9B8CFF; --p-light: #BFB5FF; --p-tint: #F3F1FF; --p-soft: #E1DCFF; --p-ink: #51498A; }

/* Platzhalter beim Laden: ruhige Flächen statt Spinner */
.skeleton .bar { height: 18px; border-radius: 9px; background: rgba(21, 19, 43, 0.06); }
.skeleton .bar.title { height: 34px; width: 72%; border-radius: 12px; }
.skeleton .bar.w60 { width: 60%; margin-top: 18px; }
.skeleton .bar.w40 { width: 40%; margin-top: 12px; }
.skeleton .bar.w50 { width: 50%; margin-top: 28px; }
@media (prefers-reduced-motion: no-preference) {
  .skeleton .bar { animation: pulse 1.4s ease-in-out infinite; }
}
@keyframes pulse { 50% { opacity: 0.45; } }

/* Ankunft der Einladung: kurz und ohne Nachfedern */
@media (prefers-reduced-motion: no-preference) {
  .arrive { animation: arrive 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .arrive .sticker { animation: stick 520ms 120ms cubic-bezier(0.34, 1.56, 0.64, 1) both; }
}
@keyframes arrive { from { opacity: 0; transform: translateY(12px); } }
@keyframes stick { from { opacity: 0; transform: rotate(0deg) scale(0.6); } }

/* Kleine Rückmeldung nach dem Kopieren (wie showPill in der App) */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 140%);
  max-width: calc(100% - 48px);
  padding: 12px 18px;
  border-radius: 40px;
  background: var(--midnight);
  color: var(--white);
  font-weight: 600;
  font-size: 15px;
  line-height: 20px;
  text-align: center;
  opacity: 0;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 160ms;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (min-width: 700px) {
  body { font-size: 17px; }
  .hero h1 { font-size: 44px; line-height: 50px; }
}

.invite + .lead, .invite + .hint { margin-top: 24px; }
h1 + .lead { margin-top: 12px; }
.center .lead { text-wrap: balance; }
