/* ══════════════════════════════════════
   DENKTRICKS – Main Stylesheet
   Mobile First
══════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:    #12120f;
  --cream:  #faf7f2;
  --yellow: #f5c518;
  --coral:  #BD3B1E;
  --green:  #2d6a4f;
  --mid:    #6b6b5a;
  --card:   #ffffff;
  --border: rgba(18,18,15,.1);
  --shadow: 0 4px 20px rgba(18,18,15,.08);
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', sans-serif; background: var(--cream); color: var(--ink); min-height: 100vh; }

/* ── GLOBAL ── */
a { color: inherit; }
strong { font-weight: 600; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }

/* ── CONFETTI + TOAST ── */
.confetti-wrap { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 999; overflow: hidden; }
.conf { position: absolute; width: 10px; height: 10px; border-radius: 2px; animation: confFall linear forwards; }
@keyframes confFall { 0% { transform: translateY(-20px) rotate(0deg); opacity: 1; } 100% { transform: translateY(100vh) rotate(720deg); opacity: 0; } }

.toast { position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(100px); background: var(--ink); color: var(--cream); padding: .875rem 1.5rem; border-radius: 100px; font-weight: 700; font-size: .9rem; white-space: nowrap; z-index: 200; transition: transform .35s ease; box-shadow: 0 8px 24px rgba(18,18,15,.25); }
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── NAV ── */
nav { border-bottom: 1.5px solid var(--border); background: var(--cream); position: sticky; top: 0; z-index: 100; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: 0 auto; padding: .875rem 1.25rem; }
.logo { font-family: 'Fraunces', serif; font-weight: 900; font-size: 1.4rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--coral); }
.nav-desktop { display: none; }
.nav-cta { background: var(--ink); color: var(--cream); padding: .55rem 1.1rem; border-radius: 100px; font-weight: 600; font-size: .85rem; border: none; cursor: pointer; text-decoration: none; white-space: nowrap; }

/* ── BUTTONS ── */
.btn { display: inline-block; padding: .875rem 1.75rem; border-radius: 100px; font-weight: 600; font-size: 1rem; border: none; cursor: pointer; text-decoration: none; text-align: center; transition: background .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.btn-full { display: block; width: 100%; }
.btn-dark { background: var(--ink); color: var(--cream); }
.btn-dark:active { background: var(--coral); }
.btn-ghost { background: transparent; color: var(--mid); border: 1.5px solid var(--border); }
.btn-ghost:active { background: var(--border); }
.btn:active { transform: scale(.97); }

/* ── BADGES ── */
.badge { display: inline-block; font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .6rem; border-radius: 100px; }
.badge-yellow  { background: var(--yellow); color: var(--ink); }
.badge-green   { background: rgba(45,106,79,.12); color: var(--green); }
.badge-dim     { background: rgba(18,18,15,.07); color: var(--mid); }
.badge-dark    { background: rgba(255,255,255,.1); color: rgba(255,255,255,.5); }

/* ══════════════════════════════════════
   LANDING PAGE
══════════════════════════════════════ */

/* HERO */
.hero { padding: 2.25rem 1.25rem 2rem; }
.hero-label { margin-bottom: 1.1rem; }
.hero h1 { font-family: 'Fraunces', serif; font-size: 2.6rem; font-weight: 900; line-height: 1.05; letter-spacing: -.03em; margin-bottom: 1rem; }
.hero h1 em { font-style: italic; color: var(--coral); }
.hero-sub { font-size: 1rem; color: var(--mid); line-height: 1.7; margin-bottom: 1.5rem; }
.hero-actions { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 2rem; }

/* HERO CARD */
.hero-card { background: var(--ink); color: var(--cream); border-radius: 1.25rem; padding: 1.5rem; position: relative; overflow: hidden; }
.hero-card::before { content: ''; position: absolute; top: -30px; right: -30px; width: 120px; height: 120px; background: var(--yellow); border-radius: 50%; opacity: .12; }
.trick-label { font-size: .65rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); margin-bottom: .6rem; }
.trick-title { font-family: 'Fraunces', serif; font-size: 1.15rem; font-weight: 700; margin-bottom: 1rem; }
.trick-steps { display: flex; flex-direction: column; gap: .65rem; }
.trick-step { display: flex; align-items: flex-start; gap: .65rem; font-size: .875rem; line-height: 1.5; }
.step-num { width: 22px; height: 22px; background: var(--yellow); color: var(--ink); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.trick-example { margin-top: 1rem; background: rgba(255,255,255,.07); border-radius: .625rem; padding: .75rem .875rem; font-size: .8rem; border-left: 3px solid var(--yellow); line-height: 1.6; }
.trick-example strong { color: var(--yellow); }

/* COUNTRIES */
.countries { background: var(--ink); color: var(--cream); padding: 1.1rem 1.25rem; overflow-x: auto; -webkit-overflow-scrolling: touch; display: flex; align-items: center; white-space: nowrap; scrollbar-width: none; }
.countries::-webkit-scrollbar { display: none; }
.countries-label { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.35); margin-right: 1.25rem; flex-shrink: 0; }
.country-item { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 500; opacity: .7; margin-right: 1.5rem; flex-shrink: 0; }

/* FILTER */
.tools-section { padding: 2.5rem 1.25rem; }
.section-label { font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--coral); margin-bottom: .4rem; }
.section-title { font-family: 'Fraunces', serif; font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; margin-bottom: 1.25rem; }

.klasse-filter { display: flex; gap: .5rem; margin-bottom: 1.75rem; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
.klasse-filter::-webkit-scrollbar { display: none; }
.filter-btn { background: var(--card); border: 1.5px solid var(--border); border-radius: 100px; padding: .45rem 1rem; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--mid); white-space: nowrap; -webkit-tap-highlight-color: transparent; flex-shrink: 0; transition: all .15s; }
.filter-btn.active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.filter-btn:active { transform: scale(.96); }

/* TOOLS GRID */
.tools-grid { display: flex; flex-direction: column; gap: 1rem; }
.tool-card { background: var(--card); border: 1.5px solid var(--border); border-radius: 1.25rem; padding: 1.5rem; text-decoration: none; color: inherit; display: block; transition: transform .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.tool-card:active { transform: scale(.99); }
.tool-card.hidden { display: none; }
.tool-card-top { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: .875rem; }
.tool-card-icon { font-size: 2rem; flex-shrink: 0; }
.tool-card-meta { flex: 1; }
.tool-card-title { font-family: 'Fraunces', serif; font-size: 1.25rem; font-weight: 700; margin-bottom: .3rem; }
.tool-card-desc { font-size: .875rem; color: var(--mid); line-height: 1.6; margin-bottom: .875rem; }
.tool-card-footer { display: flex; align-items: center; justify-content: space-between; }
.tool-klassen { display: flex; gap: .3rem; flex-wrap: wrap; }
.klasse-tag { font-size: .72rem; font-weight: 700; color: var(--mid); background: rgba(18,18,15,.06); padding: .15rem .5rem; border-radius: 100px; }
.tool-arrow { color: var(--mid); font-size: 1.1rem; }

/* WHY */
.why-section { background: var(--ink); color: var(--cream); padding: 2.5rem 1.25rem; }
.why-section .section-label { color: var(--yellow); }
.why-section .section-title { color: var(--cream); margin-bottom: 1rem; }
.why-text { font-size: .95rem; color: rgba(250,247,242,.6); line-height: 1.8; margin-bottom: 2rem; }
.compare-grid { display: flex; flex-direction: column; gap: .75rem; }
.compare-row { display: grid; grid-template-columns: 1fr 1fr; gap: .625rem; }
.compare-box { border-radius: .75rem; padding: .875rem; font-size: .8rem; line-height: 1.5; }
.compare-bad { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); color: rgba(255,255,255,.35); text-decoration: line-through; text-decoration-color: rgba(255,255,255,.15); }
.compare-good { background: rgba(245,197,24,.1); border: 1px solid rgba(245,197,24,.2); color: var(--cream); }
.compare-label { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .35rem; opacity: .4; }
.compare-good .compare-label { color: var(--yellow); opacity: 1; }

