/* ── FONTS ───────────────────────────────────────────────── */
@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/BarlowCondensed-Bold.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/BarlowCondensed-ExtraBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow Condensed';
  font-weight: 900;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/BarlowCondensed-Black.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/Barlow-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/Barlow-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url('../fonts/Barlow-Bold.woff2') format('woff2');
}

/* ── TOKENS ─────────────────────────────────────────────── */
:root {
  /* Layout */
  --nav-h:     64px;
  --r:         10px;

  /* Fonts */
  --font-head: 'Barlow Condensed', system-ui, sans-serif;
  --font-body: 'Barlow', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Consolas', monospace;

  /* Dark mode base colors */
  --bg:        #0d0f14;
  --bg2:       #161920;
  --bg3:       #1e2229;
  --border:    #2a2f3a;
  --border2:   #363c4a;
  --text:      #e8eaf0;
  --text2:     #8a91a8;
  --text3:     #6b7899;
  --accent:    #ff6b1a;
  --accent2:   #ff8c4a;
  --blue:      #2d8cff;
  --blue-dim:  #1a5ca8;
  --green:     #1db954;
  --green-dim: #155e38;
  --red:       #e8384f;
  --red-dim:   #7a1e2a;
  --gold:      #f5c842;

  /* Dark mode semantic aliases */
  --fc-back-from:  #0f1a2e;
  --fc-back-to:    #0a1520;
  --ja-text:       #4de88a;
  --nein-text:     #ff6b6b;
  --expl-text:     #7ab3e8;
  --badge-blue-bg: rgba(45,140,255,0.15);
  --badge-blue-c:  #6aacff;
  --badge-blue-b:  rgba(45,140,255,0.3);
  --ans-ja-bg:     rgba(29,185,84,0.15);
  --ans-ja-c:      #4de88a;
  --ans-ja-b:      rgba(29,185,84,0.3);
  --ans-nein-bg:   rgba(232,56,79,0.15);
  --ans-nein-c:    #ff8888;
  --ans-nein-b:    rgba(232,56,79,0.3);
  --qfb-ok-bg:     rgba(29,185,84,0.12);
  --qfb-ok-c:      #7defa7;
  --qfb-ok-b:      rgba(29,185,84,0.4);
  --qfb-err-bg:    rgba(232,56,79,0.12);
  --qfb-err-c:     #ff9999;
  --qfb-err-b:     rgba(232,56,79,0.4);

  /* transition for theme switch */
  --theme-transition: background 0.25s, color 0.25s, border-color 0.25s;
}

/* ── LIGHT MODE ─────────────────────────────────────────── */
html.light {
  --bg:        #f5f4f0;
  --bg2:       #ffffff;
  --bg3:       #ece9e3;
  --border:    #dbd7cf;
  --border2:   #c8c3b8;
  --text:      #1a1714;
  --text2:     #4a4640;
  --text3:     #6b6258;
  --accent:    #d94f00;
  --accent2:   #f06020;
  --blue:      #0070d4;
  --blue-dim:  #c8e0f8;
  --green:     #177a38;
  --green-dim: #d4f0df;
  --red:       #c0182e;
  --red-dim:   #fde8eb;
  --gold:      #b5860a;

  /* Light mode semantic aliases */
  --fc-back-from:  #dbeeff;
  --fc-back-to:    #c5dffa;
  --ja-text:       #0d5c24;
  --nein-text:     #8c0a18;
  --expl-text:     #1a4f82;
  --badge-blue-bg: rgba(0,112,212,0.1);
  --badge-blue-c:  #004a8c;
  --badge-blue-b:  rgba(0,112,212,0.25);
  --ans-ja-bg:     rgba(23,122,56,0.12);
  --ans-ja-c:      #0d5c24;
  --ans-ja-b:      rgba(23,122,56,0.3);
  --ans-nein-bg:   rgba(192,24,46,0.1);
  --ans-nein-c:    #8c0a18;
  --ans-nein-b:    rgba(192,24,46,0.3);
  --qfb-ok-bg:     rgba(23,122,56,0.1);
  --qfb-ok-c:      #0d5c24;
  --qfb-ok-b:      rgba(23,122,56,0.35);
  --qfb-err-bg:    rgba(192,24,46,0.08);
  --qfb-err-c:     #8c0a18;
  --qfb-err-b:     rgba(192,24,46,0.35);
}

/* ── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body { height: 100%; font-family: var(--font-body); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; overflow: hidden; }

/* ── FOCUS (WCAG 2.4.11) ────────────────────────────────── */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── SR-ONLY (WCAG) ─────────────────────────────────────── */
.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;
}

