/* rat.de – Landingpage. Eine Schriftdatei, keine fremden Server. */
@font-face {
  font-family: "Archivo";
  src: url("schrift/archivo-latin-wdth-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  --grund: #edf2f7;
  --flaeche: #ffffff;
  --tinte: #15212c;
  --leise: #4d5c6a;
  --linie: #c7d2dd;
  --rot: #d93a1c;
  --blau: #1d5bdb;
  --gelb: #f5c542;
  --brett: #15212c;
  --feld-hell: #e9eef4;
  --feld-dunkel: #7d9cc0;
  --rand: clamp(1.25rem, 5vw, 4rem);
  --breite: 72rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #101a23;
    --flaeche: #18242f;
    --tinte: #e9eff5;
    --leise: #a3b1be;
    --linie: #2b3a48;
    --rot: #ff6a4d;
    --brett: #5b6b7a;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--grund);
  color: var(--tinte);
  font-family: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--rot); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--rot); }
:focus-visible { outline: 3px solid var(--blau); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }

.innen { max-width: var(--breite); margin-inline: auto; padding-inline: var(--rand); }

/* Kopf */
.kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 1.5rem; padding-block: 1.25rem; }
.marke { font-stretch: 62%; font-weight: 800; font-size: 1.5rem; letter-spacing: 0.01em; text-decoration: none; }
.marke span { color: var(--rot); }
.kopf-rechts { display: flex; align-items: baseline; gap: 1.5rem; font-size: 0.95rem; }
.sprachen { display: flex; gap: 0.15rem; }
.sprachen a, .sprachen span { padding: 0.15rem 0.5rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
.sprachen a { color: var(--leise); }
.sprachen a:hover { color: var(--rot); }
.sprachen span { background: var(--tinte); color: var(--grund); }

/* Auftakt */
.auftakt { padding-top: clamp(1.5rem, 4.5vw, 3.25rem); }
h1 {
  font-stretch: 62%;
  font-weight: 800;
  font-size: clamp(2.75rem, 8.4vw, 6.25rem);
  line-height: 0.94;
  letter-spacing: -0.012em;
  max-width: 15ch;
  text-wrap: balance;
}
.auftakt .vorspann { margin-top: 1.5rem; max-width: 36rem; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); color: var(--leise); }
.knoepfe { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.75rem; }
.knopf {
  display: inline-block;
  padding: 0.8rem 1.35rem;
  border: 2px solid var(--tinte);
  border-radius: 999px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  background: var(--tinte);
  color: var(--grund);
  cursor: pointer;
}
.knopf:hover { background: var(--rot); border-color: var(--rot); color: #fff; }
.knopf.zweiter { background: transparent; color: var(--tinte); }
.knopf.zweiter:hover { background: transparent; border-color: var(--rot); color: var(--rot); }

/* Regal */
.regal-rahmen { margin-top: clamp(2.25rem, 5vw, 3.5rem); overflow-x: auto; scrollbar-width: none; border-bottom: 10px solid var(--brett); }
.regal-rahmen::-webkit-scrollbar { display: none; }
.regal { display: flex; align-items: flex-end; gap: 5px; width: max-content; padding: 1.25rem var(--rand) 0; }
.regal a { flex: none; transition: transform 0.18s ease-out; }
.regal a:hover { transform: translateY(-10px); }
.regal img { width: auto; height: calc(150px * var(--h, 1)); box-shadow: 0 0 0 1px rgba(21, 33, 44, 0.16); }
.regal a:last-child { margin-left: 14px; }
.regal a:last-child img { transform: rotate(-7deg); transform-origin: bottom right; }
@media (min-width: 760px) {
  .regal { width: auto; gap: 6px; padding-left: max(var(--rand), calc((100vw - var(--breite)) / 2 + var(--rand))); padding-right: max(var(--rand), calc((100vw - var(--breite)) / 4)); }
  .regal a { flex: calc(var(--v) * var(--h, 1)) 1 0; min-width: 0; }
  .regal img { width: 100%; height: auto; }
  .regal a:last-child { margin-left: 1vw; }
}

/* Abschnitte */
main > section { padding-top: clamp(3.5rem, 8vw, 6.5rem); }
.abschnitt-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.5rem 2rem; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
h2 { font-stretch: 62%; font-weight: 800; font-size: clamp(2rem, 5vw, 3.25rem); line-height: 1; letter-spacing: -0.005em; text-wrap: balance; }

/* Bücher */
.buecher { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 27rem), 1fr)); gap: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 4vw, 3.5rem); }
.buch { display: grid; grid-template-columns: 96px 1fr; gap: 1.1rem; align-items: start; }
@media (min-width: 600px) { .buch { grid-template-columns: 132px 1fr; gap: 1.5rem; } }
.buch-bild img { width: 100%; box-shadow: 0 0 0 1px rgba(21, 33, 44, 0.14), 0 14px 22px -14px rgba(21, 33, 44, 0.55); }
.rubrik { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; font-size: 0.875rem; color: var(--leise); }
.hinweis { padding: 0.05rem 0.55rem; border: 1px solid var(--linie); border-radius: 999px; font-size: 0.8125rem; }
.hinweis.bald { border-color: transparent; background: var(--gelb); color: #15212c; font-weight: 600; }
h3 { margin-top: 0.3rem; font-stretch: 75%; font-weight: 750; font-size: clamp(1.3rem, 2.2vw, 1.6rem); line-height: 1.12; }
h3 a { text-decoration: none; }
h3 a:hover { text-decoration: underline; text-decoration-color: var(--rot); }
.buch-text > p:last-child { margin-top: 0.5rem; max-width: 34rem; font-size: 1rem; color: var(--leise); }

/* Zugwunder */
.zugwunder {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 1.5rem clamp(1.5rem, 5vw, 3.5rem);
  align-items: center;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border-radius: 28px;
  background: var(--blau);
  color: #fff;
}
.zugwunder::after {
  content: "";
  position: absolute;
  right: -40px; bottom: -40px;
  width: min(46%, 380px); aspect-ratio: 1;
  background: conic-gradient(rgba(255, 255, 255, 0.11) 25%, transparent 0 50%, rgba(255, 255, 255, 0.11) 0 75%, transparent 0) 0 0 / 25% 25%;
  transform: rotate(-12deg);
  pointer-events: none;
}
.zugwunder > * { position: relative; z-index: 1; }
.zugwunder img { width: clamp(112px, 22vw, 200px); filter: drop-shadow(0 16px 20px rgba(8, 24, 70, 0.45)); }
.zugwunder h2 { font-size: clamp(2.25rem, 6vw, 4rem); }
.zugwunder .spruch { margin-top: 0.4rem; font-stretch: 75%; font-weight: 600; font-size: clamp(1.15rem, 2.2vw, 1.5rem); line-height: 1.2; color: #ffe08a; }
.zugwunder .text { margin-top: 1rem; max-width: 36rem; color: #e4ecff; }
.zugwunder .knopf { margin-top: 1.5rem; background: #fff; border-color: #fff; color: #15212c; }
.zugwunder .knopf:hover { background: var(--gelb); border-color: var(--gelb); color: #15212c; }
.zugwunder :focus-visible { outline-color: #fff; }
@media (min-width: 640px) { .zugwunder { grid-template-columns: auto 1fr; } }

/* Spiel */
main > section.spiel-abschnitt { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
.spiel { display: grid; gap: 1.5rem clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.spiel-auftakt { order: -1; }
.spiel-auftakt p { max-width: 30rem; color: var(--leise); }
.spiel-auftakt .knopf { margin-top: 1.25rem; }
.spiel-auftakt .klein { margin-top: 0.75rem; font-size: 0.9rem; }
@media (min-width: 860px) {
  .spiel { grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr); }
  .spiel-auftakt { order: 0; align-self: center; }
}
.play-board-wrap { position: relative; max-width: 600px; }
.pboard {
  display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  aspect-ratio: 1; width: 100%;
  border-radius: 14px; overflow: hidden;
  background: conic-gradient(var(--feld-dunkel) 25%, var(--feld-hell) 0 50%, var(--feld-dunkel) 0 75%, var(--feld-hell) 0) 0 0 / 25% 25%;
  box-shadow: 0 0 0 1px rgba(21, 33, 44, 0.16), 0 28px 48px -28px rgba(21, 33, 44, 0.6);
  user-select: none; -webkit-user-select: none; touch-action: none;
}
.pboard .square { position: relative; display: grid; place-items: center; cursor: pointer; }
.pboard .square.light { background: var(--feld-hell); }
.pboard .square.dark { background: var(--feld-dunkel); }
.pboard .square.last::before { content: ""; position: absolute; inset: 0; background: rgba(245, 197, 66, 0.55); }
.pboard .square.selected::before { content: ""; position: absolute; inset: 0; background: rgba(245, 197, 66, 0.85); }
.pboard .square.check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(217, 58, 28, 0.95) 0%, rgba(217, 58, 28, 0.5) 45%, transparent 75%); }
.pboard .square.target::after { content: ""; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(21, 33, 44, 0.3); }
.pboard .square.target.occupied::after { width: 90%; height: 90%; background: transparent; border: 5px solid rgba(21, 33, 44, 0.32); }
.pboard .coord { position: absolute; font-weight: 700; font-size: clamp(9px, 1.4vw, 12px); line-height: 1; pointer-events: none; }
.pboard .coord.file { right: 4px; bottom: 3px; }
.pboard .coord.rank { left: 4px; top: 3px; }
.pboard .square.light .coord { color: var(--feld-dunkel); }
.pboard .square.dark .coord { color: var(--feld-hell); }
.pboard .piece { width: 90%; height: 90%; position: relative; z-index: 1; pointer-events: none; }
.wpiece { fill: #fbfaf4; stroke: #2a2a2a; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; color: #2a2a2a; }
.bpiece { fill: #1c1c1c; stroke: #1c1c1c; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; color: #e9e9e9; }
.drag-ghost { position: fixed; z-index: 10; pointer-events: none; transform: translate(-50%, -50%); }
.promotion { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(237, 242, 247, 0.6); border-radius: 14px; z-index: 5; }
.promotion.open { display: flex; }
.promotion > div { display: flex; gap: 8px; background: #fff; padding: 10px; border-radius: 14px; box-shadow: 0 24px 48px -20px rgba(21, 33, 44, 0.6); }
.promotion button { width: 64px; height: 64px; padding: 4px; border: 1px solid #c7d2dd; border-radius: 10px; background: #fff; cursor: pointer; }
.promotion button:hover { background: #dbe7fb; border-color: var(--blau); }
.promotion button svg { width: 100%; height: 100%; display: block; }

.play-side { display: grid; gap: 1.2rem; }
.play-panel { display: grid; gap: 1.1rem; padding: 1.3rem 1.4rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; }
.play-status { font-stretch: 75%; font-weight: 750; font-size: 1.45rem; line-height: 1.15; min-height: 1.3em; }
.play-eval { color: var(--leise); font-size: 0.92rem; min-height: 1.3em; margin-top: -0.5rem; }
.play-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.play-fields label { display: block; font-weight: 650; font-size: 0.85rem; margin-bottom: 0.3rem; color: var(--leise); }
.play-fields select {
  width: 100%; font: inherit; font-weight: 600; font-size: 0.95rem; color: var(--tinte); background-color: var(--flaeche);
  border: 1px solid var(--linie); border-radius: 10px; padding: 0.55rem 2rem 0.55rem 0.75rem; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237d8a97' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.7rem center; background-size: 12px 8px;
}
.play-actions { display: flex; flex-wrap: wrap; gap: 0.6rem 0.7rem; }
.taste { padding: 0.55rem 0.95rem; border: 2px solid var(--tinte); border-radius: 999px; background: transparent; color: var(--tinte); font: inherit; font-weight: 650; font-size: 0.92rem; cursor: pointer; }
.taste.erste { background: var(--tinte); color: var(--grund); }
.taste:hover:not(:disabled) { border-color: var(--rot); color: var(--rot); }
.taste.erste:hover:not(:disabled) { background: var(--rot); color: #fff; }
.taste:disabled { opacity: 0.4; cursor: default; }
.play-moves { border-top: 1px solid var(--linie); padding-top: 0.6rem; max-height: 240px; overflow-y: auto; font-size: 0.96rem; }
.play-moves ol { counter-reset: move; }
.play-moves li { counter-increment: move; display: grid; grid-template-columns: 2.4rem 1fr 1fr; padding: 0.3rem 0; border-bottom: 1px solid var(--linie); }
.play-moves li::before { content: counter(move) "."; color: var(--leise); font-weight: 600; }
.play-moves li span { font-weight: 700; }
.play-moves:has(ol:empty) { display: none; }
.play-help { padding: 0.9rem 1.4rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: 16px; }
.play-help summary { cursor: pointer; font-weight: 650; padding: 0.2rem 0; }
.play-help p, .play-help dd { font-size: 0.94rem; color: var(--leise); }
.play-help p { margin-top: 0.8rem; }
.play-help dl { margin: 0.6rem 0; }
.play-help dt { font-weight: 700; margin-top: 0.7rem; }

/* Fuß */
footer { margin-top: clamp(4rem, 9vw, 7rem); padding-block: 1.75rem 2.5rem; border-top: 1px solid var(--linie); font-size: 0.9rem; color: var(--leise); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .regal a { transition: none; }
  .regal a:hover { transform: none; }
}
