/* =====================================================================
   Erstaunliches über das Auge (fakten.js): Reiter, Karten, Grafiken, Quiz,
   „Wusstest du?“ auf der Startseite. Farben aus dem Design Salbei (style.css).
   ===================================================================== */
.fakten { --fk-licht: #d4a93c; --fk-stroma: #dccfb3; position: relative; overflow: hidden; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fakten { --fk-licht: #f1dc93; --fk-stroma: #cdbf9f; } }
:root[data-theme="dark"] .fakten { --fk-licht: #f1dc93; --fk-stroma: #cdbf9f; }
.fakten > h2 { font-size: clamp(1.35rem, 5vw, 1.8rem); margin-top: .2rem; }
.fakten .lead { max-width: 62ch; }

/* Reiter */
.fk-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 14px -20px 16px; padding: 2px 20px 4px; scroll-padding: 0 20px; }
.fk-tabs::-webkit-scrollbar { display: none; }
.fk-tabs button { flex: 0 0 auto; font: 600 .9rem var(--f-body, inherit); min-height: 42px; padding: 8px 16px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text); }
.fk-tabs button:hover { border-color: var(--accent); }
.fk-tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.fk-tabs button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.fk-h { font-size: 1.12rem; margin: 0 0 4px; }
.fk-intro { color: var(--text-soft); margin: 0 0 12px; font-size: .95rem; }
.fk-hinweis { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); border-left: 4px solid var(--accent); font-size: .92rem; color: var(--text); }
.fk-cap { font-size: .8rem; color: var(--muted); margin: 6px 0 0; line-height: 1.4; }
.fk-src { font-size: .78rem; color: var(--muted); margin: 10px 0 0; line-height: 1.45; overflow-wrap: anywhere; }
.fk-src a, .fk-cap a { color: var(--accent-text, var(--accent)); }
.fk-wisch { font-size: .78rem; color: var(--muted); margin: 0 0 6px; text-align: right; }

