:root {
  color-scheme: dark;
  --nacht: #080b10;
  --flaeche: rgba(255, 255, 255, 0.045);
  --rand: rgba(255, 255, 255, 0.12);
  --text: #efe9dc;
  --leise: #9aa39f;
  --gold: #e9b949;
  --gold-hell: #ffe6a3;
  --gruen: #2f8f6b;
  --feld-hell: #d8c9a3;
  --feld-dunkel: #3b6b57;
  --breite: 1120px;
  --figuren: "Segoe UI Symbol", "Noto Sans Symbols 2", "Noto Sans Symbols2", "Apple Symbols", "DejaVu Sans", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(47, 143, 107, 0.22), transparent 60%),
    radial-gradient(900px 600px at -10% 30%, rgba(233, 185, 73, 0.10), transparent 60%),
    var(--nacht);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3 { margin: 0; line-height: 1.05; text-wrap: balance; }
h1 { font-size: clamp(3.2rem, 10vw, 7.5rem); font-weight: 800; letter-spacing: -0.045em; }
h2 { font-family: var(--serif); font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
h3 { font-family: var(--serif); font-size: 1.4rem; line-height: 1.2; }

#figuren { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }

.lichtkegel {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(420px circle at var(--zx, 50%) var(--zy, 30%), rgba(233, 185, 73, 0.10), transparent 70%);
}

.kopf, main, .fuss { position: relative; z-index: 1; }

.kopf {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px max(16px, calc((100vw - var(--breite)) / 2));
  background: rgba(8, 11, 16, 0.6);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--rand);
}

.marke { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; text-decoration: none; white-space: nowrap; }

.marke-feld {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--gold), #b9832a);
  color: var(--nacht);
  font-family: var(--figuren);
  font-size: 1.3rem;
  line-height: 1;
  transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1);
}

.marke:hover .marke-feld { transform: translate(6px, -6px) rotate(12deg); }

.kopf nav { display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; font-size: 0.95rem; }
.kopf nav a { position: relative; text-decoration: none; color: var(--leise); white-space: nowrap; padding: 4px 0; transition: color 0.2s; }
.kopf nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform 0.3s; }
.kopf nav a:hover { color: var(--text); }
.kopf nav a:hover::after { transform: scaleX(1); }

main > section { max-width: var(--breite); margin: 0 auto; padding: 96px 16px; }

