/* Patzerschach – Unterseiten (/gegner/, /patzer/, /analyse/, /schach-zu-zweit/, /bretter/), erzeugt von tools/seiten-bau.py.
   Schlank und eigenständig: lädt NICHT schach.css. Farbwelt wie css/recht.css und der Startbildschirm im Standardzustand.
   Bewusst ohne backdrop-filter und ohne automatische Silbentrennung. */
:root {
  color-scheme: dark;
  --navy: #0c1b2a; --navy-2: #13293f; --navy-3: #1a3550; --line: rgba(255, 255, 255, .1); --chip-line: rgba(255, 255, 255, .16);
  --gold: #c9a35c; --gold-2: #ddbe85; --text: #dfe7ef; --muted: #9db0c3; --white: #fff;
  --r: 14px; --spalte: 760px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--navy); color: var(--text); font: 400 1rem/1.65 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow-wrap: break-word; -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--gold-2); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--white); }
:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 10px 16px; background: var(--gold); color: var(--navy); font-weight: 700; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 8px; }

/* ---------- Kopf ---------- */
.kopf { background: var(--navy); border-bottom: 1px solid var(--line); }
.kopf-in { max-width: 1080px; margin: 0 auto; padding: 6px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left));
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; }
.marke { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; color: var(--white); font-weight: 700; font-size: 1.18rem; letter-spacing: -.01em; text-decoration: none; }
.marke img { width: 28px; height: 28px; display: block; }
.marke:hover { color: var(--gold-2); }
.jetzt { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; border-radius: 999px;
  background: var(--gold); color: var(--navy); font-weight: 700; text-decoration: none; white-space: nowrap; box-shadow: 0 3px 0 #8a6d37; }
.jetzt:hover { background: var(--gold-2); color: var(--navy); }
.kopf .jetzt { margin-left: auto; }
.nav { order: 3; flex: 1 1 100%; margin: 0 -8px; overflow-x: auto; scrollbar-width: thin; }
.nav ul { display: flex; gap: 2px; margin: 0; padding: 0 0 2px; list-style: none; }
.nav a { position: relative; display: flex; align-items: center; min-height: 44px; min-width: 44px; padding: 0 10px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 500; white-space: nowrap; }
.nav a:hover { color: var(--gold-2); background: rgba(255, 255, 255, .05); }
.nav a[aria-current="page"] { color: var(--gold-2); }
.nav a[aria-current="page"]::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 5px; height: 2px; border-radius: 2px; background: var(--gold); }
@media (max-width: 420px) {
  .nav ul { justify-content: space-between; gap: 0; }
  .nav a { padding: 0 6px; font-size: .95rem; }
  .nav a[aria-current="page"]::after { left: 6px; right: 6px; }
}
@media (min-width: 880px) {
  .kopf-in { flex-wrap: nowrap; gap: 20px; }
  .nav { order: 0; flex: 0 1 auto; margin: 0 0 0 12px; overflow: visible; }
  .nav ul { padding: 0; }
}

/* ---------- Hauptspalte ---------- */
.spalte { max-width: calc(var(--spalte) + 32px); margin: 0 auto; padding: 36px max(16px, env(safe-area-inset-right)) 40px max(16px, env(safe-area-inset-left)); }
.spalte h1 { margin: 0 0 16px; font-size: 2.1rem; line-height: 1.18; font-weight: 700; color: var(--white); letter-spacing: -.01em; text-wrap: balance; }
.spalte h2 { margin: 42px 0 10px; font-size: 1.35rem; line-height: 1.3; font-weight: 700; color: var(--gold-2); text-wrap: balance; }
.spalte h3 { margin: 0; font-size: 1.12rem; line-height: 1.3; font-weight: 700; color: var(--white); }
.spalte p { margin: 0 0 14px; }
.spalte .lead { font-size: 1.16rem; line-height: 1.6; color: var(--text); }
.spalte ol { margin: 0 0 16px; padding-left: 1.5em; }
.spalte li { margin: 0 0 8px; padding-left: 4px; }
.spalte li::marker { color: var(--gold-2); font-weight: 700; }
.spalte strong { color: var(--white); }
@media (max-width: 600px) {
  .spalte { padding-top: 24px; }
  .spalte h1 { font-size: 1.62rem; }
  .spalte h2 { font-size: 1.2rem; margin-top: 34px; }
  .spalte .lead { font-size: 1.06rem; }
}

