/* W668 Lernkino: Pult, Lernpfade, Auswertung. Alles lokal, ohne Speicher. */
.ka-lk-stamp, .ka-lk-qmark, .ka-lk-cluek { display: none; }

/* Foyer: zweiter Eingang */
html body .ka-lk-foyer { flex-direction: column; gap: 2px; padding: 9px 22px; white-space: normal; line-height: 1.25; background: rgba(5,9,18,.62); border-color: rgba(95,214,234,.45); }
html body .ka-lk-foyer b { font-size: 14px; color: var(--ink); letter-spacing: .01em; }
html body .ka-lk-foyer span { font-size: 11.5px; font-weight: 500; color: var(--ink2); }
html body .ka-lk-foyer:hover { border-color: var(--cyan); background: rgba(95,214,234,.08); }

/* Steuerleiste */
html body .ka-lk-barbtn { border-color: rgba(95,214,234,.42); }
html body .ka-lk-barbtn[aria-pressed="true"] { border-color: var(--cyan); color: #bff3fb; background: rgba(95,214,234,.12); }

/* Leinwand im Fragemodus */
.screen.ka-lk-q #meta, .screen.ka-lk-q #sent, .screen.ka-lk-q #z2 { display: none !important; }
.screen.ka-lk-q:not(.ka-lk-qn) #big { display: none !important; }
.screen.ka-lk-q .vis canvas, .screen.ka-lk-q .legend { opacity: 0; transition: opacity .25s ease; }
.screen.ka-lk-qn #head, .screen.ka-lk-qn #num { display: none !important; }
.screen.ka-lk-qn .ka-lk-qmark { display: block; animation: kaLkPulse 2.6s ease-in-out infinite; }
.screen.ka-lk-q .ka-lk-cluek { display: block; font-family: var(--f-data); font-size: max(10px, 1.75cqh); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); }
.screen.ka-lk-q #head { animation: kaLkIn .7s cubic-bezier(.2,.7,.2,1) both; }
.screen.ka-lk-rev #meta, .screen.ka-lk-rev #big, .screen.ka-lk-rev #sent, .screen.ka-lk-rev #z2 { animation: kaLkIn .75s cubic-bezier(.2,.7,.2,1) both; }
.screen.ka-lk-rev #big { animation-delay: .06s; }
.screen.ka-lk-rev #sent { animation-delay: .2s; }
.screen.ka-lk-rev #z2 { animation-delay: .32s; }

