/* ===== Schriften (SIL Open Font License, siehe fonts/LIZENZ.txt) ===== */
@font-face {
  font-family: "Big Shoulders";
  font-weight: 600 900;
  font-display: swap;
  src: url("fonts/BigShoulders-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/SchibstedGrotesk-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/BodoniModa-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Bodoni Moda";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/BodoniModa-italic-latin.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/IBMPlexMono-400-latin.woff2") format("woff2");
}

/* ===== Farben wie auf hendrik4k.com, dazu Gold für die Momente ===== */
:root {
  color-scheme: dark;
  --raum: #050403;
  --flaeche: #0e0c0a;
  --glas: #f2ebe2;
  --glas-leise: #a0968c;
  --chrom: #c8ccd2;
  --wachs: #ff2b12;
  --glut: #ffad5c;
  --gold: #ffc978;
  --linie: rgba(242, 235, 226, 0.14);
  --leuchtlinie: linear-gradient(90deg, rgba(255, 173, 92, 0), rgba(255, 173, 92, 0.9) 50%, rgba(255, 173, 92, 0));
  --chromverlauf: linear-gradient(180deg, #ffffff 0%, #d4d8de 34%, #5f646b 50%, #eceef1 64%, #8d9299 100%);
  --goldverlauf: linear-gradient(180deg, #fff1d6 0%, #ffc978 36%, #a8541c 52%, #ffb35e 66%, #c9702c 100%);
  --serif: "Bodoni Moda", "Bodoni 72", Didot, Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --text: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --block: "Big Shoulders", "Arial Narrow", Impact, sans-serif;
  --rand: clamp(16px, 4vw, 56px);
}

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

html {
  background: var(--raum);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html.offen { overflow: hidden; }

body {
  margin: 0;
  background: var(--raum);
  color: var(--glas);
  font: 400 1.0625rem/1.6 var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
@supports (overflow: clip) { body { overflow-x: clip; } }

a { color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--glut); outline-offset: 4px; border-radius: 2px; }

.sprung {
  position: absolute;
  left: var(--rand);
  top: -100px;
  z-index: 30;
  padding: 8px 12px;
  background: var(--raum);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.sprung:focus { top: 12px; }

/* ===== Kopf ===== */
.kopf {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: calc(24px + env(safe-area-inset-top, 0px)) var(--rand) 24px;
}
.logo {
  font: 700 1.3rem/1 var(--serif);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  background: var(--chromverlauf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kopf-rubrik, .vorzeile, .zahlen, .inhalt, .spiel-nr, .spiel-info, .ansicht-info, .fuss {
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.kopf-rubrik { font-size: 0.72rem; color: var(--glas-leise); }

/* ===== Start: Titel im Schein der Lampe ===== */
.start {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
  padding: clamp(48px, 12vh, 140px) var(--rand) clamp(40px, 8vh, 96px);
}
.start::before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -10vw;
  top: -30vh;
  width: min(90vw, 1100px);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(255, 90, 30, 0.22), rgba(255, 60, 20, 0.07) 55%, rgba(255, 60, 20, 0));
  pointer-events: none;
}
.vorzeile {
  display: flex;
  align-items: center;
  gap: 0.9em;
  margin: 0 0 1.4rem;
  font-size: 0.74rem;
  color: var(--glut);
}
.punkt {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--wachs);
  box-shadow: 0 0 12px 2px rgba(255, 60, 20, 0.6);
}
.titel {
  margin: 0;
  font: 400 clamp(3.3rem, 14vw, 12.5rem)/0.92 var(--serif);
  font-variation-settings: "opsz" 96;
  letter-spacing: -0.02em;
  background: var(--chromverlauf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
}
.titel em {
  font-style: italic;
  background: var(--goldverlauf);
  -webkit-background-clip: text;
  background-clip: text;
}
.lead {
  max-width: 34ch;
  margin: 1.8rem 0 0;
  color: var(--glas-leise);
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.55;
}
.zahlen {
  display: inline-block;
  margin: 2.2rem 0 0;
  padding-top: 0.9rem;
  font-size: 0.74rem;
  border-top: 1px solid var(--linie);
}

/* ===== Inhaltsverzeichnis ===== */
.inhalt {
  margin: 0 var(--rand);
  padding: 28px 0 40px;
  border-top: 1px solid var(--linie);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
}
.inhalt-titel {
  margin: 0 0 18px;
  font: inherit;
  color: var(--glas-leise);
  letter-spacing: 0.22em;
}
.inhalt ol {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: spiel;
}
.inhalt li { counter-increment: spiel; }
.inhalt a {
  display: flex;
  align-items: baseline;
  gap: 0.9em;
  padding: 9px 0;
  border-bottom: 1px solid rgba(242, 235, 226, 0.07);
  text-decoration: none;
  transition: color 0.2s;
}
.inhalt a::before {
  content: counter(spiel, decimal-leading-zero);
  color: var(--glut);
}
.inhalt a span {
  margin-left: auto;
  color: var(--glas-leise);
}
.inhalt a:hover { color: var(--gold); }

/* ===== Galerie ===== */
.galerie:focus { outline: none; }

.spiel {
  padding: clamp(40px, 7vw, 88px) var(--rand) 0;
  scroll-margin-top: 8px;
  /* Lange Bildseite: Abschnitte außerhalb des Bildschirms muss der Browser nicht zeichnen. */
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}
.spiel-kopf {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: end;
  gap: 4px 20px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--linie);
  position: relative;
}
.spiel-kopf::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  width: min(220px, 40%);
  height: 1px;
  background: var(--leuchtlinie);
}
.spiel-nr {
  align-self: start;
  padding-top: 0.5em;
  font-size: 0.74rem;
  color: var(--glut);
}
.spiel h2 {
  margin: 0;
  font: 800 clamp(1.9rem, 5vw, 4.2rem)/0.95 var(--block);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.spiel-info {
  display: flex;
  gap: 1.4em;
  margin: 0;
  font-size: 0.68rem;
  color: var(--glas-leise);
  white-space: nowrap;
}

.raster {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.kachel a {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 3px;
  background: var(--flaeche);
}
.kachel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s;
}
.kachel a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(242, 235, 226, 0.08);
  transition: box-shadow 0.3s;
  pointer-events: none;
}
.kachel a:hover img, .kachel a:focus-visible img { transform: scale(1.035); }
.kachel a:hover::after, .kachel a:focus-visible::after {
  box-shadow: inset 0 0 0 1px rgba(255, 201, 120, 0.7), inset 0 0 40px rgba(255, 140, 50, 0.25);
}
.kachel a:focus-visible { outline-offset: 3px; }

/* Spannweiten setzt das Build-Skript je nach Bildanzahl, damit jede Reihe voll wird. */
@media (min-width: 600px) and (max-width: 899.98px) {
  .raster { grid-template-columns: repeat(2, 1fr); }
  .kachel.t-voll { grid-column: 1 / -1; }
}
@media (min-width: 900px) {
  .raster { grid-template-columns: repeat(3, 1fr); }
  .kachel.d-gross { grid-column: span 2; grid-row: span 2; }
  .kachel.d-zwei { grid-column: span 2; }
  .kachel.d-voll { grid-column: 1 / -1; }
  /* Höhe kommt von den Nachbarn in der Reihe, das Bild füllt nur aus. */
  .kachel.d-gross a, .kachel.d-zwei a { aspect-ratio: auto; height: 100%; min-height: 160px; }
  .kachel.d-gross img, .kachel.d-zwei img { position: absolute; inset: 0; }
}

/* ===== Fuß ===== */
.fuss {
  margin: clamp(64px, 10vw, 120px) var(--rand) 0;
  padding: 28px 0 calc(32px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--linie);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--glas-leise);
}
.fuss-hinweis { margin: 0 0 16px; max-width: 60ch; text-transform: none; letter-spacing: 0.04em; line-height: 1.6; }
.fuss-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.fuss a { text-decoration: none; color: var(--glas); }
.fuss a:hover { color: var(--gold); }

/* ===== Großansicht ===== */
.ansicht {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(5, 4, 3, 0.97);
  color: var(--glas);
  overscroll-behavior: contain;
  touch-action: pan-y pinch-zoom;
}
.ansicht::backdrop { background: rgba(5, 4, 3, 0.9); }
.ansicht[open] { display: grid; place-items: center; }

.ansicht-bild {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 0;
  padding: calc(64px + env(safe-area-inset-top, 0px)) 84px 24px;
  width: 100%;
}
.ansicht-bild img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 170px);
  max-height: calc(100svh - 170px);
  border-radius: 3px;
  box-shadow: 0 30px 120px rgba(255, 90, 30, 0.12);
  transition: opacity 0.25s;
  user-select: none;
  -webkit-user-drag: none;
}
.ansicht-bild img.laedt { opacity: 0.25; }
.ansicht figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 24px;
  width: 100%;
  max-width: 1600px;
}
.ansicht-spiel {
  font: 800 clamp(1.3rem, 2.6vw, 2rem)/1 var(--block);
  text-transform: uppercase;
}
.ansicht-info { display: flex; gap: 1.6em; font-size: 0.68rem; color: var(--glas-leise); }
.ansicht-zaehler { color: var(--glut); }

.knopf {
  position: absolute;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(200, 204, 210, 0.35);
  border-radius: 50%;
  background: rgba(14, 12, 10, 0.8);
  color: var(--chrom);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.knopf svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.knopf:hover { border-color: var(--gold); color: var(--gold); }
.knopf:focus-visible { outline-offset: 3px; }
.zurueck { left: 18px; top: 50%; translate: 0 -50%; }
.weiter { right: 18px; top: 50%; translate: 0 -50%; }
.schliessen { right: 18px; top: calc(14px + env(safe-area-inset-top, 0px)); width: 44px; height: 44px; }

@media (max-width: 700px) {
  .spiel-kopf { grid-template-columns: auto 1fr; }
  .spiel-info { grid-column: 2; }
  .ansicht-bild { padding: calc(64px + env(safe-area-inset-top, 0px)) 12px 96px; }
  .ansicht-bild img { max-height: calc(100svh - 230px); }
  .zurueck, .weiter { top: auto; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); translate: none; }
  .zurueck { left: calc(50% - 64px); }
  .weiter { right: calc(50% - 64px); }
}

/* ===== Weniger Bewegung ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .kachel a:hover img, .kachel a:focus-visible img { transform: none; }
}
