:root {
  --bg: #f7f2ec;
  --card: #ffffff;
  --ink: #2a1d1f;
  --muted: #6f6266;
  --line: #e7ddd5;
  --red: #7a1f2b;
  --red-2: #9b2a39;
  --green: #1f5b45;
  --gold: #e9c46a;
  --danger: #b3261e;
  --radius: 14px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #0d2236;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Weihnachtlicher Hintergrund: Nachthimmel mit Sternen, verschneite Tannen,
   darüber leise fallender Schnee. Als fixierte Pseudo-Elemente statt
   background-attachment: fixed, weil iOS Safari Letzteres ignoriert. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}
body::before {
  z-index: -2;
  background:
    url("/bg-landscape.svg") repeat-x center bottom / auto 240px,
    url("/bg-stars.svg") repeat 0 0 / 400px 300px,
    radial-gradient(ellipse at 80% 8%, rgba(243, 217, 139, .22), transparent 35%),
    linear-gradient(180deg, #0b1d2e 0%, #13324a 55%, #2a5873 100%);
}
body::after {
  z-index: -1;
  background-image: url("/bg-snow.svg"), url("/bg-snow.svg");
  background-size: 240px 240px, 380px 380px;
  opacity: .75;
  animation: snow 30s linear infinite;
}
@keyframes snow {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 480px, 0 380px; }
}
@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
}

.top {
  background: var(--red);
  color: #fff;
  padding: .8rem 1.25rem;
  box-shadow: 0 2px 0 var(--gold);
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em; }
.brand-mark { margin-right: .25rem; }

main {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
  flex: 1;
}

.foot { text-align: center; color: #3c556b; font-size: .85rem; padding: 1rem; }
.foot p { margin: 0 auto; max-width: 34rem; }

h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 .5rem; color: var(--red); }
.hero h1 { color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .45); }
.hero p { text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.hero, .hero .muted, main > .muted { color: #d6e3ee; }
h2 { font-size: 1.25rem; margin: 0 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.25rem 0 .5rem; }

.hero { margin: .5rem 0 1.25rem; }
.lead { font-size: 1.05rem; margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(42, 29, 31, .04), 0 6px 20px rgba(42, 29, 31, .05);
}
.card-accent { border-top: 4px solid var(--green); }
.card-quiet { background: rgba(255, 255, 255, .88); box-shadow: none; border-style: dashed; }
.card > p:last-child { margin-bottom: 0; }

form { display: grid; gap: .9rem; }

.field { display: grid; gap: .3rem; align-content: start; }
.label { font-weight: 600; font-size: .92rem; }
.hint { color: var(--muted); font-size: .85rem; }

.grid2 { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } }

input, select {
  font: inherit;
  width: 100%;
  padding: .65rem .75rem;
  border: 1px solid #cdbfb5;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 3px solid rgba(31, 91, 69, .25); border-color: var(--green); }

.btn {
  font: inherit;
  font-weight: 600;
  border: 0;
  border-radius: 10px;
  padding: .75rem 1.1rem;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  justify-self: start;
}
.btn:hover { background: #174a37; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-small { padding: .5rem .8rem; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--green); border: 1px solid var(--green); }
.btn-ghost:hover { background: rgba(31, 91, 69, .08); }
.btn-danger { background: transparent; color: var(--danger); border: 1px solid currentColor; }
.btn-danger:hover { background: rgba(179, 38, 30, .08); }

.error {
  margin: 0;
  padding: .6rem .8rem;
  border-radius: 10px;
  background: #fbe9e7;
  color: var(--danger);
  font-weight: 500;
}

.share { display: grid; gap: .3rem; margin: .5rem 0; }
.share-row { display: flex; gap: .5rem; }
.share-url { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }

.progress-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.count { font-weight: 700; color: var(--green); white-space: nowrap; }
.progress { height: 10px; background: #efe6df; border-radius: 99px; overflow: hidden; margin: .25rem 0 1rem; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #2f7d60); border-radius: 99px; transition: width .4s ease; }

.chips { list-style: none; padding: 0; margin: 0 0 .75rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { background: #f3ece6; border: 1px solid var(--line); padding: .25rem .7rem; border-radius: 99px; font-size: .92rem; }
.chip-me { background: #e5f0eb; border-color: #b9d6c9; font-weight: 600; }

.reveal-result { text-align: center; padding: 1rem 0 .25rem; }
.reveal-intro { margin: 0; color: var(--muted); }
.reveal-name {
  margin: .25rem 0 .75rem;
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--red);
  word-break: break-word;
}

.pairs { list-style: none; margin: 0; padding: 0; }
.pairs li {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: .75rem;
  align-items: center;
  padding: .55rem 0;
  border-bottom: 1px solid var(--line);
}
.pairs li:last-child { border-bottom: 0; }
.pairs .arrow { color: var(--gold); font-weight: 700; }
.pairs .to { font-weight: 600; }

.manage summary { cursor: pointer; font-weight: 600; }
.manage[open] summary { margin-bottom: .75rem; }
.manage-list { list-style: none; margin: 0; padding: 0; }
.manage-list li { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }

a { color: var(--green); }
