:root {
  color-scheme: dark;
  --ink: #fdfbf7;
  --ink-dim: rgba(253, 251, 247, 0.78);
  --glass: rgba(255, 255, 255, 0.14);
  --glass-strong: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.35);
  --accent: #d9a3a4;
  --accent-light: #f3d7d3;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
  background: #14110f;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.page {
  position: relative;
  height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  /* Sicherheitsnetz: auf normal großen Handy-Screens passt alles rein und es
     gibt nie Scroll. Auf sehr niedrigen Viewports (Querformat, alte/kleine
     Geräte, Split-Screen) darf der Inhalt notfalls minimal scrollen, statt
     unerreichbar abgeschnitten zu werden. */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.bg-img {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  z-index: 0;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10, 8, 6, 0.55) 0%, rgba(10, 8, 6, 0.38) 38%, rgba(10, 8, 6, 0.72) 100%);
}

.content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: max(24px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  gap: clamp(10px, 3vh, 28px);
}

.header {
  text-align: center;
  padding-top: clamp(6px, 2vh, 20px);
}

.names {
  margin: 0;
  font-family: 'Parisienne', cursive;
  font-weight: 400;
  font-style: normal;
  font-size: clamp(2.2rem, 10.5vw, 4.4rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.35);
}

.names .amp {
  font-size: 0.85em;
  padding: 0 0.08em;
  color: var(--accent);
}

.subtitle {
  margin: 0.6em 0 0;
  font-weight: 300;
  font-size: clamp(0.78rem, 2.6vw, 0.95rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.gallery-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(6px);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  transition: transform 0.15s ease, background 0.2s ease;
}

.gallery-link:active { transform: scale(0.96); }

.main {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
}

.step {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  animation: fadeUp 0.5s ease both;
}

.step.hidden { display: none; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

#uploadForm {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.glass-input {
  width: 100%;
  padding: 13px 18px;
  font-size: 16px;
  font-family: 'Poppins', sans-serif;
  color: var(--ink);
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  outline: none;
  backdrop-filter: blur(6px);
  text-align: center;
}

.glass-input::placeholder { color: var(--ink-dim); }

.dropzone {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: clamp(22px, 6vh, 40px) 20px;
  border: 1.5px dashed var(--glass-border);
  border-radius: 22px;
  background: var(--glass);
  backdrop-filter: blur(6px);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease, border-color 0.2s ease;
}

.dropzone:active { transform: scale(0.98); }
.dropzone.drag-over {
  background: rgba(255, 255, 255, 0.24);
  border-color: var(--accent);
}

.dropzone-icon {
  width: 30px;
  height: 30px;
  color: var(--accent);
  margin-bottom: 4px;
}

.dropzone-title {
  font-size: clamp(0.95rem, 3.2vw, 1.05rem);
  font-weight: 500;
}

.dropzone-hint {
  font-size: 0.78rem;
  color: var(--ink-dim);
  font-weight: 300;
}

.filesize-hint {
  margin: 2px 0 0;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  text-align: center;
  font-weight: 300;
}

/* Vorschau-Grid */
.preview-grid {
  width: 100%;
  max-height: 38vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 4px 6px;
  -webkit-overflow-scrolling: touch;
}

.preview-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
}

.preview-item img,
.preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-item .video-badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  font-size: 0.62rem;
  background: rgba(0, 0, 0, 0.55);
  padding: 2px 6px;
  border-radius: 8px;
  letter-spacing: 0.03em;
}

.preview-item .remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.preview-actions {
  width: 100%;
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn {
  flex: 1;
  border: none;
  border-radius: 999px;
  padding: 13px 16px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--glass-strong);
  color: #241d15;
  flex: 1.4;
}

.btn-ghost {
  background: var(--glass);
  color: var(--ink);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(6px);
}

/* Fortschritt */
.progress-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
}

.progress-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.progress-text {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--ink-dim);
}

/* Danke-Screen */
.thanks-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.check {
  width: 68px;
  height: 68px;
  margin-bottom: 6px;
}

.check-circle {
  stroke: var(--accent);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: circleDraw 0.6s ease forwards;
}

.check-mark {
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkDraw 0.4s ease 0.5s forwards;
}

@keyframes circleDraw {
  to { stroke-dashoffset: 0; }
}
@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}

.thanks-title {
  margin: 4px 0 0;
  font-family: 'Parisienne', cursive;
  font-weight: 400;
  font-size: clamp(2.4rem, 10vw, 3.4rem);
}

.thanks-text {
  margin: 0;
  font-weight: 300;
  font-size: 0.9rem;
  color: var(--ink-dim);
  max-width: 320px;
}

.thanks-wrap .preview-actions {
  margin-top: 14px;
  width: 100%;
}

.error-box {
  margin-top: 10px;
  padding: 10px 16px;
  font-size: 0.82rem;
  background: rgba(200, 40, 40, 0.35);
  border: 1px solid rgba(255, 120, 120, 0.4);
  border-radius: 14px;
  text-align: center;
}

.error-box.hidden { display: none; }

@media (max-height: 640px) {
  .header { padding-top: 4px; }
  .subtitle { display: none; }
}
