/* ============================================================
   Hanzi schreiben im VocabBoss-Design (03.12.2026, Entwurf „Hanzi-App – neues Design“)
   Gilt im Fenster von VocabBoss (#hzwPanel) und in der Hanzi-App (/hanzi/).
   Markup: hanziWrite.js hzwRenderSetup / hzwRenderWrite / hzwRenderDone (Klassen .hzr-…)
   ============================================================ */
.hzr { --hzr-ink: #0B1E3F; --hzr-mut: #4A5878; --hzr-card: #FFFFFF; --hzr-line: #D5DEEC; --hzr-soft: #F2F6FC; --hzr-blue: #1E6FE8;
  display: flex; flex-direction: column; gap: 12px; color: var(--hzr-ink); font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; text-align: start; }
.night .hzr { --hzr-ink: #EEF2FF; --hzr-mut: #AEBBD6; --hzr-card: #16213A; --hzr-line: #2E3D5E; --hzr-soft: #0E1628; }
#hzwContent h2.hzr-title { font-family: Fredoka, Inter, sans-serif; font-weight: 600; margin: 0 0 12px; }
.hzr-card { background: var(--hzr-card); border: 1px solid var(--hzr-line); border-radius: 20px; padding: 16px; box-sizing: border-box; }

/* Fortschritt */
.hzr-prog { display: flex; gap: 14px; align-items: center; }
.hzr-ring { width: 84px; height: 84px; flex: none; border-radius: 50%; background: conic-gradient(#22A35A calc(var(--p) * 1%), #E3EAF5 0); display: flex; align-items: center; justify-content: center; }
.night .hzr-ring { background: conic-gradient(#2FBF6B calc(var(--p) * 1%), #2A3858 0); }
.hzr-ring > div { width: 64px; height: 64px; border-radius: 50%; background: var(--hzr-card); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.hzr-ring b { font-family: Fredoka, Inter, sans-serif; font-size: 22px; line-height: 1; color: var(--hzr-ink); }
.hzr-ring span { font-size: 11px; color: var(--hzr-mut); }
.hzr-prog-t { flex: 1; min-width: 0; }
.hzr-kicker { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #1C7C45; }
.night .hzr-kicker { color: #7FE0A6; }
.hzr-prog-h { font-family: Fredoka, Inter, sans-serif; font-size: 19px; font-weight: 600; margin: 2px 0 6px; }
.hzr-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.hzr-pill { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.hzr-pill-red { background: #FDECEC; color: #B3261E; }
.hzr-pill-gold { background: #FFF1D6; color: #8A4B00; }
.night .hzr-pill-red { background: #4A2026; color: #FFB4A8; }
.night .hzr-pill-gold { background: #4A3610; color: #FFC85C; }
.hzr-intro { margin: 0; font-size: 13px; line-height: 1.45; color: var(--hzr-mut); }

/* Schritte */
.hzr-steps { display: flex; flex-direction: column; gap: 16px; }
.hzr-step-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.hzr-step-n { width: 24px; height: 24px; border-radius: 50%; background: var(--hzr-blue); color: #FFFFFF; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hzr-sub { font-size: 12px; font-weight: 700; color: var(--hzr-mut); margin: 8px 0 6px; }
.hzr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hzr-chip { min-height: 38px; min-width: 48px; padding: 0 13px; border-radius: 999px; border: 1.5px solid #B0B0B8; background: var(--hzr-card); color: var(--hzr-ink); font: 600 14px Inter, system-ui, sans-serif; cursor: pointer; }
.hzr-chip:hover { border-color: var(--hzr-blue); }
.hzr-chip.on { background: var(--hzr-blue); border-color: var(--hzr-blue); color: #FFFFFF; }
.night .hzr-chip { border-color: #4A5878; }
.night .hzr-chip.on { background: #2F7BF0; border-color: #2F7BF0; }
.hzr-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.hzr-modes .dd-option { margin: 0; width: 100%; min-height: 60px; padding: 10px; border-radius: 16px; border: 1.5px solid #B0B0B8; background: var(--hzr-card); color: var(--hzr-ink); text-align: start; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; box-shadow: none; }
.hzr-modes .dd-option.selected { border: 2px solid var(--hzr-blue); background: #EAF2FF; }
.night .hzr-modes .dd-option { border-color: #4A5878; }
.night .hzr-modes .dd-option.selected { background: #1B3566; border-color: #5B9BFF; }
.hzr-modes .dd-option-label { font-weight: 700; font-size: 14px; color: var(--hzr-ink); }
.hzr-modes .dd-option-hint { font-size: 12px; color: var(--hzr-mut); }
.hzr-check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.hzr-check input { width: 20px; height: 20px; accent-color: var(--hzr-blue); margin: 0; }

/* Knöpfe */
.hzr-go { min-height: 56px; width: 100%; border: 0; border-radius: 18px; background: linear-gradient(180deg, #5BF0DE, #17C3B2); color: #0B1E3F; font: 600 21px Fredoka, Inter, sans-serif; display: flex; align-items: center; justify-content: center; gap: 12px; cursor: pointer; box-shadow: 0 8px 22px rgba(23,195,178,.35); padding: 8px 16px; margin: 0; }
.hzr-go:disabled { opacity: .5; cursor: default; }
.hzr-go-s { min-height: 48px; font-size: 17px; border-radius: 14px; box-shadow: none; }
.hzr-go-i { width: 32px; height: 32px; border-radius: 50%; background: #0B1E3F; color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; }
.hzr-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.hzr-btn { min-height: 48px; padding: 6px 14px; border-radius: 14px; border: 1.5px solid #B0B0B8; background: var(--hzr-card); color: var(--hzr-ink); font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; margin: 0; width: 100%; box-sizing: border-box; }
.hzr-btn:hover { border-color: var(--hzr-blue); }
.hzr-btn.on { background: #EAF2FF; border-color: var(--hzr-blue); }
.hzr-btn-gold { border-color: #F5A623; background: #FFF6E3; color: #8A4B00; }
.hzr-btn-small { min-height: 40px; font-size: 13px; margin-top: 8px; }
.night .hzr-btn { border-color: #4A5878; }
.night .hzr-btn.on { background: #1B3566; border-color: #5B9BFF; }
.night .hzr-btn-gold { background: #3A2A0C; border-color: #C98A2E; color: #FFC85C; }

/* Aufklappbare Karten (Wettkampf, alle Zeichen) */
.hzr-fold { padding: 0; }
.hzr-fold > summary { padding: 14px 16px; font-weight: 700; font-size: 14px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.hzr-fold > summary::-webkit-details-marker { display: none; }
.hzr-fold > summary::after { content: "▾"; margin-inline-start: auto; transition: transform .2s; }
.hzr-fold[open] > summary::after { transform: rotate(180deg); }
.hzr-fold > :not(summary) { margin-inline: 14px; }
.hzr-fold[open] { padding-bottom: 14px; }
.hzr-fold .hzw-hs-box { margin: 0 14px; padding: 0; border: 0; background: none; }
.hzr-fold .hzw-hs-box > .ld-section-title:first-child { display: none; }

/* ---------- Runde ---------- */
.hzr-head { background: linear-gradient(135deg, #0B1E3F, #16336B); color: #FFFFFF; border-radius: 18px; padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 10px; }
.hzr-head-row { display: flex; align-items: center; gap: 8px; }
.hzr-head-t { flex: 1; min-width: 0; font-family: Fredoka, Inter, sans-serif; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hzr-head-t span { color: #F5C65B; }
.hzr-hbtn, .hzr-head .hzw-flag { width: 40px; height: 40px; border-radius: 12px; border: 1px solid #4A5E8A; background: #13284F; color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; margin: 0; flex: none; }
.hzr-hbtn:hover, .hzr-head .hzw-flag:hover { background: #1D3A6E; }
.hzr-head .hzw-flag-pin.on { background: #4A3610; color: #FFC85C; border-color: #C98A2E; }
.hzr-head .hzw-flag-x.on { background: #143A25; color: #7FE0A6; border-color: #2E9E5E; }
.hzr-combo { font-weight: 700; color: #F5C65B; }
.hzr-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hzr-tile { background: #13284F; border-radius: 12px; padding: 5px 8px; text-align: center; min-width: 0; }
.hzr-tile span { display: block; font-size: 11px; font-weight: 600; color: #AFC4EA; }
.hzr-tile b { font-size: 18px; color: #FFFFFF; }
.hzr-tile b.hzr-ok { color: #5BF0DE; }
.hzr-tile b.hzr-bad { color: #FFB4A8; }
.hzr-tile .hzw-hs-hearts { font-size: 17px; }
.hzr-bar { display: flex; gap: 3px; }
.hzr-bar span { flex: 1; height: 6px; border-radius: 3px; background: var(--hzr-line); }
.hzr-bar span.ok { background: #22A35A; }
.hzr-bar span.good { background: #F5A623; }
.hzr-bar span.bad { background: #E5484D; }
.hzr-bar span.cur { background: var(--hzr-blue); }
.hzr-q { background: var(--hzr-card); border: 2px solid #F5A623; border-radius: 18px; padding: 8px 12px; display: flex; align-items: center; gap: 12px; }
.hzr-q-t { flex: 1; min-width: 0; }
.hzr-q-l { font-size: 12px; font-weight: 600; color: var(--hzr-mut); }
.hzr-q-m { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hzr-q .hzw-pinyin { font-family: Fredoka, Inter, sans-serif; font-size: 32px; font-weight: 600; color: var(--hzr-blue); line-height: 1.15; }
.night .hzr-q .hzw-pinyin { color: #9CC3FF; }
.hzr-q .hzw-meaning { font-size: 18px; font-weight: 700; color: var(--hzr-ink); }
.hzr-q .hzw-word { font-size: 13px; color: var(--hzr-mut); }
.hzr-q .hzw-word b { font-size: 16px; color: var(--hzr-ink); }
.hzr-q .hzw-word i { color: var(--hzr-mut); }
.hzr-speak { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; background: #EEF3FF; color: #1E4FB8; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.night .hzr-speak { background: #22304B; color: #9CC3FF; }
.hzr-write .hzw-board { margin: 2px 0 0; }
.hzr-write .hzw-board { width: 100%; }
.hzr-write .hzw-target { width: min(340px, 100%, calc(100vh - 430px)); width: min(340px, 100%, calc(100dvh - 430px)); min-width: min(200px, 100%); box-sizing: border-box; border-radius: 22px; border: 2px solid var(--hzr-blue); box-shadow: 0 10px 26px rgba(11,30,63,.16); overflow: hidden; }
.hzr-write .hzw-info { justify-content: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--hzr-mut); }
.hzr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hzr-actions .hzw-controls { display: contents; }
.hzr-actions .hzr-btn, .hzr-actions .hzr-go { flex: 1 1 140px; width: auto; }
.hzr { min-width: 0; max-width: 100%; }
/* In der Runde hat der Kopf ein eigenes ✕ – das Fenster-Kreuz würde darüber liegen */
#hzwPanel .battle-card:has(.hzr-write) #hzwCloseBtn { display: none !important; }
.hzr-hint { margin: 0; text-align: center; font-size: 12px; color: var(--hzr-mut); }

/* ---------- Rundenende ---------- */
.hzr-done { display: flex; flex-direction: column; gap: 12px; }
.hzr-done-h { margin: 0; font-family: Fredoka, Inter, sans-serif; font-size: 22px; font-weight: 600; text-align: center; }
.hzr-res-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.hzr-res { border-radius: 14px; padding: 10px 6px; text-align: center; border: 1.5px solid transparent; }
.hzr-res b { display: block; font-family: Fredoka, Inter, sans-serif; font-size: 28px; line-height: 1.1; }
.hzr-res span { font-size: 12px; font-weight: 700; }
.hzr-res.ok { background: #E3F6EA; border-color: #22A35A; color: #14532D; }
.hzr-res.good { background: #FFF1D6; border-color: #F5A623; color: #6B3A00; }
.hzr-res.bad { background: #FDECEC; border-color: #E5484D; color: #8C1D18; }
.night .hzr-res.ok { background: #143A25; color: #9BE3B8; border-color: #2E9E5E; }
.night .hzr-res.good { background: #4A3610; color: #FFD38A; border-color: #C98A2E; }
.night .hzr-res.bad { background: #4A2026; color: #FFC2BA; border-color: #C24A4A; }
.hzr .hzw-grid { margin: 0; }
@media (max-width: 420px){ .hzr-head-t { font-size: 16px; } .hzr-hbtn, .hzr-head .hzw-flag { width: 38px; height: 38px; } }

/* ---------- Statistik (03.12.2026) ---------- */
.hzr-pill-blue { background: #EAF2FF; color: #1E4FB8; }
.night .hzr-pill-blue { background: #1B3566; color: #A9C8FF; }
.hzr-stats .hzr-ring b { font-size: 19px; }
.hzr-kts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.hzr-kt { background: var(--hzr-card); border: 1px solid var(--hzr-line); border-radius: 14px; padding: 8px 4px; text-align: center; min-width: 0; }
.hzr-kt b { display: block; font-family: Fredoka, Inter, sans-serif; font-size: 20px; line-height: 1.15; color: var(--hzr-ink); }
.hzr-kt span { display: block; font-size: 11px; font-weight: 600; color: var(--hzr-mut); line-height: 1.2; }
@media (max-width: 380px){ .hzr-kts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hzr-filter { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.hzr-filter-h { display: flex; align-items: center; gap: 8px; }
.hzr-filter-h b { flex: 1; font-size: 15px; }
.hzr-filter-q { display: inline-flex; gap: 6px; }
.hzr-mini { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1.5px solid #B0B0B8; background: var(--hzr-card); color: var(--hzr-ink); font: 600 13px Inter, sans-serif; cursor: pointer; }
.night .hzr-mini { border-color: #4A5878; }
.hzr-filter .hzr-sub { margin: 2px 0 0; }
/* Farbkarten als Chips */
.hzr-filter .color-filter-grid, .hzr-filter .stats-mode-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; grid-template-columns: none; }
.hzr-filter .color-filter-card, .hzr-filter .stats-mode-card { position: relative; flex: 0 1 auto; flex-direction: row; align-items: center; gap: 7px; min-height: 38px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid #B0B0B8; background: var(--hzr-card); box-shadow: none; transform: none; cursor: pointer; display: inline-flex; width: auto; }
.hzr-filter .color-filter-card:hover, .hzr-filter .stats-mode-card:hover { border-color: var(--hzr-blue); transform: none; }
.hzr-filter .cf-swatch { width: 14px; height: 14px; min-width: 14px; border-radius: 50%; font-size: 10px; line-height: 14px; margin: 0; box-shadow: none; }
.hzr-filter .cf-swatch-lucky { width: 18px; height: 18px; min-width: 18px; font-size: 11px; color: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; }
.hzr-filter .cf-swatch-pinned, .hzr-filter .cf-swatch-mastered { width: auto; height: auto; min-width: 0; background: none; font-size: 14px; }
.hzr-filter .cf-label { font-size: 13px; font-weight: 600; color: var(--hzr-ink); white-space: nowrap; }
.hzr-filter .cf-check { display: none; }
.hzr-filter .color-filter-card.cf-checked, .hzr-filter .stats-mode-card.cf-checked { background: #EAF2FF; border-color: var(--hzr-blue); }
.hzr-filter .color-filter-card.cf-checked .cf-label, .hzr-filter .stats-mode-card.cf-checked .cf-label { color: #0B3A8C; }
.hzr-filter .color-filter-card.cf-checked .cf-check, .hzr-filter .stats-mode-card.cf-checked .cf-check { display: inline-flex; position: static; width: 16px; height: 16px; font-size: 10px; }
.hzr-filter .color-filter-card select.cf-rare-select { width: auto; margin: 0; min-height: 26px; padding: 0 4px; border-radius: 999px; font-size: 12px; }
.night .hzr-filter .color-filter-card, .night .hzr-filter .stats-mode-card { background: var(--hzr-card); border-color: #4A5878; }
.night .hzr-filter .color-filter-card.cf-checked, .night .hzr-filter .stats-mode-card.cf-checked { background: #1B3566; border-color: #5B9BFF; }
.night .hzr-filter .color-filter-card.cf-checked .cf-label, .night .hzr-filter .stats-mode-card.cf-checked .cf-label { color: #FFFFFF; }
.hzr-filter .hzr-go, .hzr-filter .hzr-btn { width: 100%; }
.hzr-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.hzr-search { flex: 1 1 180px; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1.5px solid #B0B0B8; background: var(--hzr-card); color: var(--hzr-ink); font: 500 14px Inter, sans-serif; box-sizing: border-box; margin: 0; max-width: none; }
.hzr-select { flex: 0 1 auto; min-height: 42px; padding: 0 10px; border-radius: 999px; border: 1.5px solid #B0B0B8; background: var(--hzr-card); color: var(--hzr-ink); font: 600 13px Inter, sans-serif; }
.night .hzr-search, .night .hzr-select { border-color: #4A5878; }
.hzr-stats .hzw-tiles { padding: 8px 2px; }
.hzr-stats .hzw-overview { margin: 0 14px; }
