/* ============================================================
   style.css — Lern-Modul „Menschenrechte" (House-Style Hans Lietz).
   Würdig-warmes UN-Blau/Gold-Thema. Zero-Dependency, system-fonts,
   responsiv, WCAG-AA als Ziel. prefers-reduced-motion respektiert.
   ============================================================ */
:root {
  --accent: #b8860b;        /* Gold/Ocker (UN-Lorbeer) – nur für große/dekorative Flächen */
  --accent-dark: #8a6508;   /* abgedunkelter Akzent für kleinen Text (≥4.5:1 auf Weiß) */
  --accent-2: #e0a93a;
  --navy: #0b3a66;          /* UN-Blau */
  --navy-2: #15568f;
  --ink: #1a2733;
  --muted: #56616b;
  --line: #d7dde3;
  --paper: #ffffff;
  --bg: #eef3f8;
  --soft: #f4f7fb;
  --r: 16px;
  --shadow: 0 8px 24px rgba(11, 58, 102, .12);
  --good: #1f9d7a;
  --warn: #e9a800;
  --bad: #c0392b;
  /* Kahoot-Farben */
  --k-red: #e21b3c;
  --k-blue: #1368ce;
  --k-yellow: #9a6a00;      /* abgedunkelt: weißer Text erreicht ≥4.5:1 (AA) */
  --k-green: #26890c;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body {
  margin: 0; color: var(--ink); line-height: 1.55;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(1200px 460px at 100% -80px, #d7e6f5 0, transparent 60%), var(--bg);
}
a { color: var(--navy-2); }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: var(--navy); padding: .5rem .8rem; z-index: 200; border-radius: 0 0 10px 0; }
.skip:focus { left: 0; }

/* ---------- Kopf ---------- */
.top { background: linear-gradient(135deg, var(--navy), var(--navy-2) 60%, #1a6bb0); color: #fff; padding: 1rem 1.1rem 1.2rem; box-shadow: var(--shadow); }
.top__row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; max-width: 1000px; margin: 0 auto; }
.top h1 { margin: 0; font-size: clamp(1.35rem, 3.5vw, 2rem); }
#module-sub { max-width: 1000px; margin: .35rem auto 0; opacity: .92; font-size: .98rem; }
.top__nav { max-width: 1000px; margin: .6rem auto 0; display: flex; gap: .6rem; }
.top__nav a { color: #dcebff; color: #d9e8fa; text-decoration: none; font-weight: 700; font-size: .85rem; background: rgba(255,255,255,.14); padding: .3rem .7rem; border-radius: 999px; min-height: 44px; display: inline-flex; align-items: center; }
.top__nav a:hover, .top__nav a:focus-visible { background: rgba(255,255,255,.28); }
.app-status { display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; font-size: .82rem; }
.app-name { background: rgba(255,255,255,.18); padding: .25rem .6rem; border-radius: 999px; font-weight: 800; }

main { max-width: 1000px; margin: 0 auto; padding: 1rem 1.1rem 3rem; }
main:focus { outline: none; }

/* ---------- Intro ---------- */
.intro { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.2rem 1.3rem; margin: .2rem 0 1.3rem; }
.intro__title { margin: 0 0 .4rem; color: var(--navy); font-size: 1.3rem; }
.intro__lead { margin: 0 0 .8rem; color: var(--ink); }
.intro__media { float: right; margin: 0 0 .6rem 1rem; max-width: 230px; }
.intro__media img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); display: block; }
.intro__media figcaption { font-size: .76rem; color: var(--muted); margin-top: .3rem; }
@media (max-width: 560px) { .intro__media { float: none; max-width: 100%; margin: 0 0 .8rem; } }
.intro__actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; clear: both; }

.btn-quiz { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #2a1d00; border: none; font-weight: 800; font-size: 1rem; padding: .7rem 1.1rem; border-radius: 12px; cursor: pointer; min-height: 48px; box-shadow: var(--shadow); }
.btn-quiz:hover, .btn-quiz:focus-visible { filter: brightness(1.05); }
.btn-ghost { background: var(--soft); border: 1.5px solid var(--line); color: var(--navy); font-weight: 700; padding: .55rem .9rem; border-radius: 10px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; text-decoration: none; font-size: .92rem; }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--navy-2); background: #eaf1f9; }
.btn-ghost:disabled { opacity: .4; cursor: default; }

