:root{--akzent:#0e6b6b;--akzent-hell:#e2f2f1;--akzent-dunkel:#62cfc6;--akzent-hell-dunkel:#1e312e;--marke:#0e6b6b}
/* Grundregeln aller Websites (UI-UX-REGELN 2.–8., 15.): Farben mit Dunkelmodus, Schrift, Kopf mit Menü, Brotkrumen,
   Seitenkopf, Fuß, Fokus, Druck. Davor setzt der Bau die --akzent*-Variablen (kern/basis/stil.mjs),
   danach folgt das Stylesheet der Website und überschreibt, was dort anders ist (z. B. --breite). */
:root {
  --text: #1c1f1d;
  --leise: #5b625d;
  --linie: #dfe3df;
  --flaeche: #ffffff;
  --grund: #f6f7f4;
  --akzent-text: #ffffff;
  --radius: 10px;
  --breite: 1240px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8ebe8;
    --leise: #a3aba5;
    --linie: #333a35;
    --flaeche: #1b1f1c;
    --grund: #121513;
    --akzent: var(--akzent-dunkel);
    --akzent-hell: var(--akzent-hell-dunkel); /* Hauch Akzent auf dem dunklen Grund */
    --akzent-text: #0f1310;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--grund);
  /* Fuß immer am unteren Rand, auch bei wenig Inhalt */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--akzent); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.huelle { max-width: var(--breite); margin: 0 auto; padding: 0 16px; }
.unsichtbar { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprunglink { position: absolute; left: 16px; top: -100px; background: var(--flaeche); padding: .5rem 1rem; border-radius: 8px; z-index: 50; }
.sprunglink:focus { top: 8px; }

.kopf { background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.kopf .huelle { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.logo-zeichen { width: 22px; height: 22px; flex: none; color: var(--akzent); }
.kopf nav a { color: var(--leise); text-decoration: none; margin-left: 1rem; font-size: .95rem; display: inline-block; padding: .6rem 0; }
.kopf nav a:hover, .kopf nav a[aria-current] { color: var(--akzent); }
.menue-knopf { display: none; }
/* Menü-Knopf am Handy und überall, wo die Links nicht neben das Logo passen (.eng setzt das Skript in rahmen.mjs):
   Kopf in einer Zeile, Links klappen darunter auf */
@media (max-width: 699px) {
  html { scroll-padding-top: 12px; }
  .kopf .huelle { min-height: 56px; gap: 0 1rem; }
}
.js .eng .menue-knopf { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -10px; border: 0; background: none; color: var(--text); cursor: pointer; border-radius: 8px; }
.menue-knopf::before, .menue-knopf::after { content: ""; grid-area: 1 / 1; width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .15s, box-shadow .15s; }
.menue-knopf::before { box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor; }
.menue-knopf::after { transform: scaleX(0); }
.offen .menue-knopf::before { box-shadow: none; transform: rotate(45deg); }
.offen .menue-knopf::after { transform: rotate(-45deg); }
.js .kopf.eng nav { display: none; }
.js .kopf.eng.offen nav { display: flex; flex-direction: column; flex-basis: 100%; padding-bottom: .5rem; }
.js .kopf.eng nav a { margin: 0; padding: .75rem 0; font-size: 1rem; color: var(--text); border-top: 1px solid var(--linie); }

/* Knöpfe: gefüllt = Hauptaktion, umrandet (.zweit) = Nebenaktion (UI-UX-REGELN 9.) */
.knopf { font: inherit; font-weight: 600; padding: .65rem 1rem; border-radius: 8px; border: 1px solid var(--akzent); background: var(--akzent); color: var(--akzent-text); cursor: pointer; text-decoration: none; display: inline-block; }
.knopf.zweit { background: transparent; color: var(--akzent); }
main { flex: 1 0 auto; padding: 1.25rem 0 3rem; }
main.mit-vorspann { padding-top: 0; }
.krumen { font-size: .875rem; color: var(--leise); margin-bottom: .75rem; }
.krumen ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .25rem; align-items: baseline; }
.krumen li + li::before { content: "›"; margin-right: .25rem; }
.krumen a { color: var(--leise); }
/* Handy: aktuelle Seite steht ohnehin in der Überschrift */
@media (max-width: 699px) { .krumen li:nth-child(n+3)[aria-current] { display: none; } }
.einleitung { font-size: 1.05rem; color: var(--leise); max-width: 50rem; }
.seitenkopf { margin-bottom: 1rem; }
.seitenkopf h1 { margin-bottom: .3rem; }
.seitenkopf .einleitung { margin: 0; }
.prosa { max-width: 46rem; }
.prosa li { margin-bottom: .35rem; }

.fuss { border-top: 1px solid var(--linie); background: var(--flaeche); font-size: .875rem; color: var(--leise); padding: 1.5rem 0; }
.fuss .huelle { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; }
.fuss p { margin: 0; }
.fuss a { color: var(--leise); }
.fuss nav a { margin-right: 1rem; }
.fuss .link-knopf { font: inherit; color: var(--leise); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* Tastatur-Fokus überall sichtbar (UI-UX-REGELN 15.). :root davor, damit spätere Regeln wie „all: unset“ ihn nicht entfernen. */
:root :focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
/* Kleine Textlinks mindestens 24 px hoch (UI-UX-REGELN 2.) */
.fuss a, .fuss .link-knopf, .krumen a { display: inline-block; padding-block: 3px; }
/* Finger: Logo und Fußzeilen-Links 44 px hoch (UI-UX-REGELN 2.) */
@media (pointer: coarse) {
  .logo { min-height: 44px; }
  .fuss nav a, .fuss .link-knopf { display: inline-flex; align-items: center; gap: .3em; min-height: 44px; padding-block: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media print {
  .kopf, .fuss, .krumen, .sprunglink { display: none; }
  body { background: #fff; color: #000; }
}

/* Formular „Fehler melden“ (kern/basis/hinweis.mjs) */
.hinweis-form label { display: block; font-weight: 600; margin-bottom: .5rem; }
.hinweis-form textarea { display: block; width: 100%; box-sizing: border-box; font: inherit; padding: .62rem .9rem; border: 1px solid var(--linie); border-radius: 8px; background: var(--grund); color: var(--text); resize: vertical; }
.hinweis-form textarea:focus { outline: 2px solid var(--akzent); outline-offset: 1px; }
.hinweis-leise { font-size: .875rem; color: var(--leise); margin: .5rem 0 1rem; }
.hinweis-fehler { font-weight: 600; margin: 0 0 .75rem; }
.hinweis-fehler:empty, .hinweis-dank:empty { display: none; }
/* Vierergruppen: nur die eigenen Regeln. Farben, Dunkelmodus, Kopf, Fuß, Knöpfe und Fokus kommen aus kern/basis/basis.css. */
:root {
  /* Gruppenfarben nach Schwierigkeit (gelb leicht … lila schwer), hell und dunkel gleich, dunkle Schrift darauf */
  --g1: #f2d46b;
  --g2: #a7d672;
  --g3: #aac4ee;
  --g4: #cba9e9;
  --g-text: #1c1f1d;
}

main .seitenkopf, main .prosa, .spiel { margin-inline: auto; }
.seitenkopf { max-width: 34rem; text-align: center; }
.seitenkopf h1 { font-size: clamp(1.45rem, 5.5vw, 2rem); }

/* ---------- Spielfeld ---------- */
.spiel { max-width: 34rem; margin-bottom: 2.5rem; }
.spiel-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.spiel-titel { font-size: 1.05rem; margin: 0; }
.spiel-datum { margin: 0; color: var(--leise); font-size: .9rem; }

.raster { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 4rem; gap: .5rem; }
@media (min-width: 700px) { .raster { grid-auto-rows: 4.75rem; } }

.kachel {
  font: inherit; font-weight: 700; font-size: clamp(.8rem, 3.4vw, 1rem); line-height: 1.15;
  min-width: 0; padding: .25rem; border: 0; border-radius: 8px;
  background: var(--akzent-hell); color: var(--text); cursor: pointer;
  hyphens: manual; overflow-wrap: break-word;
  transition: background-color .1s, color .1s;
}
.kachel.lang { font-size: clamp(.72rem, 3vw, .95rem); }
.kachel:disabled { cursor: default; }
.kachel[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-text); box-shadow: inset 0 0 0 2px var(--akzent-text); }
@media (hover: hover) { .kachel:not(:disabled):hover { box-shadow: inset 0 0 0 2px var(--akzent); } .kachel[aria-pressed="true"]:hover { box-shadow: inset 0 0 0 2px var(--akzent-text); } }

.gruppe {
  grid-column: 1 / -1; border-radius: 8px; color: var(--g-text);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: .25rem .5rem; line-height: 1.25;
}
.gruppe strong { font-size: 1rem; text-transform: uppercase; letter-spacing: .03em; }
.gruppe span { font-size: .9rem; }
.g1 { background: var(--g1); } .g2 { background: var(--g2); } .g3 { background: var(--g3); } .g4 { background: var(--g4); }
/* Nach einem verlorenen Spiel aufgedeckte Gruppen: gestrichelt umrandet, damit man sie von den selbst gelösten unterscheidet */
.gruppe.aufgedeckt { outline: 2px dashed var(--g-text); outline-offset: -5px; }

.spiel-meldung { min-height: 1.5em; margin: .6rem 0 .2rem; text-align: center; font-weight: 600; }
.fehler { display: flex; justify-content: center; align-items: center; gap: .5rem; margin: 0 0 .8rem; color: var(--leise); }
.punkte { display: inline-flex; gap: .3rem; }
.punkte i { width: .8rem; height: .8rem; border-radius: 50%; background: var(--text); }
.punkte i.weg { background: transparent; box-shadow: inset 0 0 0 1.5px var(--leise); }

.spiel-knoepfe { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.spiel-knoepfe .knopf, .ende-knoepfe .knopf { min-height: 44px; border-radius: 22px; padding-inline: 1.1rem; }
.knopf:disabled { opacity: .45; cursor: default; }

.wackeln { animation: wackeln .15s linear 2; }
@keyframes wackeln { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@media (prefers-reduced-motion: reduce) { .wackeln { animation: none; } .kachel { transition: none; } }

/* Ohne JavaScript bzw. bis das Rätsel geladen ist: Platzhalter-Kacheln */
.spiel:not(.bereit) .kachel { color: transparent; }
.spiel:not(.bereit) .spiel-knoepfe .knopf { visibility: hidden; }

/* ---------- Ende ---------- */
.spiel-ende { text-align: center; margin-top: 1rem; padding: 1rem; border: 1px solid var(--linie); border-radius: 10px; background: var(--flaeche); }
.spiel-ende h3 { margin: 0 0 .5rem; font-size: 1.15rem; }
.verlauf { line-height: 1; margin: .5rem 0 .9rem; }
.verlauf i { display: inline-block; width: 1.1rem; height: 1.1rem; margin: 1px; border-radius: 3px; vertical-align: middle; }
.ende-knoepfe { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; }
.statistik { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1rem 0; }
.statistik div { display: flex; flex-direction: column-reverse; }
.statistik dd { margin: 0; font-size: 1.5rem; font-weight: 700; }
.statistik dt { font-size: .8rem; color: var(--leise); }

/* ---------- Text unter dem Spiel ---------- */
