:root {
  --gold: #e3c188;
  --gold-soft: #f0dcb8;
  --cream: #f4efe6;
  --muted: rgba(244, 239, 230, 0.62);
  --fir: #16291f;
  --glass: rgba(8, 18, 13, 0.86);
  --line: rgba(227, 193, 136, 0.28);
  --danger: #f0a28c;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  min-height: 100svh;
  font-family: ui-rounded, "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--cream);
  background-color: #060d0a;
  /* Der Baum sitzt rechts im Bild - auf schmalen Displays zeigen wir diese Seite. */
  background-image: linear-gradient(rgba(3, 8, 6, 0.68), rgba(3, 8, 6, 0.86)), url("/bg.jpg");
  background-size: cover;
  background-position: 62% center;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 5vw, 40px);
  padding-top: max(clamp(16px, 5vw, 40px), env(safe-area-inset-top));
  padding-bottom: max(clamp(16px, 5vw, 40px), env(safe-area-inset-bottom));
}

/* background-attachment: fixed ruckelt auf iOS beim Scrollen. */
@supports (-webkit-touch-callout: none) {
  body {
    background-attachment: scroll;
  }
}

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

#app {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
}

.card {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 6vw, 32px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  animation: rise 0.45s ease both;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card {
    background: rgba(8, 18, 13, 0.62);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
}

h1.giftee {
  font-size: clamp(2rem, 9vw, 2.6rem);
  color: var(--gold-soft);
  margin: 4px 0 22px;
  text-shadow: 0 0 28px rgba(227, 193, 136, 0.3);
}

.hint {
  margin: 0 0 18px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--muted);
}

.hint strong {
  color: var(--gold-soft);
  font-weight: 600;
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 10px;
  font: inherit;
  font-size: 1rem; /* <16px laesst iOS beim Fokus zoomen */
  color: var(--cream);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: border-color 0.2s, background 0.2s;
}

input[type="text"]::placeholder {
  color: rgba(244, 239, 230, 0.38);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.11);
}

button {
  font: inherit;
  cursor: pointer;
  border-radius: 12px;
  transition: transform 0.12s, background 0.2s, border-color 0.2s, opacity 0.2s;
}

button:active {
  transform: scale(0.98);
}

.primary {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 15px;
  font-size: 1rem;
  font-weight: 600;
  color: #16140e;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border: none;
  box-shadow: 0 8px 24px rgba(227, 193, 136, 0.22);
}

.primary:disabled {
  opacity: 0.55;
  cursor: progress;
}

.ghost {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 0.92rem;
  color: var(--gold);
  background: transparent;
  border: 1px dashed var(--line);
}

.ghost:hover {
  border-color: var(--gold);
}

.link {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  background: none;
  border: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wish-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wish-row input {
  flex: 1;
}

.wish-remove {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.wish-remove:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.error {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--danger);
}

.pending-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
}

ul.pending,
ul.wishes-readonly {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

ul.pending li {
  display: inline-block;
  margin: 0 6px 6px 0;
  padding: 5px 11px;
  font-size: 0.88rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
}

ul.wishes-readonly li {
  position: relative;
  padding: 11px 0 11px 26px;
  font-size: 1rem;
  line-height: 1.45;
  border-bottom: 1px solid rgba(227, 193, 136, 0.12);
}

ul.wishes-readonly li:last-child {
  border-bottom: none;
}

ul.wishes-readonly li::before {
  content: "★";
  position: absolute;
  left: 0;
  top: 11px;
  font-size: 0.8rem;
  color: var(--gold);
}

.budget-note {
  margin: 0;
  padding-top: 14px;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.loading {
  text-align: center;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .card {
    animation: none;
  }
  button:active {
    transform: none;
  }
}
