/* Lernprogramm – gemeinsame Styles (mobile first, dunkles Theme) */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0; min-height: 100vh; background: #14161c; color: #ecf0f4;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[translate="no"] {}
button { font: inherit; cursor: pointer; border: none; border-radius: 12px; }
input, select { font: inherit; }

/* ---------- Trainer-Layout ---------- */
.app { max-width: 640px; margin: 0 auto; padding: 12px 12px 40px; }
.header { display: flex; gap: 12px; align-items: center; }
.head-text { flex: 1; min-width: 0; }
.head-small { font-size: .78rem; color: #9aa4b2; text-transform: none; letter-spacing: .3px; }
.head-title {
  font-size: 1.25rem; font-weight: 700; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; line-height: 1.25; margin: 2px 0;
}
.head-sub { font-size: .85rem; color: #aeb8c6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ring-wrap { position: relative; width: 58px; height: 58px; flex: 0 0 auto; user-select: none; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: #2c313c; stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--accent, #f0b429); stroke-width: 6; stroke-linecap: round;
  transition: stroke-dashoffset .5s ease; }
.ring-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; }

.card {
  background: #1d222c; border-radius: 20px; padding: 18px; margin-top: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.35); position: relative;
}
.card.shake { animation: shake .4s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-8px)} 40%{transform:translateX(8px)} 60%{transform:translateX(-5px)} 80%{transform:translateX(5px)} }
.card.fade-in { animation: fadein .3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none;} }

