:root {
  --bg: #f6f1ea;
  --card: #ffffff;
  --ink: #2a2422;
  --muted: #7a6f69;
  --line: #e6ddd3;
  --accent: #b3261e;
  --accent-ink: #ffffff;
  --green: #2e6b45;
  --green-bg: #e5f1e8;
  --red-bg: #fbe7e5;
  --amber-bg: #fdf3dc;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(42, 36, 34, 0.06), 0 6px 24px rgba(42, 36, 34, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1716;
    --card: #262120;
    --ink: #f1ebe5;
    --muted: #a99d96;
    --line: #3b3432;
    --accent: #e0584e;
    --green: #7fc79a;
    --green-bg: #1f3227;
    --red-bg: #3a2120;
    --amber-bg: #3a3020;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
header.top h1 { font-size: 1.4rem; margin: 0; }
h1, h2, h3 { line-height: 1.25; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }
.stack > * + * { margin-top: 12px; }
label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 4px; }
input[type="text"], input[type="password"], input[type="email"], input[type="date"], textarea, select {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  width: 100%;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button, .btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
button:hover { border-color: var(--muted); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--accent); }
button.link { border: none; background: none; padding: 4px 6px; color: var(--muted); font-weight: 500; }
button.link:hover { color: var(--ink); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: none; }
.table-scroll { overflow-x: auto; }
.code {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}
.pill { display: inline-block; font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.warn { background: var(--amber-bg); }
.msg { padding: 10px 14px; border-radius: 10px; margin: 12px 0; }
.msg.error { background: var(--red-bg); }
.msg.ok { background: var(--green-bg); color: var(--green); }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 4px 0; }
.checks .ok::before { content: "✔ "; color: var(--green); font-weight: 700; }
.checks .bad::before { content: "✖ "; color: var(--accent); font-weight: 700; }
.group-list a { color: inherit; text-decoration: none; display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.group-list a:last-child { border-bottom: none; }
.group-list a:hover strong { color: var(--accent); }
.spoiler .recv span { filter: blur(6px); user-select: none; }
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; }
.linkbox input { flex: 1 1 260px; font-family: ui-monospace, Consolas, monospace; font-size: 0.9rem; }
.hidden { display: none !important; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 0.9rem;
}

/* Teilnehmerseite */
.join { max-width: 440px; margin: 0 auto; padding: 48px 16px; text-align: center; }
.join .card { padding: 32px 24px; }
.join .gift { font-size: 3rem; line-height: 1; }
.join h1 { font-size: 1.5rem; margin: 12px 0 4px; }
.code-input {
  font-family: ui-monospace, Consolas, monospace !important;
  font-size: 2rem !important;
  letter-spacing: 0.4em;
  text-align: center;
  text-transform: uppercase;
  max-width: 220px;
  margin: 16px auto;
  display: block;
  padding-left: 0.4em !important;
}
.reveal-name { font-size: 2.2rem; font-weight: 800; color: var(--accent); margin: 8px 0 16px; word-break: break-word; }
@media (max-width: 560px) {
  .hide-sm { display: none; }
  th, td { padding: 8px 4px; }
}

/* Erweiterungen */
label.check { font-weight: 500; display: block; margin: 0; }
label.check input { margin: 0 6px 0 0; }
.plain-list { list-style: none; padding: 0; margin: 12px 0 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: none; }
.qr { margin-top: 12px; text-align: center; }
.qr img { background: #fff; padding: 8px; border-radius: 10px; display: inline-block; }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  padding: 20px;
  width: min(480px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.info-box { background: var(--bg); border-radius: 10px; padding: 10px 14px; margin: 12px 0; font-size: 0.95rem; text-align: left; }
.info-box div + div { margin-top: 2px; }
.section { text-align: left; margin-top: 24px; }
.section h2 { font-size: 1.05rem; margin-bottom: 8px; }
.wish { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: 10px 14px; text-align: left; }
.thread { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; max-height: 300px; overflow-y: auto; }
.bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; font-size: 0.95rem; }
.bubble.theirs { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 4px; }
.bubble.mine { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.bubble time { display: block; font-size: 0.7rem; opacity: 0.7; margin-top: 2px; }
.join textarea { min-height: 90px; }

:root { color-scheme: light dark; }

/* Status je Person (Admin) */
.status-list { display: grid; gap: 10px; }
.status-item { border: 1px solid var(--line, rgba(127,127,127,.25)); border-radius: 12px; padding: 10px 14px; }
.status-item .head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.status-item .head strong { margin-right: auto; }
.status-item .wish { margin-top: 8px; font-size: 0.9rem; max-height: 180px; overflow-y: auto; word-break: break-word; }
.status-item .wish.muted { font-style: italic; }
