:root {
  --night-1: #07111f;
  --night-2: #0c2338;
  --night-3: #14405a;
  --paper: #fbf6ec;
  --paper-2: #f3ead8;
  --ink: #2a1f1a;
  --ink-soft: #6b5a4e;
  --line: #e2d5bd;
  --red: #c8312f;
  --red-dark: #9e2220;
  --green: #1f6b4a;
  --green-dark: #144a33;
  --gold: #f1c35a;
  --gold-dark: #c99a2e;
  --snow: #f5fbff;
  --radius: 18px;
  --shadow: 0 18px 40px -18px rgba(0, 0, 0, .7), 0 2px 0 rgba(255, 255, 255, .6) inset;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--snow);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(241, 195, 90, .12), transparent 60%),
    radial-gradient(900px 500px at 0% 10%, rgba(80, 160, 200, .12), transparent 60%),
    linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

#snow {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.landscape {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 26vh;
  min-height: 140px;
  z-index: 0;
  pointer-events: none;
}
.landscape .hill.far { fill: #c9dbe6; opacity: .22; }
.landscape .hill.near { fill: #e9f3f8; opacity: .35; }
.landscape .trees.far { fill: #0b2a35; opacity: .55; }
.landscape .trees.near { fill: #071c24; opacity: .8; }

.topbar, main, .foot { position: relative; z-index: 1; }

.topbar {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 6px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--snow);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 26px;
  font-style: italic;
  letter-spacing: .5px;
}
.brand-star {
  width: 26px;
  height: 26px;
  fill: var(--gold);
  filter: drop-shadow(0 0 8px rgba(241, 195, 90, .7));
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
  50% { transform: scale(.88) rotate(12deg); opacity: .85; }
}

main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  outline: none;
}

.foot {
  text-align: center;
  font-size: 13px;
  color: rgba(245, 251, 255, .7);
  padding: 20px 16px 28px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

/* ---------- Typografie ---------- */

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(34px, 7vw, 52px); letter-spacing: -.5px; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }

.hero {
  text-align: center;
  padding: 28px 0 22px;
}
.hero h1 em { color: var(--gold); font-style: italic; }
.hero p {
  max-width: 520px;
  margin: 14px auto 26px;
  font-size: 18px;
  color: rgba(245, 251, 255, .85);
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.page-title { padding: 14px 0 18px; }
.page-title p { margin: 8px 0 0; color: rgba(245, 251, 255, .8); }

/* ---------- Karten ---------- */

.card {
  position: relative;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.card > h2, .card > h3 { margin-bottom: 12px; }
.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }
.card .muted, .muted { color: var(--ink-soft); }
.card.festive {
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(200, 49, 47, .05) 14px 28px),
    var(--paper);
}
.card.festive::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: repeating-linear-gradient(90deg, var(--red) 0 18px, var(--snow) 18px 36px, var(--green) 36px 54px, var(--snow) 54px 72px);
}
.card.dark {
  background: rgba(7, 17, 31, .55);
  color: var(--snow);
  border: 1px solid rgba(245, 251, 255, .14);
  box-shadow: none;
  backdrop-filter: blur(6px);
}
.card.dark .muted { color: rgba(245, 251, 255, .7); }
.card.warn {
  background: #fff4d8;
  border: 1px dashed var(--gold-dark);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.card-head h2, .card-head h3 { margin: 0; }

/* ---------- Schritte (Startseite) ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 10px 0 26px;
}
.step {
  background: rgba(7, 17, 31, .5);
  border: 1px solid rgba(245, 251, 255, .14);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-align: center;
  backdrop-filter: blur(6px);
}
.step .num {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 10px;
  box-shadow: 0 0 0 4px rgba(200, 49, 47, .25);
}
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { margin: 0; font-size: 14px; color: rgba(245, 251, 255, .78); }

@media (max-width: 600px) {
  .steps { grid-template-columns: 1fr; }
  .step { display: grid; grid-template-columns: 38px 1fr; gap: 0 14px; text-align: left; align-items: start; }
  .step .num { grid-row: span 2; margin: 0; }
}

/* ---------- Formulare ---------- */

label { display: block; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 13px; color: var(--ink-soft); margin-top: 5px; }
.optional { font-weight: 400; color: var(--ink-soft); font-size: 13px; }

input[type="text"], input[type="date"], input[type="datetime-local"], textarea, select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 107, 74, .15);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.choice label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  margin: 0;
}
.choice label strong { display: block; font-size: 15px; }
.choice label span { font-size: 13px; color: var(--ink-soft); }
.choice input { margin-top: 4px; accent-color: var(--green); }
.choice label:has(input:checked) { border-color: var(--green); background: #eef6f1; }
@media (max-width: 520px) { .choice { grid-template-columns: 1fr; } }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400;
  cursor: pointer;
}
.check input { margin-top: 5px; accent-color: var(--green); width: 17px; height: 17px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  font: inherit;
  font-size: 13px;
  border: 1px dashed var(--gold-dark);
  background: #fff8e6;
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
}
.chip:hover { background: #ffefc2; }

details.more summary {
  cursor: pointer;
  color: var(--green);
  font-weight: 600;
  margin-bottom: 12px;
  list-style: none;
}
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "– "; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-weight: 650;
  font-size: 16px;
  text-decoration: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 22px;
  cursor: pointer;
  color: #fff;
  background: var(--red);
  box-shadow: 0 4px 0 var(--red-dark), 0 10px 20px -8px rgba(200, 49, 47, .7);
  transition: transform .1s, box-shadow .1s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: #d63835; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--red-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.big { font-size: 18px; padding: 15px 30px; }
.btn.block { width: 100%; }
.btn.green { background: var(--green); box-shadow: 0 4px 0 var(--green-dark), 0 10px 20px -8px rgba(31, 107, 74, .7); }
.btn.green:hover { background: #247a55; }
.btn.green:active { box-shadow: 0 1px 0 var(--green-dark); }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--line);
  box-shadow: none;
}
.btn.ghost:hover { background: var(--paper-2); }
.btn.ghost:active { transform: none; }
.card.dark .btn.ghost, .hero .btn.ghost { color: var(--snow); border-color: rgba(245, 251, 255, .35); }
.card.dark .btn.ghost:hover, .hero .btn.ghost:hover { background: rgba(245, 251, 255, .08); }
.btn.small { font-size: 14px; padding: 7px 14px; }
.btn.danger-text { background: none; box-shadow: none; color: var(--red); padding: 6px 8px; }
.btn.danger-text:hover { text-decoration: underline; background: none; }
.btn.link { background: none; box-shadow: none; color: var(--green); padding: 4px 6px; font-weight: 600; }
.btn.link:hover { text-decoration: underline; background: none; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.actions.center { justify-content: center; }

/* ---------- Link-Box ---------- */

.linkbox {
  display: flex;
  gap: 8px;
  align-items: stretch;
  margin: 10px 0;
}
.linkbox input {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 14px;
  background: var(--paper-2);
  min-width: 0;
}
.linkbox input:not([readonly]) { font-family: inherit; font-size: 16px; background: #fff; }
.linkbox .btn { flex-shrink: 0; }

/* ---------- Teilnehmerliste ---------- */

.people { list-style: none; padding: 0; margin: 0; }
.people li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--line);
}
.people li:last-child { border-bottom: 0; }
.people .who { flex: 1; min-width: 0; }
.people .who strong { display: block; overflow-wrap: anywhere; }
.people .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
.people .row-actions { display: flex; gap: 2px; flex-shrink: 0; }

