/* otzar Schreibtrainer — Stil in der otzar-Identität (Gold/Glas/Gentium).
   Nutzt die :root-Tokens aus style.css (--accent, --bg-card, --serif …). */

.tt-shell { max-width: 1100px; margin: 0 auto; }

.tt-controls {
  display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: center;
  margin: 1rem 0 1.25rem;
}
.tt-controls label { color: var(--fg-soft); font-size: .85rem; }
.tt-controls select {
  background: var(--bg-elev); color: var(--fg); border: 1px solid var(--line, #2a2933);
  border-radius: 8px; padding: .4rem .6rem; font: inherit;
}

/* Diktatzeile + Eingabe */
.tt-stage {
  background: var(--bg-card); border: 1px solid var(--line, #2a2933);
  border-radius: 14px; padding: 1.25rem 1.4rem; margin-bottom: 1rem;
  box-shadow: 0 1px 0 rgba(212,175,55,.12) inset;
}
.tt-target {
  font-family: var(--serif); font-size: 1.9rem; line-height: 1.7;
  min-height: 2.4em; letter-spacing: .01em; word-break: break-word;
}
.tt-target[dir="rtl"] { text-align: right; }
.tt-g { color: var(--fg-faint); border-radius: 3px; padding: 0 .02em; }
.tt-g.ok  { color: var(--accent-l); }
.tt-g.bad { color: #ff6b6b; background: rgba(255,107,107,.14); text-decoration: underline wavy #ff6b6b; }
.tt-g.cur { color: var(--fg-strong); background: rgba(212,175,55,.22);
  box-shadow: 0 0 0 1px var(--accent) inset; }

.tt-input {
  width: 100%; margin-top: .9rem; font-family: var(--serif); font-size: 1.25rem;
  background: var(--bg-elev); color: var(--fg); caret-color: var(--accent);
  border: 1px solid var(--line, #2a2933); border-radius: 10px; padding: .6rem .8rem;
}
.tt-input:focus { outline: none; border-color: var(--accent); }

.tt-bar { display: flex; justify-content: space-between; gap: 1rem;
  color: var(--fg-soft); font-size: .82rem; margin-top: .6rem; }
.tt-hint { color: var(--accent-l); }

/* Tastatur */
.tt-keyboard {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg-soft); border: 1px solid var(--line, #2a2933);
  border-radius: 14px; padding: 12px; user-select: none;
}
.tt-row { display: flex; gap: 6px; }
.tt-key {
  position: relative; flex: 1 1 0; min-width: 0; height: 46px;
  display: flex; align-items: flex-end; justify-content: center;
  background: var(--bg-elev); border: 1px solid var(--line, #2a2933);
  border-radius: 8px; padding: 4px 0 6px; color: var(--fg);
  transition: box-shadow .08s, border-color .08s, transform .05s;
}
.tt-cap { font-size: 1.05rem; line-height: 1; }
.tt-sh  { position: absolute; top: 3px; left: 5px; font-size: .62rem; color: var(--fg-faint); }
[dir="rtl"] .tt-sh { left: auto; right: 5px; }
.tt-key.tt-extra::after {
  content: "·"; position: absolute; top: 2px; right: 5px; color: var(--accent-2); font-weight: 700;
}

/* Finger-Farben (gedämpft, otzar-tauglich) */
.f-l5 { background: linear-gradient(180deg,#3a2230,var(--bg-elev)); }
.f-l4 { background: linear-gradient(180deg,#3a2c1f,var(--bg-elev)); }
.f-l3 { background: linear-gradient(180deg,#36331c,var(--bg-elev)); }
.f-l2 { background: linear-gradient(180deg,#203320,var(--bg-elev)); }
.f-r2 { background: linear-gradient(180deg,#1c3331,var(--bg-elev)); }
.f-r3 { background: linear-gradient(180deg,#1f2c3a,var(--bg-elev)); }
.f-r4 { background: linear-gradient(180deg,#272340,var(--bg-elev)); }
.f-r5 { background: linear-gradient(180deg,#33223a,var(--bg-elev)); }
.f-thumb, .f-none { background: var(--bg-elev); }

/* Nächste Taste */
.tt-key.next, .tt-key.next-shift {
  border-color: var(--accent); color: var(--fg-strong);
  box-shadow: 0 0 0 2px var(--accent) inset, 0 0 14px rgba(212,175,55,.4);
  transform: translateY(-1px);
}
.tt-key.next-shift::before {
  content: "⇧"; position: absolute; bottom: 3px; right: 5px;
  font-size: .6rem; color: var(--accent);
}
/* Diakritikum-Taste (Dead-Key / Niqqud) — abgesetzt in Cyan */
.tt-key.next-mod {
  border-color: var(--accent-2); color: var(--fg-strong);
  box-shadow: 0 0 0 2px var(--accent-2) inset, 0 0 12px rgba(0,212,170,.45);
  transform: translateY(-1px);
}
.tt-key.next-mod::before {
  content: "◆"; position: absolute; bottom: 2px; right: 4px;
  font-size: .55rem; color: var(--accent-2);
}

/* Legende */
.tt-legend { display: flex; flex-wrap: wrap; gap: .4rem .8rem; margin-top: .8rem;
  font-size: .72rem; color: var(--fg-soft); }
.tt-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.tt-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Eigener Text */
.tt-custom { margin-top: 1.4rem; }
.tt-custom textarea {
  width: 100%; min-height: 120px; font-family: var(--serif); font-size: 1rem;
  background: var(--bg-elev); color: var(--fg); border: 1px solid var(--line, #2a2933);
  border-radius: 10px; padding: .7rem .9rem; resize: vertical;
}
.tt-custom .tt-note { color: var(--fg-faint); font-size: .76rem; margin-top: .4rem; }

/* Kleiner Button + Lektions-Aktionen */
.tt-mini {
  background: var(--bg-elev); color: var(--fg); border: 1px solid var(--line, #2a2933);
  border-radius: 8px; padding: .38rem .7rem; font: inherit; font-size: .82rem; cursor: pointer;
}
.tt-mini:hover { border-color: var(--accent); color: var(--fg-strong); }
.tt-mini:disabled { opacity: .45; cursor: default; }
.tt-custom-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: .7rem; align-items: center; }

/* Statusleiste (Fehler / CPM / Zeit / Zeichen) */
.tt-status { display: flex; gap: .6rem; margin-bottom: 1rem; }
.tt-stat {
  flex: 1; background: var(--bg-card); border: 1px solid var(--line, #2a2933);
  border-radius: 12px; padding: .55rem .4rem; text-align: center;
}
.tt-stat b { display: block; font-family: "JetBrains Mono", monospace; font-size: 1.35rem;
  color: var(--accent-l); line-height: 1.1; }
.tt-stat span { font-size: .7rem; color: var(--fg-soft); text-transform: uppercase; letter-spacing: .04em; }

/* Tastatur-Wrapper + Bewegungspfad-Overlay */
.tt-kbwrap { position: relative; }
.tt-paths { position: absolute; inset: 12px; pointer-events: none; overflow: visible; }
.tt-path { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 4 4; opacity: .8;
  stroke-linecap: round; }

/* Home-Reihen-Markierung (Finger-Streifen oben auf der Taste) */
.tt-key.tt-home::before {
  content: ""; position: absolute; top: 4px; left: 28%; right: 28%; height: 3px;
  border-radius: 2px; background: currentColor; opacity: .55;
}
.f-l5 { color: #c87a93; } .f-l4 { color: #c89a6a; } .f-l3 { color: #c8c06a; }
.f-l2 { color: #7ec87e; } .f-r2 { color: #6ac8be; } .f-r3 { color: #6a9ec8; }
.f-r4 { color: #8a7ec8; } .f-r5 { color: #b87ec8; }
/* …aber Tastenbeschriftung bleibt in normaler Schriftfarbe */
.tt-cap, .tt-sh { color: var(--fg); }
.tt-cap.tt-spec { font-size: .62rem; color: var(--fg-faint); }

/* L/R-Trennlinie (mittig durch die Leertaste/Tastatur) */
.tt-keyboard { position: relative; }
.tt-keyboard::after {
  content: ""; position: absolute; top: 10px; bottom: 10px; left: 50%;
  border-left: 1px dashed rgba(255,255,255,.16); pointer-events: none;
}

/* AltGr-Hervorhebung */
.tt-key.next-alt {
  border-color: var(--accent-2); color: var(--fg-strong);
  box-shadow: 0 0 0 2px var(--accent-2) inset, 0 0 10px rgba(0,212,170,.35);
}

/* Optionen */
.tt-opts {
  border: 1px solid var(--line, #2a2933); border-radius: 12px; padding: .6rem 1rem 1rem;
  margin: 1.2rem 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem;
}
.tt-opts legend { color: var(--fg-soft); font-size: .8rem; padding: 0 .4rem; }
.tt-opts label { color: var(--fg); font-size: .88rem; display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.tt-opts input { accent-color: var(--accent); }

/* Legende-Marker */
.tt-leg-next i { background: var(--accent); }
.tt-leg-mod i { background: var(--accent-2); }

/* Perikopen-/Lektions-Liste (dedizierter Bereich, tipp10-Stil) */
.tt-lessons {
  background: var(--bg-card); border: 1px solid var(--line, #2a2933);
  border-radius: 14px; padding: .9rem 1rem 1rem; margin-bottom: 1.1rem;
}
.tt-lessons-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: .5rem; }
.tt-lessons-head h2 { margin: 0; font-size: 1.05rem; color: var(--fg-strong); }
.tt-lessons-sub { font-size: .74rem; color: var(--fg-soft); }
.tt-list { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow-y: auto;
  border: 1px solid var(--line, #2a2933); border-radius: 10px; }
.tt-lesson {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .8rem; cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,.05); color: var(--fg);
}
.tt-lesson:last-child { border-bottom: none; }
.tt-lesson:hover { background: var(--bg-elev); }
.tt-lesson.active { background: rgba(212,175,55,.16); box-shadow: inset 3px 0 0 var(--accent); }
.tt-li-ic { width: 1.2em; text-align: center; color: var(--fg-faint); font-size: .95rem; }
.tt-li-ic.done { color: var(--accent-2); }
.tt-li-ic.cur { color: var(--accent); }
.tt-li-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-li-del {
  background: none; border: none; color: var(--fg-faint); cursor: pointer; font-size: .9rem;
  padding: .1rem .4rem; border-radius: 6px; opacity: 0; transition: opacity .1s;
}
.tt-lesson:hover .tt-li-del { opacity: 1; }
.tt-li-del:hover { color: #ff6b6b; background: rgba(255,107,107,.12); }
.tt-add { margin-top: .8rem; }
.tt-add summary { cursor: pointer; color: var(--accent-l); font-size: .9rem; padding: .3rem 0; }
.tt-add[open] summary { margin-bottom: .5rem; }
.tt-add textarea {
  width: 100%; min-height: 110px; font-family: var(--serif); font-size: 1rem;
  background: var(--bg-elev); color: var(--fg); border: 1px solid var(--line, #2a2933);
  border-radius: 10px; padding: .7rem .9rem; resize: vertical;
}

@media (max-width: 720px) {
  .tt-target { font-size: 1.4rem; }
  .tt-key { height: 38px; }
  .tt-cap { font-size: .9rem; }
  .tt-stat b { font-size: 1.1rem; }
}