/* Karten: am Handy wischbar, ab Tablet im Raster */
.fk-reihe { display: grid; grid-auto-flow: column; grid-auto-columns: 84%; gap: 12px; align-items: start; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 -20px; padding: 2px 20px 12px; scroll-padding: 0 20px; overscroll-behavior-x: contain; }
.fk-karte, .fk-flip { scroll-snap-align: start; }
.fk-karte { background: var(--bg-2); border-radius: 18px; padding: 16px; border: 1px solid var(--line); display: flex; flex-direction: column; }
.fk-karte h4 { font-size: 1.02rem; margin: 0 0 6px; line-height: 1.25; }
.fk-karte > p { margin: 4px 0; font-size: .94rem; line-height: 1.55; }
.fk-karte .fk-src { margin-top: auto; padding-top: 10px; }
.fk-karte:focus { outline: none; }
.fk-arzt { margin: 10px 0 0 !important; padding: 8px 10px; border-radius: 10px; background: var(--na-soft); border-left: 3px solid var(--na); font-size: .85rem !important; color: var(--text-soft); }
.fk-num { margin: 0 0 4px; color: var(--accent-text, var(--accent)); font-family: var(--f-head, inherit); font-size: 1.1rem; font-weight: 600; line-height: 1.1; }
.fk-num b { font-size: 2.3rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fk-num span { font-size: .9rem; color: var(--text-soft); font-weight: 600; }
@media (min-width: 720px) {
  .fk-reihe { grid-auto-flow: row; grid-auto-columns: auto; align-items: stretch; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin: 0; padding: 0; }
  .fk-wisch { display: none; }
}
@media (min-width: 1100px) { .fk-reihe { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Hervorheben nach Sprung von der Startseite */
.fk-hl { animation: fkHl 1.8s ease; }
@keyframes fkHl { 0%, 60% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 3px transparent; } }

/* Iris-Grafik */
.fk-iris { display: block; width: 100%; height: auto; }
.fk-iris.klein { width: 64px; } .fk-iris.mini { width: 34px; } .fk-iris.gross { width: min(190px, 52vw); margin: 0 auto; }
.fk-row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; justify-items: center; align-items: end; margin: 8px 0 4px; }
.fk-row3 > span { display: grid; justify-items: center; gap: 4px; }
.fk-row3 b { font-size: .74rem; color: var(--muted); font-weight: 600; }
.fk-paar { display: flex; gap: 4px; padding-bottom: 15px; }
.fk-teil, .fk-kf { position: relative; display: inline-block; }
.fk-teil i { position: absolute; inset: 6.25%; border-radius: 50%; background: conic-gradient(from 25deg, rgba(122, 74, 34, .9) 0 75deg, transparent 75deg);
  -webkit-mask: radial-gradient(circle, transparent 0 32%, #000 33%); mask: radial-gradient(circle, transparent 0 32%, #000 33%); }
.fk-kf::after { content: ""; position: absolute; inset: 5%; border-radius: 50%; border: 5px solid rgba(150, 128, 52, .9); box-shadow: inset 0 0 4px rgba(90, 110, 40, .8); }
.fk-kf .fk-iris.klein { width: 84px; }

/* Lichtstreuung am Himmel */
.fk-sky { display: block; width: 100%; height: auto; margin: 8px 0 4px; border-radius: 14px; }
.fk-svgtxt { font: 600 10px var(--f-body, system-ui, sans-serif); fill: var(--text-soft); }
.fk-sky .fk-svgtxt { fill: #1f3d5c; font-size: 13px; }
.fk-beam { stroke-dasharray: 10 12; animation: fkFluss 1.1s linear infinite; }
.fk-ray { stroke-dasharray: 7 7; animation: fkFluss 1s linear infinite; }
.fk-sky .fk-dot { animation: fkBlink 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes fkFluss { to { stroke-dashoffset: -22; } }
@keyframes fkBlink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* Experiment: Melanin-Regler */
.fakten .card { box-shadow: none; }
.fk-labor, .fk-groesse { background: var(--bg-2); border: 1px solid var(--line); border-radius: 20px; padding: 16px; margin: 0 0 16px; }
.fk-labor-kopf { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fk-labor-kopf h4 { margin: 0; font-size: 1.05rem; }
.fk-tag { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.fk-labor-grid { display: grid; gap: 12px; align-items: center; }
.fk-labor-iris .fk-iris circle:first-child { transition: fill .2s; }
.fk-schnitt { width: 100%; max-width: 480px; height: auto; display: block; margin: 0 auto; }
.fk-stroma { fill: var(--fk-stroma); }
.fk-schnitt .fk-svgtxt.l { fill: #3b2a1a; font-size: 11px; }
.fk-schnitt .fk-svgtxt.hell { fill: #f3e9dc; }
.fk-weiss { stroke: var(--fk-licht); }
.fk-mel circle { opacity: calc((var(--m, 0) - var(--k)) * 14); transition: opacity .2s; }
.fk-blau, .fk-blau-t { opacity: calc(1.15 - var(--m, 0) * 1.7); transition: opacity .2s; }
.fk-slider { display: grid; gap: 4px; margin-top: 12px; font-weight: 600; font-size: .92rem; }
.fk-slider input { width: 100%; accent-color: var(--accent); min-height: 32px; }
.fk-scale { display: flex; justify-content: space-between; font-size: .76rem; color: var(--muted); font-weight: 500; }
.fk-scale i { font-style: normal; }
.fk-labor-txt { margin: 8px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--card); font-size: .93rem; min-height: 3.2em; }
@media (min-width: 640px) { .fk-labor-grid { grid-template-columns: 210px 1fr; } }

/* Vererbung: Hauptschalter und Feinregler */
.fk-gene { margin: 8px 0 6px; padding: 12px; border-radius: 14px; background: var(--card); }
.fk-gene-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fk-schalter { display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: var(--text); background: none; border: 0; padding: 4px 0; cursor: pointer; min-height: 44px; }
.fk-schalter small { display: block; font-size: .78rem; color: var(--muted); }
.fk-sw { flex: 0 0 auto; width: 42px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .2s; }
.fk-sw i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.fk-schalter[aria-pressed="true"] .fk-sw { background: var(--accent); }
.fk-schalter[aria-pressed="true"] .fk-sw i { transform: translateX(18px); }
.fk-schalter:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.fk-regler { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 6px; margin: 10px 0; }
.fk-regler span { display: grid; gap: 3px; justify-items: center; }
.fk-regler span::before { content: ""; grid-area: 1 / 1; width: 10px; height: 34px; border-radius: 99px; background: var(--bg-2); }
.fk-regler i { grid-area: 1 / 1; align-self: end; width: 10px; height: calc(4px + var(--h, .5) * 30px); border-radius: 99px; background: var(--accent); transition: height .4s cubic-bezier(.3, 1.4, .5, 1); }
.fk-regler b { font-size: .62rem; color: var(--muted); font-weight: 700; letter-spacing: -.01em; }
.fk-wuerfel { font-size: .82rem; }
@media (min-width: 640px) and (max-width: 719px), (min-width: 1100px) { .fk-regler { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

/* Häufigkeiten als Balken */
.fk-bars { display: grid; gap: 6px; margin: 8px 0 2px; }
.fk-bar { display: grid; grid-template-columns: 76px 1fr 40px; align-items: center; gap: 8px; font-size: .84rem; }
.fk-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.fk-bar-t { height: 12px; border-radius: 99px; background: var(--card); overflow: hidden; }
.fk-bar-t i { display: block; height: 100%; width: calc(var(--p) * 2%); min-width: 3px; border-radius: 99px; background: var(--c); transition: width 1s cubic-bezier(.2, .8, .2, 1); }

/* Größenvergleich */
.fk-groesse svg { width: 100%; height: auto; display: block; }
.fk-boden { stroke: var(--line-strong); }
.fk-tier { cursor: pointer; }
.fk-tier circle { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; transition: fill .2s; transform-box: fill-box; transform-origin: 50% 100%; }
.fk-tier.on circle, .fk-tier:hover circle { fill: var(--accent); }
.fk-tier.on circle { stroke-width: 3; }
.fk-tierchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.fk-tierchips .chip { min-height: 36px; }
.fk-tierinfo { margin: 8px 0 0; font-size: .93rem; min-height: 1.5em; }

/* Augenhintergrund */
.fk-fundus { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto 14px; }
.fk-gefaess path { stroke-dasharray: 220; stroke-dashoffset: 0; }

/* Mythos-Karten zum Umdrehen */
.fk-flip { perspective: 1000px; min-height: 220px; }
.fk-flip:focus { outline: none; }
.fk-flip-in { display: grid; height: 100%; transition: transform .55s cubic-bezier(.3, .7, .3, 1); transform-style: preserve-3d; }
.fk-face { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 16px; border-radius: 18px;
  -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.fk-vorn { background: var(--hi, var(--accent)); color: #fff; cursor: pointer; position: relative; overflow: hidden; }
.fk-vorn::after { content: "?"; position: absolute; right: 14px; bottom: -.15em; font: 700 9rem/1 var(--f-head, inherit); color: rgba(255, 255, 255, .1); pointer-events: none; }
.fk-vorn > * { position: relative; z-index: 1; }
.fk-vorn .fk-mythos { font-family: var(--f-head, inherit); font-size: 1.22rem; line-height: 1.3; font-weight: 600; margin: 4px 0 auto; }
.fk-vorn .chip { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .5); color: #fff; font-weight: 600; }
.fk-hinten { background: var(--bg-2); border: 1px solid var(--line); transform: rotateY(180deg); }
.fk-hinten p { margin: 0; font-size: .92rem; line-height: 1.55; }
.fk-hinten .fk-src { margin-top: auto; }
.fk-flip.auf .fk-flip-in { transform: rotateY(180deg); }
.fk-badge { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 9px; border-radius: 99px; }
.fk-badge.my { background: rgba(255, 255, 255, .22); color: #fff; }
.fk-badge.ok { background: var(--ok-soft); color: var(--ok); }
.fk-dreh:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fk-vorn .fk-dreh:focus-visible { outline-color: #fff; }

/* Quiz */
.fk-quiz { background: var(--bg-2); border-radius: 20px; padding: 16px; border: 1px solid var(--line); max-width: 680px; }
.fk-qkopf { display: flex; align-items: center; gap: 10px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.fk-qbar { flex: 1; height: 6px; border-radius: 99px; background: var(--card); overflow: hidden; }
.fk-qbar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--accent); border-radius: 99px; transition: width .4s; }
.fk-qfrage { font-family: var(--f-head, inherit); font-size: 1.18rem; font-weight: 600; line-height: 1.3; margin: 12px 0; }
.fk-qa { display: grid; gap: 8px; }
.fk-qopt { font: inherit; font-size: .96rem; text-align: left; min-height: 50px; padding: 10px 14px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--text); transition: border-color .15s, background .15s; }
.fk-qopt:hover:not(:disabled) { border-color: var(--accent); }
.fk-qopt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fk-qopt:disabled { cursor: default; }
.fk-qopt.richtig { border-color: var(--ok); background: var(--ok-soft); color: var(--text); font-weight: 600; }
.fk-qopt.richtig::after { content: "  ✓"; color: var(--ok); }
.fk-qopt.falsch { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--card)); }
.fk-qerg:not(:empty) { margin-top: 12px; padding-top: 4px; }
.fk-qerg p { margin: 6px 0; }
.fk-qurteil { font-weight: 700; font-family: var(--f-head, inherit); font-size: 1.05rem; }
.fk-qurteil.ok { color: var(--ok); } .fk-qurteil.no { color: var(--text-soft); }
.fk-qerg .pill-btn, .fk-qende .pill-btn { margin-top: 10px; }
.fk-qende { text-align: center; padding: 10px 0; }
.fk-qende .fk-num b { font-size: 3rem; }

/* Startseite: „Wusstest du?“ */
.fk-teaser { display: grid; grid-template-columns: 46px 1fr 36px; gap: 12px; align-items: center; width: 100%; margin: 12px 0 8px; padding: 12px 12px 12px 14px;
  border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--text); font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.fk-teaser:hover { border-color: var(--accent); }
.fk-teaser:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.fk-t-eye { display: block; width: 46px; height: 46px; }
.fk-t-eye .fk-iris.mini { width: 46px; }
.fk-t-txt { font-size: .93rem; line-height: 1.4; }
.fk-t-txt b { font-family: var(--f-head, inherit); color: var(--accent-text, var(--accent)); margin-right: 2px; }
.fk-t-go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); font-weight: 700; }
.fk-t-eye .fk-pupille { transform-box: fill-box; transform-origin: center; animation: fkPupille 5s ease-in-out infinite; }
@keyframes fkPupille { 0%, 100% { transform: scale(1); } 45%, 55% { transform: scale(.72); } }

/* Bewegung nur, wenn erwünscht */
@media (prefers-reduced-motion: no-preference) {
  .fk-bars:not(.da) .fk-bar-t i { width: 0; }
  .fk-groesse:not(.da) .fk-tier circle { transform: scale(0); }
  .fk-groesse.da .fk-tier circle { animation: fkWachs .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * .14s); }
  .fk-fundus:not(.da) .fk-gefaess path { stroke-dashoffset: 220; }
  .fk-fundus.da .fk-gefaess path { animation: fkZeichne 1.6s ease both; animation-delay: var(--d, 0s); }
  .fk-anim { transition: transform .5s ease, opacity .5s ease; }
  .fk-anim:not(.da) { opacity: .4; transform: translateY(8px); }
}
@keyframes fkWachs { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes fkZeichne { from { stroke-dashoffset: 220; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .fakten *, .fk-teaser * { animation: none !important; transition: none !important; }
  .fk-hl { box-shadow: 0 0 0 3px var(--accent); }
}
