/* WeeMeetly Gast-Seite (links.weemeetly.com). Designsystem "Armband" (docs/DESIGN.md): Sonnengelb auf Aubergine.
   Schriften selbst gehostet (assets/fonts, SIL OFL), keine externen Quellen. */

@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/BricolageGrotesque_700Bold.ttf") format("truetype"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 800; font-style: normal; font-display: swap; src: url("fonts/BricolageGrotesque_800ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/Figtree_400Regular.ttf") format("truetype"); }
@font-face { font-family: "Figtree"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/Figtree_600SemiBold.ttf") format("truetype"); }

:root {
  color-scheme: light dark;
  --bg: #F2EEF3; --surface: #FBF8FB; --surface-alt: #E7E1EA; --text: #241B2C; --muted: #5E5368; --border: #CEC4D3;
  --primary: #FFC531; --on-primary: #1F1200; --ink: #7A5200; --primary-soft: #FFD866;
  --sun: #FFC93C; --on-sun: #1F1200;
  --signal: #EC4D78; --signal-text: #B0194A; --signal-soft: #FFDCE5;
  --success: #2B6E2F; --success-soft: #DCEEDD; --warning: #86520A; --warning-soft: #F8E7C8; --danger: #B3261E; --danger-soft: #FADDD9;
  --brand-a: #2B1F36; --brand-b: #3D2B4A; --on-brand: #FFFFFF;
  --focus: #241B2C;
  --shadow: 0 1px 2px rgba(36, 27, 44, .06), 0 14px 32px -16px rgba(36, 27, 44, .28);
  --y0:#AB4046;--y1:#A8471B;--y2:#995700;--y3:#6C6F00;--y4:#267D30;--y5:#00815F;--y6:#007E8F;--y7:#0070B0;--y8:#535EB8;--y9:#7951AB;--y10:#94468F;--y11:#A4406B;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Figtree", "Avenir Next", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1521; --surface: #261E2D; --surface-alt: #322839; --text: #F4EEF6; --muted: #B6AABF; --border: #4A3E54;
    --primary: #FFB84D; --on-primary: #2B1700; --ink: #FFC670; --primary-soft: #4A3412;
    --sun: #FFD25E; --on-sun: #2B1700;
    --signal: #FF86C0; --signal-text: #FFA3CF; --signal-soft: #4A2438;
    --success: #86D58C; --success-soft: #22402A; --warning: #F2B862; --warning-soft: #46330F; --danger: #FF9470; --danger-soft: #4A2A22;
    --focus: #F4EEF6;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 14px 34px -16px rgba(0, 0, 0, .6);
    --y0:#FB9797;--y1:#F89D79;--y2:#E7AA5B;--y3:#B9BF5F;--y4:#85CC87;--y5:#56D0AF;--y6:#3BCDDC;--y7:#69C1FC;--y8:#A1B1FF;--y9:#C6A5F7;--y10:#E39BDC;--y11:#F496BA;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 1rem; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
::selection { background: var(--sun); color: var(--on-sun); }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.015em; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--ink); text-underline-offset: .18em; }

main { width: 100%; max-width: 600px; margin: 0 auto; padding: 16px 16px 56px; }
@media (min-width: 720px) { main { padding-top: 40px; } }

/* Kopf: Aubergine-Block mit Armband */
.top {
  position: relative; overflow: hidden; border-radius: 28px; margin-bottom: 16px;
  background: linear-gradient(160deg, var(--brand-b), var(--brand-a)); color: var(--on-brand);
}
.brand { font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: -.02em; padding: 22px 24px 18px; }
.band { width: 100%; height: 34px; object-fit: cover; }

/* Flaechen statt Rahmen-Karten */
.panel { background: var(--surface); border-radius: 28px; padding: 24px 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
@media (min-width: 720px) { .panel { padding: 28px 28px; } }
.mute { color: var(--muted); }
.kicker { color: var(--ink); font-weight: 600; font-size: .95rem; margin-bottom: 6px; }
.kicker:empty { display: none; }
h1 { font-size: clamp(1.7rem, 1.2rem + 2.2vw, 2.2rem); line-height: 1.1; }
h2 { font-size: 1.15rem; line-height: 1.25; }

/* Laden */
.loading { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; color: var(--muted); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--surface-alt); border-top-color: var(--primary); animation: spin .9s linear infinite; }
.skeleton { flex: 0 0 100%; display: grid; gap: 10px; margin-top: 8px; }
.skeleton i { display: block; height: 18px; border-radius: 99px; background: var(--surface-alt); animation: pulse 1.6s ease-in-out infinite; }
.skeleton i:nth-child(1) { width: 60%; height: 26px; } .skeleton i:nth-child(2) { width: 85%; } .skeleton i:nth-child(3) { width: 45%; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .55; } }