/* Häufige Fragen: wie #ueber auf der Startseite */
.spalte details { border-top: 1px solid var(--chip-line); }
.spalte details:last-of-type { border-bottom: 1px solid var(--chip-line); }
.spalte h2 + details { margin-top: 4px; }
.spalte summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 4px; cursor: pointer; list-style: none; font-weight: 500; color: var(--text); border-radius: 4px; }
.spalte summary::-webkit-details-marker { display: none; }
.spalte summary::before { content: '›'; flex: none; width: 1em; text-align: center; font-size: 1.25em; line-height: 1; color: var(--gold-2); transition: transform .15s; }
.spalte details[open] > summary::before { transform: rotate(90deg); }
.spalte summary:hover { color: var(--gold-2); }
.spalte summary:focus { outline: none; }
.spalte summary:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.spalte details > :not(summary) { color: var(--muted); margin: 0; padding: 0 4px 14px calc(1em + 14px); }
@media (prefers-reduced-motion: reduce) { .spalte summary::before { transition: none; } }

/* ---------- Tabellen ---------- */
.tab { margin: 18px 0 22px; }
.tab table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; background: var(--navy-2); border-radius: 10px; overflow: hidden; }
.tab th, .tab td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tab thead th { font-size: .86rem; font-weight: 700; color: var(--gold-2); background: var(--navy-3); line-height: 1.35; }
.tab tbody tr:last-child > * { border-bottom: 0; }
.tab .zahl { text-align: right; }
.tab td.zahl { white-space: nowrap; }
.tab tr.hervor > * { background: rgba(201, 163, 92, .14); color: var(--white); font-weight: 700; }
.tab figcaption { margin-top: 8px; font-size: .86rem; line-height: 1.5; color: var(--muted); }
.balken { display: inline-block; vertical-align: middle; height: 10px; margin-right: 10px; border-radius: 3px; background: var(--gold); }
.tab .mit-balken { white-space: nowrap; }
@media (max-width: 420px) { .tab th, .tab td { padding: 8px 10px; } .tab thead th { font-size: .8rem; } }