/* ---------- Übersicht-Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.tile {
  position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 4px 12px rgba(11,58,102,.08); padding: .9rem .7rem .8rem; cursor: pointer; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .35rem; min-height: 150px; transition: transform .12s, box-shadow .12s, border-color .12s; color: var(--ink);
}
.tile:hover, .tile:focus-visible { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(11,58,102,.16); border-color: var(--navy-2); outline: none; }
.tile:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.tile__no { font-size: .72rem; font-weight: 800; letter-spacing: .03em; color: var(--accent-dark); text-transform: uppercase; }
.tile__icon { display: block; }
.thumb-icon { width: 46px; height: 46px; color: var(--navy); fill: currentColor; }
.tile__title { font-weight: 700; font-size: .92rem; color: var(--navy); line-height: 1.25; }
.tile.is-seen { border-color: var(--good); }
.tile__seen { position: absolute; top: 6px; right: 8px; color: var(--good); font-weight: 900; font-size: .9rem; }

/* ---------- Artikel-Detail ---------- */
.detail { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.1rem 1.2rem 1.4rem; }
.detail__nav { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.detail__pager { display: flex; gap: .4rem; }
.detail__head { display: flex; gap: .9rem; align-items: flex-start; border-bottom: 2px solid var(--soft); padding-bottom: .8rem; margin-bottom: .9rem; }
.detail__icon .thumb-icon { width: 56px; height: 56px; color: var(--accent); }
.detail__no { color: var(--accent); font-weight: 800; text-transform: uppercase; letter-spacing: .04em; font-size: .8rem; }
.detail__title { margin: .1rem 0 .25rem; color: var(--navy); font-size: 1.35rem; }
.detail__kurz { margin: 0; color: var(--muted); font-size: .98rem; }
.detail__h3 { color: var(--navy); font-size: 1.05rem; margin: 0 0 .5rem; }

.detail__motion { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem 1rem; margin-bottom: 1rem; }
.motion-stage { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: .5rem; min-height: 150px; display: flex; align-items: center; justify-content: center; }
.motion-svg { max-width: 420px; display: block; }
.motion-ctrl { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; flex-wrap: wrap; }
.motion-play, .motion-reset, .motion-toggle { border: none; cursor: pointer; font-weight: 800; border-radius: 10px; padding: .55rem .9rem; min-height: 44px; font-size: .92rem; }
.motion-play { background: var(--navy); color: #fff; }
.motion-play:hover, .motion-play:focus-visible { background: var(--navy-2); }
.motion-reset { background: #fff; border: 1.5px solid var(--line); color: var(--navy); }
.motion-toggle { background: var(--accent); color: #2a1d00; margin-top: .6rem; }
.motion-rm { color: var(--muted); font-size: .82rem; }
.motion-caption { margin: .5rem 0 0; color: var(--ink); font-size: .9rem; font-weight: 600; }

.detail__quote {
  font-size: 1.08rem; line-height: 1.7; color: var(--ink); background: linear-gradient(0deg, var(--soft), #fff);
  border-left: 4px solid var(--accent); padding: .8rem 1rem; border-radius: 0 10px 10px 0; margin: 0 0 .6rem;
}
.detail__hint { color: var(--muted); font-size: .85rem; margin: 0; }
.gloss-demo, .gloss { border-bottom: 2px dotted var(--accent); }

/* ---------- Glossar-Tooltip ---------- */
.gloss { position: relative; cursor: help; font-weight: 600; color: var(--navy); }
.gloss:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; border-radius: 3px; }
.gloss-mark { display: inline-block; font-size: .62em; vertical-align: super; color: var(--accent-dark); font-weight: 800; margin-left: 1px; }
.gloss-tip {
  position: absolute; z-index: 30; max-width: min(240px, calc(100vw - 24px)); background: var(--navy); color: #fff; padding: .55rem .7rem;
  border-radius: 10px; font-size: .85rem; line-height: 1.4; box-shadow: var(--shadow); opacity: 0; visibility: hidden;
  transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; pointer-events: none; font-weight: 400;
}
.gloss-tip.show { opacity: 1; visibility: visible; transform: translateY(0); }
.gloss-tip::before { content: ""; position: absolute; top: -6px; left: 14px; border: 6px solid transparent; border-top: none; border-bottom-color: var(--navy); }

/* ---------- Quiz (Kahoot-Stil) ---------- */
.quiz-wrap { }
.quiz-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.2rem 1.3rem 1.4rem; }
.quiz-intro h2, .quiz-result h2 { color: var(--navy); margin-top: 0; }
.quiz-hint { color: var(--muted); font-size: .88rem; }
.quiz-hint kbd { background: var(--soft); border: 1px solid var(--line); border-radius: 5px; padding: 0 .3rem; font-size: .85em; }
.quiz-introbtns { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .6rem; }
.quiz-go { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #2a1d00; border: none; font-weight: 800; font-size: 1rem; padding: .7rem 1.2rem; border-radius: 12px; cursor: pointer; min-height: 48px; }
.quiz-back, .quiz-next { background: var(--navy); color: #fff; border: none; font-weight: 800; padding: .6rem 1.1rem; border-radius: 10px; cursor: pointer; min-height: 44px; }
.quiz-sound { background: var(--soft); border: 1.5px solid var(--line); color: var(--navy); font-weight: 700; border-radius: 999px; padding: .4rem .8rem; cursor: pointer; min-height: 44px; font-size: .85rem; }

.quiz-bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; }
.quiz-count { font-weight: 800; color: var(--muted); font-size: .9rem; }
.quiz-score { font-weight: 800; color: var(--navy); }
.quiz-timer { height: 12px; background: var(--soft); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.quiz-timer__fill { height: 100%; width: 100%; background: linear-gradient(90deg, var(--good), var(--accent-2)); transition: width .1s linear; }
.quiz-time-txt { margin: .25rem 0 .6rem; font-weight: 800; color: var(--navy); font-size: .9rem; }
.quiz-q { color: var(--ink); font-size: 1.25rem; margin: .2rem 0 .9rem; }

.quiz-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
@media (max-width: 480px) { .quiz-tiles { grid-template-columns: 1fr; } }
.quiz-tile {
  display: flex; align-items: center; gap: .7rem; text-align: left; border: none; border-radius: 12px;
  padding: .9rem 1rem; min-height: 64px; cursor: pointer; color: #fff; font-weight: 800; font-size: 1rem;
  box-shadow: 0 4px 0 rgba(0,0,0,.18); transition: transform .08s, filter .12s;
}
.quiz-tile:hover:not(:disabled) { filter: brightness(1.06); }
.quiz-tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.quiz-tile:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.quiz-tile:disabled { cursor: default; opacity: .92; }
.tile-red { background: var(--k-red); } .tile-blue { background: var(--k-blue); }
.tile-yellow { background: var(--k-yellow); } .tile-green { background: var(--k-green); }
.quiz-key {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.5em; height: 1.5em; padding: 0 .25em; border-radius: 6px;
  background: rgba(255,255,255,.22); color: #fff; font-size: .95rem; font-weight: 900; line-height: 1;
}
.quiz-shape { font-size: 1.3rem; line-height: 1; flex: 0 0 auto; }
.quiz-ans { flex: 1; }
.quiz-mark { flex: 0 0 auto; margin-left: .4rem; font-size: 1.4rem; font-weight: 900; line-height: 1; }
.quiz-tile.is-correct { outline: 4px solid var(--good); outline-offset: 2px; }
.quiz-tile.is-correct .quiz-mark { color: #fff; }
.quiz-tile.is-wrong { outline: 4px solid #fff; filter: grayscale(.4) brightness(.9); }
.quiz-tile.is-wrong .quiz-mark { color: #fff; }

.quiz-feedback { margin: .9rem 0 0; font-weight: 800; font-size: 1.05rem; min-height: 1.4em; }
.quiz-feedback.is-right { color: var(--good); }
.quiz-feedback.is-wrong { color: var(--bad); }
.quiz-erkl { display: inline-block; font-weight: 500; color: var(--ink); font-size: .92rem; margin-top: .2rem; }

.quiz-result { text-align: center; }
.quiz-medal { font-size: 3.4rem; line-height: 1; }
.quiz-final { font-size: 1.6rem; margin: .3rem 0 .1rem; color: var(--navy); }
.quiz-final strong { font-size: 2rem; }
.quiz-sub { color: var(--muted); margin: 0 0 .8rem; }
.quiz-breakdown { text-align: left; background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .8rem; margin: 0 0 .9rem; }
.quiz-breakdown summary { cursor: pointer; font-weight: 700; color: var(--navy); }
.quiz-breakdown ol { margin: .5rem 0 0; padding-left: 1.4rem; }
.quiz-breakdown li { margin: .25rem 0; font-size: .92rem; }
.quiz-pts { color: var(--accent); font-weight: 800; float: right; }
.quiz-savehint { color: var(--muted); font-size: .85rem; margin-top: .7rem; min-height: 1.2em; }
.quiz-result .quiz-introbtns { justify-content: center; }

/* ---------- Auth-Overlay ---------- */
.auth-overlay { position: fixed; inset: 0; background: rgba(11,58,102,.55); display: none; align-items: center; justify-content: center; padding: 1rem; z-index: 100; }
.auth-overlay.open { display: flex; }
.auth-card { background: #fff; border-radius: var(--r); box-shadow: 0 20px 50px rgba(0,0,0,.3); padding: 1.4rem 1.4rem 1.5rem; max-width: 440px; width: 100%; }
.auth-card h2 { margin: 0 0 .6rem; color: var(--navy); }
.auth-note { color: var(--ink); font-size: .94rem; }
.auth-card label { display: block; font-weight: 800; color: var(--navy); margin: .7rem 0 .2rem; 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; font: inherit; }
.auth-btn { width: 100%; margin-top: .9rem; background: var(--navy); color: #fff; border: none; font-weight: 800; font-size: 1rem; padding: .7rem; border-radius: 10px; cursor: pointer; min-height: 48px; }
.auth-btn:hover, .auth-btn:focus-visible { background: var(--navy-2); }
.auth-guest { width: 100%; margin-top: .6rem; background: var(--soft); color: var(--navy); border: 1.5px solid var(--line); font-weight: 800; padding: .65rem; border-radius: 10px; cursor: pointer; min-height: 48px; }
.auth-guest:hover, .auth-guest:focus-visible { background: #eaf1f9; }
.auth-err { color: var(--bad); font-weight: 700; min-height: 1.2em; margin: .4rem 0 0; }
.auth-hint { color: var(--muted); font-size: .82rem; margin-top: .8rem; }

/* ---------- Sync-Badge ---------- */
.app-sync { position: fixed; bottom: 14px; right: 14px; background: var(--navy); color: #fff; padding: .4rem .8rem; border-radius: 999px; font-size: .82rem; font-weight: 700; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; pointer-events: none; z-index: 90; }
.app-sync.show { opacity: 1; transform: translateY(0); }

/* ---------- Footer + generische Tabellen (lehrer/quellen) ---------- */
.foot { max-width: 1000px; margin: 0 auto; padding: 0 1.1rem 2rem; color: var(--muted); font-size: .82rem; }
.station { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; margin: 1rem auto; max-width: 1000px; }
.station__title { color: var(--navy); margin-top: 0; }
table { border-collapse: collapse; width: 100%; margin-top: .6rem; font-size: .9rem; }
th, td { border: 1px solid var(--line); padding: .45rem .55rem; text-align: left; }
th { background: var(--soft); color: var(--navy); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .quiz-timer__fill { transition: none; }
}
