/* Lernkalender, Gruppenziel, Wort des Tages, Race, Meine Fehler, Modus-Menü (js/heatmap.js, groupgoal.js, wotd.js, race.js, mistakes.js) */

/* ——— Modus-Menü im Tab Üben ——— */
#practiceSeg { position: relative; }
#practiceSeg .mode-more { flex: 1.3; }
.mode-menu {
  position: absolute; z-index: 20; right: 0; top: calc(100% + 4px); min-width: 170px; padding: 4px;
  background: var(--surface); border-radius: 12px; box-shadow: 0 6px 24px rgb(0 0 0 / .22); display: flex; flex-direction: column; gap: 2px;
}
.segmented .mode-menu button { flex: none; text-align: left; padding: 10px 12px; font-size: 15px; }
.mode-menu button.on { background: var(--surface-2); }

/* ——— Chips in der Leiste ——— */
.strip { overflow-x: auto; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.strip-b.grow { min-width: 92px; }
.strip-b { position: relative; }
.strip-b.done .s-lbl { color: var(--ok); }
.s-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.s-dot.hidden { display: none; }
#motiv[data-open="group"] #motivGroup, #motiv[data-open="word"] #motivWord { display: block; }

/* ——— Lernkalender ——— */
.heatmap { padding: 12px 12px 10px; position: relative; }
.hm-scroll { overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hm-scroll::-webkit-scrollbar { display: none; }
.hm-grid { display: grid; grid-template-columns: 26px repeat(20, minmax(11px, 1fr)); grid-template-rows: 14px repeat(7, auto); gap: 3px; min-width: 300px; }
.hm-grid > .hm-wd { grid-column: 1; font-size: 10px; line-height: 1; color: var(--muted); align-self: center; }
.hm-mon { grid-row: 1; font-size: 10px; line-height: 14px; color: var(--muted); white-space: nowrap; overflow: visible; }
.hm-c { aspect-ratio: 1; min-width: 0; padding: 0; border: 0; border-radius: 3px; background: var(--surface-2); display: block; touch-action: manipulation; }
.hm-c.l1 { background: color-mix(in srgb, var(--accent) 25%, var(--surface-2)); }
.hm-c.l2 { background: color-mix(in srgb, var(--accent) 50%, var(--surface-2)); }
.hm-c.l3 { background: color-mix(in srgb, var(--accent) 75%, var(--surface-2)); }
.hm-c.l4 { background: var(--accent); }
.hm-c.today { outline: 2px solid var(--text); outline-offset: 1px; }
.hm-c.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--muted); }
.hm-tip { position: absolute; z-index: 5; transform: translateX(-50%); left: 50%; top: 0; padding: 5px 9px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 13px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s; }
.hm-tip.on { opacity: 1; }
.hm-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.hm-legend { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.hm-legend .hm-c { width: 11px; height: 11px; aspect-ratio: auto; display: inline-block; }

/* ——— Gruppenziel ——— */
.gg-card { padding: 12px 14px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); }
.gg-head { font-size: 15px; margin-bottom: 8px; }
.gg-bar { display: flex; height: 14px; border-radius: 7px; background: var(--surface-2); overflow: hidden; }
.gg-bar i { display: block; height: 100%; border-right: 2px solid var(--surface); }
.gg-bar i:last-child { border-right: 0; }
.gg-bar.full { box-shadow: 0 0 0 2px var(--ok); }
.gg-foot { margin-top: 6px; font-size: 13px; color: var(--muted); }
.gg-done { color: var(--ok); font-weight: 600; }
.gg-people { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; }
.gg-who { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.gg-who.zero { opacity: .5; }
.gg-section.hidden { display: none; }
.strip-b.done { box-shadow: 0 0 0 2px var(--ok) inset; }
.confetti { position: fixed; inset: 0; z-index: 200; pointer-events: none; overflow: hidden; }
.confetti span { position: absolute; top: -30px; font-size: 24px; animation: confall 2.2s ease-in forwards; }
@keyframes confall { to { transform: translate(var(--dx, 0), 105vh) rotate(360deg); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }

/* ——— Wort des Tages ——— */
.wotd-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; }
.wotd-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.wotd-tag { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.wotd-meta { font-size: 12px; color: var(--muted); }
.wotd-word { display: flex; align-items: center; gap: 8px; margin: 4px 0 0; }
.wotd-word b, .mk-front b { font-size: 24px; letter-spacing: -.01em; }
.wotd-say { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--surface-2); font-size: 17px; line-height: 1; touch-action: manipulation; }
.wotd-tr { font-size: 17px; color: var(--muted); margin-bottom: 6px; }
.wotd-ex { font-size: 16px; line-height: 1.4; margin: 4px 0 10px; }
.wotd-ex small { display: block; color: var(--muted); font-size: 13px; }
.wotd-add { width: 100%; }
.wotd-add:disabled { opacity: 1; color: var(--ok); background: var(--ok-bg); }

/* ——— Race ——— */
.race-intro { margin: 4px 0 12px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.race-best { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.race-best b { font-size: 34px; font-variant-numeric: tabular-nums; }
.race-best small { color: var(--muted); }
.race-top { display: flex; justify-content: space-between; align-items: baseline; }
.race-score { font-size: 28px; font-weight: 800; color: var(--ok); font-variant-numeric: tabular-nums; }
.race-time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.race-time.low { color: var(--bad); }
.race-bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 4px 0 10px; }
.race-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(1); }
.race-q { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline; }
.race-t { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.race-v { font-size: 26px; }
.race-m { font-size: 14px; color: var(--muted); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-p { grid-column: 1 / -1; font-size: 18px; font-weight: 700; margin: 4px 0 6px; }
.race-fb { min-height: 20px; font-size: 14px; margin: 2px 0 4px; }
.race-fb.ok { color: var(--ok); }
.race-fb.bad { color: var(--bad); }
.race-big { font-size: 64px; font-weight: 800; line-height: 1.1; text-align: center; font-variant-numeric: tabular-nums; }
.race-big small { display: block; font-size: 14px; font-weight: 500; color: var(--muted); }
.race-nb { min-height: 24px; text-align: center; font-weight: 700; color: var(--accent); }
.race-stats { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--muted); margin: 6px 0 10px; }
.race-stats b { color: var(--text); }
.race-fr { background: var(--surface-2); border-radius: 12px; padding: 8px 12px; margin-bottom: 8px; }
.race-fr-t { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.race-fr-r { display: flex; align-items: center; gap: 8px; min-height: 30px; font-size: 15px; }
.race-fr-r .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.race-fr-r.me { font-weight: 700; }
.race-badge { white-space: nowrap; }

/* ——— Meine Fehler ——— */
.mk-left { font-size: 13px; font-weight: 600; color: var(--muted); }
.mk-kind { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.mk-dots { display: inline-flex; gap: 3px; }
.mk-dots i { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--line); box-sizing: border-box; }
.mk-dots i.on { background: var(--ok); border-color: var(--ok); }
.mk-tense { font-size: 13px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; margin-top: 4px; }
.mk-word { font-size: 24px; margin: 2px 0; }
.mk-card { background: var(--surface-2); border-radius: 14px; padding: 16px; margin: 8px 0 10px; min-height: 96px; }
.mk-front { display: flex; align-items: center; gap: 10px; }
.mk-tr { font-size: 20px; font-weight: 600; margin: 8px 0 4px; }
.mk-empty { text-align: center; padding: 16px 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mk-empty b { font-size: 20px; }
