/* Die Subsumtions-Liga – 1940er-Comic-Stil. Keine externen Schriften. */
:root {
  --tinte: #1d1a17;
  --papier: #f3e6c4;
  --papier-hell: #fbf3dc;
  --rot: #c8302a;
  --gelb: #f2c230;
  --cyan: #5fb8c9;
  --gruen: #2f7a3b;
  --lila: #6b3fa0;
  --hinter: #22303f;
  --comic: "Arial Black", "Segoe UI Black", Impact, sans-serif;
  --text: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--hinter);
  background-image: radial-gradient(rgba(255,255,255,.05) 1px, transparent 1.2px);
  background-size: 10px 10px;
  color: var(--tinte);
  font-family: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}

#buehne {
  position: relative;
  width: min(100vw - 16px, (100vh - 44px) * 16 / 9);
  aspect-ratio: 16 / 9;
  border: 4px solid var(--tinte);
  box-shadow: 0 0 0 6px var(--papier), 0 0 0 9px var(--tinte), 0 10px 40px rgba(0,0,0,.6);
  background: #9fd3dc;
  container-type: inline-size;
  overflow: hidden;
}
#spiel { position: absolute; inset: 0; }
#spiel canvas { display: block; }
#spiel canvas:focus { outline: none; }

.fuss { color: #c9c1ad; font: 12px/1.4 system-ui, sans-serif; margin: 10px 8px 0; text-align: center; }
kbd { background: var(--papier); color: var(--tinte); border-radius: 3px; padding: 0 4px; font: bold 11px system-ui, sans-serif; }

/* ---------- Frage-Banner während der Torpassage ---------- */
#banner {
  position: absolute; left: 50%; top: .35%; transform: translateX(-50%);
  width: max-content; max-width: 50%;
  background: var(--gelb); border: 3px solid var(--tinte); border-radius: 6px;
  box-shadow: 3px 3px 0 var(--tinte);
  padding: .2em .9em .25em; text-align: center; line-height: 1.2;
  font-size: clamp(10px, 1.5cqw, 20px);
  pointer-events: none;
  animation: reinfallen .35s ease-out;
}
#banner .frage { font-family: var(--comic); letter-spacing: .01em; }
#banner .info { font-family: var(--text); font-size: .85em; margin-top: .05em; }
@keyframes reinfallen { from { transform: translate(-50%, -40px); opacity: 0; } }

/* ---------- Karten (Titel, Briefing, Erklärungen, Ergebnis) ---------- */
#ebene {
  position: absolute; inset: 0;
  background: rgba(20, 24, 32, .55);
  display: flex; align-items: center; justify-content: center;
  padding: 2.5cqw;
}
#ebene[hidden], #banner[hidden] { display: none; }

.karte {
  position: relative;
  width: min(100%, 980px);
  max-height: 100%;
  overflow: auto;
  background: var(--papier-hell);
  background-image: radial-gradient(rgba(120,80,20,.08) 1px, transparent 1.3px);
  background-size: 6px 6px;
  border: 4px solid var(--tinte); border-radius: 4px;
  box-shadow: 8px 8px 0 var(--tinte);
  padding: 1.6cqw 2.2cqw;
  font-size: clamp(12px, 1.55cqw, 18px);
  line-height: 1.42;
  animation: aufploppen .25s ease-out;
}
@keyframes aufploppen { from { transform: scale(.94); opacity: 0; } }

.karte h1, .karte h2 {
  font-family: var(--comic); color: var(--rot); margin: 0 0 .35em;
  text-shadow: 2px 2px 0 var(--gelb), 3px 3px 0 var(--tinte);
  line-height: 1.1; letter-spacing: .01em;
}
.karte h1 { font-size: 2.3em; }
.karte h2 { font-size: 1.6em; }
.karte h3 { font-family: var(--comic); font-size: 1em; margin: .8em 0 .3em; }
.karte p { margin: .45em 0; }

.reihe { display: flex; gap: 1.6cqw; align-items: flex-start; }
.reihe > .panel { flex: 0 0 44%; }
.reihe > .inhalt { flex: 1; min-width: 0; }
.panel { margin: 0; }
.panel img { width: 100%; display: block; border: 3px solid var(--tinte); box-shadow: 4px 4px 0 var(--tinte); }
.panel.gross img { max-height: 46cqw; object-fit: cover; }

.akte {
  background: #fff; border: 2px solid var(--tinte); border-left: 10px solid var(--cyan);
  padding: .5em .8em; margin: .5em 0; font-size: .95em;
}
.akte .kopf { font-family: var(--comic); font-size: .78em; color: #2c4a7a; letter-spacing: .05em; }
.hinweis { font-size: .85em; color: #5b5146; }

.knoepfe { display: flex; gap: .8em; flex-wrap: wrap; margin-top: .9em; align-items: center; }
button.knopf {
  font: 1.05em var(--comic); letter-spacing: .02em;
  background: var(--rot); color: #fff;
  border: 3px solid var(--tinte); border-radius: 5px;
  padding: .45em 1.1em; cursor: pointer;
  box-shadow: 4px 4px 0 var(--tinte);
  text-shadow: 1px 1px 0 var(--tinte);
}
button.knopf.zweit { background: var(--papier); color: var(--tinte); text-shadow: none; }
button.knopf:hover { filter: brightness(1.08); }
button.knopf:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--tinte); }
button.knopf:focus-visible, .karte input:focus-visible { outline: 4px solid var(--cyan); outline-offset: 2px; }
.schalter { font-size: .9em; display: inline-flex; gap: .4em; align-items: center; cursor: pointer; }

