:root {
  --bg: #f4f7fc; --fg: #17202e; --muted: #5b6678; --card: #fff; --line: #d6deea;
  --accent: #3b6fc4; --accent-fg: #fff; --ok: #1f9d55; --ok-bg: #e3f6ea; --bad: #d64545; --bad-bg: #fde8e8;
  --box1: #f28b82; --box2: #fbbc04; --box3: #fff475; --box4: #a8e6a1; --box5: #34a853;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121821; --fg: #e8edf5; --muted: #9aa6b8; --card: #1d2531; --line: #2f3a4a;
          --accent: #6d9cf0; --accent-fg: #0d1420; --ok-bg: #173826; --bad-bg: #3d1d1d; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { font-family: "Nunito", "Chalkboard SE", "Comic Sans MS", system-ui, sans-serif; font-size: 20px; line-height: 1.35;
       -webkit-tap-highlight-color: transparent; }
header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--accent); color: var(--accent-fg); position: sticky; top: 0; z-index: 5; }
header h1 { font-size: 22px; margin: 0; flex: 1; }
#who { font-weight: bold; }
main { max-width: 720px; margin: 0 auto; padding: 16px 16px 120px; }
h2 { font-size: 26px; margin: 8px 0 16px; }
h3 { font-size: 20px; margin: 24px 0 8px; color: var(--muted); }
button, input, select { font: inherit; color: inherit; }
button { border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 18px; cursor: pointer; min-height: 52px; }
button:active { transform: scale(.97); }
button.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: bold; }
button.icon { min-height: 44px; min-width: 44px; padding: 4px 10px; font-size: 24px; background: transparent; border: none; color: inherit; }
input, select { border: 2px solid var(--line); border-radius: 12px; padding: 12px; background: var(--card); min-height: 52px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.row input { flex: 1; min-width: 0; }
.center { justify-content: center; }
.muted { color: var(--muted); font-size: 17px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.grid button { font-size: 24px; font-weight: bold; min-height: 90px; }

/* Units */
.unit { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 6px 0; }
.unit[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.unit .check { width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; flex: none; }
.unit[aria-pressed="true"] .check { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.unit .name { flex: 1; }
.unit .boxes { display: flex; height: 10px; width: 110px; border-radius: 5px; overflow: hidden; background: var(--line); flex: none; }
.unit .n { font-size: 15px; color: var(--muted); width: 44px; text-align: right; flex: none; }
.b1 { background: var(--box1); } .b2 { background: var(--box2); } .b3 { background: var(--box3); } .b4 { background: var(--box4); } .b5 { background: var(--box5); }
.sticky { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 2px solid var(--line); padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); }
.sticky > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.sticky .row { margin: 4px auto; }
.toggle { display: flex; gap: 10px; align-items: center; }
.toggle select { min-height: 44px; padding: 6px 10px; }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode { display: flex; flex-direction: column; align-items: center; font-size: 28px; padding: 8px; }
.mode span { font-size: 16px; font-weight: bold; }
.mode:disabled { opacity: .4; }
#vUnits { padding-bottom: 200px; }
#selInfo { text-align: center; margin: 6px auto 0; }

/* Üben */
.progress { height: 12px; background: var(--line); border-radius: 6px; overflow: hidden; }
#bar { height: 100%; width: 0; background: var(--ok); transition: width .3s; }
#counter { text-align: center; margin: 6px 0 12px; }
.card { position: relative; background: var(--card); border: 2px solid var(--line); border-radius: 20px; min-height: 220px; padding: 40px 20px 24px;
        display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 16px; }
.card.flip { cursor: pointer; }
.speak { position: absolute; top: 6px; right: 6px; }
.prompt { font-size: 38px; font-weight: bold; overflow-wrap: anywhere; }
.answer { font-size: 30px; color: var(--accent); overflow-wrap: anywhere; }
#controls { margin-top: 16px; display: grid; gap: 10px; }
#controls.two { grid-template-columns: 1fr 1fr; }
#controls .choice { font-size: 22px; min-height: 64px; text-align: center; }
#controls .choice.right { background: var(--ok-bg); border-color: var(--ok); }
#controls .choice.wrong { background: var(--bad-bg); border-color: var(--bad); }
.btnOk { background: var(--ok-bg); border-color: var(--ok); font-weight: bold; }
.btnBad { background: var(--bad-bg); border-color: var(--bad); font-weight: bold; }
#typeInput { width: 100%; font-size: 28px; text-align: center; }
.feedback { min-height: 48px; text-align: center; font-size: 22px; font-weight: bold; margin-top: 12px; }
.feedback.ok { color: var(--ok); } .feedback.bad { color: var(--bad); }
.done { text-align: center; padding-top: 30px; }
.stars { font-size: 64px; letter-spacing: 8px; }
.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.06); } 100% { transform: scale(1); } }
.shake { animation: shake .35s ease; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (max-width: 420px) { .prompt { font-size: 30px; } .answer { font-size: 24px; } #controls.two { grid-template-columns: 1fr; } }