.q-label { font-size: .8rem; color: var(--accent, #f0b429); font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.q-text { font-size: clamp(15px, 6vw, 26px); font-weight: 600; margin: 8px 0 4px; overflow-wrap: break-word; text-align: center; }
.q-text.small-long { text-align: left; }
.q-task { font-size: .9rem; color: #b8c2d0; margin: 4px 0; overflow-wrap: break-word; }
.q-aufgabe { font-size: .95rem; color: #ccd5e0; margin: 6px 0; }
img.q-image { max-width: 100%; max-height: 220px; border-radius: 12px; margin: 8px 0; object-fit: contain; }
.img-placeholder { color: #9aa4b2; font-size: .9rem; padding: 24px 0; text-align: center; }

/* Akzent-Klassen (sieben Farbstile) */
.st-gold   { --accent: #f0b429; --accent-soft: rgba(240,180,41,.16); }
.st-green  { --accent: #4caf7d; --accent-soft: rgba(76,175,125,.16); }
.st-pink   { --accent: #ec6fae; --accent-soft: rgba(236,111,174,.16); }
.st-red    { --accent: #e35d5d; --accent-soft: rgba(227,93,93,.16); }
.st-teal   { --accent: #35b8b0; --accent-soft: rgba(53,184,176,.16); }
.st-purple { --accent: #9b7bf0; --accent-soft: rgba(155,123,240,.16); }
.st-satred { --accent: #ff4d3d; --accent-soft: rgba(255,77,61,.18); }

/* Antwort-Bereich */
.answer-area { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.answer-input {
  width: 100%; padding: 14px; font-size: 1.15rem; text-align: center;
  background: #262c38; color: #fff; border: 2px solid #3a4250; border-radius: 14px; outline: none;
}
.answer-input:focus { border-color: var(--accent, #f0b429); }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.options.one-col { grid-template-columns: 1fr; }
.opt-btn {
  padding: 14px 10px; background: #262c38; color: #ecf0f4; border: 2px solid #3a4250;
  border-radius: 14px; font-weight: 600; min-height: 52px; overflow-wrap: break-word;
  word-break: normal; overflow: hidden; text-align: center; line-height: 1.3;
}
.opt-btn.selected { border-color: var(--accent, #f0b429); background: var(--accent-soft, rgba(240,180,41,.16)); }
.opt-btn:disabled { opacity: .85; }
.opt-btn.right { border-color: #4caf7d; background: rgba(76,175,125,.25); }
.opt-btn.wrong { border-color: #e35d5d; background: rgba(227,93,93,.25); }

.artikel-btns { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.artikel-btns .opt-btn { font-size: 1.25rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #262c38; border: 2px solid #3a4250; border-radius: 999px; padding: 8px 14px;
  font-size: 1.02rem; min-height: 44px; display: inline-flex; align-items: center;
}
.chip.selected { border-color: var(--accent, #f0b429); background: var(--accent-soft, rgba(240,180,41,.16)); }
.chip.right { border-color: #4caf7d; background: rgba(76,175,125,.25); }

.badge {
  display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  font-weight: 700; margin: 12px auto 0; font-size: 1rem; width: fit-content; max-width: 100%;
}
.badge.ok { background: rgba(76,175,125,.2); color: #6fd59a; }
.badge.bad { background: rgba(227,93,93,.2); color: #f08a8a; }
.badge .right-answer { font-weight: 500; font-size: .95rem; }

.hint { color: #f0c674; margin-top: 10px; font-size: .95rem; }

.big-btn {
  margin-top: 14px; width: 100%; padding: 16px; font-size: 1.15rem; font-weight: 700;
  background: var(--accent, #f0b429); color: #14161c; border-radius: 16px;
}
.big-btn:disabled { opacity: .5; }
.big-btn.secondary { background: #2c3442; color: #ecf0f4; }
.small-btn { background: #2c3442; color: #ecf0f4; padding: 10px 16px; border-radius: 12px; font-weight: 600; }
.small-btn.danger { background: rgba(227,93,93,.2); color: #f08a8a; }

.help-btn {
  position: absolute; top: 10px; right: 12px; width: 42px; height: 42px; border-radius: 50%;
  background: #2c3442; color: var(--accent, #f0b429); font-size: 1.2rem; font-weight: 700;
}
.new-mark { display: inline-block; background: var(--accent, #f0b429); color: #14161c;
  border-radius: 999px; padding: 2px 12px; font-size: .78rem; font-weight: 700; margin-bottom: 8px; }

/* Ende-Bildschirm */
.end-title { text-align: center; font-size: 1.6rem; font-weight: 800; margin: 10px 0 4px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.tile { background: #262c38; border-radius: 16px; padding: 14px; text-align: center; }
.tile .v { font-size: 1.5rem; font-weight: 800; }
.tile .l { font-size: .78rem; color: #9aa4b2; margin-top: 4px; }
.save-line { text-align: center; color: #9aa4b2; margin-top: 14px; font-size: .95rem; }
.save-line.ok { color: #6fd59a; }

/* Dialog */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.66); display: flex;
  align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.dialog {
  background: #1d222c; border-radius: 20px; padding: 22px; width: 100%; max-width: 380px;
  box-shadow: 0 10px 40px rgba(0,0,0,.6); max-height: 90vh; overflow: auto;
}
.dialog h2 { margin: 0 0 12px; font-size: 1.2rem; }
.dialog input {
  width: 100%; padding: 12px; background: #262c38; border: 2px solid #3a4250;
  border-radius: 12px; color: #fff; outline: none; margin: 6px 0;
}
.dialog input:focus { border-color: var(--accent, #f0b429); }
.dialog .link-btn { background: none; color: #8fb7e8; padding: 8px 0; width: 100%; }
.err { color: #f08a8a; font-size: .9rem; margin-top: 6px; }

.code-box { width: 100%; height: 90px; background: #262c38; color: #d7dee8; border: 1px solid #3a4250;
  border-radius: 10px; padding: 8px; font-size: .7rem; word-break: break-all; resize: none; }

/* Sperrzeit / Pause / Hilfe / Reveal */
.cooldown-wrap, .pause-wrap { text-align: center; padding: 30px 10px; }
.cooldown-wrap h2, .pause-wrap h2 { font-size: 1.3rem; }
.countdown { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent, #f0b429); margin: 14px 0; }
.help-list { max-height: 50vh; overflow: auto; text-align: left; }
.help-list .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 4px; border-bottom: 1px solid #2c313c; }
.reveal-word { text-align: center; font-size: 2rem; font-weight: 800; margin: 18px 0; }

/* ---------- Allgemeine Seiten (Aufträge, Verwaltung, Auswertung) ---------- */
.page { max-width: 760px; margin: 0 auto; padding: 16px 14px 60px; }
.page.wide { max-width: 1100px; }
.page h1 { font-size: 1.4rem; margin: 0; }
.page .sub { color: #9aa4b2; font-size: .9rem; margin: 4px 0 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.pill { display: inline-block; border-radius: 999px; padding: 3px 12px; font-size: .78rem; font-weight: 700; }
.pill.open { background: rgba(240,180,41,.18); color: #f0b429; }
.pill.done { background: rgba(76,175,125,.18); color: #6fd59a; }
.pill.deferred { background: rgba(150,150,160,.18); color: #b8c2d0; }
.pill.manual { background: rgba(155,123,240,.18); color: #b9a5f5; }
.code-pill { font-family: ui-monospace, monospace; background: #262c38; border: 1px solid #3a4250;
  border-radius: 8px; padding: 2px 8px; font-size: .8rem; }
.list-card { background: #1d222c; border-radius: 16px; padding: 14px; margin: 10px 0; }
.list-card .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.muted { color: #9aa4b2; font-size: .85rem; }
.date-head { font-weight: 700; margin: 18px 0 4px; color: #c7d0dc; }
.spinner { width: 28px; height: 28px; border: 3px solid #3a4250; border-top-color: var(--accent, #f0b429);
  border-radius: 50%; animation: spin 1s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg);} }
table.data { width: 100%; border-collapse: collapse; font-size: .85rem; }
table.data th, table.data td { padding: 7px 8px; text-align: left; border-bottom: 1px solid #2c313c; white-space: nowrap; }
table.data th { cursor: pointer; user-select: none; color: #c7d0dc; }
table.data td.wrap { white-space: normal; }
.acc-pill { border-radius: 999px; padding: 2px 10px; font-weight: 700; color: #14161c; }
.kv-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 12px 0; }
.tabs { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.tab-btn { background: #262c38; color: #c7d0dc; padding: 10px 16px; border-radius: 12px; font-weight: 600; }
.tab-btn.active { background: var(--accent, #f0b429); color: #14161c; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #4caf7d;
  box-shadow: 0 0 8px #4caf7d; margin-left: 6px; }
.progressbar { background: #262c38; border-radius: 999px; height: 12px; overflow: hidden; }
.progressbar > div { height: 100%; background: var(--accent, #f0b429); border-radius: 999px; transition: width .4s; }
.progressbar.done > div { background: #4caf7d; }
form .field { margin: 10px 0; }
form label { display: block; font-size: .85rem; color: #b8c2d0; margin-bottom: 4px; }
form input, form select {
  width: 100%; padding: 11px; background: #262c38; border: 2px solid #3a4250;
  border-radius: 12px; color: #fff; outline: none;
}
form input:focus, form select:focus { border-color: var(--accent, #f0b429); }
.success { color: #6fd59a; margin: 8px 0; }
input[type="date"] { color-scheme: dark; }
.barchart { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin: 14px 0; overflow-x: auto; }
.barchart .bar { flex: 1; min-width: 10px; background: #3a4250; border-radius: 4px 4px 0 0; position: relative; }
.barchart .bar.today { background: var(--accent, #f0b429); }
.barchart .bar .val { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: .6rem; color: #9aa4b2; }
dialog { background: #1d222c; color: #ecf0f4; border: none; border-radius: 20px; padding: 20px;
  max-width: 560px; width: 92vw; max-height: 88vh; overflow: auto; }
dialog::backdrop { background: rgba(0,0,0,.6); }