.avatar {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper-2);
  color: var(--ink-soft);
}
.tag.gold { background: #fff0c7; color: #7a5a10; }
.tag.green { background: #e2f1e8; color: var(--green-dark); }
.tag.red { background: #fbe3e2; color: var(--red-dark); }

.namechips { display: flex; flex-wrap: wrap; gap: 8px; }
.namechip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px 4px 4px;
  font-size: 14px;
}
.namechip .avatar { width: 26px; height: 26px; font-size: 12px; }

/* ---------- Status & Infos ---------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 650;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill.open { background: #e2f1e8; color: var(--green-dark); }
.pill.drawn { background: #fff0c7; color: #7a5a10; }

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.fact {
  background: var(--paper-2);
  border-radius: 12px;
  padding: 10px 12px;
}
.fact small { display: block; color: var(--ink-soft); font-size: 12px; text-transform: uppercase; letter-spacing: .8px; }
.fact strong { font-size: 16px; }

.rules {
  white-space: pre-wrap;
  background: #fff;
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  padding: 12px 14px;
  margin: 0;
  font-family: inherit;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 6px;
}
.countdown div {
  min-width: 64px;
  text-align: center;
  background: var(--green);
  color: #fff;
  border-radius: 12px;
  padding: 8px 6px;
}
.countdown b { display: block; font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.countdown span { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .85; }

.progress {
  height: 10px;
  background: var(--paper-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress div {
  height: 100%;
  background: repeating-linear-gradient(135deg, var(--green) 0 10px, #2b8a60 10px 20px);
  border-radius: 999px;
  transition: width .5s;
}

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.notice .icon { font-size: 24px; line-height: 1; }
@media (max-width: 480px) {
  .notice { flex-direction: column; gap: 6px; }
  .notice > div { width: 100%; }
}

/* ---------- Geschenk ---------- */

.reveal-stage {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px 0 6px;
}
.reveal-stage p { margin-top: 6px; }

.gift {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 18px auto 10px;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  animation: wiggle 3.2s ease-in-out infinite;
}
.gift:focus-visible { outline: 3px solid var(--gold); outline-offset: 8px; border-radius: 12px; }
.gift .box {
  position: absolute;
  left: 18px;
  bottom: 0;
  width: 164px;
  height: 124px;
  border-radius: 8px;
  background: linear-gradient(90deg, #a92522, var(--red) 30%, #d43d3a 70%, #a92522);
  box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .6);
}
.gift .box::before, .gift .lid::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 26px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-dark));
}
.gift .lid {
  position: absolute;
  left: 8px;
  top: 40px;
  width: 184px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(90deg, #b82b28, #e04a44 40%, #e65752 60%, #b82b28);
  box-shadow: 0 6px 10px -4px rgba(0, 0, 0, .4);
  z-index: 2;
}
.gift .bow {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 0;
  height: 0;
}
.gift .bow::before, .gift .bow::after {
  content: "";
  position: absolute;
  top: 0;
  width: 46px;
  height: 36px;
  border: 9px solid var(--gold);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
}
.gift .bow::before { right: 0; transform: rotate(-25deg); transform-origin: right bottom; }
.gift .bow::after { left: 0; transform: rotate(25deg); transform-origin: left bottom; }
.gift .knot {
  position: absolute;
  left: 50%;
  top: -8px;
  width: 22px;
  height: 18px;
  margin-left: -11px;
  border-radius: 6px;
  background: var(--gold-dark);
  z-index: 1;
}
.gift .tag-label {
  position: absolute;
  right: -6px;
  bottom: 30px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 4px;
  transform: rotate(8deg);
  box-shadow: 0 4px 8px rgba(0, 0, 0, .3);
  z-index: 3;
}

@keyframes wiggle {
  0%, 70%, 100% { transform: rotate(0); }
  75% { transform: rotate(-5deg); }
  80% { transform: rotate(5deg); }
  85% { transform: rotate(-3deg); }
  90% { transform: rotate(2deg); }
}

.gift.opening { animation: shake .5s ease-in-out; cursor: default; }
.gift.opening .lid { animation: lidoff .9s .45s cubic-bezier(.3, 1.4, .5, 1) forwards; }
.gift.opening .tag-label { animation: fade .3s .45s forwards; }
.gift.opening .box { animation: sink .6s 1s ease-in forwards; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-3deg); }
  40% { transform: translateX(8px) rotate(3deg); }
  60% { transform: translateX(-6px) rotate(-2deg); }
  80% { transform: translateX(6px) rotate(2deg); }
}
@keyframes lidoff {
  to { transform: translate(90px, -170px) rotate(40deg); opacity: 0; }
}
@keyframes sink {
  to { transform: translateY(30px) scale(.9); opacity: 0; }
}
@keyframes fade { to { opacity: 0; } }