/* ---------- Gegnerkarten ---------- */
.karten { display: grid; grid-template-columns: 1fr; gap: 16px; margin: 18px 0 8px; }
@media (min-width: 700px) { .karten { grid-template-columns: 1fr 1fr; } }
.karte { display: flex; flex-direction: column; padding: 18px 18px 16px; background: var(--navy-2); border: 1px solid var(--line); border-radius: var(--r); }
.karte-kopf { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.gesicht { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 3px rgba(255, 255, 255, .85), 0 6px 18px rgba(0, 0, 0, .35); }
.gesicht svg { display: block; width: 100%; height: 100%; }
.spalte .karte h3 { font-size: 1.15rem; }
.spalte .karte .stufe { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.stufe b { color: var(--gold-2); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; padding: 0; list-style: none; }
.spalte .chips li { margin: 0; padding: 3px 10px; font-size: .84rem; line-height: 1.4; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid var(--chip-line); color: var(--text); }
.spruch { margin: 0 0 12px; padding: 2px 0 2px 12px; border-left: 3px solid var(--gold); }
.spalte .spruch p { margin: 0; color: var(--gold-2); line-height: 1.5; }
.spalte .karte > p { margin-bottom: 10px; }
.spalte .karte .brettzeile { margin-top: auto; padding-top: 2px; font-size: .9rem; color: var(--muted); }
.knopf { display: flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 8px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--gold); color: var(--gold-2); font-weight: 700; text-decoration: none; text-align: center; line-height: 1.3; }
.knopf:hover { background: var(--gold); color: var(--navy); }

/* ---------- Diagramme (Patzer-Beispiele) ---------- */
.legende { font-size: .92rem; color: var(--muted); }
.legende i { display: inline-block; width: .95em; height: .95em; vertical-align: -.1em; border-radius: 2px; margin-right: 4px; }
.legende .l-zug { background: #f2c94c; }
.legende .l-pfeil { background: #e5484d; }
.diagramme { display: grid; grid-template-columns: 1fr; gap: 26px; margin: 18px 0 10px; }
@media (min-width: 700px) { .diagramme { grid-template-columns: 1fr 1fr; gap: 28px 22px; } }
.bsp { margin: 0; }
.brett { position: relative; width: 100%; max-width: 440px; aspect-ratio: 1 / 1; margin: 0 auto; border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .4), 0 10px 26px rgba(0, 0, 0, .35); container-type: inline-size; }
.felder { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); width: 100%; height: 100%; }
.feld { position: relative; background: #f0d9b5; }
.feld.d { background: #b58863; }
.feld.zug::before { content: ''; position: absolute; inset: 0; background: rgba(242, 201, 76, .62); }
.feld .pc { position: absolute; inset: 0; z-index: 1; background-size: 100% 100%; background-repeat: no-repeat; background-position: center; }
.ko { position: absolute; z-index: 2; font-size: .6rem; font-size: clamp(8px, 2.7cqw, 12px); font-weight: 700; line-height: 1; color: #8a6a49; pointer-events: none; }
.feld.d .ko { color: #f3e3c8; }
.ko.r { left: 3%; top: 4%; }
.ko.l { right: 4%; bottom: 3%; }
.pz { position: absolute; z-index: 3; right: 3%; top: 3%; padding: 1px 2px; border-radius: 3px; background: #c62f2f; color: #fff;
  font-size: .6rem; font-size: clamp(8px, 2.6cqw, 12px); font-weight: 700; line-height: 1.1; font-style: normal; }
.pfeil { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; }
.bsp figcaption { max-width: 440px; margin: 12px auto 0; }
.spalte .bsp h3 { margin-bottom: 6px; font-size: 1.06rem; }
.spalte .bsp p { margin: 0 0 4px; font-size: .95rem; line-height: 1.5; }
.bsp .zuege b { color: var(--white); white-space: nowrap; }
.spalte .bsp .verlust { color: var(--muted); }

/* ---------- Bretter ---------- */
.brett-abschnitt { margin: 30px 0 0; }
.spalte .brett-abschnitt h3 { margin: 0 0 10px; font-size: 1.2rem; }
.brett-abschnitt picture { display: block; max-width: 560px; }
.brett-abschnitt img { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 10px 28px rgba(0, 0, 0, .4); background: var(--navy-2); }
.brett-abschnitt picture + p { margin-top: 14px; }
.spalte .brett-abschnitt .musik { color: var(--muted); font-size: .94rem; }

/* ---------- Abschlussband ---------- */
.abschluss { background: var(--navy-2); border-top: 1px solid rgba(201, 163, 92, .45); }
.abschluss-in { max-width: calc(var(--spalte) + 32px); margin: 0 auto; padding: 32px max(16px, env(safe-area-inset-right)) 34px max(16px, env(safe-area-inset-left)); }
.abschluss h2 { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.3; color: var(--white); }
.abschluss p { margin: 0 0 16px; color: var(--muted); }
.weiter { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 24px 0 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .weiter { grid-template-columns: 1fr 1fr; } }
.weiter li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: rgba(12, 27, 42, .5); color: var(--muted); font-size: .94rem; line-height: 1.5; }
.weiter a { display: inline-block; margin-bottom: 2px; font-weight: 700; font-size: 1rem; }

/* ---------- Fuß ---------- */
.fuss { padding: 22px max(16px, env(safe-area-inset-right)) calc(26px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); color: var(--muted); font-size: .84rem; line-height: 1.6; }
.fuss-in { max-width: calc(var(--spalte) + 32px); margin: 0 auto; }
.fuss p { margin: 0 0 8px; }
.fuss a { color: var(--muted); }
.fuss a:hover { color: var(--gold-2); }
.fuss .fuss-links a { display: inline-block; padding: 6px 0; color: var(--text); }
