/* ============================================================
   style.css — Völkerrecht (bespoke). House-Style-kompatible
   Variablen (--navy, --line, --soft, --r, --shadow, --muted),
   damit lehrer.html / quellen.html / auth.js mitlaufen.
   AA-Kontraste, Touch-Targets ≥44px, sichtbarer Fokus,
   prefers-reduced-motion respektiert.
   ============================================================ */
:root {
  --navy: #0c2f4a;
  --navy2: #103e60;
  --ink: #14202b;
  --muted: #5a6b78;
  --line: #d6e1ea;
  --soft: #eef4f9;
  --bg: #eaf1f7;
  --accent: #1d6fb8;
  --good: #2a9d4a;
  --bad: #c0392b;
  --r: 16px;
  --shadow: 0 6px 22px rgba(12, 47, 74, .10);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 80% -10%, #d8e9f6 0, rgba(216,233,246,0) 60%),
    var(--bg);
  line-height: 1.5;
}
a { color: var(--accent); }
:focus-visible { outline: 3px solid #ffb020; outline-offset: 2px; border-radius: 6px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: #fff; color: var(--navy); padding: .6rem .9rem; border-radius: 0 0 10px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* Nur für Screenreader sichtbar (visuell ausgeblendet). */
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ---- Header ---- */
.top { background: linear-gradient(180deg, var(--navy), var(--navy2)); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 10px rgba(0,0,0,.16); }
.top__row { max-width: 1000px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; flex-wrap: wrap; }
.top__brand { display: inline-flex; align-items: center; gap: .5rem; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.top__logo { font-size: 1.4rem; }
.top__nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.top__nav a { color: #dceaf6; text-decoration: none; padding: .5rem .7rem; border-radius: 10px; font-weight: 600; font-size: .92rem; min-height: 44px; display: inline-flex; align-items: center; }
.top__nav a:hover { background: rgba(255,255,255,.14); color: #fff; }

main { max-width: 1000px; margin: 0 auto; padding: 1rem 1rem 2.5rem; min-height: 60vh; }

.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1.2rem 1rem 2rem; }
.foot a { color: var(--navy); }

/* ---- Intro / Übersicht ---- */
.intro { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin: .4rem 0 1.2rem; }
.intro__h { margin: 0 0 .4rem; color: var(--navy); font-size: 1.35rem; }
.intro__p { margin: 0 0 .9rem; color: #2b3b48; }
.intro__bar { height: 12px; background: var(--soft); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.intro__fill { display: block; height: 100%; background: linear-gradient(90deg, #2a9d4a, #1d6fb8); transition: width .5s ease; }
.intro__meta { margin: .4rem 0 .8rem; color: var(--muted); font-size: .88rem; }
.quiz-launch { background: linear-gradient(135deg, #7a1fb8, #1675d1); color: #fff; border: 0; border-radius: 12px; padding: .75rem 1.1rem; font: inherit; font-weight: 800; cursor: pointer; min-height: 48px; box-shadow: 0 4px 14px rgba(118,29,191,.3); }
.quiz-launch:hover { filter: brightness(1.06); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem; }
.card {
  position: relative; display: flex; flex-direction: column; gap: .35rem;
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: 14px; box-shadow: var(--shadow); padding: .9rem .95rem 1rem;
  text-decoration: none; color: inherit; transition: transform .14s ease, box-shadow .14s ease;
  min-height: 168px;
}
.card:hover, .card:focus-visible { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(12,47,74,.16); }
.card--seen { border-top-color: var(--good); }
.card__cat { align-self: flex-start; font-size: .68rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; padding: .15rem .5rem; border-radius: 999px; }
.card__cat--charta { background: #e4f0fa; color: #14507f; }
.card__cat--hvr { background: #fde6e3; color: #9c2a1e; }
.card__icon { width: 52px; height: 52px; }
.card__icon svg { width: 100%; height: 100%; display: block; }
.card__nr { font-size: .78rem; color: var(--muted); font-weight: 700; }
.card__title { font-size: 1.02rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.card__teaser { font-size: .85rem; color: #41525f; }
.card__seen { position: absolute; top: .6rem; right: .6rem; font-size: .68rem; font-weight: 800; color: var(--good); background: #e7f6ec; padding: .12rem .45rem; border-radius: 999px; }

/* ---- Detail ---- */
.detail { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.1rem 1.2rem 1.4rem; border-top: 5px solid var(--accent); }
.detail__back { display: inline-block; margin: 0 0 .6rem; font-weight: 700; text-decoration: none; min-height: 44px; line-height: 44px; }
.detail__head { display: flex; gap: .9rem; align-items: center; margin-bottom: 1rem; }
.detail__icon { width: 60px; height: 60px; flex: 0 0 auto; }
.detail__icon svg { width: 100%; height: 100%; }
/* Kleiner Label-Text: dunklerer Navy-Akzent für sicheren AA-Kontrast (≥4.5:1). */
.detail__cat { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: #155a96; }
.detail__cat--hvr { color: #9c2a1e; }
.detail__title { margin: .1rem 0 0; color: var(--navy); font-size: 1.4rem; line-height: 1.15; }
.detail__nr { color: var(--accent); }

.block { margin: 0 0 1.1rem; padding: 1rem 1.05rem; border: 1px solid var(--line); border-radius: 14px; background: #fbfdff; }
.block__h { margin: 0 0 .6rem; font-size: 1.02rem; color: var(--navy); }
.block--quote { background: linear-gradient(180deg, #f3f8fc, #fbfdff); border-left: 4px solid var(--accent); }
.quote { margin: 0; font-size: 1.06rem; line-height: 1.7; color: #1c2b36; font-family: Georgia, "Times New Roman", serif; }
.quote__src { margin: .8rem 0 0; font-size: .8rem; color: var(--muted); }
.quote__hint { margin: .5rem 0 0; font-size: .82rem; color: #41525f; }
.explain { margin: 0; font-size: 1rem; color: #25333e; }

/* Glossar-Begriffe (Hover-Hilfe) */
.gloss {
  font: inherit; color: inherit; background: #fff5d6; border: 0; border-bottom: 2px dotted #c79a16;
  padding: 0 .1em; margin: 0; cursor: help; border-radius: 3px; font-weight: 600;
}
.gloss:hover, .gloss:focus-visible { background: #ffe9a8; }
.gloss--demo { cursor: default; }
.gloss-tip {
  position: absolute; z-index: 60; max-width: 300px; background: #102a3c; color: #f4fbff;
  border: 1px solid #2b5876; border-radius: 12px; padding: .7rem .8rem; font-size: .9rem; line-height: 1.45;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .14s ease, transform .14s ease;
}
.gloss-tip.show { opacity: 1; transform: translateY(0); }
.gloss-tip strong { color: #ffd86b; }

/* Motion-Stage */
.motion-stage { width: 100%; border-radius: 12px; overflow: hidden; background: #0c2f4a; }
.mstage { width: 100%; height: auto; display: block; aspect-ratio: 400 / 220; }
.motion-caption { margin: .7rem 0 0; min-height: 2.6em; font-size: .95rem; color: #21323e; font-weight: 600; }
.motion-fallback { color: #fff; padding: 1.4rem; text-align: center; }
.mctl { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .7rem; align-items: center; }
.mbtn {
  font: inherit; font-weight: 700; background: var(--navy); color: #fff; border: 0; border-radius: 10px;
  padding: .55rem .85rem; cursor: pointer; min-height: 44px;
}
.mbtn:hover { background: var(--navy2); }
.mslider { display: inline-flex; flex-direction: column; gap: .2rem; font-size: .8rem; color: #41525f; font-weight: 700; }
.mslider__head { display: inline-flex; gap: .35rem; align-items: baseline; }
.mslider__val { font-weight: 800; color: var(--navy); background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 0 .4em; font-size: .82rem; }
/* Trefferfläche ≥44px (Höhe + größerer Thumb). */
.mslider input[type="range"] { width: 200px; height: 44px; accent-color: var(--accent); cursor: pointer; }
.mslider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mslider input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; }

.detail__fig { margin: 0 0 1.1rem; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fbfdff; }
.detail__fig img { width: 100%; height: auto; display: block; max-height: 340px; object-fit: cover; }
.detail__fig figcaption { padding: .55rem .8rem; font-size: .82rem; color: var(--muted); }

.detail__nav { display: flex; justify-content: space-between; gap: .6rem; margin-top: 1rem; }
.detail__navbtn { background: var(--soft); color: var(--navy); text-decoration: none; font-weight: 700; padding: .6rem .9rem; border-radius: 10px; border: 1px solid var(--line); min-height: 44px; display: inline-flex; align-items: center; }
.detail__navbtn:hover { background: #e1ecf5; }
.detail__navbtn--next { background: var(--navy); color: #fff; border-color: var(--navy); }
.detail__navbtn--next:hover { background: var(--navy2); }

/* ============================================================
   Quiz (Kahoot-Stil)
   ============================================================ */
.quiz { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.1rem 1.2rem 1.4rem; }
.quiz-back { display: inline-block; font-weight: 700; text-decoration: none; min-height: 44px; line-height: 44px; }
.quiz-intro h2 { color: var(--navy); margin: .2rem 0 .5rem; }
.quiz-rules { margin: .6rem 0 1rem; padding-left: 1.1rem; color: #2b3b48; }
.quiz-rules li { margin: .2rem 0; }
.quiz-introbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.quiz-start { background: linear-gradient(135deg, #7a1fb8, #1675d1); color: #fff; border: 0; border-radius: 12px; padding: .8rem 1.3rem; font: inherit; font-weight: 800; cursor: pointer; min-height: 48px; }
.quiz-start:hover { filter: brightness(1.06); }
.quiz-sound { background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: .55rem .8rem; font: inherit; font-weight: 700; cursor: pointer; min-height: 44px; color: var(--navy); }
kbd { background: #eef3f7; border: 1px solid #c7d4de; border-bottom-width: 2px; border-radius: 5px; padding: 0 .35em; font-family: ui-monospace, Consolas, monospace; font-size: .85em; }

.quiz-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.quiz-count { font-weight: 800; color: var(--navy); }
.quiz-score { font-weight: 800; color: #7a1fb8; }
.quiz-timer { margin: .2rem 0 1rem; }
.quiz-timerbar { height: 14px; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.quiz-timerfill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #2a9d4a, #e8b21e, #e2403a); transition: width .12s linear; }
.quiz-secs { display: block; margin-top: .3rem; font-weight: 800; color: var(--navy); font-size: .9rem; }
.quiz-q { color: var(--navy); font-size: 1.25rem; margin: .2rem 0 1rem; }

.qtiles { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 480px) { .qtiles { grid-template-columns: 1fr; } }
.qtile {
  display: flex; align-items: center; gap: .6rem; text-align: left;
  background: var(--qc); color: #fff; border: 0; border-radius: 14px; padding: 1rem 1.1rem;
  font: inherit; font-weight: 800; font-size: 1.05rem; cursor: pointer; min-height: 64px;
  box-shadow: 0 4px 0 rgba(0,0,0,.18); transition: transform .08s ease, filter .12s ease;
}
.qtile:hover:not(:disabled) { filter: brightness(1.07); }
.qtile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.qtile__sym { font-size: 1.3rem; flex: 0 0 auto; }
.qtile__txt { flex: 1; }
.qtile__key { flex: 0 0 auto; background: rgba(255,255,255,.25); border-radius: 7px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; }
/* Sichtbares Richtig/Falsch-Symbol (zusätzlich zur Farbe – nicht aria-hidden). */
.qtile__mark { flex: 0 0 auto; margin-left: .2rem; font-size: 1.4rem; font-weight: 900; line-height: 1; background: #fff; color: var(--ink); width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.qtile--correct .qtile__mark { color: #0f5132; }
.qtile--wrong .qtile__mark { color: #8a2017; }
.qtile:disabled { cursor: default; }
.qtile--dim { opacity: .4; }
.qtile--correct { outline: 4px solid #064; box-shadow: 0 0 0 4px #2a9d4a inset, 0 4px 0 rgba(0,0,0,.18); }
.qtile--wrong { outline: 4px solid #600; opacity: .85; }

.quiz-feedback { margin: 1rem 0 0; padding: .8rem .9rem; border-radius: 12px; font-size: .98rem; min-height: 1.2em; }
.quiz-feedback.is-right { background: #e7f6ec; color: #0f5132; border: 1px solid #b6e2c4; }
.quiz-feedback.is-wrong { background: #fdecea; color: #8a2017; border: 1px solid #f3c3bc; }
.quiz-next { display: block; margin: 1rem 0 0; background: var(--navy); color: #fff; border: 0; border-radius: 12px; padding: .8rem 1.2rem; font: inherit; font-weight: 800; cursor: pointer; min-height: 48px; width: 100%; }
.quiz-next:hover { background: var(--navy2); }

.quiz-result { text-align: center; }
.quiz-result h2 { color: var(--navy); margin: .3rem 0; font-size: 1.5rem; }
.quiz-bigscore { font-size: 3rem; font-weight: 900; color: #7a1fb8; margin: .3rem 0 0; line-height: 1; }
.quiz-bigscore span { font-size: 1.1rem; color: var(--muted); font-weight: 700; }
.quiz-sub { color: #2b3b48; font-weight: 700; margin: .3rem 0 1rem; }
.quiz-table { width: 100%; border-collapse: collapse; margin: .5rem 0 1rem; font-size: .9rem; text-align: left; }
.quiz-table th, .quiz-table td { border: 1px solid var(--line); padding: .45rem .55rem; }
.quiz-table th { background: var(--soft); }
.quiz-table td.ok { color: var(--good); font-weight: 800; text-align: center; }
.quiz-table td.no { color: var(--bad); font-weight: 800; text-align: center; }
.quiz-note { color: var(--muted); font-size: .85rem; margin-top: .8rem; }

/* ============================================================
   Auth-Overlay (gatelos) — kompatibel zu auth.js
   ============================================================ */
.auth-overlay { position: fixed; inset: 0; z-index: 80; display: none; align-items: center; justify-content: center; background: rgba(8, 28, 44, .72); padding: 1rem; }
.auth-overlay.open { display: flex; }
.auth-card { background: #fff; border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.35); max-width: 440px; width: 100%; padding: 1.4rem 1.5rem 1.6rem; }
.auth-card h2 { margin: 0 0 .5rem; color: var(--navy); }
.auth-note { color: #2b3b48; font-size: .95rem; margin: 0 0 .8rem; }
.auth-card label { display: block; font-weight: 800; color: var(--navy); margin: .7rem 0 .25rem; font-size: .9rem; }
.auth-opt { color: var(--muted); font-weight: 600; }
.auth-card input { width: 100%; border: 1.5px solid var(--line); border-radius: 10px; padding: .6rem .7rem; font: inherit; min-height: 44px; }
.auth-err { color: var(--bad); font-weight: 700; min-height: 1.2em; margin: .5rem 0 0; }
.auth-btn { width: 100%; margin-top: .8rem; background: var(--navy); color: #fff; border: 0; border-radius: 12px; padding: .8rem; font: inherit; font-weight: 800; cursor: pointer; min-height: 48px; }
.auth-btn:hover { background: var(--navy2); }
.auth-guest { width: 100%; margin-top: .55rem; background: var(--soft); color: var(--navy); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; font: inherit; font-weight: 700; cursor: pointer; min-height: 48px; }
.auth-guest:hover { background: #e1ecf5; }
.auth-hint { color: var(--muted); font-size: .82rem; margin: .8rem 0 0; }

.app-sync { position: fixed; right: 12px; bottom: 12px; z-index: 70; background: #102a3c; color: #eafaff; padding: .5rem .8rem; border-radius: 10px; font-size: .85rem; font-weight: 700; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; }
.app-sync.show { opacity: 1; transform: translateY(0); }

/* Tabellen für quellen.html / lehrer.html */
main table { border-collapse: collapse; width: 100%; margin-top: .6rem; font-size: .9rem; }
main th, main td { border: 1px solid var(--line); padding: .45rem .55rem; text-align: left; }
main th { background: var(--soft); }
.station { background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: .6rem 0 1.1rem; }
.station__title { margin: .1rem 0 .7rem; color: var(--navy); }

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .card, .intro__fill, .gloss-tip, .qtile, .app-sync, .quiz-timerfill { transition: none !important; }
}