.partner {
  animation: pop .7s cubic-bezier(.2, 1.6, .4, 1) both;
}
.partner .you-give {
  font-size: 15px;
  color: var(--ink-soft);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.partner .partner-name {
  font-family: var(--serif);
  font-size: clamp(40px, 10vw, 64px);
  font-style: italic;
  color: var(--red);
  line-height: 1.1;
  margin: 6px 0 4px;
  overflow-wrap: anywhere;
}
.partner .shh { font-size: 14px; color: var(--ink-soft); }
@keyframes pop {
  from { transform: scale(.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.wish {
  white-space: pre-wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: left;
  font-family: var(--serif);
  font-size: 17px;
  background-image: repeating-linear-gradient(transparent 0 27px, #eadfca 27px 28px);
  background-position: 0 14px;
  line-height: 28px;
}

.confetti {
  position: fixed;
  width: 10px;
  height: 14px;
  pointer-events: none;
  z-index: 50;
  border-radius: 2px;
}

/* ---------- Dialog & Toast ---------- */

dialog {
  border: 0;
  border-radius: var(--radius);
  padding: 24px;
  width: min(480px, calc(100vw - 32px));
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
dialog::backdrop { background: rgba(4, 10, 20, .65); backdrop-filter: blur(3px); }
dialog h2 { margin-bottom: 10px; }
dialog p { margin: 0 0 12px; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 30px);
  background: var(--ink);
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  max-width: calc(100vw - 32px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--red-dark); }

.error-box {
  background: #fbe3e2;
  color: var(--red-dark);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 15px;
}

.loading { display: grid; place-items: center; padding: 80px 0; }
.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid rgba(245, 251, 255, .2);
  border-top-color: var(--gold);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.mygroups { list-style: none; padding: 0; margin: 0; }
.mygroups li { border-bottom: 1px solid rgba(245, 251, 255, .12); }
.mygroups li:last-child { border-bottom: 0; }
.mygroups a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  color: var(--snow);
  text-decoration: none;
}
.mygroups a:hover strong { text-decoration: underline; }

.center { text-align: center; }
.mt { margin-top: 14px; }
.big-emoji { font-size: 54px; line-height: 1; margin-bottom: 8px; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .gift.opening .lid, .gift.opening .box { animation-duration: .3s !important; }
}