/* Fall-Stempel links auf der Leinwand */
.screen.ka-lk-q .ka-lk-stamp { display: grid; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -54%); width: min(46cqh, 80%); aspect-ratio: 1; place-content: center; justify-items: center; gap: .6cqh; text-align: center; pointer-events: none; }
.ka-lk-stamp .ka-lk-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px dashed rgba(224,184,102,.42); box-shadow: 0 0 0 1.4cqh rgba(224,184,102,.035), inset 0 0 6cqh rgba(95,214,234,.06); animation: kaLkSpin 28s linear infinite; }
.ka-lk-stamp .ka-lk-ring::before, .ka-lk-stamp .ka-lk-ring::after { content: ""; position: absolute; width: 1.1cqh; height: 1.1cqh; border-radius: 50%; background: var(--gold); top: -0.55cqh; left: calc(50% - .55cqh); box-shadow: 0 0 2cqh rgba(224,184,102,.8); }
.ka-lk-stamp .ka-lk-ring::after { top: auto; bottom: -0.55cqh; background: var(--cyan); box-shadow: 0 0 2cqh rgba(95,214,234,.8); }
.ka-lk-stamp .ka-lk-sk, .ka-lk-stamp .ka-lk-so { position: relative; font-family: var(--f-data); font-size: max(10px, 1.7cqh); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.ka-lk-stamp strong { position: relative; font-family: var(--f-display); font-weight: 600; font-size: max(44px, 17cqh); line-height: .9; color: var(--gold-ink); text-shadow: 0 0 5cqh rgba(224,184,102,.25); font-variant-numeric: lining-nums; }
.ka-lk-stamp.pop strong { animation: kaLkPop .6s cubic-bezier(.2,.9,.25,1.25) both; }

/* Das Pult */
.ka-lk-pult { position: fixed; z-index: 31; left: 50%; transform: translateX(-50%); bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 66px); width: min(900px, calc(100% - 32px)); display: grid; gap: 10px; padding: 12px 16px 14px; border-radius: 18px; background: linear-gradient(180deg, rgba(10,19,38,.94), rgba(4,8,17,.96)); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(224,184,102,.26); box-shadow: 0 26px 70px -20px rgba(0,0,0,.95), 0 0 0 1px rgba(255,255,255,.025) inset, 0 1px 0 rgba(224,184,102,.18) inset; color: var(--ink); font-family: var(--f-body); animation: kaLkRise .45s cubic-bezier(.2,.8,.2,1) both; }
.ka-lk-pult[hidden] { display: none; }
.ka-lk-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ka-lk-k { font-family: var(--f-data); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); white-space: nowrap; }
.ka-lk-path { font-family: var(--f-display); font-size: 17px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ka-lk-dots { display: inline-flex; gap: 5px; margin-left: auto; flex: none; }
.ka-lk-dots i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; transition: background .3s, border-color .3s, transform .3s; }
.ka-lk-dots i.cur { border-color: var(--gold); transform: scale(1.18); }
.ka-lk-dots i.ok { background: var(--gold); border-color: var(--gold); }
.ka-lk-dots i.no { background: transparent; border-color: var(--red); box-shadow: inset 0 0 0 2px rgba(255,95,90,.45); }
.ka-lk-dots i.sk { background: var(--line2); border-color: var(--muted); }
.ka-lk-sc { font-family: var(--f-data); font-size: 11.5px; color: var(--ink2); white-space: nowrap; flex: none; }
.ka-lk-x { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line2); background: transparent; color: var(--ink2); font-size: 18px; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; }
.ka-lk-x:hover { border-color: var(--muted); color: var(--ink); }
.ka-lk-body { display: grid; gap: 10px; }
.ka-lk-qt { margin: 0; font-family: var(--f-display); font-size: 22px; font-weight: 500; line-height: 1.15; text-wrap: balance; }
.ka-lk-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ka-lk-opt { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line2); background: rgba(12,22,42,.8); color: var(--ink); font: 600 14.5px/1.25 var(--f-body); text-align: left; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; position: relative; }
.ka-lk-opt span { min-width: 0; overflow-wrap: anywhere; }
.ka-lk-opt kbd { flex: none; width: 24px; height: 24px; border-radius: 7px; display: inline-grid; place-items: center; font: 600 11.5px var(--f-data); color: var(--gold-ink); border: 1px solid rgba(224,184,102,.4); background: rgba(224,184,102,.07); }
button.ka-lk-opt:hover { border-color: var(--gold); background: rgba(224,184,102,.08); transform: translateY(-1px); }
button.ka-lk-opt:focus-visible, .ka-lk-ticket:focus-visible, .ka-lk-skip:focus-visible, .ka-lk-x:focus-visible, .ka-lk-gloss summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.ka-lk-opts.done .ka-lk-opt { cursor: default; opacity: .55; }
.ka-lk-opts.done .ka-lk-opt.is-right { opacity: 1; border-color: var(--gold); background: rgba(224,184,102,.12); }
.ka-lk-opts.done .ka-lk-opt.is-right kbd { background: var(--gold); color: #191204; border-color: var(--gold); }
.ka-lk-opts.done .ka-lk-opt.is-wrong { opacity: 1; border-color: rgba(255,95,90,.7); background: rgba(255,95,90,.08); animation: kaLkShake .42s ease both; }
.ka-lk-opts.done .ka-lk-opt.is-wrong kbd { color: var(--red); border-color: rgba(255,95,90,.6); background: transparent; }
.res-ok .ka-lk-opt.is-right::after { content: ""; position: absolute; inset: -1px; border-radius: 12px; box-shadow: 0 0 0 0 rgba(224,184,102,.7); animation: kaLkRing .9s ease-out both; pointer-events: none; }
.ka-lk-aux { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ka-lk-skip { border: 0; background: none; color: var(--muted); font: 500 12.5px var(--f-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 4px 0; }
.ka-lk-skip:hover { color: var(--ink2); }
.ka-lk-gloss { font-size: 12.5px; color: var(--ink2); min-width: 0; }
.ka-lk-gloss summary { cursor: pointer; color: var(--ink2); list-style: none; display: inline-flex; gap: 6px; align-items: center; }
.ka-lk-gloss summary::-webkit-details-marker { display: none; }
.ka-lk-gloss summary::before { content: "+"; font-family: var(--f-data); color: var(--cyan); }
.ka-lk-gloss[open] summary::before { content: "−"; }
.ka-lk-gloss dl { margin: 8px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.ka-lk-gloss dl div { display: flex; gap: 8px; min-width: 0; }
.ka-lk-gloss dt { font-weight: 700; color: var(--ink); white-space: nowrap; }
.ka-lk-gloss dd { margin: 0; color: var(--muted); }
.ka-lk-verdict { margin: 0; font-size: 15px; color: var(--ink2); animation: kaLkIn .45s ease both; }
.ka-lk-verdict b { color: var(--ink); }
.res-ok .ka-lk-verdict b:first-child { color: var(--gold-ink); }
.res-no .ka-lk-verdict { color: #ffb3ae; }
.ka-lk-lesson { display: grid; gap: 3px; padding: 8px 13px; border-radius: 12px; border: 1px solid rgba(95,214,234,.22); border-left: 3px solid var(--cyan); background: rgba(95,214,234,.05); animation: kaLkIn .55s .12s ease both; }
.ka-lk-lesson p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink); }
.ka-lk-lesson a { font-size: 12.5px; font-weight: 600; color: var(--gold-ink); text-decoration: none; justify-self: start; }
.ka-lk-lesson a:hover { text-decoration: underline; text-underline-offset: 3px; }
.ka-lk-go { display: flex; justify-content: flex-end; }
.is-a .ka-lk-body { grid-template-columns: minmax(0, 1fr) auto; align-items: end; column-gap: 16px; }
.is-a .ka-lk-opts, .is-a .ka-lk-verdict { grid-column: 1 / -1; }
.is-a .ka-lk-lesson { grid-column: 1; }
.is-a .ka-lk-go { grid-column: 2; }
.is-a .ka-lk-opts .ka-lk-opt { padding: 5px 10px; font-size: 13px; }
.is-a .ka-lk-opts .ka-lk-opt kbd { width: 20px; height: 20px; }
.is-a .ka-lk-body { gap: 8px; }

/* Hinweis im normalen Film */
.ka-lk-toast { position: fixed; z-index: 31; left: 50%; transform: translateX(-50%); bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 68px); display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 16px; border-radius: 999px; background: rgba(5,9,18,.9); border: 1px solid rgba(95,214,234,.4); box-shadow: 0 20px 50px -18px rgba(0,0,0,.9); font-size: 13.5px; color: var(--ink); white-space: nowrap; max-width: calc(100% - 32px); animation: kaLkRise .45s cubic-bezier(.2,.8,.2,1) both; }
.ka-lk-toast[hidden] { display: none; }
html body .ka-lk-toast .btn { padding: 7px 13px; }

/* Auswahl und Auswertung */
.ka-lk-layer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: radial-gradient(70% 60% at 50% 50%, rgba(6,12,26,.6), rgba(1,3,8,.86)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: kaLkFade .3s ease both; }
.ka-lk-layer[hidden] { display: none; }
.ka-lk-panel { width: min(1060px, 100%); max-height: 100%; overflow: auto; overscroll-behavior: contain; padding: 22px 26px 20px; border-radius: 22px; background: linear-gradient(180deg, #0c1834, #060c1b 70%); border: 1px solid rgba(224,184,102,.3); box-shadow: 0 40px 120px -30px rgba(0,0,0,1), 0 1px 0 rgba(224,184,102,.25) inset; color: var(--ink); font-family: var(--f-body); animation: kaLkRise .45s cubic-bezier(.2,.8,.2,1) both; }
.ka-lk-ph { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ka-lk-h { margin: 6px 0 4px; font-family: var(--f-display); font-weight: 500; font-size: clamp(28px, 4.2vw, 44px); line-height: 1.04; text-wrap: balance; }
.ka-lk-sub { margin: 0; max-width: 64ch; font-size: 15px; line-height: 1.5; color: var(--ink2); }
.ka-lk-tickets { margin-top: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.ka-lk-ticket { --c: var(--gold); position: relative; display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 0; min-width: 0; padding: 0; border-radius: 14px; border: 1px solid var(--line2); background: linear-gradient(90deg, rgba(14,25,48,.95), rgba(8,15,30,.95)); color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; transition: border-color .2s, transform .2s, box-shadow .2s; }
.ka-lk-ticket::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c); }
.ka-lk-ticket:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 16px 40px -20px rgba(224,184,102,.5); }
.ka-lk-stub { align-self: stretch; display: grid; place-items: center; font-family: var(--f-display); font-size: 24px; font-weight: 600; color: var(--c); border-right: 1px dashed rgba(195,204,219,.22); position: relative; }
.ka-lk-stub::before, .ka-lk-stub::after { content: ""; position: absolute; right: -7px; width: 13px; height: 13px; border-radius: 50%; background: #060c1b; border: 1px solid var(--line2); }
.ka-lk-stub::before { top: -8px; } .ka-lk-stub::after { bottom: -8px; }
.ka-lk-tm { display: grid; gap: 3px; padding: 12px 12px 12px 14px; min-width: 0; }
.ka-lk-tm b { font-family: var(--f-display); font-size: 19px; font-weight: 600; line-height: 1.1; }
.ka-lk-tm span { font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.ka-lk-tc { padding: 0 14px 0 4px; font-family: var(--f-data); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink2); white-space: nowrap; }
.ka-lk-foot { margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.ka-lk-score { margin-top: 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; align-items: center; }
.ka-lk-score > strong { width: 150px; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: baseline; justify-content: center; padding-top: 44px; font-family: var(--f-display); font-size: 62px; font-weight: 600; color: var(--gold-ink); border: 1px solid rgba(224,184,102,.45); box-shadow: 0 0 0 10px rgba(224,184,102,.05), 0 0 60px -10px rgba(224,184,102,.35) inset; animation: kaLkPop .7s cubic-bezier(.2,.9,.25,1.25) both; }
.ka-lk-score > strong small { font-size: .38em; color: var(--muted); font-weight: 500; }
.ka-lk-score .ka-lk-dots { margin: 12px 0 0; }
.ka-lk-score .ka-lk-dots i.cur { transform: none; border-color: var(--line2); }
.ka-lk-score .ka-lk-dots i.cur.ok { border-color: var(--gold); }
.ka-lk-k2 { display: block; margin: 20px 0 8px; }
.ka-lk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ka-lk-chip { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line2); color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 600; background: rgba(12,22,42,.8); }
.ka-lk-chip:hover { border-color: var(--gold); color: var(--gold-ink); }
.ka-lk-acts { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
html body .ka-lk-acts .btn { white-space: normal; text-align: center; }
html.ka-lk-modal .ka-lk-pult, html.ka-lk-modal .ka-lk-toast { visibility: hidden; }

@keyframes kaLkIn { from { opacity: 0; transform: translateY(12px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes kaLkRise { from { opacity: 0; transform: translate(-50%, 18px); } to { opacity: 1; transform: translate(-50%, 0); } }
.ka-lk-panel { animation-name: kaLkPanel; }
@keyframes kaLkPanel { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes kaLkFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kaLkPop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
@keyframes kaLkSpin { to { transform: rotate(360deg); } }
@keyframes kaLkPulse { 0%, 100% { opacity: .75; text-shadow: 0 0 3cqh rgba(224,184,102,.15); } 50% { opacity: 1; text-shadow: 0 0 7cqh rgba(224,184,102,.45); } }
@keyframes kaLkShake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-2px); } }
@keyframes kaLkRing { from { box-shadow: 0 0 0 0 rgba(224,184,102,.7); } to { box-shadow: 0 0 0 14px rgba(224,184,102,0); } }

@media (max-width: 760px) {
  .ka-lk-pult { bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 58px); padding: 10px 12px 12px; gap: 8px; width: calc(100% - 24px); }
  .ka-lk-head .ka-lk-k, .ka-lk-head .ka-lk-path { display: none; }
  .ka-lk-dots { margin-left: 0; gap: 4px; }
  .ka-lk-dots i { width: 8px; height: 8px; }
  .ka-lk-sc { margin-left: auto; font-size: 11px; }
  .ka-lk-qt { font-size: 18px; }
  .ka-lk-opts { gap: 6px; }
  .ka-lk-opt { padding: 8px 6px; font-size: 13px; min-height: 48px; justify-content: center; text-align: center; hyphens: auto; }
  button.ka-lk-opt kbd { display: none; }
  html.ka-lk-on .screen .txt { justify-content: flex-start; padding-top: 5cqh; }
  .screen.ka-lk-q .ka-lk-stamp { top: 62%; width: min(34cqh, 62%); }
  .ka-lk-gloss dl { grid-template-columns: 1fr; }
  .is-a .ka-lk-opts { display: none; }
  .is-a .ka-lk-body { grid-template-columns: 1fr; }
  .is-a .ka-lk-lesson, .is-a .ka-lk-go { grid-column: 1; }
  .ka-lk-lesson p { font-size: 13.5px; }
  html body .ka-lk-go .btn { width: 100%; }
  .ka-lk-toast { bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + 58px); font-size: 12.5px; padding-left: 12px; }
  .ka-lk-toast > span { white-space: normal; line-height: 1.25; }
  .ka-lk-panel { padding: 18px 16px 16px; border-radius: 18px; }
  .ka-lk-tickets { grid-template-columns: 1fr; }
  .ka-lk-tm b { font-size: 17px; }
  .ka-lk-score { grid-template-columns: 1fr; gap: 14px; justify-items: start; }
  .ka-lk-score > strong { width: 110px; font-size: 46px; padding-top: 30px; }
  html body .bar .ka-lk-barbtn { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ka-lk-pult, .ka-lk-panel, .ka-lk-layer, .ka-lk-toast, .ka-lk-verdict, .ka-lk-lesson, .ka-lk-stamp .ka-lk-ring, .ka-lk-stamp.pop strong, .ka-lk-score > strong, .screen.ka-lk-rev #meta, .screen.ka-lk-rev #big, .screen.ka-lk-rev #sent, .screen.ka-lk-rev #z2, .screen.ka-lk-q #head, .screen.ka-lk-qn .ka-lk-qmark, .ka-lk-opts.done .ka-lk-opt.is-wrong, .res-ok .ka-lk-opt.is-right::after { animation: none !important; }
}