/* FOOTER */
footer { background: var(--ink); color: #B8B49A; padding: 2rem 1.25rem; text-align: center; font-size: .875rem; line-height: 1.9; }
.footer-logo { display: inline-block; margin-bottom: .75rem; }
.footer-copy { margin-top: .5rem; font-size: .75rem; }

/* ══════════════════════════════════════
   TOOL PAGE
══════════════════════════════════════ */

.tool-page-wrap { padding: 1.5rem 1.25rem 4rem; }

.breadcrumb { display: flex; align-items: center; gap: .4rem; font-size: .8rem; color: var(--mid); margin-bottom: 1.5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--mid); text-decoration: underline; }
.breadcrumb a:hover { color: var(--ink); }

/* MODE SWITCHER */
.mode-switcher { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-bottom: 1.5rem; background: var(--card); border: 1.5px solid var(--border); border-radius: 1rem; padding: .3rem; }
.mode-btn { padding: .7rem 1rem; border-radius: .75rem; border: none; cursor: pointer; font-size: .9rem; font-weight: 600; background: transparent; color: var(--mid); transition: all .2s; -webkit-tap-highlight-color: transparent; }
.mode-btn.active { background: var(--ink); color: var(--cream); }

/* TOOL HEADER */
.tool-header { margin-bottom: 1.5rem; }
.tool-header h1 { font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 900; letter-spacing: -.02em; margin-bottom: .5rem; line-height: 1.1; }
.tool-header p { color: var(--mid); font-size: .9rem; line-height: 1.7; }
.tool-origin { display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .625rem; font-size: .75rem; color: var(--mid); }

/* CHECKER */
.input-card { background: var(--card); border: 1.5px solid var(--border); border-radius: 1.125rem; padding: 1.25rem; margin-bottom: 1rem; }
.input-label-sm { font-size: .75rem; font-weight: 700; color: var(--mid); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .625rem; display: block; }
.big-input { font-family: 'Fraunces', serif; font-size: 2.8rem; font-weight: 700; border: 2px solid var(--border); border-radius: .75rem; padding: .75rem 1rem; background: var(--cream); color: var(--ink); outline: none; transition: border-color .2s; width: 100%; text-align: center; min-height: 72px; -webkit-appearance: none; appearance: none; }
.big-input:focus { border-color: var(--coral); }
.big-input::-webkit-outer-spin-button, .big-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.big-input[type=number] { -moz-appearance: textfield; }
.input-hint { font-size: .75rem; color: var(--mid); margin-top: .5rem; text-align: center; }
.quickpick { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.qbtn { background: var(--card); border: 1.5px solid var(--border); border-radius: 100px; padding: .5rem 1rem; font-size: .9rem; font-weight: 600; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.qbtn:active { background: var(--yellow); border-color: var(--yellow); }

/* RESULT CARDS */
.results { display: flex; flex-direction: column; gap: .75rem; }
.result-card { background: var(--card); border: 1.5px solid var(--border); border-radius: 1rem; overflow: hidden; }
.result-card.yes { border-color: rgba(45,106,79,.35); }
.result-card.no { opacity: .5; }
.result-header { display: flex; align-items: center; gap: .875rem; padding: 1rem 1.1rem; cursor: pointer; min-height: 60px; -webkit-tap-highlight-color: transparent; user-select: none; }
.result-badge { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .95rem; flex-shrink: 0; }
.yes .result-badge { background: var(--green); color: #fff; }
.no  .result-badge { background: #e5e2db; color: var(--mid); }
.result-divisor { font-family: 'Fraunces', serif; font-size: 1.05rem; font-weight: 700; flex: 1; }
.result-verdict { font-size: .75rem; font-weight: 700; padding: .25rem .65rem; border-radius: 100px; flex-shrink: 0; }
.yes .result-verdict { background: rgba(45,106,79,.1); color: var(--green); }
.no  .result-verdict { background: rgba(107,107,90,.08); color: var(--mid); }
.result-expand { color: var(--mid); font-size: 1rem; transition: transform .2s; flex-shrink: 0; }
.result-card.open .result-expand { transform: rotate(180deg); }
.result-body { display: none; padding: 0 1.1rem 1.1rem; border-top: 1px solid var(--border); }
.result-card.open .result-body { display: block; }
.result-rule { font-size: .875rem; color: var(--mid); line-height: 1.65; margin-top: .75rem; margin-bottom: .75rem; }
.rule-hl { display: inline-block; background: var(--yellow); color: var(--ink); padding: .05em .35em; border-radius: .2rem; font-weight: 700; }
.result-calc { background: var(--cream); border-radius: .625rem; padding: .875rem; font-size: .85rem; line-height: 1.75; color: var(--ink); }
.calc-step { display: flex; align-items: baseline; gap: .4rem; flex-wrap: wrap; }
.calc-op { color: var(--coral); font-weight: 700; font-family: 'Fraunces', serif; }
.calc-note { font-size: .75rem; color: var(--mid); font-style: italic; }

/* GENERIC CHECKER RESULT (finger trick, multiplication) */
.checker-result { background: var(--card); border: 1.5px solid var(--border); border-radius: 1.25rem; padding: 1.5rem; margin-top: 1rem; }
.checker-result-num { font-family: 'Fraunces', serif; font-size: 3rem; font-weight: 900; color: var(--ink); text-align: center; margin-bottom: 1rem; }
.checker-steps { display: flex; flex-direction: column; gap: .625rem; }
.checker-step { display: flex; align-items: flex-start; gap: .75rem; font-size: .9rem; line-height: 1.5; padding: .625rem; background: var(--cream); border-radius: .625rem; }
.checker-step .step-num { background: var(--yellow); }
.step-math { font-family: 'Fraunces', serif; font-weight: 700; color: var(--coral); margin-left: auto; font-size: 1rem; }

/* FINGER TRICK VISUAL */
.finger-hands { display: flex; justify-content: center; gap: 1.5rem; margin: 1.5rem 0; flex-wrap: wrap; }
.hand { display: flex; gap: .4rem; align-items: flex-end; }
.finger { width: 36px; height: 60px; border-radius: 18px 18px 8px 8px; border: 2px solid var(--border); background: var(--card); display: flex; align-items: center; justify-content: center; font-size: .7rem; font-weight: 700; color: var(--mid); transition: all .3s; cursor: pointer; }
.finger.down { background: var(--yellow); border-color: var(--yellow); color: var(--ink); height: 40px; }
.finger.active { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.finger-label { text-align: center; font-size: .75rem; color: var(--mid); margin-top: .5rem; }
.finger-result { text-align: center; font-family: 'Fraunces', serif; font-size: 1.5rem; font-weight: 700; margin-top: 1rem; }

/* EMPTY STATE */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--mid); }
.empty-num { font-family: 'Fraunces', serif; font-size: 4.5rem; font-weight: 900; color: var(--border); line-height: 1; margin-bottom: .75rem; }
.empty-state p { font-size: .9rem; }

/* ── QUIZ ── */
.stats-bar { display: grid; grid-template-columns: repeat(3,1fr); gap: .625rem; margin-bottom: 1.25rem; }
.stat-box { background: var(--card); border: 1.5px solid var(--border); border-radius: .875rem; padding: .875rem .75rem; text-align: center; }
.stat-val { font-family: 'Fraunces', serif; font-size: 1.6rem; font-weight: 900; line-height: 1; margin-bottom: .2rem; }
.stat-label { font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--mid); }
.stat-box.s-streak .stat-val { color: var(--coral); }
.stat-box.s-points .stat-val { color: var(--green); }
.stat-box.s-level  .stat-val { font-size: .95rem; padding-top: .2rem; }

.level-bar-wrap { margin-bottom: 1.5rem; }
.level-bar-labels { display: flex; justify-content: space-between; font-size: .75rem; color: var(--mid); margin-bottom: .35rem; }
.level-bar-track { height: 8px; background: var(--border); border-radius: 100px; overflow: hidden; }
.level-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--yellow)); border-radius: 100px; transition: width .4s ease; }

