/* ============================================================
   🤖 KI-Hinweis beim Betreten der Seite — HSV-Design
   Wird NUR geladen, wenn das Fenster wirklich angezeigt wird.
   ============================================================ */

/* Alles hinter dem Fenster: unscharf, nicht anklickbar, kein Scrollen. */
body.ofc-gated { overflow: hidden !important; }
body.ofc-gated > *:not(.ofcgate) {
  filter: blur(11px) saturate(.75) brightness(.88);
  pointer-events: none !important;
  user-select: none;
  transition: filter .6s ease;
}
/* Nach dem "JA": Unschärfe fährt weich raus. */
body.ofc-open > *:not(.ofcgate) { filter: none; }

.ofcgate {
  --gb: #0a3b7c;        /* HSV-Blau */
  --gb2: #061c46;       /* dunkles Blau */
  --gk: #0b1220;        /* Schwarz */
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.ofcgate__defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Dunkler Schleier über der (bereits unscharfen) Seite */
.ofcgate__bd {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 50% 22%, rgba(23, 92, 180, .55), transparent 60%),
    linear-gradient(180deg, rgba(6, 18, 40, .90), rgba(3, 8, 20, .95));
}

/* ---------- Karte ---------- */
.ofcgate__card {
  position: relative;
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fff; color: #0b1220;
  border-radius: 24px;
  box-shadow: 0 34px 90px rgba(0, 0, 0, .6), 0 0 0 3px rgba(255, 255, 255, .10);
  animation: ofcgateIn .55s cubic-bezier(.2, .9, .3, 1.25) both;
}

/* Blaues Kopfteil mit Fan-Streifen */
.ofcgate__top {
  position: relative; overflow: hidden;
  padding: 26px 22px 22px;
  text-align: center; color: #fff;
  background: linear-gradient(160deg, #0e4a99 0%, var(--gb) 45%, var(--gb2) 100%);
}
.ofcgate__top::before {
  content: ''; position: absolute; inset: -40%;
  background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .10) 0 16px, rgba(255, 255, 255, 0) 16px 38px);
  animation: ofcgateStripes 14s linear infinite;
}
.ofcgate__top::after {
  content: ''; position: absolute; left: 50%; top: -70%;
  width: 130%; height: 130%; transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255, 255, 255, .35), transparent 62%);
  pointer-events: none;
}
.ofcgate__raute {
  position: relative; z-index: 2;
  display: block; width: 88px; height: 88px; margin: 0 auto 14px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .45));
  animation: ofcgateFloat 4.5s ease-in-out infinite;
}
.ofcgate__title {
  position: relative; z-index: 2;
  margin: 0; font-size: clamp(22px, 5vw, 30px); font-weight: 900;
  letter-spacing: .3px; text-shadow: 0 3px 12px rgba(0, 0, 0, .45);
}
/* Vereinsfarben als Abschluss zum weißen Teil: blau · weiß · schwarz */
.ofcgate__pitch {
  position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
  background: linear-gradient(90deg, #00a3e0 0 33.34%, #ffffff 33.34% 66.67%, var(--gk) 66.67% 100%);
}

/* ---------- Inhalt ---------- */
.ofcgate__body { padding: 24px 24px 22px; text-align: center; }
.ofcgate__text {
  margin: 0 0 20px; font-size: clamp(15px, 3.6vw, 17.5px); line-height: 1.6; color: #22304a;
}
.ofcgate__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; padding: 15px 20px;
  font: inherit; font-size: clamp(16px, 4vw, 18px); font-weight: 800; letter-spacing: .2px;
  color: #fff; background: linear-gradient(180deg, #1256b0, var(--gb));
  border: 0; border-bottom: 4px solid var(--gb2); border-radius: 14px;
  cursor: pointer; box-shadow: 0 12px 26px rgba(10, 59, 124, .38);
  transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.ofcgate__btn:hover { transform: translateY(-2px); filter: brightness(1.09); box-shadow: 0 18px 34px rgba(10, 59, 124, .48); }
.ofcgate__btn:active { transform: translateY(2px); border-bottom-width: 2px; }
.ofcgate__btn:focus-visible { outline: 3px solid #00a3e0; outline-offset: 3px; }
.ofcgate__bicon { width: 34px; height: 34px; flex: 0 0 auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35)); animation: ofcgateRoll 7s linear infinite; }
.ofcgate__btn:hover .ofcgate__bicon { animation-duration: 1s; }
.ofcgate__note {
  margin: 14px 0 0; font-size: 13px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--gb); opacity: .8;
}

/* ---------- Der Ball, der alles zudeckt ---------- */
.ofcgate__kick {
  position: fixed; left: 50%; top: 50%;
  width: 150px; height: 150px; margin: -75px 0 0 -75px;
  opacity: 0; pointer-events: none; will-change: transform;
}
.ofcgate__kickball { width: 100%; height: 100%; display: block; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .5)); }

.ofcgate.is-go .ofcgate__card { animation: ofcgateOut .32s ease forwards; }
.ofcgate.is-go .ofcgate__bd { opacity: 0; transition: opacity .8s ease .35s; }
.ofcgate.is-go .ofcgate__kick {
  opacity: 1;
  animation: ofcgateKick 1.25s cubic-bezier(.5, .02, .32, 1) forwards;
}
/* Ball ausblenden -> die fertige Seite kommt zum Vorschein
   (die Animation hält den Zoom, sie animiert bewusst kein opacity) */
.ofcgate.is-done .ofcgate__kick { opacity: 0; transition: opacity .55s ease; }

/* ---------- Bewegung ---------- */
@keyframes ofcgateIn {
  from { opacity: 0; transform: translateY(26px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes ofcgateOut {
  to { opacity: 0; transform: translateY(-10px) scale(.9); }
}
@keyframes ofcgateKick {
  0%   { transform: scale(.10) rotate(0deg); }
  16%  { transform: scale(.42) rotate(190deg); }
  100% { transform: scale(var(--ofc-scale, 16)) rotate(1260deg); }
}
@keyframes ofcgateRoll { to { transform: rotate(360deg); } }
@keyframes ofcgateFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-7px) rotate(6deg); }
}
@keyframes ofcgateStripes { to { transform: translateX(38px); } }

/* ---------- Handy ---------- */
@media (max-width: 520px) {
  .ofcgate { padding: 12px; }
  .ofcgate__card { border-radius: 20px; }
  .ofcgate__top { padding: 20px 16px 18px; }
  .ofcgate__raute { width: 62px; height: 62px; }
  .ofcgate__body { padding: 20px 18px 18px; }
}

/* ---------- Weniger Bewegung gewünscht ----------
   Nur die Deko-Animationen aus. Das Ausblenden der Karte MUSS bleiben,
   sonst hängt sie beim Freigeben vor dem Ball. */
@media (prefers-reduced-motion: reduce) {
  .ofcgate__card, .ofcgate__raute, .ofcgate__bicon, .ofcgate__top::before { animation: none; }
  .ofcgate.is-go .ofcgate__card { animation: none; opacity: 0; transition: opacity .2s ease; }
  .ofcgate.is-go .ofcgate__kick { animation-duration: .5s; }
}
