/* =========================================================
   Basis / Reset
   ========================================================= */
:root{
  --green: #1a482b;
  --white: #ffffff;
  --black: #000000;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--green);
  color: var(--white);
  font-family: "DM Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* =========================================================
   Layout-Hülle
   ========================================================= */
.d-home {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* =========================================================
   HERO
   Ziel: immer zentriert, kein Cropping des Bildes
   ========================================================= */
.d-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 64px;
  padding: 48px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.d-text-hero {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-self: center; /* Textbox zentrieren in der Spalte */
}

.wie-viele-personen {
  font-size: 60px;
  line-height: 1.05;
  letter-spacing: .2px;
  margin: 0;
}
.relativ-zur-stadiongrsse {
  font-size: 40px;
  font-weight: 500;
  opacity: .95;
  margin: 0;
}

/* ====== Grafikbereich (Hero) ====== */
.d-grafik-hero {
  width: 100%;
  max-width: 640px;          /* Obergrenze Desktop */
  display: grid;
  place-items: center;       /* Inhalt mittig */
  gap: 24px;
  text-align: center;
  justify-self: center;      /* Spalte zentriert */
}

/* Spielfeld + Overlays (Hero & Datum) */
.field-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;      /* hält Verhältnis ohne zu beschneiden */
  border-radius: 16px;
  overflow: visible;         /* Wichtig: nicht clippen -> kein Cropping */
  line-height: 0;            /* vermeidet Baseline-Lücke */
}

/* Bild selbst: immer vollständig sichtbar, zentriert */
.field-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;   /* Fläche füllen */
  object-fit: contain;       /* nie beschneiden */
  object-position: center;
  display: block;
}

/* ====== Ball-Overlays HERO & DATUM ====== */
#balls-layer-oben,
#balls-layer-unten {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* overflow sichtbar lassen, damit nichts „abgeschnitten“ wirkt */
  overflow: visible;
}

/* Die Clip-Pfade beschränken nur die Flugzone, nicht das Bild */
#balls-layer-oben  { clip-path: inset(34% 30% 24% 30%); }
#balls-layer-unten { clip-path: inset(13% 6% 11% 6%); }

/* ====== Ein einzelner Ball ====== */
.ball {
  position: absolute;
  width: 16px;
  height: 16px;
  background-image: url('./ball.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  will-change: transform;
  animation: drift 6s ease-in-out infinite;
  transform: translate(var(--x0, 0), var(--y0, 0));
  opacity: 0.95;
  /* Default-Zone (wird via JS überschrieben/ergänzt) */
  --x0: 30%;
  --y0: 34%;
  --x1: 70%;
  --y1: 76%;
}

/* ====== Drift-Animation (hin & zurück) ====== */
@keyframes drift {
  0%   { transform: translate(var(--x0), var(--y0)); }
  50%  { transform: translate(var(--x1), var(--y1)); }
  100% { transform: translate(var(--x0), var(--y0)); }
}

/* ====== Zähler (Hero) ====== */
.personen-parent {
  display: flex;
  flex-direction: column;
  align-items: center;   /* zentriert */
  gap: 8px;
}
.personen {
  font-size: 40px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin: 0;
}

/* =========================================================
   DATUMSBEREICH
   ========================================================= */
.d-passantenanzahl-datum {
  padding: 64px 24px 96px;
  background: var(--green);
}

.features {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  justify-items: center; /* beides zentriert */
}

/* Linke Grafik-Box */
.d-grafik-daypicker-icon {
  width: 100%;
  max-width: 624px;
  aspect-ratio: 624 / 429;
  border-radius: 12px;
  overflow: visible;          /* kein hartes Abschneiden */
  position: relative;
}
.d-grafik-daypicker-icon .daypicker-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100% !important;
  object-fit: contain;
  object-position: center;
  display: block;
}