.question-card { background: var(--card); border: 1.5px solid var(--border); border-radius: 1.25rem; padding: 1.5rem; margin-bottom: 1.25rem; text-align: center; transition: opacity .25s, transform .25s; }
.q-meta { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--mid); margin-bottom: .875rem; }
.q-number { font-family: 'Fraunces', serif; font-size: 3.5rem; font-weight: 900; line-height: 1; margin-bottom: .625rem; color: var(--ink); }
.q-text { font-size: 1rem; color: var(--mid); }
.q-text strong { color: var(--ink); }

.answer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem; margin-bottom: 1.25rem; }
.ans-btn { padding: 1.1rem; border-radius: 1rem; border: 2px solid var(--border); background: var(--card); font-size: 1.1rem; font-weight: 700; cursor: pointer; transition: all .15s; -webkit-tap-highlight-color: transparent; display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.ans-label { font-size: .75rem; font-weight: 600; color: var(--mid); }
.ans-btn:active { transform: scale(.97); }
.ans-btn.correct  { background: rgba(45,106,79,.12); border-color: var(--green); color: var(--green); }
.ans-btn.wrong    { background: rgba(189,59,30,.1); border-color: var(--coral); color: var(--coral); }
.ans-btn.disabled { pointer-events: none; opacity: .5; }

.ans-btn-wide { width: 100%; padding: 1rem; border-radius: 1rem; border: 2px solid var(--border); background: var(--card); font-size: 1rem; font-weight: 700; cursor: pointer; margin-bottom: .625rem; text-align: center; -webkit-tap-highlight-color: transparent; }
.ans-btn-wide.correct  { background: rgba(45,106,79,.12); border-color: var(--green); color: var(--green); }
.ans-btn-wide.wrong    { background: rgba(189,59,30,.1); border-color: var(--coral); color: var(--coral); }
.ans-btn-wide.disabled { pointer-events: none; opacity: .5; }

.feedback { border-radius: 1rem; padding: 1rem 1.25rem; margin-bottom: 1.25rem; display: none; }
.feedback.show { display: block; }
.feedback.fb-ok  { background: rgba(45,106,79,.08); border: 1.5px solid rgba(45,106,79,.25); }
.feedback.fb-err { background: rgba(189,59,30,.07); border: 1.5px solid rgba(189,59,30,.2); }
.feedback-title { font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; }
.fb-ok  .feedback-title { color: var(--green); }
.fb-err .feedback-title { color: var(--coral); }
.feedback-text  { font-size: .875rem; color: var(--mid); line-height: 1.65; margin-bottom: .75rem; }
.feedback-trick { background: var(--cream); border-radius: .625rem; padding: .75rem; font-size: .82rem; line-height: 1.7; color: var(--ink); }

.next-btn { background: var(--ink); color: var(--cream); padding: 1rem; border-radius: 100px; font-weight: 700; font-size: 1rem; border: none; cursor: pointer; width: 100%; display: none; -webkit-tap-highlight-color: transparent; }
.next-btn.show { display: block; }
.next-btn:active { background: var(--coral); }

/* ── ANIMATIONS ── */
@keyframes slideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.animate-in { animation: slideIn .25s ease forwards; }
@keyframes pop { 0%{transform:scale(1)} 50%{transform:scale(1.1)} 100%{transform:scale(1)} }
.pop { animation: pop .25s ease; }

/* ══════════════════════════════════════
   TABLET 640px+
══════════════════════════════════════ */
@media (min-width: 640px) {
  .hero { padding: 3rem 2rem; }
  .hero h1 { font-size: 3.2rem; }
  .hero-actions { flex-direction: row; }
  .btn-full { width: auto; }
  .tools-section { padding: 3rem 2rem; }
  .tools-grid { display: grid; grid-template-columns: 1fr 1fr; }
  .why-section { padding: 3rem 2rem; }
  .tool-page-wrap { padding: 2rem 2rem 4rem; }
}

/* ══════════════════════════════════════
   DESKTOP 1024px+
══════════════════════════════════════ */
@media (min-width: 1024px) {
  .nav-inner { padding: 1rem 2.5rem; }
  .nav-desktop { display: flex; gap: 2rem; align-items: center; }
  .nav-desktop a { color: var(--mid); text-decoration: none; font-size: .9rem; font-weight: 500; }
  .nav-desktop a:hover { color: var(--ink); }
  .hero { max-width: 1100px; margin: 0 auto; padding: 5rem 2.5rem 4rem; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
  .hero h1 { font-size: 4rem; }
  .countries { justify-content: center; gap: 3rem; padding: 1.5rem 2.5rem; white-space: normal; }
  .country-item { margin-right: 0; }
  .tools-section { max-width: 1100px; margin: 0 auto; padding: 5rem 2.5rem; }
  .section-title { font-size: 2.4rem; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
  .why-section { padding: 5rem 2.5rem; }
  .why-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
  .tool-page-wrap { max-width: 680px; margin: 0 auto; padding: 3rem 2rem 5rem; }
}

/* ── GESCHICHTE ── */
.geschichte-hero { display:flex; align-items:center; gap:1rem; background:var(--ink); color:var(--cream); border-radius:1.25rem; padding:1.5rem; margin-bottom:1.25rem; }
.geschichte-flag { font-size:3rem; flex-shrink:0; }
.geschichte-kultur { font-family:'Fraunces',serif; font-size:1.3rem; font-weight:700; margin-bottom:.25rem; }
.geschichte-jahr { font-size:.85rem; color:rgba(250,247,242,.55); }
.geschichte-text { background:var(--card); border:1.5px solid var(--border); border-radius:1.125rem; padding:1.25rem; margin-bottom:1rem; font-size:.925rem; line-height:1.8; color:var(--ink); }
.geschichte-fun { background:rgba(245,197,24,.12); border:1.5px solid rgba(245,197,24,.3); border-radius:1rem; padding:1.1rem 1.25rem; font-size:.875rem; line-height:1.7; color:var(--ink); }
.fun-label { font-size:.7rem; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--coral); margin-bottom:.5rem; }

/* ── PRIME SIEVE GRID ── */
.prime-grid { display:flex; flex-wrap:wrap; gap:.35rem; }
.prime-cell { width:38px; height:38px; border-radius:.5rem; border:2px solid var(--border); background:var(--card); font-size:.85rem; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .2s; -webkit-tap-highlight-color:transparent; }
.prime-alive { background:var(--card); color:var(--ink); }
.prime-alive:hover { border-color:var(--coral); }
.prime-dead { background:#e5e2db; color:rgba(18,18,15,.3); text-decoration:line-through; cursor:default; }
.prime-fresh { background:rgba(189,59,30,.15); border-color:var(--coral); }
@keyframes strike { from{background:rgba(189,59,30,.4)} to{background:#e5e2db} }
.prime-fresh { animation:strike .4s ease forwards; }

/* ── MUSTER GRID ── */
.muster-grid { display:flex; flex-wrap:wrap; gap:.5rem; }
.muster-cell { min-width:52px; padding:.5rem .25rem; background:var(--card); border:1.5px solid var(--border); border-radius:.625rem; font-family:'Fraunces',serif; font-weight:700; font-size:1rem; text-align:center; }
.muster-cell-hl { background:var(--yellow); border-color:var(--yellow); }

/* ── BINÄR FINGER ── */
.finger-bin-row { display:flex; gap:.35rem; flex-wrap:wrap; justify-content:center; }
.bin-finger { width:52px; height:64px; border-radius:.75rem; border:2px solid var(--border); background:var(--card); cursor:pointer; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.2rem; -webkit-tap-highlight-color:transparent; transition:all .15s; }
.bin-finger.bin-on { background:var(--yellow); border-color:var(--yellow); }
.bin-val { font-size:.6rem; font-weight:700; color:var(--mid); }
.bin-on .bin-val { color:var(--ink); }
.bin-state { font-family:'Fraunces',serif; font-size:1.2rem; font-weight:900; color:var(--mid); }
.bin-on .bin-state { color:var(--ink); }

/* ══════════════════════════════════════
   TOOL INTRO BLOCKS
   Erklärung + Beispiel vor jeder Interaktion
══════════════════════════════════════ */
.intro-block {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 1.125rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.intro-what {
  font-size: .9rem;
  color: var(--mid);
  line-height: 1.7;
  margin-bottom: 1rem;
}
.intro-what strong { color: var(--ink); font-weight: 600; }

.intro-label {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--orange); margin-bottom: .625rem; display: block;
}
.intro-example {
  background: var(--bg);
  border-radius: .75rem;
  padding: 1rem;
}
.ex-seq {
  display: flex; align-items: center;
  gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem;
}
.ex-cell {
  width: 48px; height: 48px; border-radius: .625rem;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Fraunces', serif; font-size: 1.1rem; font-weight: 700;
}
.ex-num  { background: var(--card); border: 1.5px solid var(--border-md); color: var(--ink); }
.ex-gap  { background: rgba(26,92,57,.12); border: 2px solid rgba(26,92,57,.4); color: var(--green); }
.ex-result { background: var(--green); color: #fff; }
.ex-arrow { color: var(--dim); font-size: .85rem; }
.ex-note {
  font-size: .8rem; color: var(--mid); line-height: 1.65;
  padding-top: .625rem;
  border-top: 1px solid var(--border);
}
.ex-note strong { color: var(--ink); }

/* Zwei-Spalten Einmaleins-Beispiel */
.ex-ways { display: flex; flex-direction: column; gap: .5rem; }
.ex-way {
  display: flex; align-items: center; gap: .625rem;
  font-size: .875rem; color: var(--mid);
}
.ex-way-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--yellow-bg); color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem; font-weight: 700; flex-shrink: 0;
}
.ex-way strong { color: var(--ink); }

/* Finger visual */
.ex-hands { display: flex; gap: 1rem; justify-content: center; margin: .625rem 0; }
.ex-hand  { display: flex; gap: .3rem; align-items: flex-end; }
.ex-finger {
  width: 30px; height: 50px; border-radius: 15px 15px 6px 6px;
  border: 1.5px solid var(--border); background: var(--card);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 700; color: var(--mid);
}
.ex-finger.down { background: var(--yellow-bg); border-color: var(--yellow-bg); color: var(--ink); height: 34px; }

/* Prozent-Tabelle */
.ex-pct-table { width: 100%; font-size: .85rem; border-collapse: collapse; }
.ex-pct-table td { padding: .35rem .5rem; }
.ex-pct-table tr:not(:last-child) td { border-bottom: 1px solid var(--border); }
.ex-pct-hl { background: var(--yellow-bg); color: var(--ink); font-weight: 700; border-radius: .3rem; padding: .1em .4em; }

/* Binary grid preview */
.ex-bits { display: flex; gap: .3rem; justify-content: center; }
.ex-bit {
  width: 36px; height: 40px; border-radius: .4rem;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px;
  border: 1.5px solid var(--border);
}
.ex-bit-val { font-size: .6rem; color: var(--dim); }
.ex-bit-state { font-family: 'Fraunces', serif; font-weight: 700; font-size: 1rem; }
.ex-bit.on { background: var(--yellow-bg); border-color: var(--yellow-bg); }
.ex-bit.on .ex-bit-state { color: var(--ink); }
.ex-bit.off .ex-bit-state { color: var(--dim); }

/* Divider between intro and interactive */
.intro-divider {
  border: none; border-top: 1.5px solid var(--border);
  margin: 1.25rem 0;
}

/* Additional vars for intro blocks */
:root {
  --orange:    #B83A00;
  --bg:        #faf7f2;
  --yellow-bg: #FFD23F;
  --border-md: rgba(18,18,15,.2);
}

/* ══════════════════════════════════════
   WCAG AA FIXES & IMPROVEMENTS
══════════════════════════════════════ */

/* 1. Non-text contrast: focus rings on ALL interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
}
/* Remove default outline only after we set our own */
a:focus,
button:focus,
input:focus,
select:focus {
  outline: none;
}
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 3px;
  border-radius: 3px;
}

/* 2. Mode tabs: selected state visible beyond color */
.mode-btn[aria-selected="true"] {
  background: var(--ink);
  color: var(--dark-text);
  font-weight: 700; /* extra weight differentiator */
}
.mode-btn[aria-selected="true"]::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--yellow-bg);
  border-radius: 1px;
  margin-top: 3px;
}

/* 3. Filter buttons: active state includes text-decoration */
.filter-btn[aria-pressed="true"] {
  background: var(--ink);
  color: var(--dark-text);
  border-color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* 4. Links in body text must be underlined */
.g-text a,
.intro-what a,
.why-body a {
  text-decoration: underline;
  color: var(--orange);
}

/* 5. Skip link — always accessible */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 9999;
  background: var(--orange);
  color: #fff;
  padding: .75rem 1.25rem;
  border-radius: .5rem;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  transition: top .15s;
  border: 2px solid #fff;
}
.skip-link:focus {
  top: 1rem;
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* 6. Error/wrong states: not color alone — add icon prefix */
.result-card[data-ok="false"] .result-verdict::before { content: ''; }
.ans-btn.wrong::before { content: ''; }

/* 7. Touch targets minimum 44×44px */
.filter-btn,
.qbtn,
.qpick-btn,
.mode-btn,
.mtab,
.mode-tab {
  min-height: 44px;
  min-width: 44px;
}

/* 8. High-contrast mode support */
@media (forced-colors: active) {
  .result-card.yes { border: 2px solid ButtonText; }
  .ans-btn.correct { border: 2px solid ButtonText; }
  .level-fill { background: ButtonText; }
}

/* 9. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 10. Visible text for screen-reader only content */
.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;
}

/* ── FOOTER WCAG FIX ── */
/* All footer text uses accessible contrast ≥ 4.5:1 on --ink bg */
footer                 { color: #B8B49A; }          /* 8.4:1 ✓ */
footer p               { color: #B8B49A; }          /* 8.4:1 ✓ */
footer .footer-copy    { color: #968E79; font-size: .8rem; margin-top: .4rem; }  /* 5.8:1 ✓ */
footer .footer-logo    { display: flex; justify-content: center; margin-bottom: .75rem; }
/* Logo on dark: 'Lern' cream, 'kurven' warm amber (10.76:1) */
footer .logo-lern      { color: #faf7f2; }          /* 14.8:1 ✓ */
footer .logo-kurven    { color: #F5C518; }          /* 10.8:1 ✓ */
footer .logo-com       { color: #968E79; }          /* 5.8:1  ✓ */
footer nav             { margin-top: .875rem; }
footer nav a           {
  color: #D4CEBC;                                    /* 10.1:1 ✓ */
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: .875rem;
  padding: .35rem .5rem;
  display: inline-block;
  min-height: 44px; line-height: 44px;              /* touch target */
}
footer nav a:hover     { color: #faf7f2; }
footer nav a:focus-visible {
  outline: 3px solid #F5C518;
  outline-offset: 3px;
  border-radius: 3px;
}
/* Separator dots in footer */
footer .footer-sep     { color: #968E79; margin: 0 .35rem; }

/* ── FOOTER LAYOUT ── */
.site-footer   { background: var(--ink); }
.footer-inner  {
  max-width: 860px; margin: 0 auto;
  padding: 2.5rem 1.25rem 2rem;
  display: flex; flex-direction: column;
  align-items: center; gap: 0;
  text-align: center;
}
.footer-inner p  { color: #B8B49A; font-size: .875rem; line-height: 1.7; margin: .2rem 0; }
.footer-inner .footer-copy { color: #968E79; font-size: .78rem; margin-top: .25rem; }

/* ── IMPRESSUM ── */
.impressum-wrap {
  max-width: 680px; margin: 0 auto;
  padding: 2.5rem 1.25rem 5rem;
}
.impressum-wrap h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 900; letter-spacing: -.025em;
  margin-bottom: 2rem; color: var(--ink);
}
.impressum-wrap h2 {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem; font-weight: 700;
  margin-bottom: 1rem; padding-bottom: .5rem;
  border-bottom: 1.5px solid var(--border);
  color: var(--ink);
}
.impressum-wrap h3 {
  font-size: 1rem; font-weight: 600;
  margin-bottom: .5rem; margin-top: 1.25rem;
  color: var(--ink);
}
.impressum-wrap section { margin-bottom: 2.5rem; }
.impressum-wrap address {
  font-style: normal; line-height: 1.9;
  color: var(--ink);
}
.impressum-wrap p {
  color: var(--mid); line-height: 1.8;
  margin-bottom: 1rem; font-size: .925rem;
}
.impressum-wrap a {
  color: var(--orange);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.impressum-wrap dl { line-height: 1.9; }
.impressum-wrap dt { font-weight: 600; display: inline; }
.impressum-wrap dd { display: inline; margin-left: .5rem; }
.impressum-wrap .impressum-meta {
  font-size: .8rem; color: var(--dim);
  border-top: 1px solid var(--border);
  padding-top: 1rem; margin-top: 2rem;
}

/* ══════════════════════════════════════
   FACH-NAVIGATION
══════════════════════════════════════ */
.fach-nav {
  background: var(--card);
  border-bottom: 1.5px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 57px; /* below main nav */
  z-index: 90;
}
.fach-nav::-webkit-scrollbar { display: none; }
.fach-nav-inner {
  display: flex;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
  gap: 0;
  min-width: max-content;
}
.fach-btn {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .875rem 1.1rem;
  font-family: inherit;
  font-size: .875rem;
  font-weight: 600;
  color: var(--mid);
  background: none;
  border: none;
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.fach-btn:hover { color: var(--ink); }
.fach-btn[aria-selected="true"] {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 700;
}
.fach-btn-icon {
  font-size: 1rem;
  line-height: 1;
}
.fach-count {
  font-size: .65rem;
  font-weight: 700;
  color: var(--dim);
  background: rgba(26,26,13,.07);
  padding: .1em .45em;
  border-radius: 100px;
  min-width: 18px;
  text-align: center;
}
.fach-btn[aria-selected="true"] .fach-count {
  background: var(--ink);
  color: var(--cream);
}

/* Subject color accents on active */
.fach-btn[data-fach="mathe"][aria-selected="true"]    { border-bottom-color: #B83A00; color: #B83A00; }
.fach-btn[data-fach="physik"][aria-selected="true"]   { border-bottom-color: #1A5C39; color: #1A5C39; }
.fach-btn[data-fach="chemie"][aria-selected="true"]   { border-bottom-color: #4A3BAA; color: #4A3BAA; }
.fach-btn[data-fach="deutsch"][aria-selected="true"]  { border-bottom-color: #0E6B8C; color: #0E6B8C; }
.fach-btn[data-fach="englisch"][aria-selected="true"] { border-bottom-color: #7A3BAA; color: #7A3BAA; }
.fach-btn[data-fach="lernen"][aria-selected="true"]   { border-bottom-color: #1A6B3C; color: #1A6B3C; }

/* Fach badge on tool cards */
.fach-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: .18rem .55rem;
  border-radius: 100px;
}
.fach-badge-mathe    { background: rgba(184,58,0,.1);    color: #7A2500; }
.fach-badge-physik   { background: rgba(26,92,57,.1);   color: #0D4028; }
.fach-badge-chemie   { background: rgba(74,59,170,.1);  color: #2D2475; }
.fach-badge-deutsch  { background: rgba(14,107,140,.1); color: #074E68; }
.fach-badge-englisch { background: rgba(122,59,170,.1); color: #4A1A78; }
.fach-badge-lernen   { background: rgba(26,107,60,.1);  color: #0D4A28; }

/* Subject dividers in grid */
.tools-group-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .5rem 0 .25rem;
  border-bottom: 1.5px solid var(--border);
  margin-top: .5rem;
}
.tools-group-header:first-child { margin-top: 0; }
.tools-group-icon { font-size: 1.1rem; }
.tools-group-label {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
}
.tools-group-count {
  font-size: .75rem;
  color: var(--dim);
  margin-left: auto;
}

@media (min-width: 1024px) {
  .fach-nav-inner { padding: 0 2.5rem; }
  .fach-btn { padding: .875rem 1.35rem; font-size: .9rem; }
}

/* ── Fach-Farben für tool.php Header ── */
.fach-header-mathe    { border-top: 3px solid #B83A00; }
.fach-header-physik   { border-top: 3px solid #1A5C39; }
.fach-header-chemie   { border-top: 3px solid #4A3BAA; }
.fach-header-deutsch  { border-top: 3px solid #0E6B8C; }
.fach-header-englisch { border-top: 3px solid #7A3BAA; }
.fach-header-lernen   { border-top: 3px solid #1A6B3C; }

/* ── Answer buttons für Deutsch/Englisch Quiz ── */
.answer-btns { display: grid; grid-template-columns: 1fr 1fr; gap: .875rem; }
.abn {
  padding: 1rem; border-radius: var(--radius-md);
  border: 2px solid var(--border-md);
  background: var(--card);
  font-family: inherit; font-size: .95rem; font-weight: 700;
  color: var(--ink); cursor: pointer; min-height: 56px;
  transition: all .15s;
}
.abn:hover { border-color: var(--ink); }
.abn.correct { background: rgba(26,92,57,.1); border-color: var(--green); color: var(--green); }
.abn.off { opacity: .45; pointer-events: none; }

/* ── cmp-grid (compare boxes) ── */
.cmp-grid { display: flex; flex-direction: column; gap: .625rem; }
.cmp-row  { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cmp { border-radius: var(--radius-md); padding: .75rem .875rem; font-size: .85rem; line-height: 1.55; }
.cmp-label { font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }
.cmp-bad  { background: rgba(246,243,238,.04); border: 1px solid rgba(246,243,238,.1); color: rgba(246,243,238,.35); }
.cmp-bad .cmp-label { color: rgba(246,243,238,.3); }
.cmp-good { background: rgba(255,210,63,.08); border: 1px solid rgba(255,210,63,.2); color: var(--dark-text,#F6F3EE); }
.cmp-good .cmp-label { color: #FFD23F; }

/* ── hero-card (renamed from trick-showcase) ── */
.hero-card {
  background: var(--ink);
  border-radius: 1.25rem;
  padding: 1.75rem;
  color: var(--cream);
  position: relative; overflow: hidden;
}
.hero-card::after {
  content: ''; position: absolute; bottom: -40px; right: -40px;
  width: 140px; height: 140px; background: var(--yellow-bg);
  border-radius: 50%; opacity: .07; pointer-events: none;
}
.trick-tag { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--yellow-bg); margin-bottom: .75rem; display: block; }
.trick-question { font-family: 'Fraunces', serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 1rem; color: var(--cream); }
.trick-steps { display: flex; flex-direction: column; gap: .75rem; }
.trick-step { display: flex; align-items: flex-start; gap: .75rem; font-size: .9rem; line-height: 1.55; color: rgba(250,247,242,.7); }
.trick-step strong { color: var(--cream); }
.step-dot { width: 24px; height: 24px; border-radius: 50%; background: var(--yellow-bg); color: var(--ink); display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.trick-note { margin-top: 1.25rem; background: rgba(255,210,63,.1); border-left: 3px solid var(--yellow-bg); border-radius: 0 .5rem .5rem 0; padding: .75rem 1rem; font-size: .85rem; line-height: 1.65; color: rgba(250,247,242,.7); }
.trick-note strong { color: var(--yellow-bg); }

/* also ensure logo classes exist */
.logo-lern   { color: var(--ink); }
.logo-kurven { color: var(--orange); }
.logo-com    { font-size: .55em; font-weight: 400; color: var(--mid); align-self: flex-end; margin-bottom: .1em; margin-left: .1em; font-family: 'Source Sans 3', sans-serif; }

/* ══════════════════════════════════════
   MOBILE-FIRST FIXES
══════════════════════════════════════ */

/* Nav: score chip always accessible */
.score-chip {
  display: none;
  align-items: center; gap: .35rem;
  background: var(--ink); color: var(--cream);
  padding: .4rem .875rem; border-radius: 100px;
  font-size: .78rem; font-weight: 700;
  border: none; min-height: 40px;
  cursor: pointer; flex-shrink: 0;
}
.score-chip:hover { background: var(--orange); }
.score-chip:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }

/* Hero: single column on mobile */
.hero {
  padding: 2.5rem 1.25rem 2rem;
  display: block; /* mobile: stack */
}
.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.1rem, 8vw, 3.75rem);
  font-weight: 900; line-height: 1.05;
  letter-spacing: -.03em; margin-bottom: 1rem;
}
.hero h1 em { font-style: italic; color: var(--orange); }
.hero-lead {
  font-size: .975rem; color: var(--mid);
  line-height: 1.75; margin-bottom: 1.5rem;
}
.hero-actions {
  display: flex; flex-direction: column; gap: .75rem;
  margin-bottom: 2rem;
}
.hero-card { margin-top: 2rem; }

/* World strip: scrollable on mobile */
.world-strip {
  background: var(--ink);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; white-space: nowrap;
  display: flex; align-items: center;
  padding: .875rem 1.25rem; gap: 1.5rem;
}
.world-strip::-webkit-scrollbar { display: none; }
.world-strip-label {
  font-size: .65rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: rgba(250,247,242,.4); flex-shrink: 0;
}
.world-item {
  font-size: .82rem; font-weight: 500;
  color: rgba(250,247,242,.65); flex-shrink: 0;
  display: inline-flex; align-items: center; gap: .3rem;
}

/* Tools section */
.tools-section { padding: 2.5rem 1.25rem; }
.section-eyebrow {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--orange); margin-bottom: .4rem;
}
.section-heading {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.6rem, 5vw, 2.25rem);
  font-weight: 700; letter-spacing: -.02em;
  line-height: 1.12; margin-bottom: 1.25rem;
}

/* Filter bar: horizontal scroll on mobile */
.filter-bar {
  display: flex; gap: .5rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 2px; margin-bottom: 1.5rem;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  background: var(--card); border: 1.5px solid var(--border-md);
  border-radius: 100px; padding: .5rem 1rem;
  font-family: inherit; font-size: .82rem; font-weight: 600;
  color: var(--mid); cursor: pointer; white-space: nowrap;
  flex-shrink: 0; min-height: 40px; transition: all .15s;
}
.filter-btn:hover { border-color: var(--ink); color: var(--ink); }
.filter-btn[aria-pressed="true"], .filter-btn.active {
  background: var(--ink); color: var(--cream);
  border-color: var(--ink); text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tool grid: single column mobile */
.tools-grid {
  display: flex; flex-direction: column; gap: .875rem;
}

/* Why section */
.why-section { background: var(--ink); color: var(--cream); padding: 3rem 1.25rem; }
.why-inner { display: block; }
.why-section .section-heading { color: var(--cream); margin-bottom: 1rem; }
.why-section .section-eyebrow { color: var(--yellow-bg); }
.why-body { font-size: .95rem; color: rgba(250,247,242,.7); line-height: 1.8; margin-bottom: 1.75rem; }

/* ── COMPARE BOXES (dark surface — why section) ── */
.cmp-grid { display: flex; flex-direction: column; gap: .625rem; }
.cmp-row  { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.cmp { border-radius: .875rem; padding: .875rem 1rem; font-size: .85rem; line-height: 1.6; }
.cmp-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; margin-bottom: .35rem; }
/* Dark theme (why-section): */
.cmp-bad  { background: rgba(250,247,242,.04); border: 1px solid rgba(250,247,242,.1); color: rgba(250,247,242,.35); }
.cmp-bad .cmp-label { color: rgba(250,247,242,.3); }
.cmp-good { background: rgba(255,210,63,.08); border: 1px solid rgba(255,210,63,.2); color: var(--cream); }
.cmp-good .cmp-label { color: var(--yellow-bg); }
/* Light theme (tool pages, cards): */
.cmp-l-bad  { background: rgba(26,26,13,.05); border: 1.5px solid rgba(26,26,13,.12); color: var(--mid); border-radius: .75rem; padding: .75rem; font-size: .85rem; line-height: 1.6; }
.cmp-l-bad .cmp-label  { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); margin-bottom: .3rem; }
.cmp-l-good { background: rgba(26,92,57,.07); border: 1.5px solid rgba(26,92,57,.25); color: var(--ink); border-radius: .75rem; padding: .75rem; font-size: .85rem; line-height: 1.6; }
.cmp-l-good .cmp-label { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--green); margin-bottom: .3rem; }

/* ══════════════════════════════════════
   MODALS (Score + Level-Up)
══════════════════════════════════════ */
.lk-modal {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(26,26,13,.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end;
  justify-content: center;
  opacity: 0; transition: opacity .2s;
  padding: 0;
}
.lk-modal.visible { opacity: 1; }

@media (min-width: 640px) {
  .lk-modal { align-items: center; padding: 1.5rem; }
}

.lk-modal-box {
  background: var(--card);
  border-radius: 1.25rem 1.25rem 0 0;
  padding: 1.5rem 1.25rem 2rem;
  width: 100%; max-height: 92dvh; overflow-y: auto;
  position: relative;
  transform: translateY(20px); transition: transform .25s ease;
}
.lk-modal.visible .lk-modal-box { transform: translateY(0); }

@media (min-width: 640px) {
  .lk-modal-box {
    border-radius: 1.25rem;
    max-width: 520px; max-height: 88dvh;
  }
}

.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px; border-radius: 50%;
  border: none; background: rgba(26,26,13,.08);
  cursor: pointer; font-size: .875rem; color: var(--mid);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(26,26,13,.15); }

/* Level-up modal */
.levelup-box { text-align: center; padding: 2.5rem 1.5rem; }
.levelup-emoji { font-size: 5rem; line-height: 1; margin-bottom: .75rem; }
.levelup-label {
  font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--orange); margin-bottom: .25rem;
}
.levelup-name {
  font-family: 'Fraunces', serif;
  font-size: 2.25rem; font-weight: 900;
  letter-spacing: -.025em; margin-bottom: .75rem;
}
.levelup-desc { color: var(--mid); font-size: .95rem; line-height: 1.65; margin-bottom: 1.5rem; }

/* Score modal */
.score-modal { padding: 1.5rem 1.25rem 1.5rem; }

.sm-hero {
  display: flex; align-items: center; gap: 1rem;
  background: var(--ink); color: var(--cream);
  border-radius: 1rem; padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.sm-hero-emoji { font-size: 3rem; line-height: 1; flex-shrink: 0; }
.sm-hero-level {
  font-family: 'Fraunces', serif;
  font-size: 1.5rem; font-weight: 900; line-height: 1.1;
  color: var(--cream);
}
.sm-hero-pts { font-size: .875rem; color: rgba(250,247,242,.65); margin-top: .2rem; }

.sm-progress { margin-bottom: 1.25rem; }
.sm-prog-labels {
  display: flex; justify-content: space-between;
  font-size: .78rem; font-weight: 600; color: var(--mid);
  margin-bottom: .4rem;
}
.sm-prog-pct { color: var(--ink); font-weight: 700; }
.sm-prog-track {
  height: 10px; background: rgba(26,26,13,.1);
  border-radius: 100px; overflow: hidden; margin-bottom: .4rem;
}
.sm-prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow-bg));
  border-radius: 100px; transition: width .5s ease;
}
.sm-prog-hint { font-size: .78rem; color: var(--mid); text-align: center; }

.sm-stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .5rem; margin-bottom: 1.25rem;
}
.sm-stat {
  background: var(--bg); border-radius: .75rem;
  padding: .75rem .5rem; text-align: center;
}
.sm-stat-val {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem; font-weight: 900; line-height: 1; color: var(--ink);
}
.sm-stat-lbl {
  font-size: .65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--dim); margin-top: .25rem;
}

.sm-section-title {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--orange); margin: 1rem 0 .625rem;
  display: flex; align-items: center; gap: .5rem;
}
.sm-badge-count {
  font-size: .65rem; font-weight: 700;
  background: rgba(26,26,13,.08); color: var(--mid);
  padding: .1em .5em; border-radius: 100px;
}

/* Level roadmap */
.lvr {
  display: flex; flex-direction: column; gap: 0;
  background: var(--bg); border-radius: .875rem;
  overflow: hidden; margin-bottom: .5rem;
}
.lvr-item {
  display: flex; align-items: center; gap: .875rem;
  padding: .625rem .875rem;
  border-bottom: 1px solid var(--border);
  opacity: .45;
}
.lvr-item:last-child { border-bottom: none; }
.lvr-item.done  { opacity: .75; }
.lvr-item.active { opacity: 1; background: var(--card); }
.lvr-item.active .lvr-name { font-weight: 700; color: var(--ink); }
.lvr-dot  { font-size: 1.25rem; flex-shrink: 0; width: 2rem; text-align: center; }
.lvr-name { font-size: .875rem; font-weight: 500; color: var(--mid); }
.lvr-pts  { font-size: .72rem; color: var(--dim); margin-top: .1rem; }
.lvr-info { flex: 1; }

/* Badge grid */
.bdg-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: .5rem; margin-bottom: .875rem;
}
@media (min-width: 480px) { .bdg-grid { grid-template-columns: repeat(5, 1fr); } }

.bdg {
  border-radius: .625rem; padding: .625rem .25rem;
  text-align: center; border: 1.5px solid var(--border);
  cursor: default;
}
.bdg-on  { background: var(--card); border-color: var(--border-md); }
.bdg-off { background: rgba(26,26,13,.03); opacity: .5; }
.bdg-ico  { font-size: 1.25rem; line-height: 1.2; }
.bdg-name { font-size: .6rem; font-weight: 600; color: var(--mid); margin-top: .2rem; }
.bdg-on .bdg-name { color: var(--ink); }

.sm-daily {
  background: rgba(245,197,24,.12);
  border-radius: .75rem; padding: .875rem 1rem;
  font-size: .875rem; color: var(--ink); margin-top: .5rem;
}

/* ══════════════════════════════════════
   RESPONSIVE — TABLET (640px+)
══════════════════════════════════════ */
@media (min-width: 640px) {
  .hero { padding: 3.5rem 2rem 3rem; }
  .hero-actions { flex-direction: row; flex-wrap: wrap; }
  .hero-card { margin-top: 2.5rem; }
  .tools-section { padding: 3rem 2rem; }
  .tools-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
  .why-section { padding: 4rem 2rem; }
  .world-strip { padding: 1rem 2rem; }
  .fach-nav-inner { padding: 0 2rem; }
}

/* ══════════════════════════════════════
   RESPONSIVE — DESKTOP (1024px+)
══════════════════════════════════════ */
@media (min-width: 1024px) {
  .hero {
    max-width: 1100px; margin: 0 auto;
    padding: 5rem 2.5rem 4rem;
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 4rem; align-items: center;
  }
  .hero-card { margin-top: 0; }
  .hero-actions { flex-direction: row; }
  .tools-section { max-width: 1100px; margin: 0 auto; padding: 5rem 2.5rem; }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  .why-section { padding: 5.5rem 2.5rem; }
  .why-inner { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; align-items: start; }
  .world-strip { justify-content: center; padding: 1rem; }
  .fach-nav-inner { padding: 0 2.5rem; }
  .nav-inner { padding: 1rem 2.5rem; }
}

/* ── Nav back link ── */
.nav-back {
  color: var(--mid); text-decoration: none;
  font-size: .875rem; font-weight: 600;
  display: none;
}
.nav-back:hover { color: var(--ink); text-decoration: underline; }
@media (min-width: 640px) { .nav-back { display: inline; } }

.tool-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 1rem;
  padding: 1.125rem;
  cursor: pointer; display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: box-shadow .15s, border-color .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
  gap: .625rem;
}
.tool-card:hover {
  box-shadow: 0 4px 18px rgba(26,26,13,.09);
  border-color: rgba(26,26,13,.2);
  transform: translateY(-1px);
}
.tool-card:active { transform: translateY(0); }
.tool-card-header { display: flex; align-items: flex-start; gap: .75rem; }
.tool-icon {
  font-size: 1.6rem; line-height: 1.2;
  flex-shrink: 0; width: 2.2rem; text-align: center;
}
.tool-chips { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .3rem; }
.tool-name {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem; font-weight: 700;
  color: var(--ink); line-height: 1.25;
}
.tool-desc {
  font-size: .855rem; color: var(--mid);
  line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.tool-card-footer {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-top: auto; padding-top: .375rem;
}
.card-arrow { color: var(--dim); font-size: 1rem; flex-shrink: 0; }
/* ── TOOL CARD KLASSEN PILLS ── */
.klassen-list {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: .25rem;
  padding: 0; margin: 0;
}
.kl-tag {
  display: inline-block;
  font-size: .65rem; font-weight: 700;
  color: var(--dim);
  background: rgba(26,26,13,.06);
  padding: .18rem .55rem; border-radius: 100px;
  letter-spacing: .03em;
}

/* ── FILTER BAR SCROLL FIX ── */
.filter-bar-wrap {
  position: relative; margin-bottom: 1.5rem;
}
.filter-bar-wrap::after {
  content: '';
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 3rem;
  background: linear-gradient(90deg, transparent, var(--bg));
  pointer-events: none;
}
.filter-bar {
  display: flex; gap: .375rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 3px;
  margin-bottom: 0; /* handled by wrapper */
  scroll-snap-type: x mandatory;
  padding-right: 2.5rem; /* space for fade */
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-btn {
  scroll-snap-align: start; flex-shrink: 0;
  padding: .5rem .875rem; min-height: 40px;
  font-size: .82rem; font-weight: 600;
  border-radius: 100px; white-space: nowrap;
}

/* Tool grid with group headers */
.tools-group-header {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: .625rem;
  padding: .25rem 0 .5rem;
  border-bottom: 1.5px solid var(--border);
  margin-top: 1rem;
}
.tools-group-header:first-child { margin-top: 0; }
.tools-group-icon { font-size: 1rem; }
.tools-group-label {
  font-family: 'Fraunces', serif;
  font-size: 1rem; font-weight: 700; color: var(--ink);
}
.tools-group-count {
  margin-left: auto; font-size: .75rem;
  color: var(--dim); font-weight: 500;
}

/* ══════════════════════════════════════
   AFFILIATE BLOCK (Geschichte-Tab)
══════════════════════════════════════ */
.affiliate-block {
  margin-top: 1.5rem;
  border-top: 1.5px solid var(--border);
  padding-top: 1.25rem;
}
.affiliate-label {
  font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--mid); margin-bottom: .75rem;
}
.affiliate-card {
  display: flex; gap: .875rem; align-items: center;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: .875rem; padding: .875rem 1rem;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.affiliate-card:hover {
  border-color: var(--orange);
  box-shadow: 0 2px 10px rgba(26,26,13,.07);
}
.affiliate-cover {
  font-size: 2rem; flex-shrink: 0;
  width: 44px; text-align: center;
}
.affiliate-title {
  font-weight: 700; font-size: .9rem;
  color: var(--ink); margin-bottom: .2rem;
  line-height: 1.35;
}
.affiliate-sub  { font-size: .8rem; color: var(--mid); margin-bottom: .25rem; }
.affiliate-hint { font-size: .65rem; color: var(--dim); }

/* ══════════════════════════════════════
   SHARE BUTTON
══════════════════════════════════════ */
.share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem; border-radius: 100px;
  border: 1.5px solid var(--border-md);
  background: none; cursor: pointer;
  font-family: inherit; font-size: .8rem; font-weight: 600;
  color: var(--mid); transition: all .15s;
  min-height: 40px;
}
.share-btn:hover { border-color: var(--ink); color: var(--ink); }
.share-btn:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
.share-row {
  display: flex; justify-content: flex-end;
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════
   SPIELPAUSE
══════════════════════════════════════ */
.game-hub {
  max-width: 680px; margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.game-hub-hero {
  text-align: center;
  background: var(--ink); color: var(--cream);
  border-radius: 1.25rem; padding: 2.5rem 1.5rem;
  margin-bottom: 1.5rem;
}
.game-hub-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: .75rem; }
.game-hub-title {
  font-family: 'Fraunces', serif;
  font-size: 2rem; font-weight: 900;
  letter-spacing: -.025em; margin-bottom: .5rem;
}
.game-hub-sub { color: rgba(250,247,242,.65); font-size: .95rem; }
.game-hub-pts {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(245,197,24,.15); border: 1px solid rgba(245,197,24,.3);
  border-radius: 100px; padding: .5rem 1.25rem;
  font-size: .9rem; font-weight: 700; color: var(--yellow-bg);
  margin-top: 1rem;
}

.game-grid {
  display: flex; flex-direction: column; gap: .875rem;
}
.game-card {
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 1rem; padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  text-decoration: none; color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.game-card:hover {
  border-color: var(--orange);
  box-shadow: 0 3px 14px rgba(26,26,13,.08);
}
.game-icon { font-size: 2.5rem; flex-shrink: 0; }
.game-title {
  font-family: 'Fraunces', serif;
  font-size: 1.05rem; font-weight: 700;
  margin-bottom: .2rem;
}
.game-desc { font-size: .85rem; color: var(--mid); line-height: 1.5; }
.game-cost {
  margin-left: auto; flex-shrink: 0;
  background: rgba(26,26,13,.07); border-radius: .5rem;
  padding: .35rem .75rem; font-size: .75rem; font-weight: 700;
  color: var(--mid); white-space: nowrap;
}
.game-cost.affordable { background: rgba(26,92,57,.1); color: var(--green); }

.game-frame-wrap {
  background: var(--ink); border-radius: 1rem;
  overflow: hidden; aspect-ratio: 4/3;
  margin-bottom: 1.25rem; position: relative;
}
.game-timer {
  position: absolute; top: .75rem; right: .75rem;
  background: rgba(0,0,0,.6); color: #fff;
  border-radius: .5rem; padding: .35rem .75rem;
  font-size: .875rem; font-weight: 700;
  font-family: 'Fraunces', serif;
  z-index: 10;
}