/* ── REDUCED MOTION (WCAG 2.3.3) ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .flashcard { transition: none !important; }
}

/* ── LAYOUT ─────────────────────────────────────────────── */
#app {
  display: flex; flex-direction: column;
  height: 100%; max-width: 640px; margin: 0 auto;
  background: var(--bg); position: relative;
  box-shadow: 0 0 80px rgba(0,0,0,0.8);
}

main { flex: 1; overflow-y: auto; overflow-x: hidden; }
main::-webkit-scrollbar { width: 4px; }
main::-webkit-scrollbar-track { background: var(--bg2); }
main::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.view { display: none; padding: 0 0 calc(var(--nav-h) + 8px); }
.view.active { display: block; }

/* ── TOP BAR ────────────────────────────────────────────── */
.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 14px 16px 12px;
  position: sticky; top: 0; z-index: 10;
}
.topbar-inner { display: flex; align-items: flex-start; justify-content: space-between; }
.topbar h1 {
  font-family: var(--font-head);
  font-size: 22px; font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text);
  line-height: 1;
}
.topbar h1 span { color: var(--accent); }
.topbar-sub {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--text2);
  margin-top: 3px; letter-spacing: 0.3px;
}

/* ── BOTTOM NAV ─────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 640px;
  height: var(--nav-h);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  display: flex; z-index: 20;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  color: var(--text3); border: none; background: none;
  cursor: pointer; gap: 4px; padding: 8px 4px;
  font-family: var(--font-head);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  position: relative;
}
.nav-btn::after {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 2px;
  background: var(--accent);
  transition: width 0.2s;
  border-radius: 0 0 2px 2px;
}
.nav-btn.active { color: var(--accent); }
.nav-btn.active::after { width: 60%; }
.nav-btn svg { width: 20px; height: 20px; }

/* ── SECTION PADDING ────────────────────────────────────── */
.pad { padding: 16px; }

/* ── DIVIDER ─────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 0 16px; }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 10px;
}
.card-accent { border-color: var(--accent); }

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 14px 20px;
  border-radius: var(--r); font-family: var(--font-head);
  font-size: 16px; font-weight: 800; letter-spacing: 0.5px;
  text-transform: uppercase; border: none; cursor: pointer;
  transition: all 0.15s; min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.btn-full { width: 100%; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent2); }
.btn-primary:active { transform: scale(0.98); }
.btn-ghost {
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { border-color: var(--text2); color: var(--text); }

/* ── PROGRESS BAR ───────────────────────────────────────── */
.pbar { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.pbar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }
.pbar-fill.blue  { background: var(--blue); }
.pbar-fill.green { background: var(--green); }
.pbar-fill.orange { background: var(--accent); }

/* ── CHIPS / FILTERS ─────────────────────────────────────── */
.chip-row {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 2px; scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 8px 14px; border-radius: 6px;
  font-family: var(--font-head); font-size: 12px;
  font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  border: 1px solid var(--border2); background: var(--bg3);
  color: var(--text2); cursor: pointer;
  transition: all 0.15s; min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}
.chip:hover { border-color: var(--text3); color: var(--text); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

/* ── BADGE ──────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
}
.badge-blue { background: var(--badge-blue-bg); color: var(--badge-blue-c); border: 1px solid var(--badge-blue-b); }
.badge-orange { background: rgba(255,107,26,0.15); color: var(--accent2); border: 1px solid rgba(255,107,26,0.3); }
.badge-link {
  cursor: pointer; font-family: var(--font-body); font-weight: 600;
  transition: background 0.15s;
}
.badge-link:hover { background: rgba(45,140,255,0.25); }

/* ── HOME REGELWERK / STATS BUTTON ──────────────────────── */
.home-rules-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 12px 14px; margin-bottom: 8px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: var(--r); cursor: pointer;
  color: var(--text); transition: border-color 0.15s, transform 0.1s;
  text-align: left;
}
.home-rules-btn:hover { border-color: var(--accent); }
.home-rules-btn:active { transform: scale(0.98); }
.home-rules-left { display: flex; align-items: center; gap: 12px; }
.home-rules-icon { font-size: 22px; flex-shrink: 0; }
.home-rules-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
.home-rules-desc { font-size: 11px; color: var(--text2); }

/* ── SECTION LABEL ──────────────────────────────────────── */
.section-label {
  font-family: var(--font-head); font-size: 11px;
  font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text3);
  margin-bottom: 10px;
}

