/* Duelle, Abzeichen, Wochenrückblick, Karte „Heute“ (js/duels.js, js/badges.js, js/today.js) */

/* ——— Oberer Bereich im Tab Üben ——— */
#motiv:empty, #motiv > div:empty { display: none; }
.today-card, .weekly-card, .duel-banner { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin: 0 0 10px; }

.today-list { list-style: none; margin: 0; padding: 0 14px 8px; }
.today-list li { display: flex; align-items: center; gap: 8px; min-height: 38px; border-top: 1px solid var(--surface-2); font-size: 14px; }
.today-list .t-mark { width: 18px; height: 18px; flex: none; border: 2px solid var(--line); border-radius: 50%; font-size: 11px; line-height: 14px; text-align: center; color: var(--on-status); }
.today-list li.done .t-mark { background: var(--ok); border-color: var(--ok); }
.today-list li.done { color: var(--muted); }
.today-list .t-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-list .t-n { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 2.2em; text-align: right; }
.today-list .t-go { width: 52px; flex: none; }
.today-list .btn.small { padding: 5px 12px; font-size: 14px; min-height: 30px; width: 52px; flex: none; }

.weekly-card { padding: 10px 14px 12px; }
.wk-head { display: flex; align-items: center; gap: 8px; }
.wk-head b { font-size: 15px; }
.wk-rank { flex: 1; font-size: 13px; color: var(--muted); }
.wk-head .icon-btn { margin-left: auto; width: 32px; height: 32px; }
.wk-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; text-align: center; }
.wk-grid b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.wk-grid small { display: block; font-size: 11px; color: var(--muted); line-height: 1.2; }

.duel-banner { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; font-size: 14px; border: 2px solid var(--accent); }
.duel-banner > span { flex: 1; min-width: 0; }
.duel-banner.done { border-color: transparent; }

/* ——— Duell-Knopf in der Rangliste, Duell-Liste ——— */
.duel-cell { width: 40px; text-align: right; }
.duel-btn { border: 0; background: var(--surface-2); border-radius: 10px; width: 36px; height: 36px; font-size: 18px; line-height: 1; cursor: pointer; touch-action: manipulation; }
.duel-btn:active { transform: scale(.94); }
.duels-card { padding: 4px 12px; }
.duel-list { list-style: none; margin: 0; padding: 0; }
.duel-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--surface-2); }
.duel-list li:first-child { border-top: 0; }
.duel-flag { font-size: 22px; }
.duel-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.duel-who small { color: var(--muted); font-size: 12px; }
.duel-st { font-size: 13px; color: var(--muted); text-align: right; }
.duel-st.win { color: var(--ok); font-weight: 700; }
.duel-st.lose { color: var(--bad); }

/* ——— Spielbildschirm ——— */
body.duel-open { overflow: hidden; }
.duel-ov { position: fixed; inset: 0; z-index: 100; background: var(--bg); color: var(--text); display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 16px calc(env(safe-area-inset-bottom) + 12px); overflow-y: auto; }
.duel-top { display: flex; align-items: center; gap: 8px; min-height: 52px; }
.duel-title { flex: 1; min-width: 0; font-weight: 700; display: flex; flex-direction: column; line-height: 1.2; }
.duel-vs-n { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-title small { font-weight: 400; color: var(--muted); font-size: 12px; }
.duel-time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); min-width: 3.4em; text-align: right; }
.duel-bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-bottom: 14px; }
.duel-bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .25s; }
.duel-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px 12px; }
.duel-kind { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.duel-word { margin: 10px 0 2px; font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.duel-sub { color: var(--muted); font-size: 14px; }
.duel-person { margin: 12px 0 6px; font-size: 18px; font-weight: 700; }
.duel-opts { display: grid; gap: 8px; margin-top: 14px; }
.duel-opt { min-height: 48px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-size: 17px; padding: 8px 12px; text-align: left; cursor: pointer; }
.duel-opt.ok { border-color: var(--ok); background: var(--ok-bg); }
.duel-opt.bad { border-color: var(--bad); background: var(--bad-bg); }
.duel-fb { min-height: 24px; margin-top: 8px; font-size: 15px; }
.duel-fb.ok { color: var(--ok); }
.duel-fb.bad { color: var(--bad); }
.duel-msg { margin: auto; text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; max-width: 320px; }
.duel-vs { font-size: 22px; font-weight: 700; }
.duel-end { text-align: center; padding: 8px 0; }
.duel-big { font-size: 64px; font-weight: 800; line-height: 1.1; }
.duel-big small { font-size: 28px; color: var(--muted); }
.duel-res { margin-top: 10px; }
.duel-verdict { font-size: 22px; font-weight: 800; margin: 6px 0 8px; }
.duel-verdict.win { color: var(--ok); }

/* ——— Abzeichen ——— */
.badges { margin-top: 14px; border-top: 1px solid var(--surface-2); padding-top: 12px; }
.badges-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.badges-head span { font-size: 12px; color: var(--muted); }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 8px 4px; border-radius: 12px; background: var(--surface-2); font-size: 12px; line-height: 1.2; min-width: 0; }
.badge .b-emo { font-size: 26px; line-height: 1.1; }
.badge .b-name { font-weight: 600; overflow-wrap: anywhere; }
.badge.off { opacity: .55; }
.badge.off .b-emo { filter: grayscale(1); }
.badge .b-prog { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.badge .b-bar { width: 80%; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.badge .b-bar i { display: block; height: 100%; background: var(--accent); }