.steuerung { display: grid; grid-template-columns: auto 1fr; gap: .15em .9em; font-size: .92em; margin: .3em 0; }
.steuerung kbd { font-size: .85em; }

/* Ergebnis einer Torfrage */
.antwort { border: 3px solid var(--tinte); border-radius: 5px; padding: .5em .8em; margin: .6em 0; background: #fff; }
.antwort.gut { border-left: 12px solid var(--gruen); }
.antwort.schlecht { border-left: 12px solid var(--rot); }
.antwort .kopf { font-family: var(--comic); }
.antwort .kopf .lampe { display: inline-block; width: .9em; height: .9em; border-radius: 50%; border: 2px solid var(--tinte); vertical-align: -.1em; margin-right: .35em; }
.lampe.gruen { background: #3fbf4f; box-shadow: 0 0 8px #3fbf4f; }
.lampe.rot { background: #e0402f; box-shadow: 0 0 8px #e0402f; }
.fundstelle { font-size: .85em; color: #4a4036; font-style: italic; }

.tabelle { width: 100%; border-collapse: collapse; margin: .4em 0; font-size: .92em; }
.tabelle th, .tabelle td { border: 2px solid var(--tinte); padding: .25em .5em; text-align: left; vertical-align: top; }
.tabelle th { background: var(--gelb); font-family: var(--comic); font-weight: normal; }
.tabelle td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.tabelle tr.ich td { background: #fff2b8; font-weight: bold; }

.lampen { display: flex; gap: .5em; margin: .3em 0 .6em; }
.lampen .lampe { width: 1.6em; height: 1.6em; border-radius: 50%; border: 3px solid var(--tinte); }
.lampe.aus { background: #8d8a83; }

.abzeichen {
  display: inline-block; font-family: var(--comic); background: var(--gelb); border: 3px solid var(--tinte);
  border-radius: 50px; padding: .25em .9em; box-shadow: 3px 3px 0 var(--tinte); margin: .3em 0;
}
.karte input[type=text] {
  font: 1em var(--text); padding: .35em .5em; border: 3px solid var(--tinte); border-radius: 4px; width: 14em; max-width: 100%;
}
/* Levelauswahl im Titel */
.levelwahl { display: grid; gap: .35em; margin: .5em 0; }
button.level {
  display: grid; grid-template-columns: auto auto 1fr; column-gap: .6em; align-items: baseline; text-align: left;
  font: inherit; background: #fff; color: var(--tinte); cursor: pointer;
  border: 3px solid var(--tinte); border-radius: 6px; box-shadow: 3px 3px 0 var(--tinte); padding: .3em .7em;
  line-height: 1.25;
}
button.level .nr { font-family: var(--comic); background: var(--rot); color: #fff; padding: 0 .45em; border-radius: 4px; border: 2px solid var(--tinte); }
button.level strong { font-family: var(--comic); font-weight: normal; font-size: 1.05em; color: var(--rot); }
button.level span:last-child { font-size: .85em; text-align: right; color: #5b5146; }
button.level:hover { background: #fff7d6; }
button.level:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--tinte); }
button.level:focus-visible { outline: 4px solid var(--cyan); outline-offset: 2px; }

/* Level 5: Einordnen-Karte */
.karte.kompakt { width: min(100%, 760px); }
.karte.kompakt h2 { font-size: 1.35em; }
.zitat { margin: .4em 0 .2em; padding: .5em .8em; background: #f6d3c9; border-left: 8px solid var(--rot); font-size: 1.05em; }
.karte.kompakt .knoepfe { display: grid; grid-template-columns: repeat(auto-fill, minmax(13em, 1fr)); gap: .5em; }
button.knopf.kat { font-size: .92em; text-align: left; padding: .4em .7em; }
button.knopf.kat kbd { font-size: .9em; margin-right: .2em; }
.antwort.mittel { border-left: 12px solid var(--gelb); }
.satz { margin: .35em 0; padding: .3em .6em; }
.satz.falsch { background: #f6d3c9; text-decoration: line-through; text-decoration-color: rgba(200,48,42,.6); }
.satz.richtig { background: #dcefd8; }
.satz.richtig span { font-family: var(--comic); font-size: .8em; display: block; color: var(--gruen); }

.steckbrief { margin-top: .6em; }
.steckbrief summary { font-family: var(--comic); cursor: pointer; }
.steckbrief summary:focus-visible { outline: 4px solid var(--cyan); }
.teufel-liste { columns: 2; column-gap: 1.5em; padding-left: 1.1em; margin: .3em 0; font-size: .9em; }
.teufel-liste li { break-inside: avoid; margin-bottom: .25em; }
.noscript { color: #fff; padding: 2em; }

@media (max-width: 700px) {
  .reihe { flex-direction: column; }
  .reihe > .panel { flex-basis: auto; width: 60%; align-self: center; }
  .teufel-liste { columns: 1; }
}