/* ─────────────────────────────────────────────────────────
   HOME
───────────────────────────────────────────────────────── */
.hero {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 20px 16px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: 'DBB';
  position: absolute; right: -10px; top: -10px;
  font-family: var(--font-head); font-size: 120px;
  font-weight: 900; color: rgba(255,107,26,0.04);
  line-height: 1; pointer-events: none; user-select: none;
  letter-spacing: -4px;
}
.hero-label {
  font-family: var(--font-body); font-size: 13px;
  color: var(--text2); margin-bottom: 16px; margin-top: 2px;
}
.hero-title {
  font-family: var(--font-head); font-size: 32px;
  font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.5px; line-height: 1.1;
  color: var(--text); margin-bottom: 0;
}
.hero-title span { color: var(--accent); }
.hero-logo {
  display: block;
  width: min(290px, 85vw);
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 3px 12px rgba(255,107,26,0.3));
}
html.light .hero-logo {
  filter: drop-shadow(0 2px 8px rgba(180,60,0,0.18));
}
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.stat-tile {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 8px; text-align: center;
}
.stat-tile .n {
  font-family: var(--font-head); font-size: 28px;
  font-weight: 900; color: var(--accent); line-height: 1;
}
.stat-tile .l {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.mode-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.mode-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r); padding: 16px 14px;
  cursor: pointer; text-align: left;
  transition: all 0.15s; min-height: 80px;
  -webkit-tap-highlight-color: transparent;
  display: flex; flex-direction: column; gap: 6px;
}
.mode-btn:hover { border-color: var(--border2); background: var(--bg3); }
.mode-btn:active { transform: scale(0.98); border-color: var(--accent); }
.mode-btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.mode-btn .m-icon { font-size: 24px; line-height: 1; }
.mode-btn .m-title {
  font-family: var(--font-head); font-size: 15px;
  font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.3px; color: var(--text);
}
.mode-btn .m-desc { font-size: 12px; color: var(--text2); }

.cat-progress { margin-bottom: 10px; }
.cat-progress-head {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 6px;
}
.cat-progress-head span:first-child {
  font-family: var(--font-head); font-size: 13px;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.3px; color: var(--text2);
}
.cat-progress-head span:last-child {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text3);
}

/* ─────────────────────────────────────────────────────────
   FLASHCARDS
───────────────────────────────────────────────────────── */
.fc-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 16px; margin-bottom: 8px;
}
.fc-meta-id {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); font-weight: 500;
}
.fc-meta-art {
  font-family: var(--font-mono); font-size: 11px; color: var(--text3);
}
.fc-progress-row {
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px; margin-bottom: 12px;
}
.fc-progress-row .pbar { flex: 1; }
.fc-progress-num {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text3); white-space: nowrap;
}

.fc-wrap {
  display: block; width: calc(100% - 32px);
  perspective: 1200px; height: 260px;
  margin: 0 16px 12px; cursor: pointer;
  border-radius: 14px;
  background: none; border: none; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.fc-inner {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 14px;
}
.fc-inner.flipped { transform: rotateY(180deg); }
.fc-face {
  position: absolute; width: 100%; height: 100%;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  border: 1px solid var(--border);
}
.fc-front {
  background: linear-gradient(145deg, var(--bg2) 0%, var(--bg3) 100%);
}
.fc-back {
  background: linear-gradient(145deg, var(--fc-back-from) 0%, var(--fc-back-to) 100%);
  border-color: var(--blue-dim);
  transform: rotateY(180deg);
}
.fc-q-text {
  font-family: var(--font-body); font-size: 16px;
  font-weight: 500; line-height: 1.5; color: var(--text);
}
.fc-hint {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); margin-top: 14px;
  text-transform: uppercase; letter-spacing: 1px;
}
.fc-answer-word {
  font-family: var(--font-head); font-size: 52px;
  font-weight: 900; text-transform: uppercase;
  letter-spacing: 2px; line-height: 1; margin-bottom: 10px;
}
.fc-answer-word.ja { color: var(--ja-text); }
.fc-answer-word.nein { color: var(--nein-text); }
.fc-explanation {
  font-size: 13px; color: var(--expl-text); line-height: 1.5;
  max-height: 100px; overflow-y: auto;
}