/* Fehler */
.error-panel { text-align: center; padding-block: 32px; }
.error-panel h2 { font-size: 1.4rem; margin-bottom: 8px; }
.torn { margin: 0 auto 12px; fill: none; stroke-width: 5; stroke-linecap: round; }
.torn .a { stroke: var(--y1); } .torn .b { stroke: var(--y7); }
#error:not([hidden]) ~ .privacy { display: none; }

/* Event */
.event .when, .event .where { display: flex; align-items: flex-start; gap: 10px; }
.event .when { margin-top: 14px; font-size: 1.1rem; font-weight: 600; }
.event .where { margin-top: 6px; color: var(--muted); }
.when:empty, .where:empty { display: none; }
.when::before, .where::before { content: ""; flex: 0 0 22px; height: 22px; margin-top: 1px; background: var(--ink); -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; }
.when { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v3M17 2v3M3.5 9h17M5 4.5h14a1.5 1.5 0 0 1 1.5 1.5v13a1.5 1.5 0 0 1-1.5 1.5H5A1.5 1.5 0 0 1 3.5 19V6A1.5 1.5 0 0 1 5 4.5Z' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.where { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s7-6.1 7-11.5A7 7 0 0 0 5 9.5C5 14.9 12 21 12 21Z' fill='none' stroke='%23000' stroke-width='2' stroke-linejoin='round'/%3E%3Ccircle cx='12' cy='9.5' r='2.5' fill='%23000'/%3E%3C/svg%3E"); }
.where::before { background: var(--muted); }
.counts { display: inline-block; margin-top: 18px; padding: 10px 18px; border-radius: 999px; background: var(--surface-alt); font-weight: 600; font-variant-numeric: tabular-nums; white-space: pre; }
.counts:empty { display: none; }

/* Abstimmung */
.plan .mute { margin-top: 6px; }
#plQuestions h2 { margin: 24px 0 8px; font-size: 1.2rem; }
#plQuestions h2:first-child { margin-top: 20px; }
label.opt {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 14px;
  min-height: 56px; margin: 8px 0; padding: 12px 16px; border-radius: 20px; cursor: pointer;
  background: var(--surface-alt); transition: background-color .18s;
}
label.opt:has(input:checked) { background: var(--primary-soft); }
label.opt:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
label.opt input {
  -webkit-appearance: none; appearance: none; margin: 0; width: 26px; height: 26px; border-radius: 9px; cursor: inherit;
  background: var(--surface); border: 2px solid var(--muted); display: grid; place-content: center;
}
label.opt input:focus-visible { outline: none; }
label.opt input::after { content: ""; width: 14px; height: 8px; margin-top: -3px; border: solid var(--on-primary); border-width: 0 0 3px 3px; transform: rotate(-45deg) scale(0); transition: transform .15s; }
label.opt input:checked { background: var(--primary); border-color: var(--primary); }
label.opt input:checked::after { transform: rotate(-45deg) scale(1); }
label.opt input:disabled { opacity: .6; }
label.opt:has(input:disabled) { cursor: default; }
label.opt .cnt { color: var(--muted); font-size: .92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { grid-column: 1 / -1; display: block; height: 10px; border-radius: 99px; background: var(--bg); overflow: hidden; }
.fill { display: flex; gap: 2px; height: 100%; width: var(--w, 0%); min-width: 0; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.fill i { flex: 1 1 0; min-width: 3px; border-radius: 99px; }
.fill .t0 { background: var(--y0); }
.fill .t1 { background: var(--y1); }
.fill .t2 { background: var(--y2); }
.fill .t3 { background: var(--y3); }
.fill .t4 { background: var(--y4); }
.fill .t5 { background: var(--y5); }
.fill .t6 { background: var(--y6); }
.fill .t7 { background: var(--y7); }
.fill .t8 { background: var(--y8); }
.fill .t9 { background: var(--y9); }
.fill .t10 { background: var(--y10); }
.fill .t11 { background: var(--y11); }

/* Formular */
.field-label { display: block; font-family: var(--display); font-weight: 800; font-size: 1.15rem; margin-bottom: 10px; }
input[type=text], input[type=password] {
  width: 100%; min-height: 52px; padding: 12px 18px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg); border: 2px solid var(--border); border-radius: 20px;
}
input[type=text]:focus-visible, input[type=password]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-color: transparent; }
.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
button {
  font: inherit; font-weight: 600; min-height: 52px; padding: 12px 20px; border-radius: 999px; cursor: pointer;
  border: 2px solid transparent; background: var(--surface-alt); color: var(--text);
  transition: background-color .18s, transform .12s;
}
button:active:not(:disabled) { transform: scale(.97); }
button.primary { flex: 1 1 100%; background: var(--primary); color: var(--on-primary); font-size: 1.05rem; }
.rsvp { gap: 8px; }
.rsvp button { flex: 1 1 88px; min-width: 0; padding-inline: 8px; font-size: .95rem; line-height: 1.2; text-wrap: balance; }
.rsvp button.sel::before, .rsvp button[aria-pressed="true"]::before { content: "\2713\00a0"; font-weight: 800; }
.rsvp button.yes.sel { background: var(--primary); color: var(--on-primary); }
.rsvp button.maybe.sel { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
.rsvp button.no.sel { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
button:disabled { cursor: default; background: var(--surface-alt); color: var(--muted); }
button.sel:disabled { opacity: .85; }
.msg { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 14px 18px; border-radius: 20px; font-weight: 600; }
.msg::before { flex: 0 0 auto; font-weight: 800; }
.msg.ok { background: var(--success-soft); color: var(--success); } .msg.ok::before { content: "\2713"; }
.msg.err { background: var(--danger-soft); color: var(--danger); } .msg.err::before { content: "!"; }
.note { margin-top: 16px; padding: 14px 18px; border-radius: 20px; background: var(--surface-alt); color: var(--muted); }

.foot { text-align: center; margin-top: 8px; }
a.link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--ink); font-size: .95rem; font-weight: 600; }
.privacy { text-align: center; color: var(--muted); font-size: .85rem; max-width: 460px; margin: 4px auto 0; }

/* Konfetti: nur nach eigener Handlung (assets/ui.js), nie automatisch */
.confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; left: var(--x0); top: var(--y0); width: 9px; height: 14px; border-radius: 3px; opacity: 0;
  animation: pop 1.3s cubic-bezier(.15,.7,.3,1) var(--delay, 0ms) forwards;
}
.confetti i.dot { width: 10px; height: 10px; border-radius: 50%; }
.confetti .c0 { background: var(--y0); }
.confetti .c1 { background: var(--y1); }
.confetti .c2 { background: var(--y2); }
.confetti .c3 { background: var(--y3); }
.confetti .c4 { background: var(--y4); }
.confetti .c5 { background: var(--y5); }
.confetti .c6 { background: var(--y6); }
.confetti .c7 { background: var(--y7); }
.confetti .c8 { background: var(--y8); }
.confetti .c9 { background: var(--y9); }
.confetti .c10 { background: var(--y10); }
.confetti .c11 { background: var(--y11); }
@keyframes pop {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 120px)) rotate(var(--rot)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .confetti { display: none; }
}

