/* Tastenblitz – Tipp-Spiel (eigene Umsetzung). Nur Klassen, keine Inline-Stile (CSP). */
body.g-tastenblitz { --acc: #ae3ec9; }
.tb-main { position: relative; background: #0f0b1e; color: #e9e6f5; padding: 10px max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
html.fr-app .tb-main { justify-content: flex-start; }
.tb-app { width: min(100%, 940px); flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; margin: 0 auto; }

.tb-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; font-size: 13px; color: #a9a3c4; flex: none; }
.tb-kopf #tbStufe { font-weight: 700; color: #d9b8ff; }
.tb-werte { display: flex; gap: 14px; }
.tb-werte b { color: #fff; font-size: 19px; font-variant-numeric: tabular-nums; }
.tb-fort { height: 5px; background: #2a2342; border-radius: 3px; overflow: hidden; flex: none; }
.tb-fort i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .08s linear; }

.tb-feld { position: relative; flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 14px; }
.tb-box { position: relative; flex: 1 1 auto; min-height: 110px; overflow-x: hidden; overflow-y: auto; background: #1a1430; border-radius: 14px; padding: 14px 18px; cursor: text; box-shadow: inset 0 0 0 2px #2c2450; overscroll-behavior: contain; }
.tb-box.fokus { box-shadow: inset 0 0 0 2px var(--acc); }
.tb-text { font: 500 clamp(18px, 2.7vw, 28px)/1.65 ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace; white-space: pre-wrap; overflow-wrap: break-word; color: #6f6889; transition: filter .25s; user-select: none; }
.tb-box.verdeckt .tb-text { filter: blur(8px); }
.tb-text span { border-radius: 3px; }
.tb-text span.ok { color: #f4f1ff; }
.tb-text span.falsch { color: #fff; background: #e03131; }
.tb-text span.geist { box-shadow: inset 0 -3px 0 rgba(255, 212, 59, .75); }
.tb-text span.cur { background: rgba(174, 62, 201, .35); box-shadow: inset 0 -3px 0 var(--acc); color: #fff; }
.tb-box.blink .tb-text span.cur { animation: tbBlink 1s steps(1) infinite; }
@keyframes tbBlink { 50% { box-shadow: none; } }
.tb-in { position: absolute; left: 0; top: 0; width: 2px; height: 2px; opacity: 0; border: 0; padding: 0; margin: 0; resize: none; font-size: 16px; color: transparent; background: transparent; caret-color: transparent; }
.tb-cd { position: absolute; inset: 0; display: grid; place-items: center; font: 900 clamp(64px, 15vw, 130px)/1 ui-monospace, Consolas, 'Courier New', monospace; color: #ffd43b; pointer-events: none; text-shadow: 0 6px 24px rgba(0, 0, 0, .6); }
.tb-cd[hidden] { display: none; }
.tb-cd.los { color: #51cf66; animation: tbWeg .8s ease-out forwards; }
.tb-cd.puls { animation: tbPuls .8s ease-out; }
@keyframes tbPuls { from { transform: scale(1.35); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@keyframes tbWeg { from { transform: scale(1); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

.tb-unter { display: flex; align-items: center; justify-content: center; gap: 10px; flex: none; min-height: 22px; }
.tb-hinweis { margin: 0; font-size: 13px; color: #8e87a8; text-align: center; }
.tb-hinweis.warn { color: #ffd43b; font-weight: 700; }
.tb-fertig { display: none; padding: 7px 14px; }
.tb-unter .fr-btn { white-space: nowrap; font-size: 14px; }
.tb-unter .fr-btn.tb-hoeren { padding: 7px 14px; background: #2a2342; color: #e9e6f5; }
.tb-hoeren[hidden] { display: none; }
/* Diktat: noch nicht Geschriebenes bleibt unsichtbar, nur die Schreibmarke ist zu sehen */
.tb-box.diktat .tb-text span:not(.ok):not(.falsch):not(.cur) { display: none; }
.tb-box.diktat .tb-text span.cur { color: transparent; }@media (pointer: coarse) { .tb-fertig.zeigen { display: inline-block; } }

/* Bildschirmtastatur mit Fingerfarben (nur am Computer) */
.tb-kb { margin-top: auto; display: flex; flex-direction: column; gap: 5px; align-items: center; flex: none; user-select: none; padding-bottom: 4px; }
.tb-kr { display: flex; gap: 5px; }
.tb-k { --fc: #5c5478; position: relative; width: clamp(28px, 4.4vw, 48px); height: clamp(28px, 4.2vw, 44px); border-radius: 7px; display: grid; place-items: center; font: 600 13px/1 system-ui, sans-serif; color: #cfc9e6; background: #221b3a; border-bottom: 3px solid var(--fc); }
.tb-k.weit { width: clamp(46px, 7.4vw, 82px); font-size: 11px; }
.tb-k.leer { width: clamp(170px, 32vw, 320px); }
.tb-k.home::after { content: ''; position: absolute; bottom: 6px; width: 10px; height: 2px; border-radius: 1px; background: #cfc9e6; }
.tb-k.an { background: var(--fc); color: #120d22; transform: translateY(1px); }
.tb-k.f0 { --fc: #ff6b6b; } .tb-k.f1 { --fc: #ffa94d; } .tb-k.f2 { --fc: #ffd43b; } .tb-k.f3 { --fc: #69db7c; }
.tb-k.f4 { --fc: #38d9a9; } .tb-k.f5 { --fc: #4dabf7; } .tb-k.f6 { --fc: #9775fa; } .tb-k.f7 { --fc: #f783ac; }
@media (pointer: coarse), (max-height: 600px), (max-width: 620px) { .tb-kb { display: none; } }

/* Menü und Ergebnis */
.tb-over { position: absolute; inset: 0; z-index: 10; background: rgba(12, 9, 26, .97); display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 10px; padding: 14px max(12px, env(safe-area-inset-left)); overflow: auto; text-align: center; }
.tb-over[hidden] { display: none; }
.tb-over h1 { margin: 0; font: 900 clamp(30px, 7vw, 48px)/1 'Courier New', monospace; color: #ffd43b; letter-spacing: .05em; }
.tb-sub { margin: 0; color: #bdb6d6; font-size: 14px; }
.tb-stufen { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; width: min(100%, 760px); }
.tb-st { background: #1f1838; border: 2px solid #2f2752; color: #eee; border-radius: 12px; padding: 8px 9px; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 2px; font: inherit; min-width: 0; }
.tb-st b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-st small { color: #9b94b5; font-size: 11px; }
.tb-st .s { color: #ffd43b; letter-spacing: 1px; font-size: 13px; }
.tb-st .s i { font-style: normal; color: #3e355d; }
.tb-st.an { border-color: var(--acc); background: #2c1f48; }
.tb-st.dk { border-style: dashed; }
.tb-st.dk.an { border-style: solid; }
.tb-gruppe { grid-column: 1 / -1; margin: 4px 0 -2px; text-align: left; font: 700 12px/1.2 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: #9b94b5; }
.tb-gruppe:first-child { margin-top: 0; }
.tb-st:focus-visible { outline: 3px solid var(--acc); outline-offset: 2px; }
.tb-info { color: #e3ddf5; font-size: 14px; max-width: 560px; margin: 0; min-height: 20px; }
.tb-regel { color: #8e87a8; font-size: 12px; margin: 0; max-width: 560px; }
.tb-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.tb-btns .fr-btn.alt { background: #2a2342; color: #e9e6f5; }
.tb-punkte { font: 900 clamp(46px, 11vw, 76px)/1 ui-monospace, Consolas, 'Courier New', monospace; color: #fff; }
.tb-punkte small { display: block; font: 600 13px/1.4 system-ui, sans-serif; color: #9b94b5; }
.tb-sterne { font-size: clamp(26px, 7vw, 36px); color: #ffd43b; letter-spacing: 6px; line-height: 1; }
.tb-sterne i { font-style: normal; color: #3a3157; }
.tb-zahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 580px); }
.tb-zahlen div { background: #1f1838; border-radius: 10px; padding: 8px 4px; }
.tb-zahlen b { display: block; font-size: 20px; color: #fff; font-variant-numeric: tabular-nums; }
.tb-zahlen small { color: #9b94b5; font-size: 11px; }
.tb-tipp { color: #cfc9e6; font-size: 13px; margin: 0; max-width: 560px; }
.tb-muenz { color: #ffd43b; font-weight: 700; margin: 0; min-height: 18px; font-size: 14px; }
@media (max-width: 620px) {
  .tb-stufen { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tb-st { padding: 6px 8px; }
  .tb-zahlen { grid-template-columns: repeat(2, 1fr); }
  .tb-werte { gap: 10px; } .tb-werte b { font-size: 16px; }
  .tb-box { padding: 10px 12px; }
  .tb-text { font-size: 17px; line-height: 1.6; }
  .tb-over { gap: 7px; }
}