.answer-row {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; padding: 0 16px;
}
.a-btn {
  min-height: 52px; border-radius: var(--r); border: none;
  cursor: pointer; font-family: var(--font-head);
  font-size: 20px; font-weight: 900; text-transform: uppercase;
  letter-spacing: 1px; transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.a-btn-nein { background: var(--red-dim); color: var(--ans-nein-c); border: 1px solid var(--red); }
.a-btn-nein:hover { background: var(--red); color: #fff; }
.a-btn-nein:active { transform: scale(0.97); }
.a-btn-ja  { background: var(--green-dim); color: var(--ans-ja-c); border: 1px solid var(--green); }
.a-btn-ja:hover { background: var(--green); color: #fff; }
.a-btn-ja:active { transform: scale(0.97); }

.kbd-hint {
  text-align: center;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); padding: 10px 0 4px;
  letter-spacing: 0.5px;
}
kbd {
  display: inline-block; padding: 1px 5px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 3px; font-family: var(--font-mono);
  font-size: 10px; color: var(--text2);
}

.fc-done-state {
  text-align: center; padding: 48px 24px;
}
.fc-done-state .big-icon { font-size: 56px; margin-bottom: 16px; }
.fc-done-state h2 {
  font-family: var(--font-head); font-size: 26px;
  font-weight: 900; text-transform: uppercase;
  color: var(--text); margin-bottom: 8px;
}
.fc-done-state p { font-size: 14px; color: var(--text2); margin-bottom: 24px; }

/* ─────────────────────────────────────────────────────────
   QUIZ
───────────────────────────────────────────────────────── */
.quiz-config-wrap { padding: 16px; }
.quiz-count-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 16px;
}
.count-tile {
  min-height: 48px; border-radius: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  font-family: var(--font-head); font-size: 18px;
  font-weight: 800; color: var(--text2);
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.count-tile:hover { border-color: var(--border2); color: var(--text); }
.count-tile.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.count-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.quiz-q-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.quiz-q-num {
  font-family: var(--font-mono); font-size: 12px; color: var(--text3);
}
.quiz-score-live {
  font-family: var(--font-mono); font-size: 13px;
  font-weight: 500; color: var(--green);
}
.quiz-q-text {
  font-size: 17px; font-weight: 500; line-height: 1.55;
  color: var(--text); margin: 14px 0;
}
.quiz-feedback {
  padding: 14px 16px; border-radius: 8px;
  font-size: 13px; line-height: 1.5; margin-bottom: 12px;
  font-weight: 500;
}
.quiz-feedback.correct {
  background: var(--qfb-ok-bg);
  border: 1px solid var(--qfb-ok-b);
  color: var(--qfb-ok-c);
}
.quiz-feedback.wrong {
  background: var(--qfb-err-bg);
  border: 1px solid var(--qfb-err-b);
  color: var(--qfb-err-c);
}
.quiz-summary-wrap { text-align: center; padding: 32px 16px; }
.quiz-big-score {
  font-family: var(--font-head); font-size: 80px;
  font-weight: 900; color: var(--accent);
  line-height: 1; letter-spacing: -2px;
}
.quiz-score-label {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--text2); margin-top: 6px; margin-bottom: 24px;
}
.quiz-msg {
  font-family: var(--font-head); font-size: 20px;
  font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 24px;
}

/* ─────────────────────────────────────────────────────────
   LEARN
───────────────────────────────────────────────────────── */
.search-wrap { position: relative; margin-bottom: 12px; }
.search-wrap svg { 
  position: absolute; left: 12px; top: 50%; 
  transform: translateY(-50%); 
  color: var(--text3); pointer-events: none;
  width: 16px; height: 16px;
}
.search-input {
  width: 100%; padding: 12px 12px 12px 38px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); font-size: 15px;
  color: var(--text); outline: none;
  font-family: var(--font-body); min-height: 44px;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text3); }
.search-input::-webkit-search-cancel-button { display: none; }
.learn-count {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text3); margin-bottom: 10px;
  text-transform: uppercase; letter-spacing: 0.5px;
}

.learn-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px; margin-bottom: 8px;
  transition: border-color 0.15s;
}
.learn-item:hover { border-color: var(--border2); }
.learn-item .q {
  font-size: 14px; font-weight: 500;
  line-height: 1.5; color: var(--text); margin-bottom: 8px;
}
.learn-item .a-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ans-pill {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-family: var(--font-head); font-size: 13px;
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px;
}
.ans-pill.ja {
  background: var(--ans-ja-bg); color: var(--ans-ja-c);
  border: 1px solid var(--ans-ja-b);
}
.ans-pill.nein {
  background: var(--ans-nein-bg); color: var(--ans-nein-c);
  border: 1px solid var(--ans-nein-b);
}
.learn-item .expl {
  font-size: 12px; color: var(--text3); line-height: 1.5;
  margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border);
}
.learn-item .learn-stat {
  font-family: var(--font-mono); font-size: 10px; color: var(--text3);
  margin-top: 4px;
}

/* ─────────────────────────────────────────────────────────
   STATISTIK
───────────────────────────────────────────────────────── */
.stat-kpi-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  margin-bottom: 16px;
}
.kpi-tile {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 10px; text-align: center;
}
.kpi-tile .kpi-n {
  font-family: var(--font-head); font-size: 30px;
  font-weight: 900; line-height: 1;
}
.kpi-tile .kpi-l {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.kpi-tile.kpi-blue .kpi-n  { color: var(--blue); }
.kpi-tile.kpi-green .kpi-n { color: var(--green); }
.kpi-tile.kpi-gold .kpi-n  { color: var(--gold); }

.donut-container { display: flex; justify-content: center; margin: 8px 0 16px; }
.legend-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
.legend-item {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px; color: var(--text2);
}
.legend-dot { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }

.art-table { width: 100%; border-collapse: collapse; }
.art-table th {
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text3); text-transform: uppercase;
  letter-spacing: 0.8px; font-weight: 500;
  padding: 6px 4px 8px; border-bottom: 1px solid var(--border);
  text-align: left;
}
.art-table td {
  padding: 8px 4px; border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text2);
}
.art-table td:first-child {
  font-family: var(--font-mono); font-size: 12px; color: var(--text);
}
.art-table tr:last-child td { border-bottom: none; }