/* Einladungsseite (einladung.html): beide Sprachen sichtbar, bis assets/invite.js html[data-lang] setzt */
html[data-lang="de"] [lang="en"], html[data-lang="en"] [lang="de"] { display: none !important; }
.invite h1 span, .invite .lead span, .invite .note span { display: block; }
.invite .note span + span { margin-top: 6px; font-size: .92rem; }
.invite .lead { margin-top: 8px; color: var(--muted); font-size: 1.1rem; }
.codebox { margin-top: 24px; padding: 20px; border-radius: 28px; background: var(--primary-soft); }
.code-label { font-weight: 600; color: var(--ink); }
.code { margin: 8px 0 4px; font-family: var(--display); font-weight: 800; font-size: clamp(2rem, 9vw, 2.8rem); letter-spacing: .14em; line-height: 1.15; word-break: break-all; user-select: all; }
.codebox .row { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 12px 22px; border-radius: 999px; font-weight: 600; text-decoration: none; text-align: center; }
.btn.primary { flex: 1 1 180px; background: var(--primary); color: var(--on-primary); }
/* Zum Kalender (Gast-Seite, N32): zwei Link-Knoepfe im Armband-Stil, Rand in Garnfarbe */
.codebox button.secondary { flex: 1 1 140px; background: var(--surface); }
.codebox .msg { margin-top: 12px; }
.invite .note { margin-top: 24px; }
/* Einladungsseite: "Hol dir die App" (Store-/Beta-Links aus assets/app-links.js) */
.invite .getapp { margin-top: 24px; }
.invite .getapp h2 span { display: block; }
.invite .getapp .muted { margin: 6px 0 0; color: var(--muted); }
.invite .getapp .muted span { display: block; }
.invite .getapp .row { margin-top: 12px; }

/* Hinweis nach der Antwort (Kalender/App) und Bestaetigung zum Loeschen (ersetzt window.confirm) */
.app-hint h2 { font-size: 1.15rem; }
.app-hint p { margin-top: 6px; }
.app-hint .row { margin-top: 12px; }
.forget-confirm h2 { font-size: 1.15rem; }
.forget-confirm p { margin-top: 6px; }
button.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
#voteMsg { margin-top: 12px; }

.invite .steps { margin: 12px 0 0; padding-left: 22px; text-align: left; color: var(--muted); }
.invite .steps li + li { margin-top: 6px; }
.invite .steps span { display: block; }
