/* Hauptseite islbs – keine fremden Quellen, Systemschriften (auf Apple-Geräten SF Rounded). */

:root {
  --grund: #0b0d12;
  --flaeche: #141821;
  --flaeche-hoch: #1b2030;
  --text: #f2f3f6;
  --text-leise: #9aa1b0;
  --rand: rgb(255 255 255 / .08);
  --rand-stark: rgb(255 255 255 / .16);
  --blau: #3b82f6;
  --rot: #ef4444;
  --akzent-standard: #f59e0b;
  --an: #4ade80;
  --aus: #f87171;
  --stoerung: #fbbf24;
  --schein-staerke: .3;
  --schatten: 0 1px 0 rgb(255 255 255 / .04) inset, 0 10px 30px rgb(0 0 0 / .35);
  --radius: 20px;
  --schrift: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root {
    --grund: #f6f5f1;
    --flaeche: #ffffff;
    --flaeche-hoch: #ffffff;
    --text: #15171c;
    --text-leise: #5b6070;
    --rand: rgb(15 20 30 / .09);
    --rand-stark: rgb(15 20 30 / .18);
    --an: #16a34a;
    --aus: #dc2626;
    --stoerung: #d97706;
    --schein-staerke: .16;
    --schatten: 0 1px 2px rgb(15 20 30 / .05), 0 10px 30px rgb(15 20 30 / .08);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  line-height: 1.5;
  overflow-x: hidden;
}
main { flex: 1; }

.breite {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

.nur-vorleser {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* Lichtschein oben: Blaulicht links, Einspruch-Rot rechts, feines Raster */
.schein {
  position: absolute;
  inset: 0 0 auto 0;
  height: 560px;
  pointer-events: none;
  z-index: 0;
  opacity: var(--schein-staerke);
  background:
    radial-gradient(520px 380px at 12% 8%, color-mix(in srgb, var(--blau) 70%, transparent), transparent 70%),
    radial-gradient(520px 380px at 88% 4%, color-mix(in srgb, var(--rot) 60%, transparent), transparent 70%);
  filter: blur(20px);
}
.leiste, .held, main, .fuss { position: relative; z-index: 1; }

/* Kopfleiste */
.leiste {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: max(20px, env(safe-area-inset-top));
  padding-bottom: 20px;
}
.marke {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.marke img { border-radius: 8px; }

/* Titelbereich */
.held { padding-top: clamp(8px, 2vw, 20px); padding-bottom: 20px; }
.held h1 {
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.unterzeile {
  margin: 10px 0 0;
  color: var(--text-leise);
  font-size: 1.125rem;
}
.zaehler {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  color: var(--text-leise);
  font-size: .9375rem;
  font-weight: 600;
}
.zaehler::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--an);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--an) 60%, transparent);
  animation: atmen 2s ease-out infinite;
}
.zaehler[data-keins]::before { background: var(--text-leise); animation: none; }

@keyframes atmen {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--an) 55%, transparent); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

/* Kartenraster: 1 Spalte am Handy, sonst nebeneinander über die volle Breite (bei vielen Spielen bis 3) */
.raster {
  list-style: none;
  margin: 0;
  padding: 0 0 72px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 24px;
}
.raster > li {
  animation: auftauchen .5s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
@keyframes auftauchen {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.karte {
  --akzent: var(--akzent-standard);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform .25s cubic-bezier(.2, .7, .2, 1), box-shadow .25s, border-color .25s;
}
.karte:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--akzent) 55%, transparent);
  box-shadow: var(--schatten), 0 14px 36px -14px color-mix(in srgb, var(--akzent) 45%, transparent);
}
.karte:active { transform: translateY(-1px); }
.karte:focus-visible { outline: 3px solid var(--akzent); outline-offset: 4px; }

.bild {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--flaeche-hoch);
}
.bild img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.karte:hover .bild img { transform: scale(1.05); }
/* sanfter Übergang vom Bild in die Karte */
.bild::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--flaeche) 85%, transparent));
  pointer-events: none;
}
.bild.ohne-bild {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--akzent) 45%, var(--flaeche)), var(--flaeche) 75%);
}
.bild.ohne-bild img { display: none; }
.bild .initiale { display: none; font-size: 4rem; font-weight: 800; color: var(--akzent); }
.bild.ohne-bild .initiale { display: block; }

.status {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: rgb(10 12 18 / .6);
  border: 1px solid rgb(255 255 255 / .12);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #9ca3af; }
.status[data-zustand="an"]::before { background: #4ade80; box-shadow: 0 0 8px #4ade80; }
.status[data-zustand="stoerung"]::before { background: #fbbf24; }
.status[data-zustand="aus"]::before { background: #f87171; }
.status[data-zustand="pruefe"]::before { animation: puls 1s ease-in-out infinite alternate; }
@keyframes puls { from { opacity: .3; } to { opacity: 1; } }

.inhalt {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  padding: 6px 24px 24px;
}
.inhalt h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.inhalt p { margin: 0; color: var(--text-leise); font-size: 1rem; }

.unten {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 14px;
}
.tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tags li {
  padding: 3px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--akzent) 14%, transparent);
  color: color-mix(in srgb, var(--akzent) 70%, var(--text));
  font-size: .8125rem;
  font-weight: 600;
}
.knopf {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px 11px 20px;
  border-radius: 999px;
  background: var(--akzent);
  color: #fff;
  font-weight: 700;
  font-size: .9375rem;
  transition: gap .2s, filter .2s;
}
.knopf svg { width: 16px; height: 16px; }
.karte:hover .knopf { gap: 12px; filter: brightness(1.08); }

/* Meldungen (Laden, Fehler) */
.meldung {
  margin: 0 0 72px;
  padding: 28px;
  border: 1px dashed var(--rand-stark);
  border-radius: var(--radius);
  color: var(--text-leise);
  text-align: center;
}
.meldung.fehler { border-style: solid; border-color: var(--aus); color: var(--text); }

/* Fuß */
.fuss {
  padding: 24px 0 max(28px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--rand);
  color: var(--text-leise);
  font-size: .875rem;
}
.fuss .breite { display: flex; gap: 10px; flex-wrap: wrap; }
.fuss a { color: inherit; text-decoration: none; }
.fuss a:hover { color: var(--text); text-decoration: underline; }

/* Rechtstexte (impressum.html, datenschutz.html) */
.kopf { position: relative; z-index: 1; padding: 48px 0 12px; }
.kopf h1 { margin: 0; font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.zurueck {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--text-leise);
  font-weight: 600;
  text-decoration: none;
}
.zurueck:hover { color: var(--text); }
.text { position: relative; z-index: 1; padding-bottom: 64px; }
.text > * { max-width: 760px; }
.text h2 { margin-top: 2em; font-size: 1.25rem; letter-spacing: -0.01em; }
.text a { color: #60a5fa; }
@media (prefers-color-scheme: light) { .text a { color: #2563eb; } }
.platzhalter { padding: 2px 6px; border-radius: 4px; background: color-mix(in srgb, var(--stoerung) 25%, transparent); }

@media (max-width: 520px) {
  .inhalt { padding: 4px 18px 20px; }
  .unten { flex-direction: column; align-items: stretch; }
  .knopf { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .raster > li { animation: none; }
  .karte, .bild img, .knopf { transition: none; }
  .karte:hover, .karte:active { transform: none; }
  .karte:hover .bild img { transform: none; }
  .zaehler::before, .status[data-zustand="pruefe"]::before { animation: none; }
}