/* ─────────────────────────────────────────────────────────
   DURCHLAUF
───────────────────────────────────────────────────────── */
.dl-scoreboard {
  background: var(--bg2); border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.dl-scoreboard-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.dl-score-label {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px;
}
.dl-score-val {
  font-family: var(--font-head); font-size: 16px;
  font-weight: 800; color: var(--text);
}
.dl-score-val em { color: var(--accent); font-style: normal; }
.round-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,107,26,0.15); border: 1px solid var(--accent);
  border-radius: 4px; padding: 2px 10px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--accent); font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.dl-summary-wrap { text-align: center; padding: 40px 24px; }
.dl-trophy { font-size: 64px; margin-bottom: 16px; }
.dl-summary-title {
  font-family: var(--font-head); font-size: 28px;
  font-weight: 900; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text); margin-bottom: 4px;
}
.dl-big-rounds {
  font-family: var(--font-head); font-size: 80px;
  font-weight: 900; color: var(--accent); line-height: 1;
  letter-spacing: -2px;
}
.dl-rounds-label {
  font-family: var(--font-mono); font-size: 12px;
  color: var(--text3); margin-bottom: 16px;
  text-transform: uppercase; letter-spacing: 1px;
}
.dl-summary-stats {
  font-size: 14px; color: var(--text2); margin-bottom: 28px;
}

/* ─────────────────────────────────────────────────────────
   EMPTY / INFO STATES
───────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--text3);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

.info-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--r); padding: 14px; margin-bottom: 12px;
}
.info-box p { font-size: 13px; color: var(--text2); line-height: 1.6; }
.info-box strong { color: var(--accent); }

/* ── THEME TOGGLE ────────────────────────────────────────── */
.theme-toggle {
  position: absolute; top: 16px; right: 16px;
  width: 44px; height: 44px;
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; transition: background 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
  z-index: 5;
}
.theme-toggle:hover { background: var(--border); }
.theme-toggle:active { transform: scale(0.92); }

/* ── THEME TRANSITION on html ────────────────────────────── */
html { transition: background 0.25s; }
body { transition: background 0.25s, color 0.25s; }
#app, .card, .bottom-nav, .topbar, .hero, .stat-tile,
.mode-btn, .chip, .fc-face, .learn-item, .kpi-tile,
.info-box, .search-input, .badge, .quiz-feedback,
.ans-pill, .a-btn-nein, .a-btn-ja, .count-tile {
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}

/* Light mode: hero background adjustment */
html.light .hero {
  background: linear-gradient(145deg, #fff8f2 0%, #fff3eb 100%);
  border-bottom: 2px solid var(--border);
}
html.light .hero::before { color: rgba(217,79,0,0.06); }
html.light .hero-label { color: var(--accent); }
html.light .fc-front {
  background: linear-gradient(145deg, #f5f4f0 0%, #ece9e3 100%);
}
html.light .fc-back {
  border-color: rgba(0,112,212,0.25);
}
html.light .bottom-nav { border-top: 2px solid var(--accent); }
html.light .nav-btn::after { background: var(--accent); }
html.light .topbar { border-bottom: 2px solid var(--border); }
/* ── REGELWERK ──────────────────────────────────────────── */
.rules-search-wrap {
  position: relative;
}
.rules-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text2);
  pointer-events: none;
}
.rules-search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px 10px 40px;
  background: var(--bg3);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.rules-search-input:focus {
  border-color: var(--accent);
}
.rules-search-input::placeholder { color: var(--text2); }
.rules-search-input::-webkit-search-cancel-button { display: none; }

/* Artikel-Karte */
.rules-artikel-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.rules-artikel-card:active { transform: scale(0.98); }
.rules-artikel-card:hover { border-color: var(--accent); }
.rules-artikel-card-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.rules-art-num {
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255,107,26,0.12);
  border-radius: 5px;
  padding: 3px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}