/* Rechte Text-Box */
.d-text-daypicker {
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.d-home-wie-viele-personen {
  max-width: 510px;
  font-weight: 500;
  font-size: 28px;
  margin: 0;
}
.d-home-frame { font-size: 16px; color: #000; }

.d-button-date {
  width: 100%;
  max-width: 555px;
  height: 56px;
  border-radius: 32px;
  background: var(--white);
  border: 1px solid var(--green);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  cursor: pointer;
  color: #555;
  font-size: 22px;
  font-weight: 600;
}
.jjjj-mm-dd { line-height: 1; opacity: .6; }

.es-waren-xy-personen-am-jjjj-m-wrapper { font-size: 22px; }
.es-waren-xy-container { width: 100%; max-width: 620px; }

/* =========================================================
   FOOTER (immer zentriert, responsive Breiten)
   ========================================================= */
.d-footer {
  background: var(--black);
  padding: 64px 24px;
  display: grid;
  place-items: center;     /* Inhalt mittig */
  text-align: center;
  gap: 20px;
}
.d-line-footer {
  width: min(100%, 760px);
  height: 0;
  border-top: 3px solid var(--white);
  margin: 0 auto;
}
.copywright-2025-sarina-container p { margin: 0; }

/* =========================================================
   POPUP (Date Picker)
   ========================================================= */
.popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.25);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.d-daypicker {
  background: #ACABAB;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 360px;
  width: 100%;
}

/* Kalender */
.calendar-month {
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  margin: 12px 0;
}
#calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
#calendar .day {
  padding: 10px 0;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
}
#calendar .day:hover { background-color: #ddd; }
#calendar .selected { background-color: #1a482b; color: #fff; }

#calendar .disabled {
  color: #777;
  background: #ccc;
  cursor: not-allowed;
}
#calendar .today {
  outline: 2px solid #1a482b;
}

/* Input */
.date-input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 16px;
  cursor: pointer;
}

/* Screenreader Only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Monats-Navigation */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
}
.month-nav {
  width: 24px; height: 24px; cursor: pointer; position: relative;
}
.arrow-left::before,
.arrow-right::before {
  content: ""; display: block; width: 10px; height: 10px;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(45deg);
  border-color: #fff;
}
.arrow-left::before  { border-left: 3px solid; border-bottom: 3px solid; }
.arrow-right::before { border-right: 3px solid; border-top: 3px solid; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1100px) {
  /* Hero untereinander, aber zentriert – kein "align-items: flex-start" */
  .d-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    justify-items: center;    /* zentriert beide Blöcke */
    text-align: center;
  }

  .wie-viele-personen { font-size: 44px; }
  .relativ-zur-stadiongrsse { font-size: 28px; }

  .features {
    grid-template-columns: 1fr;
    gap: 28px;
    justify-items: center;
  }

  .d-grafik-daypicker-icon,
  .d-text-daypicker,
  .d-home-wie-viele-personen,
  .d-button-date,
  .es-waren-xy-container {
    width: 100%;
    max-width: 720px;
  }

  #balls-layer-oben  { clip-path: inset(34% 30% 24% 30%); }
  #balls-layer-unten { clip-path: inset(13% 6% 11% 6%); }

  .personen { font-size: 34px; }
}

@media (max-width: 720px) {
  .d-hero { padding: 32px 16px; gap: 24px; }
  .wie-viele-personen { font-size: 34px; }
  .relativ-zur-stadiongrsse { font-size: 22px; }

  .personen { font-size: 28px; }
  .d-button-date { height: 50px; font-size: 18px; }

  .d-passantenanzahl-datum { padding: 40px 16px 64px; }
  .d-home-wie-viele-personen { font-size: 20px; width: 100%; }
  .es-waren-xy-personen-am-jjjj-m-wrapper { font-size: 18px; }

  #balls-layer-oben  { clip-path: inset(33% 30% 24% 30%); }
  #balls-layer-unten { clip-path: inset(13% 6% 11% 6%); }
}

/* Optional: weniger Bewegung, wenn Nutzer*innen das wünschen */
@media (prefers-reduced-motion: reduce) {
  .ball { animation: none; }
}