/* Gemeinsames Layout für die Vokabeltrainer (Stil wie Chainsaw-Man-Trainer) */
:root { --acc: #ff6b35; --bg: #0d0d0d; --panel: #111; --line: #2a2a2a; --text: #f0ede6; --muted: #666; --green: #3ddc84; --red: #ff4136; --blue: #4488ff; --purple: #b48ad6; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: 'Courier New', monospace; min-height: 100vh; -webkit-text-size-adjust: 100%; }
button { font-family: inherit; }

.header { background: #111; border-bottom: 3px solid var(--acc); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; position: sticky; top: 0; z-index: 10; }
.header-title { font-size: 17px; font-weight: bold; color: var(--acc); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-title a { color: var(--acc); text-decoration: none; margin-right: 6px; }
.header-sub { font-size: 11px; color: #555; text-align: right; }

.container { max-width: 560px; margin: 0 auto; padding: 18px 16px; }
.screen { display: none; }
.screen.active { display: block; }

/* Start */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.stat-box { border-radius: 8px; padding: 11px 4px; text-align: center; border: 2px solid; }
.stat-num { font-size: 22px; font-weight: bold; }
.stat-label { font-size: 10px; color: var(--muted); margin-top: 2px; }
.progress-bar-wrap { margin-bottom: 18px; }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: #555; margin-bottom: 5px; }
.progress-bar { height: 5px; background: #1a1a1a; border-radius: 4px; }
.progress-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--acc), var(--green)); transition: width .5s; }
.section-label { font-size: 11px; color: #555; text-transform: uppercase; letter-spacing: 1px; margin: 4px 0 10px; }
.mode-btn { width: 100%; padding: 13px 16px; background: var(--panel); border: 2px solid var(--line); border-radius: 8px; color: var(--text); cursor: pointer; text-align: left; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; transition: border-color .2s; }
.mode-btn:hover { border-color: color-mix(in srgb, var(--acc) 50%, transparent); }
.mode-btn.hl { border-color: color-mix(in srgb, var(--acc) 60%, transparent); }
.mode-btn:disabled { opacity: .45; cursor: default; }
.mode-btn-title { font-weight: bold; margin-bottom: 2px; }
.mode-btn-sub { font-size: 11px; color: #555; }
.badge { border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: bold; display: inline-block; white-space: nowrap; border: 1px solid; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.btn { padding: 7px 12px; border-radius: 4px; border: 2px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; transition: all .2s; }
.btn.active { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 14%, transparent); color: var(--acc); }
.btn-right { margin-left: auto; }
.footer-txt { margin-top: 14px; text-align: center; font-size: 11px; color: #333; }
.reset-link { display: block; margin: 10px auto 0; background: none; border: none; color: #3a3a3a; font-size: 11px; cursor: pointer; text-decoration: underline; }

/* Szenen */
.top-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.back-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px 0; }
.top-title { color: var(--acc); font-weight: bold; font-size: 13px; }
.top-meta { font-size: 12px; color: #555; }
.hint-txt { color: #555; font-size: 12px; margin-bottom: 14px; }
.szene-btn { display: flex; align-items: center; justify-content: space-between; padding: 12px; margin-bottom: 8px; border-radius: 8px; border: 2px solid var(--line); background: var(--panel); cursor: pointer; transition: all .2s; width: 100%; text-align: left; color: inherit; }
.szene-btn.active { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 7%, transparent); }
.szene-num { width: 32px; height: 32px; border-radius: 6px; background: #1a1a1a; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: bold; color: #444; flex-shrink: 0; }
.szene-btn.active .szene-num { background: var(--acc); color: #fff; }
.szene-info { margin-left: 12px; flex: 1; min-width: 0; }
.szene-name { font-size: 13px; color: var(--muted); }
.szene-btn.active .szene-name { color: var(--text); font-weight: bold; }
.szene-count { font-size: 11px; color: #555; margin-top: 2px; }
.szene-check { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #333; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; flex-shrink: 0; margin-left: 8px; }
.szene-btn.active .szene-check { background: var(--acc); border-color: var(--acc); }
.confirm-row { display: flex; gap: 10px; margin-top: 12px; }
.confirm-btn { flex: 1; padding: 12px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.all-select-btn { background: transparent; border: 2px solid #333; color: #888; }
.confirm-ok { background: var(--acc); border: none; color: #fff; font-weight: bold; }

/* Lernen */
#screen-learn .container { padding-bottom: 110px; }
.progress-top { display: flex; justify-content: space-between; font-size: 11px; margin-bottom: 5px; }
.progress-thin { height: 3px; background: #1a1a1a; border-radius: 2px; margin-bottom: 12px; }
.progress-thin-fill { height: 100%; background: linear-gradient(90deg, var(--acc), var(--red)); border-radius: 2px; transition: width .3s; }
.badges-row { margin-bottom: 10px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.b-vokabel { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 50%, transparent); background: color-mix(in srgb, var(--acc) 12%, transparent); }
.b-phrase { color: var(--blue); border-color: #4488ff66; background: #4488ff14; }
.b-grammatik { color: var(--purple); border-color: #b48ad666; background: #b48ad614; }
.b-plain { color: #777; border-color: #333; background: transparent; font-weight: normal; }

.card { border: 2px solid var(--line); border-radius: 10px; background: var(--panel); padding: 30px 18px; text-align: center; cursor: pointer; min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; user-select: none; }
.card.flipped { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 5%, #111); box-shadow: 0 0 24px color-mix(in srgb, var(--acc) 18%, transparent); cursor: default; padding: 20px 18px; min-height: 0; }
.card-main { font-weight: bold; letter-spacing: 1px; line-height: 1.3; word-break: break-word; }
.card-hint { font-size: 11px; color: #3a3a3a; margin-top: 12px; }
.card-q { font-size: 13px; color: #888; margin-bottom: 8px; line-height: 1.4; word-break: break-word; }
.card-a { font-weight: bold; color: var(--acc); line-height: 1.35; word-break: break-word; }
.card-a.long { font-size: 14px; font-weight: normal; color: var(--text); text-align: left; line-height: 1.55; }

.ctx { margin-top: 10px; padding: 12px 14px; border-radius: 8px; background: #141008; border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent); font-size: 13px; line-height: 1.55; }
.ctx-head { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: color-mix(in srgb, var(--acc) 75%, #888); margin-bottom: 6px; }
.ctx-jp { color: var(--text); }
.ctx-n { display: inline-block; min-width: 2.4em; color: #555; font-size: 11px; }
.ctx-jp mark { background: color-mix(in srgb, var(--acc) 25%, transparent); color: var(--acc); border-radius: 3px; padding: 0 2px; }
.ctx-de { margin-top: 6px; color: #998f80; font-style: italic; }
.ctx-ex { margin-top: 6px; color: #777; font-size: 12px; }

.info-box { margin-top: 10px; border-radius: 8px; background: #0a0f1a; border: 1px solid #2a3a5a; font-size: 13px; line-height: 1.6; }
.info-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; cursor: pointer; color: #7f9cc8; font-size: 12px; }
.info-text { color: #aabbd0; padding: 0 14px 12px; }
.info-box.closed .info-text { display: none; }

.action-bar { position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, var(--bg) 22%); padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); z-index: 20; }
.action-inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.action-btn { flex: 1; padding: 15px 8px; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: bold; border: 2px solid; }
.btn-wrong { background: #1a0808; border-color: var(--red); color: var(--red); }
.btn-right-action { background: #081a08; border-color: var(--green); color: var(--green); }
.btn-flip { background: color-mix(in srgb, var(--acc) 14%, #111); border-color: var(--acc); color: var(--acc); }
.action-btn small { display: block; font-size: 10px; font-weight: normal; opacity: .75; margin-top: 2px; }

.done-box { text-align: center; border: 2px solid var(--acc); border-radius: 12px; padding: 40px 24px; background: var(--panel); margin-top: 30px; }
.done-emoji { font-size: 44px; margin-bottom: 12px; }
.done-title { font-size: 20px; font-weight: bold; color: var(--acc); margin-bottom: 8px; }
.done-sub { color: var(--muted); font-size: 14px; margin-bottom: 22px; line-height: 1.5; }
.done-btns { display: flex; flex-direction: column; gap: 10px; }
.empty-box { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 14px; line-height: 1.6; }
@media (max-width: 480px) { .header-sub { display: none; } .header-title { font-size: 16px; } }
.card-kanji { font-family: 'Hiragino Sans','Yu Gothic','Noto Sans JP',sans-serif; font-size: 28px; color: color-mix(in srgb, var(--acc) 45%, #fff); margin-top: 8px; }
.card-kanji.small { font-size: 20px; margin: -2px 0 8px; }
.ask-btn { width: 100%; margin-top: 10px; padding: 11px; border-radius: 8px; background: transparent; border: 1px dashed #3a3a3a; color: #8a8a8a; font-size: 13px; cursor: pointer; }
.ask-btn:hover { border-color: var(--acc); color: var(--acc); }
.ask-toast { display: none; margin-top: 6px; font-size: 11px; color: #666; text-align: center; line-height: 1.4; }