.rules-art-info { flex: 1; min-width: 0; }
.rules-art-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rules-art-regel {
  font-size: 11px;
  color: var(--text2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rules-art-chevron {
  color: var(--text2);
  flex-shrink: 0;
}
.rules-art-img-count {
  font-size: 11px;
  color: var(--text2);
  background: var(--bg3);
  border-radius: 10px;
  padding: 2px 8px;
  flex-shrink: 0;
}

/* Glossar */
.rules-glossar-entry {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 10px;
  overflow: hidden;
}
.rules-glossar-term {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  gap: 8px;
}
.rules-glossar-term:hover { background: var(--bg3); }
.rules-glossar-body {
  padding: 0 14px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.2s;
}
.rules-glossar-body.open {
  max-height: 500px;
  padding: 0 14px 14px;
}
.rules-glossar-def {
  font-size: 14px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
}
.rules-glossar-arts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.rules-glossar-art-link {
  font-size: 12px;
  background: rgba(255,107,26,0.12);
  color: var(--accent);
  border: none;
  border-radius: 5px;
  padding: 3px 9px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
}
.rules-glossar-art-link:hover { background: rgba(255,107,26,0.25); }
.rules-glossar-arrow {
  transition: transform 0.2s;
  flex-shrink: 0;
}
.rules-glossar-arrow.open { transform: rotate(180deg); }

/* Bilder-Galerie */
.rules-bilder-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.rules-bild-card {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}
.rules-bild-card:hover { border-color: var(--accent); }
.rules-bild-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
  background: var(--bg3);
}
.rules-bild-caption {
  font-size: 11px;
  color: var(--text2);
  padding: 6px 8px;
  line-height: 1.4;
}

/* Lightbox */
.rules-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.rules-lightbox-img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
}
.rules-lightbox-caption {
  margin-top: 12px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  max-width: 400px;
}
.rules-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Detail-Overlay */
.rules-detail-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg);
  z-index: 10;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.rules-detail-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  z-index: 2;
}
.rules-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}
.rules-back-btn svg { width: 20px; height: 20px; }
.rules-detail-meta {
  font-size: 12px;
  color: var(--text2);
  margin-left: auto;
  text-align: right;
}
.rules-detail-body {
  padding: 16px;
  padding-bottom: 80px;
}
.rules-detail-art-num {
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255,107,26,0.12);
  border-radius: 5px;
  padding: 3px 9px;
  display: inline-block;
  margin-bottom: 6px;
}
.rules-detail-title {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}
.rules-detail-regel {
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 16px;
}
.rules-detail-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}
.rules-detail-images {
  margin-top: 20px;
}
.rules-detail-images-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.rules-detail-img-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.rules-detail-img-thumb {
  flex-shrink: 0;
  width: 160px;
  height: 120px;
  object-fit: cover;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
  background: var(--bg3);
}
.rules-detail-img-thumb:hover { border-color: var(--accent); }
.rules-detail-related {
  margin-top: 20px;
  border-top: 1.5px solid var(--border);
  padding-top: 16px;
}
.rules-detail-related-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.rules-related-q {
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 13px;
}
.rules-related-q-text { color: var(--text); margin-bottom: 4px; }
.rules-related-q-answer {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
}
.rules-related-q-answer.nein { color: var(--red, #e05555); }

/* Keine Ergebnisse */
.rules-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text2);
}
.rules-empty-icon { font-size: 40px; margin-bottom: 12px; }

