/* Trainer — Oberfläche des Übungsprogramms */

.trainer-body { background: var(--bg); }

/* ---------- Modulkacheln ---------- */

.mod {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform .16s, box-shadow .2s, border-color .2s;
}
.mod:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c9d8f0; }
.mod .icon-box { font-size: 1.3rem; }
.mod h3 { margin: 0 0 8px; font-size: 1.1rem; }
.mod p { margin: 0 0 18px; color: var(--muted); font-size: .93rem; flex: 1; }

.mod-types {
  font-size: .8rem;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 8px;
  padding: 7px 11px;
  margin-bottom: 16px;
  align-self: flex-start;
}

.mod-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: .84rem;
  color: var(--muted);
}
.mod-best {
  margin-left: auto;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 3px 11px;
  border-radius: 999px;
}
.mod-best.empty { color: var(--muted); background: #f1f5f9; font-weight: 600; }

.exam-card {
  margin-top: 26px;
  background: var(--dark);
  color: #fff;
  border-radius: var(--radius);
  padding: 34px;
  display: flex;
  align-items: center;
  gap: 34px;
  flex-wrap: wrap;
}
.exam-card h3 { margin: 0 0 8px; font-size: 1.3rem; }
.exam-card p { margin: 0; color: #a9bdd6; max-width: 62ch; font-size: .95rem; }
.exam-card > div { flex: 1; min-width: 280px; }

/* ---------- Runner ---------- */

.runner {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--dark);
  color: #fff;
  display: flex;
  flex-direction: column;
}
.runner[hidden] { display: none; }

.runner-top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  flex-wrap: wrap;
}
.runner-meta { display: flex; flex-direction: column; min-width: 180px; }
.runner-title { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.runner-sub { font-size: .82rem; color: #8ba3c0; }

.runner-clock { display: flex; align-items: center; gap: 14px; flex: 1; max-width: 460px; }
.clock-bar { flex: 1; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.clock-bar span {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #38bdf8, #0b57d0);
  transition: width .2s linear;
}
.clock-bar span.warn { background: linear-gradient(90deg, #fbbf24, #dc2626); }
#clockText { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.1rem; min-width: 34px; text-align: right; }

.runner-abort {
  margin-left: auto;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .26);
  color: #cbd8e8;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
}
.runner-abort:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.runner-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 28px;
  overflow-y: auto;
}

.runner-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 28px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: .87rem;
  color: #8ba3c0;
  flex-wrap: wrap;
}

/* ---------- Aufgaben-Bausteine ---------- */

.task { width: min(860px, 100%); text-align: center; }
.task-question { font-size: 1.35rem; font-weight: 700; margin: 0 0 28px; line-height: 1.45; }
.task-question small { display: block; font-size: .85rem; font-weight: 600; color: #8ba3c0; margin-top: 8px; letter-spacing: .02em; }

.opts { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.opts.one { grid-template-columns: 1fr; }
.opts.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 620px) { .opts, .opts.three { grid-template-columns: 1fr; } }

.opt {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  padding: 16px 20px;
  border-radius: 14px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background .14s, border-color .14s, transform .1s;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  text-align: center;
}
.opt:hover { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .34); }
.opt:active { transform: scale(.985); }
.opt .key {
  font-size: .72rem;
  font-weight: 800;
  background: rgba(255, 255, 255, .16);
  border-radius: 6px;
  padding: 2px 7px;
  letter-spacing: .04em;
}
.opt.correct { background: rgba(22, 163, 74, .3); border-color: #16a34a; }
.opt.wrong { background: rgba(220, 38, 38, .3); border-color: #dc2626; }
.opt.picked { outline: 2px solid #7dd3fc; outline-offset: -2px; }

/* Zeichenraster (Konzentration) */
.symgrid {
  display: grid;
  gap: 7px;
  margin: 0 0 26px;
  justify-content: center;
}
.symgrid .cell {
  display: grid;
  place-items: center;
  width: clamp(30px, 4.6vw, 46px);
  height: clamp(30px, 4.6vw, 46px);
  border-radius: 9px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: clamp(.95rem, 2.1vw, 1.35rem);
  font-weight: 700;
  color: #e2e8f2;
  font-family: "SFMono-Regular", Consolas, monospace;
}
.symgrid.pick .cell { cursor: pointer; transition: background .12s, border-color .12s; }
.symgrid.pick .cell:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .4); }
.symgrid .cell.correct { background: rgba(22, 163, 74, .45); border-color: #16a34a; }
.symgrid .cell.wrong { background: rgba(220, 38, 38, .45); border-color: #dc2626; }

.target {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  vertical-align: middle;
  border-radius: 10px;
  background: rgba(125, 211, 252, .18);
  border: 1px solid rgba(125, 211, 252, .5);
  margin: 0 4px;
}

/* Abruf-Anzeige (Merkfähigkeit) */
.recall-sym { font-size: 5rem; line-height: 1; margin-bottom: 4px; }
.recall-word {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: #7dd3fc;
  margin-bottom: 12px;
}

.learn-table {
  width: min(520px, 100%);
  margin: 0 auto 26px;
  border-collapse: collapse;
  background: rgba(255, 255, 255, .06);
  border-radius: 14px;
  overflow: hidden;
}
.learn-table th, .learn-table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
  font-size: 1.05rem;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.learn-table th {
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #8ba3c0;
  font-weight: 600;
}
.learn-table td:first-child { font-weight: 700; letter-spacing: .05em; }
.learn-table tr:last-child td { border-bottom: none; }

.gauges {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 0 0 26px;
}
@media (max-width: 620px) { .gauges { grid-template-columns: repeat(2, 1fr); } }
.gauge {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  padding: 16px 12px;
}
.gauge .g-label { display: block; font-size: .76rem; text-transform: uppercase; letter-spacing: .09em; color: #8ba3c0; margin-bottom: 6px; }
.gauge .g-val { display: block; font-size: 1.45rem; font-weight: 800; color: #7dd3fc; font-variant-numeric: tabular-nums; }

/* Leseverstehen (Englisch) */
.reading {
  text-align: left;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .14);
  border-left: 3px solid #7dd3fc;
  border-radius: 12px;
  padding: 18px 22px;
  margin: 0 auto 24px;
  max-width: 660px;
  font-size: .97rem;
  line-height: 1.7;
  color: #dbe6f3;
}

.tech-svg { width: min(340px, 100%); height: auto; margin-bottom: 18px; }

/* Zeichenreihen (Konzentration) */
.rows { display: grid; gap: 14px; margin: 0 0 30px; }
.charrow {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(1.5rem, 4.4vw, 2.4rem);
  letter-spacing: .5em;
  padding: 16px 10px 16px 24px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  font-weight: 700;
}

/* Merkfähigkeit */
.pairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 26px; }
@media (max-width: 620px) { .pairs { grid-template-columns: repeat(2, 1fr); } }
.pair {
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  padding: 18px 12px;
}
.pair .sym { font-size: 2.2rem; line-height: 1.1; }
.pair .val { font-size: 1.5rem; font-weight: 800; color: #7dd3fc; font-variant-numeric: tabular-nums; }

.learn-bar {
  height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .16);
  overflow: hidden; margin-top: 8px;
}
.learn-bar span { display: block; height: 100%; background: #fbbf24; }

/* Würfelklappen (PPT) */
.ppt-wrap { display: grid; place-items: center; margin: 0 0 20px; }
.ppt-net { width: clamp(112px, 16vw, 148px); height: auto; }
.ppt-cube { width: 100%; max-width: 96px; height: auto; }

.opts.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .opts.four { grid-template-columns: repeat(2, 1fr); } }

.opt.visual { flex-direction: column; gap: 10px; padding: 16px 10px; }
.opt.visual > span:last-child { display: block; width: 100%; }

/* Wegfiguren (WFG) */
.wfg-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 0 0 16px;
  color: #8ba3c0;
  font-size: .92rem;
  font-weight: 600;
}
.wfg-letter {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border: 2px solid #fbbf24;
  border-radius: 12px;
  color: #fbbf24;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
}
.wfg-svg { width: min(540px, 100%); height: auto; margin: 0 0 22px; }

/* Canvas-Module */
.canvas-wrap { display: grid; place-items: center; margin: 0 0 26px; }
canvas { border-radius: 16px; }

.mt-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  min-height: 4.2rem;
  margin-bottom: 6px;
}
.mt-secondary {
  font-size: 3rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  min-width: 3rem;
  display: grid;
  place-items: center;
}
.mt-warn {
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .12em;
  padding: 12px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .05);
  color: rgba(255, 255, 255, .18);
  transition: background .1s, color .1s, border-color .1s;
}
.mt-warn.on {
  background: #dc2626;
  border-color: #f87171;
  color: #fff;
  animation: warnPulse .55s infinite alternate;
}
@keyframes warnPulse {
  from { box-shadow: 0 0 0 0 rgba(220, 38, 38, .7); }
  to { box-shadow: 0 0 0 12px rgba(220, 38, 38, 0); }
}
.mt-legend { display: flex; gap: 26px; justify-content: center; color: #8ba3c0; font-size: .88rem; flex-wrap: wrap; }
.mt-legend kbd {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
}

/* Countdown vor Modulstart */
.countdown { text-align: center; }
.countdown .big { font-size: 6rem; font-weight: 800; line-height: 1; letter-spacing: -.04em; }
.countdown p { color: #a9bdd6; max-width: 56ch; margin: 18px auto 0; }
.countdown h2 { margin: 0 0 6px; font-size: 1.6rem; }

/* ---------- Ergebnis ---------- */

.result-inner {
  margin: auto;
  width: min(760px, calc(100% - 40px));
  padding: 40px 0;
}
.result-inner h2 { font-size: 2rem; margin: 0 0 6px; letter-spacing: -.02em; }
.result-sub { color: #a9bdd6; margin: 0 0 30px; }

.score-ring { display: flex; align-items: center; gap: 28px; margin-bottom: 30px; flex-wrap: wrap; }
.score-num { font-size: 4rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.score-num small { font-size: 1.2rem; color: #8ba3c0; font-weight: 700; }
.verdict { flex: 1; min-width: 240px; color: #cbd8e8; }
.verdict strong { display: block; font-size: 1.1rem; color: #fff; margin-bottom: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 30px; }
@media (max-width: 620px) { .stat-grid { grid-template-columns: 1fr; } }
.stat {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 14px;
  padding: 18px;
}
.stat b { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1.2; }
.stat span { font-size: .84rem; color: #8ba3c0; }

.result-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; }
.result-table th, .result-table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid rgba(255, 255, 255, .12); font-size: .93rem; }
.result-table th { color: #8ba3c0; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.result-table td:last-child, .result-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

.result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
