/* ===== Reset & Basis ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --rose:    #f97316;
  --rose-dk: #c2410c;
  --gold:    #fb923c;
  --cream:   #fff7ed;
  --white:   rgba(255, 255, 255, 0.75);
  --white-solid: #ffffff;
  --text:    #1c1005;
  --muted:   #78614a;
  --radius:  18px;
  --shadow:  0 6px 28px rgba(0,0,0,.12);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(160deg, #ffedd5 0%, #fff7ed 60%, #ffe8cc 100%);
  min-height: 100vh;
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 1.5rem 1rem 3rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Foto-Hintergrund ===== */
#photoBg {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  grid-auto-rows: 130px;
  gap: 6px;
  overflow: hidden;
  align-content: start;
}

.photo-tile:nth-child(5n+1) {
  grid-column: span 2;
  grid-row: span 2;
}

.photo-tile:nth-child(7n+3) {
  grid-row: span 2;
}

.photo-tile {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .8s ease;
}

.photo-tile.loaded { opacity: 1; }

#bgOverlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(255, 247, 237, 0.25);
  backdrop-filter: blur(0px);
}

#confetti {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1000;
}

main {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

/* ===== Header ===== */
header {
  text-align: center;
  padding: 2rem 1rem 1.4rem;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.rings {
  font-size: 6rem;
  text-align: center;
  margin-bottom: .4rem;
  animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.12); }
}

h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: #ea580c;
  letter-spacing: .5px;
  -webkit-text-stroke: 0px;
  text-rendering: geometricPrecision;
}

.names {
  font-size: 1.5rem;
  font-weight: 700;
  color: #c2410c;
  margin-top: .2rem;
  letter-spacing: .5px;
}

.subtitle {
  margin-top: .5rem;
  color: #000000;
  font-size: 1rem;
  font-weight: 600;
}

/* ===== Spendenhinweis ===== */
.donation-banner {
  background: var(--white);
  border-left: 5px solid #16a34a;
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .8rem;
  box-shadow: var(--shadow);
  font-size: .95rem;
  line-height: 1.5;
  text-align: center;
}

.drk-icon { font-size: 1.5rem; line-height: 1; }

/* ===== Counter ===== */
.counter-box {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.85), rgba(194, 65, 12, 0.85));
  border-radius: var(--radius);
  padding: 1.6rem 1rem 1.4rem;
  text-align: center;
  color: var(--white-solid);
  box-shadow: var(--shadow);
}

.counter-number {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
  transition: transform .3s ease;
  color: #ffffff;
}

.counter-number.bump {
  transform: scale(1.25);
}

.counter-label {
  font-size: 1rem;
  font-weight: 800;
  margin-top: .3rem;
  letter-spacing: .5px;
  color: #ffffff;
}

.counter-donation {
  margin-top: .8rem;
  font-weight: 800;
  color: #ffffff;
}

.donation-amount {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1;
  display: block;
}

.donation-label {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .5px;
}

/* ===== Upload-Bereich ===== */
.upload-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}

.preview-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
}

.preview-wrapper img {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid #f97316;
}

.btn-primary, .btn-upload, .btn-remove {
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .3px;
  padding: .9rem 2.2rem;
  transition: transform .15s, opacity .15s, box-shadow .15s;
  width: 80%;
  max-width: 320px;
  text-align: center;
  margin: 0 auto;
}

.btn-primary {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.85), rgba(194, 65, 12, 0.85));
  color: var(--white-solid);
  box-shadow: 0 4px 16px rgba(249, 115, 22, .35);
  display: block;
  margin: 0 auto;
  animation: pulse 2.2s ease-in-out infinite;
}

.btn-primary:active { transform: scale(.97); opacity: .9; }

.btn-upload {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: var(--white-solid);
  box-shadow: 0 4px 16px rgba(76,175,80,.35);
}

.btn-upload:active { transform: scale(.97); opacity: .9; }

.btn-remove {
  background: transparent;
  color: var(--muted);
  border: 2px solid #ddd;
  font-size: .9rem;
  padding: .5rem 1.4rem;
}

/* Fortschrittsbalken */
.progress-bar {
  width: 100%;
  height: 10px;
  background: #ffe8cc;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f97316, #fb923c);
  border-radius: 10px;
  transition: width .4s ease;
}

.status-msg {
  font-size: .9rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.2em;
}

.status-msg.error { color: #c62828; }

/* ===== Erfolgs-Screens ===== */
.success-screen, .already-screen {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.4rem 1.6rem;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
}

.success-icon { font-size: 3.5rem; }

.success-screen h2, .already-screen h2 {
  font-size: 1.5rem;
  color: var(--text);
}

.success-screen p, .already-screen p {
  color: var(--muted);
  line-height: 1.6;
}