/* Light mode overrides */
html.light .rules-search-input { background: #fff; }
html.light .rules-artikel-card { background: #fff; }
html.light .rules-glossar-entry { background: #fff; }
html.light .rules-bild-card { background: #fff; }
html.light .rules-detail-overlay { background: var(--bg); }
html.light .rules-detail-header { background: var(--bg); }

/* ── Glossar Inline Terms & Popup ─────────────────────────── */
.gloss-term {
  display: inline;
  background: rgba(45, 140, 255, 0.12);
  color: var(--accent, #2d8cff);
  border: none;
  border-bottom: 1.5px dashed var(--accent, #2d8cff);
  border-radius: 2px;
  padding: 0 2px;
  font: inherit;
  font-size: inherit;
  line-height: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.gloss-term:hover { background: rgba(45, 140, 255, 0.22); }

.gloss-popup {
  position: fixed;
  z-index: 9999;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  padding: 14px 16px 12px;
  width: min(300px, calc(100vw - 16px));
  max-height: 60vh;
  overflow-y: auto;
}
.gloss-popup-term {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--accent, #2d8cff);
  padding-right: 24px;
}
.gloss-popup-def {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 10px;
}
.gloss-popup-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.gloss-popup-link {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--accent, #2d8cff);
  color: var(--accent, #2d8cff);
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.15s;
}
.gloss-popup-link:hover { background: rgba(45,140,255,0.12); }
.gloss-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.gloss-popup-close:hover { color: var(--text); background: var(--bg3, rgba(255,255,255,0.08)); }

/* ── Artikel Text Formatierung ─────────────────────────────── */
.rules-detail-text .rules-section-heading {
  font-weight: 700;
  font-size: 13px;
  color: var(--accent, #2d8cff);
  margin: 14px 0 4px;
}
.rules-detail-text .rules-para {
  margin: 0 0 10px;
  line-height: 1.65;
  font-size: 14px;
}
.rules-detail-text .rules-list {
  margin: 4px 0 12px 0;
  padding-left: 20px;
}
.rules-detail-text .rules-list li {
  margin-bottom: 6px;
  line-height: 1.6;
  font-size: 14px;
}

/* ── Inline Bilder im Artikeltext ──────────────────────────── */
.rules-inline-figure {
  margin: 14px 0;
  text-align: center;
}
.rules-inline-img {
  max-width: 100%;
  max-height: 320px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
  margin: 0 auto;
}
.rules-inline-caption {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text2);
  font-style: italic;
}

/* ── Artikel-Section-Overlay (global) ─────────────────────── */
.art-sec-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: var(--bg);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex-direction: column;
}
.art-sec-overlay[style*="display:none"] { display: none !important; }
.art-sec-overlay.open { display: flex; }

.art-sec-header {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1;
}
.art-sec-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
}
.art-sec-back-btn svg { width: 18px; height: 18px; }
.art-sec-back-btn:hover { border-color: var(--text2); color: var(--text); }
.art-sec-back-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.art-sec-header-info { min-width: 0; }
.art-sec-art-num   { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.art-sec-art-title { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-sec-meta      { font-size: 12px; color: var(--text3); margin-left: auto; white-space: nowrap; flex-shrink: 0; }

.art-sec-body { padding: 0; max-width: 680px; margin: 0 auto; width: 100%; }

/* Einzelner Abschnitt */
.art-sec-item {
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 56px;
}

/* Fokussierter Abschnitt */
.art-sec-item.is-focused {
  border-left: 3px solid var(--accent);
}
.art-sec-item.is-focused .art-sec-inner { padding-left: 13px; }

/* Benachbarte (navigierbar, ausgegraut) */
.art-sec-item.is-nav {
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.art-sec-item.is-nav:hover  { background: var(--bg2); }
.art-sec-item.is-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; opacity: .75; }
.art-sec-item[data-dist="1"] { opacity: .42; }
.art-sec-item[data-dist="2"] { opacity: .22; }
.art-sec-item[data-dist="3"] { opacity: .14; }

.art-sec-inner { padding: 16px 16px; }

.art-sec-num   { font-size: 11px; font-weight: 700; color: var(--text3); margin-bottom: 2px; }
.art-sec-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.art-sec-item.is-focused .art-sec-title { font-size: 18px; }

.art-sec-text { font-size: 14px; line-height: 1.65; color: var(--text2); }
.art-sec-text p { margin-bottom: 10px; }
.art-sec-text p:last-child { margin-bottom: 0; }

.art-sec-hint { font-size: 12px; color: var(--text3); margin-top: 4px; }

/* Bildgruppe innerhalb Section-Overlay */
.art-sec-img-group { margin-top: 16px; }
.art-sec-img-label { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 8px; text-align: center; }
.art-sec-img-row   { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.art-sec-img-row figure { text-align: center; margin: 0; }
.art-sec-img-row img    { max-height: 130px; border-radius: 8px; border: 1px solid var(--border); display: block; cursor: zoom-in; }
.art-sec-img-row figcaption { font-size: 11px; color: var(--text3); margin-top: 4px; font-style: italic; }

html.light .art-sec-overlay  { background: var(--bg); }
html.light .art-sec-header   { background: var(--bg); }

/* ── Bildgruppen im Artikel-Detail ────────────────────────── */
.rules-img-group {
  margin: 18px 0 10px;
}
.rules-img-group-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 10px;
  text-align: center;
}
.rules-img-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.rules-img-group-figure {
  flex: 0 1 auto;
  text-align: center;
  margin: 0;
}
.rules-img-group-img {
  max-height: 220px;
  max-width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}
.rules-img-group-caption {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text2);
  font-style: italic;
}

/* ── Artikel Text Struktur (neu) ───────────────────────────── */
.rules-detail-text .rules-h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.rules-detail-text .rules-h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin: 14px 0 2px;
}
.rules-detail-text .rules-sec-num {
  color: var(--accent, #2d8cff);
  font-weight: 700;
  margin-right: 2px;
}
.rules-detail-text .rules-sec-num-inline {
  color: var(--accent, #2d8cff);
  font-weight: 700;
  font-size: 13px;
}

/* ── Inline Bild-Referenz Button ───────────────────────────── */
.rules-inline-bild-btn {
  display: inline;
  background: none;
  border: none;
  border-bottom: 1.5px dashed var(--blue);
  color: var(--blue);
  font: inherit;
  font-size: inherit;
  cursor: pointer;
  padding: 0 1px;
  border-radius: 2px;
  transition: background 0.15s;
}
.rules-inline-bild-btn:hover { background: rgba(45,140,255,0.12); }
.rules-inline-bild-btn:disabled { color: var(--text3); border-bottom-color: var(--text3); cursor: default; }

/* ── HANDZEICHEN ────────────────────────────────────────────── */

/* Mode bar (Galerie / Quiz: Name / Quiz: Bild) */
.hz-mode-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Category filter row */
.hz-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

/* Galerie Grid */
.hz-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

/* Single card */
.hz-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.hz-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.hz-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--bg3);
  display: block;
}
.hz-card-no-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text3);
}
.hz-card-body {
  padding: 8px 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hz-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.hz-card-desc {
  font-size: 11px;
  color: var(--text2);
  line-height: 1.4;
  flex: 1;
}
.hz-category-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--badge-blue-bg);
  color: var(--badge-blue-c);
  border: 1px solid var(--badge-blue-b);
  margin-top: 2px;
  align-self: flex-start;
}

/* Quiz layout */
.hz-quiz-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 16px;
}

/* Progress */
.hz-quiz-progress {
  height: 6px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}
.hz-quiz-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.hz-quiz-progress-label {
  font-size: 12px;
  color: var(--text2);
  display: block;
  margin-bottom: 4px;
}

/* Question area */
.hz-quiz-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.hz-quiz-img {
  max-width: min(260px, 100%);
  max-height: 240px;
  object-fit: contain;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--bg3);
}
.hz-quiz-name-display {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  padding: 20px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  width: 100%;
  line-height: 1.3;
}
.hz-quiz-instruction {
  font-size: 13px;
  color: var(--text2);
  text-align: center;
}

/* Options grid */
.hz-quiz-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.hz-quiz-option {
  background: var(--bg2);
  border: 1.5px solid var(--border2);
  border-radius: var(--r);
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 60px;
  justify-content: center;
  line-height: 1.3;
}
.hz-quiz-option:hover:not(:disabled) { border-color: var(--accent); background: var(--bg3); }
.hz-quiz-option.correct { border-color: var(--green); background: var(--ans-ja-bg); color: var(--ans-ja-c); }
.hz-quiz-option.wrong { border-color: var(--red); background: var(--ans-nein-bg); color: var(--ans-nein-c); }
.hz-quiz-option:disabled { opacity: 0.7; cursor: default; }
.hz-quiz-option-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--bg3);
  display: block;
}
.hz-quiz-option-img-label {
  font-size: 11px;
  color: var(--text2);
  text-align: center;
  display: block;
  line-height: 1.3;
}
.hz-quiz-option.correct .hz-quiz-option-img-label { color: var(--ans-ja-c); }
.hz-quiz-option.wrong .hz-quiz-option-img-label { color: var(--ans-nein-c); }

