/* ----------------------------------------------------------------
   Romantischer Countdown – Stylesheet
   Mobile-first, warm und ruhig gehalten.
------------------------------------------------------------------ */

:root {
  /* Farbwelt passend zum goldenen Waldlicht */
  --color-text: #fdf6ec;
  --color-text-soft: rgba(253, 246, 236, 0.78);
  --color-accent: #f4c794;

  /* Sicheres Padding für Notch / Home-Indicator (iPhone & Co.) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--color-text);
  background-color: #1a120b;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Vollbild-Hintergrund -------------------------------------------------- */

.screen {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh; /* berücksichtigt mobile Browserleisten */
  display: flex;
  flex-direction: column;
  align-items: center;

  background-image: url("assets/romantische_herbststimmung_im_wald.png");
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  background-attachment: scroll;

  padding:
    calc(var(--safe-top) + 1.5rem)
    calc(var(--safe-right) + 1.5rem)
    calc(var(--safe-bottom) + 1.5rem)
    calc(var(--safe-left) + 1.5rem);
}

/* Sanfter dunkler Verlauf für gute Lesbarkeit des Textes */
.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(10, 6, 2, 0.55) 0%,
    rgba(10, 6, 2, 0.25) 30%,
    rgba(10, 6, 2, 0.1) 55%,
    rgba(10, 6, 2, 0.45) 100%
  );
}

/* Countdown wird im oberen/mittleren Bereich platziert,
   wo der Hintergrund genügend freie Fläche bietet. */
.countdown {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  margin-top: clamp(3rem, 18vh, 9rem);
  text-align: center;
  animation: fade-in 1.4s ease-out both;
}

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

.headline {
  margin: 0 0 1.5rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.15rem, 5vw, 1.6rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--color-text-soft);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

/* Großer Countdown ----------------------------------------------------- */

.timer {
  display: flex;
  justify-content: center;
  gap: clamp(0.6rem, 3.5vw, 1.4rem);
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(3.4rem, 18vw, 4.5rem);
}

.value {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(2.6rem, 14vw, 4.2rem);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

.label {
  margin-top: 0.5rem;
  font-size: clamp(0.6rem, 2.6vw, 0.72rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-soft);
}

/* Romantische Zeile ---------------------------------------------------- */

.signature {
  margin: 1.75rem 0 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.15rem, 5.5vw, 1.6rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--color-accent);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
}

/* Nachricht bei Erreichen von Null ------------------------------------- */

.message {
  margin: 1.5rem auto 0;
  max-width: 22rem;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.3rem, 6vw, 1.85rem);
  font-style: italic;
  line-height: 1.35;
  color: var(--color-text);
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
  animation: fade-in 1.2s ease-out both;
}

.message[hidden] {
  display: none;
}

/* Wenn der Countdown null erreicht hat, den Timer ausblenden */
.countdown.is-finished .timer,
.countdown.is-finished .headline {
  display: none;
}

/* Animation ------------------------------------------------------------ */

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .countdown,
  .message {
    animation: none;
  }
}

/* Desktop / größere Schirme -------------------------------------------- */

@media (min-width: 768px) {
  .screen {
    /* Auf großen Schirmen das Bild etwas höher zeigen,
       damit das Paar sichtbar bleibt. */
    background-position: center 35%;
  }

  .countdown {
    margin-top: clamp(4rem, 16vh, 10rem);
  }
}