.vorzeile { margin: 0 0 14px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.abschnitt-kopf { margin-bottom: 44px; }

.hinweis {
  display: inline-block;
  margin: 10px 0 0;
  padding: 6px 14px;
  border: 1px dashed var(--rand);
  border-radius: 999px;
  color: var(--leise);
  font-size: 0.9rem;
}

/* Start */

main > .start {
  position: relative;
  max-width: none;
  min-height: calc(100svh - 59px);
  padding: 0;
  display: grid;
  align-items: center;
  overflow: hidden;
}

.boden {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: 0;
  height: 110%;
  background: repeating-conic-gradient(rgba(233, 185, 73, 0.20) 0 25%, rgba(47, 143, 107, 0.14) 0 50%) 0 0 / 120px 120px;
  transform: perspective(600px) rotateX(68deg);
  transform-origin: center bottom;
  mask-image: linear-gradient(to top, #000 5%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, #000 5%, transparent 85%);
  animation: boden 9s linear infinite;
}

@keyframes boden { to { background-position: 0 120px; } }

.start-inhalt {
  position: relative;
  width: 100%;
  max-width: var(--breite);
  margin: 0 auto;
  padding: 56px 16px 96px;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 56px;
  align-items: center;
}

h1 .zeile { display: block; overflow: hidden; padding-bottom: 0.08em; }
h1 .wort { display: inline-block; transform: translateY(110%); animation: hoch 0.9s cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
h1 .zeile:nth-child(1) .wort:nth-child(2) { animation-delay: 0.12s; }
h1 .gold .wort {
  animation-delay: 0.26s, 1.2s;
  animation-name: hoch, schimmer;
  animation-duration: 0.9s, 5s;
  animation-iteration-count: 1, infinite;
  animation-timing-function: cubic-bezier(0.2, 0.9, 0.2, 1), linear;
  background: linear-gradient(100deg, var(--gold) 20%, var(--gold-hell) 40%, #fff 50%, var(--gold-hell) 60%, var(--gold) 80%) 0 0 / 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@keyframes hoch { to { transform: translateY(0); } }
@keyframes schimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }

.einstieg { max-width: 32em; font-size: 1.25rem; color: var(--leise); margin: 26px 0 40px; opacity: 0; animation: blende 1s 0.6s forwards; }
@keyframes blende { to { opacity: 1; } }

.kernzahlen { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0; opacity: 0; animation: blende 1s 0.8s forwards; }

.kernzahlen div {
  position: relative;
  padding: 20px 18px;
  border: 1px solid var(--rand);
  border-radius: 18px;
  background:
    radial-gradient(220px circle at var(--mx, 50%) var(--my, 0%), rgba(233, 185, 73, 0.22), transparent 70%),
    var(--flaeche);
  backdrop-filter: blur(10px);
}

.kernzahlen dt { font-size: 2.1rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; color: var(--gold-hell); }
.kernzahlen dd { margin: 8px 0 0; font-size: 0.9rem; line-height: 1.4; color: var(--leise); }
.kernzahlen .offen dt { color: var(--leise); }
.kernzahlen .offen { border-style: dashed; }

.kipp { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 0.25s ease-out; transform-style: preserve-3d; }

.start-bild { margin: 0; opacity: 0; animation: blende 1.2s 0.5s forwards; }
.start-bild img {
  border-radius: 22px;
  border: 1px solid var(--rand);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 8px rgba(255, 255, 255, 0.03), 0 0 90px rgba(233, 185, 73, 0.18);
}

figcaption { margin-top: 14px; font-size: 0.88rem; color: var(--leise); }

.weiter {
  position: absolute;
  left: 50%;
  bottom: 22px;
  translate: -50% 0;
  font-family: var(--figuren);
  font-size: 1.8rem;
  color: var(--gold);
  text-decoration: none;
  animation: wippen 2.2s ease-in-out infinite;
}

@keyframes wippen { 50% { transform: translateY(10px); } }

/* Einblenden beim Scrollen */

.zeig { opacity: 0; transform: translateY(36px); transition: opacity 0.9s, transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.zeig.sichtbar { opacity: 1; transform: none; }
.kipp.zeig.sichtbar { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: opacity 0.9s, transform 0.25s ease-out; }

/* Zeitleiste */

.zeitleiste { position: relative; list-style: none; margin: 0 0 28px; padding: 0 0 0 44px; }

.zeitleiste::before,
.zeitleiste::after { content: ""; position: absolute; left: 14px; top: 0; width: 2px; height: 100%; background: var(--rand); }
.zeitleiste::after { height: calc(var(--fortschritt, 0) * 100%); background: linear-gradient(var(--gold), var(--gruen)); box-shadow: 0 0 14px var(--gold); }

.zeitleiste .laeufer {
  position: absolute;
  left: 15px;
  top: calc(var(--fortschritt, 0) * 100%);
  translate: -50% -50%;
  z-index: 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--gold);
  color: var(--nacht);
  font-family: var(--figuren);
  font-size: 1.3rem;
  line-height: 1;
  box-shadow: 0 0 24px rgba(233, 185, 73, 0.7);
}

.zeitleiste li:not(.laeufer) {
  position: relative;
  margin-bottom: 22px;
  padding: 24px 26px;
  border: 1px solid var(--rand);
  border-radius: 20px;
  background: var(--flaeche);
  backdrop-filter: blur(10px);
}

.zeit { margin: 0 0 6px; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); font-variant-numeric: tabular-nums; }
.zeitleiste li p { max-width: 40em; margin: 8px 0 0; color: var(--leise); }
.zeitleiste li .zeit { margin: 0 0 6px; color: var(--gold); }

.marke-platz { display: inline-block; margin-top: 14px !important; padding: 4px 14px; border-radius: 999px; background: linear-gradient(135deg, var(--gold), #b9832a); color: var(--nacht) !important; font-weight: 700; font-size: 0.88rem; }
.marke-teilnahme { background: transparent; color: var(--text) !important; border: 1px solid var(--rand); font-weight: 500; }

/* Partien */

.partien-raster { display: grid; grid-template-columns: minmax(0, 460px) 1fr; gap: 56px; align-items: center; }

.brett-buehne { perspective: 1100px; }

.brett {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: repeating-conic-gradient(var(--feld-dunkel) 0 25%, var(--feld-hell) 0 50%) 0 0 / 25% 25%;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.65), 0 0 0 10px rgba(255, 255, 255, 0.04), 0 0 120px rgba(47, 143, 107, 0.25);
  transform: rotateX(14deg) rotateZ(-2deg);
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  container-type: inline-size;
}

.brett-buehne:hover .brett { transform: none; }

.brett .marke-zug { position: absolute; left: 0; top: 0; width: 12.5%; height: 12.5%; background: rgba(233, 185, 73, 0.55); transition: transform 0.3s; }

.brett .figur {
  position: absolute;
  left: 0;
  top: 0;
  width: 12.5%;
  height: 12.5%;
  display: grid;
  place-items: center;
  font-family: var(--figuren);
  font-size: 10cqw;
  line-height: 1;
  color: #14171c;
  -webkit-text-stroke: 0.25cqw rgba(255, 255, 255, 0.55);
  transition: transform 0.55s cubic-bezier(0.3, 1.2, 0.4, 1), opacity 0.35s;
  filter: drop-shadow(0 0.6cqw 0.5cqw rgba(0, 0, 0, 0.45));
}

.brett .figur.weiss { color: #fbf5e6; -webkit-text-stroke: 0.3cqw #14171c; }
.brett .figur.geschlagen { opacity: 0; }

.partie-titel { margin: 0 0 8px; font-family: var(--serif); font-size: 1.5rem; }
.partien p { max-width: 34em; color: var(--leise); }
.partien .partie-titel { color: var(--text); }

.zug-anzeige { margin: 22px 0 14px; font-size: 1.6rem; font-weight: 800; color: var(--gold-hell) !important; font-variant-numeric: tabular-nums; min-height: 1.6em; }

.steuerung { display: flex; gap: 10px; margin-bottom: 18px; }

.steuerung button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--rand);
  background: var(--flaeche);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.steuerung button:hover { background: var(--gold); color: var(--nacht); border-color: var(--gold); transform: translateY(-2px); }
.steuerung button:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Galerie */

.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 32px; }
.galerie figure { margin: 0; }
.galerie img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center top;
  border-radius: 20px;
  border: 1px solid var(--rand);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.4s;
}
.galerie figure:hover img { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 70px rgba(233, 185, 73, 0.25); }

.kontakt p { max-width: 38em; color: var(--leise); }

.fuss { border-top: 1px solid var(--rand); background: rgba(8, 11, 16, 0.7); color: var(--leise); padding: 36px 16px; text-align: center; font-size: 0.92rem; }
.fuss p { margin: 4px 0; }
.fuss a { margin: 0 10px; }

.text-seite { max-width: 720px; margin: 0 auto; padding: 72px 16px 96px; }
.text-seite h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); margin-bottom: 28px; }
.text-seite h2 { font-size: 1.5rem; margin: 36px 0 8px; }
.text-seite p { color: var(--leise); }

@media (max-width: 820px) {
  main > section { padding: 68px 16px; }
  .start-inhalt { grid-template-columns: 1fr; gap: 44px; padding: 40px 16px 96px; }
  .start-bild { max-width: 320px; }
  .kernzahlen { grid-template-columns: 1fr; }
  .partien-raster { grid-template-columns: 1fr; gap: 36px; }
  .brett { transform: rotateX(8deg); }
  .kopf nav { gap: 16px; }
  .zeitleiste { padding-left: 38px; }
  .zeitleiste::before, .zeitleiste::after { left: 10px; }
  .zeitleiste .laeufer { left: 11px; width: 28px; height: 28px; font-size: 1.05rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .boden, .weiter, h1 .wort, .einstieg, .kernzahlen, .start-bild { animation: none; opacity: 1; transform: none; }
  h1 .wort { transform: none; }
  h1 .gold .wort { animation: none; background-position: 50% 0; }
  .zeig { opacity: 1; transform: none; transition: none; }
  .kipp { transform: none; }
  .brett { transform: none; }
  .brett .figur { transition: none; }
}