/* Feedback box */
.hz-quiz-feedback {
  padding: 10px 14px;
  border-radius: var(--r);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.hz-quiz-feedback-correct {
  background: var(--qfb-ok-bg);
  color: var(--qfb-ok-c);
  border: 1.5px solid var(--qfb-ok-b);
}
.hz-quiz-feedback-wrong {
  background: var(--qfb-err-bg);
  color: var(--qfb-err-c);
  border: 1.5px solid var(--qfb-err-b);
}

/* Summary */
.hz-quiz-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 0 16px;
}
.hz-quiz-score-big {
  font-family: var(--font-head);
  font-size: 52px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}
.hz-quiz-score-pct {
  font-size: 16px;
  color: var(--text2);
  font-weight: 600;
}
.hz-quiz-msg {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
}

/* ── UPDATE BANNER ──────────────────────────────────────── */
.update-banner {
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 500;
}
.update-banner button { background: rgba(0,0,0,.25); border: none; border-radius: 6px; color: #fff; cursor: pointer; font-size: 12px; font-weight: 700; padding: 4px 10px; }

/* ── LEARN HUB ──────────────────────────────────────────── */
.learn-hub-modes {
  display: flex;
  gap: 8px;
  padding: 8px 16px 0;
}
.learn-hub-btn {
  flex: 1;
  background: var(--bg2);
  border: 1.5px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  gap: 4px;
  transition: border-color .15s;
}
.learn-hub-btn:hover { border-color: var(--accent); }
.learn-hub-btn--active { border-color: var(--accent); background: rgba(255,107,26,.08); }
.learn-hub-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.learn-hub-icon { font-size: 22px; line-height: 1; }
.learn-hub-title { font-size: 13px; font-weight: 700; }
.learn-hub-desc { font-size: 11px; color: var(--text3); }

/* ── BUY ME A COFFEE ────────────────────────────────────── */
.bmac-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #ffdd00;
  color: #000;
  border-radius: var(--r);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .15s;
}
.bmac-btn:hover { opacity: .85; }
.bmac-btn:focus-visible { outline: 2px solid #000; outline-offset: 2px; }
.bmac-btn span:first-child { font-size: 15px; }
