/* Magyarul — the adult course. Chunky, friendly, Duolingo-like but our own colours. */
:root {
  --bg: #f7f7f2; --card: #fff; --ink: #1f2421; --muted: #6b716c; --line: #e3e5df;
  --green: #2f9e44; --green-d: #237a34; --red: #e03131; --red-d: #b42525; --red-bg: #ffe3e3; --green-bg: #d3f9d8;
  --blue: #1c7ed6; --gold: #f59f00; --locked: #d9dcd6; --locked-d: #b8bcb4; --sel: #d0ebff;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #151816; --card: #1f2421; --ink: #eef1ec; --muted: #9aa29b; --line: #323833;
  --green-bg: #18361f; --red-bg: #3d1c1c; --locked: #3a403b; --locked-d: #2a2f2b; --sel: #173a57;
} }
:root[data-theme="dark"] {
  --bg: #151816; --card: #1f2421; --ink: #eef1ec; --muted: #9aa29b; --line: #323833;
  --green-bg: #18361f; --red-bg: #3d1c1c; --locked: #3a403b; --locked-d: #2a2f2b; --sel: #173a57;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--blue); }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
h1 { font-size: 1.7rem; line-height: 1.2; margin: 8px 0 16px; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }

/* buttons */
.btn { display: inline-block; border: 0; border-radius: 14px; background: var(--green); color: #fff; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; padding: 13px 22px; box-shadow: 0 4px 0 var(--green-d); text-decoration: none; text-align: center; transition: transform .05s; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--green-d); }
.btn:disabled { background: var(--locked); box-shadow: 0 4px 0 var(--locked-d); color: var(--muted); cursor: default; }
.btn.small { padding: 8px 14px; font-size: .8rem; border-radius: 12px; }
.btn.ghost { background: var(--card); color: var(--blue); box-shadow: 0 3px 0 var(--line); border: 2px solid var(--line); }
.btn.light { background: rgba(255,255,255,.22); box-shadow: 0 3px 0 rgba(0,0,0,.18); }

/* top bar */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 14px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: var(--bg); border-bottom: 2px solid var(--line); }
.brand { font-weight: 900; font-size: 1.15rem; color: var(--green); text-decoration: none; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.flag { width: 22px; height: 15px; border-radius: 3px; background: linear-gradient(#cd2a3e 33.3%, #fff 33.3% 66.6%, #436f4d 66.6%); box-shadow: 0 0 0 1px var(--line); }
.stat { font-weight: 700; white-space: nowrap; }
.who { font-weight: 700; text-decoration: none; white-space: nowrap; max-width: 30vw; overflow: hidden; text-overflow: ellipsis; }

.card { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; }
main.path, main.narrow, main.guide { max-width: 620px; margin: 0 auto; padding: 16px 16px 60px; }
main.narrow { max-width: 440px; }
.back { display: inline-block; margin: 6px 0; font-weight: 700; text-decoration: none; }

/* daily goal */
.daily { display: grid; gap: 10px; margin-bottom: 16px; }
.bar { height: 14px; border-radius: 99px; background: var(--locked); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); border-radius: 99px; transition: width .35s; }
.bar.big { flex: 1; height: 16px; }
.bar.big i { background: var(--green); }
.nudge { display: block; margin-bottom: 16px; color: var(--ink); text-decoration: none; border-color: var(--blue); }

/* path */
.unit { margin: 24px 0 8px; }
.unit-head { background: var(--u); color: #fff; border-radius: 18px; padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; box-shadow: 0 4px 0 color-mix(in srgb, var(--u) 70%, #000); }
.unit-head h2 { margin: 2px 0 0; color: #fff; }
.unit-n { font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.unit-hu { opacity: .9; font-style: italic; }
.nodes { display: flex; flex-direction: column; align-items: center; gap: 34px; padding: 40px 0 8px; }
.node-wrap { position: relative; transform: translateX(var(--x)); display: flex; flex-direction: column; align-items: center; }
.node { width: 72px; height: 66px; border-radius: 50%; border: 0; font-size: 1.7rem; font-weight: 900; color: #fff; background: var(--u); box-shadow: 0 7px 0 color-mix(in srgb, var(--u) 65%, #000); }
.node.done { background: var(--gold); box-shadow: 0 7px 0 #c77c02; }
.node.locked { background: var(--locked); box-shadow: 0 7px 0 var(--locked-d); color: var(--muted); font-size: 1.3rem; }
.node.trophy:not(.locked) { background: var(--gold); box-shadow: 0 7px 0 #c77c02; }
.node.cur { outline: 6px solid color-mix(in srgb, var(--u) 30%, transparent); outline-offset: 5px; animation: bob 1.8s ease-in-out infinite; }
.node:active:not(.locked) { transform: translateY(5px); box-shadow: 0 2px 0 color-mix(in srgb, var(--u) 65%, #000); }
.node-label { font-size: .78rem; color: var(--muted); margin-top: 10px; font-weight: 600; }
.start { position: absolute; top: -34px; background: var(--card); color: var(--u); border: 2px solid var(--line); font-weight: 900; font-size: .8rem; padding: 3px 10px; border-radius: 10px; letter-spacing: .06em; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) { .node.cur, .start { animation: none; } }
.foot { text-align: center; font-size: .85rem; margin-top: 40px; }

/* guide */
.guide h1 { color: var(--u); }
.tip { margin-bottom: 12px; border-left: 6px solid var(--u); }
.tip h3 { margin: 0 0 6px; }
.tip p { margin: 0; }
.tip i { color: var(--u); font-style: normal; font-weight: 700; }
.guide > h2 { margin-top: 26px; }
.vocab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.vocab-list { display: grid; gap: 8px; }
.vocab { display: grid; gap: 2px; text-align: left; background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; padding: 10px 12px; }
.vocab.wide { grid-template-columns: auto 1fr; column-gap: 10px; }
.vocab.wide .muted { grid-column: 2; }
.vocab b { font-size: 1.05rem; }

/* account */
.tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tabs button { flex: 1; border: 2px solid var(--line); background: var(--card); border-radius: 12px; padding: 10px; font-weight: 700; }
.tabs button.on { border-color: var(--blue); color: var(--blue); background: var(--sel); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 700; }
.form label.row { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.form input:not([type=checkbox]), .form select { font: inherit; padding: 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); }
.err { color: var(--red); margin: 0; min-height: 1em; font-weight: 600; }
.err:empty { display: none; }

/* lesson */
.lesson { min-height: 100dvh; display: flex; flex-direction: column; }
.lesson-top { display: flex; align-items: center; gap: 14px; padding: 16px; padding-top: max(16px, env(safe-area-inset-top)); max-width: 720px; width: 100%; margin: 0 auto; }
.x { background: none; border: 0; font-size: 1.4rem; color: var(--muted); padding: 4px 8px; }
.combo { font-weight: 800; color: var(--gold); font-size: .85rem; min-width: 0; white-space: nowrap; }
.ex { flex: 1; width: 100%; max-width: 620px; margin: 0 auto; padding: 8px 16px 24px; }
.ex.answered .choices, .ex.answered .bank, .ex.answered .answer-line, .ex.answered .typein, .ex.answered .accents { pointer-events: none; }
.ex h2 { font-size: 1.45rem; margin: 10px 0 18px; }
.badge { display: inline-block; color: #9c36b5; font-weight: 900; font-size: .8rem; letter-spacing: .08em; margin-top: 6px; }
.prompt { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; margin-bottom: 22px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); }
.prompt.center { justify-content: center; border: 0; background: none; }
.spk { border: 0; background: var(--blue); color: #fff; width: 44px; height: 44px; border-radius: 12px; font-size: 1.2rem; box-shadow: 0 4px 0 #1864ab; flex: none; }
.spk.big { width: 96px; height: 80px; border-radius: 20px; font-size: 2.2rem; }
.spk.slow { width: 64px; height: 64px; border-radius: 18px; font-size: 1.6rem; }
.spk:active { transform: translateY(3px); box-shadow: 0 1px 0 #1864ab; }

.choices { display: grid; gap: 10px; }
.choices.cards { grid-template-columns: 1fr 1fr; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; padding: 14px 16px; font-size: 1.08rem; }
.choice small { display: block; color: var(--muted); font-size: .85rem; }
.choice .key { flex: none; width: 26px; height: 26px; border: 2px solid var(--line); border-radius: 8px; display: grid; place-items: center; font-size: .78rem; color: var(--muted); }
.choices.cards .choice, .choices.two .choice { flex-direction: column; justify-content: center; text-align: center; padding: 18px 10px; min-height: 140px; font-size: 1.15rem; font-weight: 600; }
.choices.two .choice { font-size: 1.6rem; }
.choices.cards .key, .choices.two .key { align-self: flex-start; }
.emo { font-size: 2.6rem; line-height: 1; }
.choice.sel { border-color: var(--blue); background: var(--sel); color: var(--blue); }
.choice.sel .key { border-color: var(--blue); color: var(--blue); }

.answer-line { min-height: 64px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; padding: 6px 0 10px; margin-bottom: 22px;
  background: repeating-linear-gradient(transparent 0 58px, var(--line) 58px 60px); }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile-w { background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 9px 14px; font-size: 1.05rem; }
.tile-w.ghost { background: var(--locked); color: transparent; border-color: var(--locked); }

.typein { width: 100%; font: inherit; font-size: 1.25rem; padding: 14px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); }
.typein:focus { outline: none; border-color: var(--blue); }
.accents { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.accents button { border: 2px solid var(--line); background: var(--card); border-radius: 10px; padding: 6px 12px; font-size: 1.05rem; }

.intro { text-align: center; padding: 20px 0; }
.emo-big { font-size: 5rem; line-height: 1.1; }
.intro-hu { font-size: 2.2rem; font-weight: 800; margin: 14px 0 8px; display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.intro-hu .spk.big { width: 64px; height: 56px; font-size: 1.5rem; }
.intro-hu .spk.slow { width: 56px; height: 56px; font-size: 1.3rem; }
.intro-en { font-size: 1.2rem; color: var(--muted); }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.col { display: grid; gap: 10px; align-content: start; }
.choice.m { justify-content: center; text-align: center; min-height: 58px; }
.choice.m.gone { opacity: .35; pointer-events: none; border-color: var(--line); background: var(--card); color: var(--muted); }
.choice.m.no { border-color: var(--red); background: var(--red-bg); color: var(--red); animation: shake .3s; }
@keyframes shake { 25% { translate: -5px 0; } 75% { translate: 5px 0; } }

.check { position: sticky; bottom: 0; border-top: 2px solid var(--line); background: var(--bg); padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  display: flex; gap: 16px; align-items: center; justify-content: space-between; max-width: none; }
.check > * { max-width: 620px; }
.check .fb { flex: 1; font-size: 1.05rem; }
.check .btn { min-width: 150px; }
.check.good { background: var(--green-bg); border-color: transparent; }
.check.good .fb b { color: var(--green); font-size: 1.25rem; }
.check.bad { background: var(--red-bg); border-color: transparent; }
.check.bad .fb { color: var(--red); }
.check.bad .btn { background: var(--red); box-shadow: 0 4px 0 var(--red-d); }
@media (max-width: 520px) {
  .check { flex-direction: column; align-items: stretch; }
  .check .btn { width: 100%; }
  .check .fb:empty { display: none; }
}

/* result */
.result { max-width: 520px; margin: 0 auto; padding: 48px 16px; text-align: center; }
.burst { font-size: 5.5rem; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }
.result h1 { color: var(--gold); font-size: 2rem; margin-bottom: 4px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px 0; }
.tile { border-radius: 16px; border: 2px solid; overflow: hidden; }
.tile span { display: block; color: #fff; font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; padding: 4px; }
.tile b { display: block; padding: 12px 4px; font-size: 1.15rem; background: var(--card); }
.tile.xp { border-color: var(--gold); } .tile.xp span { background: var(--gold); }
.tile.acc { border-color: var(--green); } .tile.acc span { background: var(--green); }
.tile.time { border-color: var(--blue); } .tile.time span { background: var(--blue); }
.streak-up { font-weight: 800; font-size: 1.15rem; color: var(--gold); }
.result .btn { width: 100%; margin-top: 20px; }

.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 20; max-width: calc(100vw - 32px); }

/* reading track + speaking (#114) */
.track-pick { margin-bottom: 16px; border-color: var(--blue); }
.track-pick p { margin: 6px 0 10px; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.choices.three { grid-template-columns: repeat(3, 1fr); }
.choices.three .choice { justify-content: center; font-size: 1.3rem; min-height: 72px; }
.read-big { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 800; text-align: center; }
p.center, .muted.center { text-align: center; }
.mic-row { display: flex; justify-content: center; margin: 8px 0; }
.mic { border: 0; width: 96px; height: 96px; border-radius: 50%; font-size: 2.4rem; background: var(--blue); color: #fff; box-shadow: 0 5px 0 #1864ab; cursor: pointer; }
.mic.on { background: #e03131; box-shadow: 0 5px 0 #a51d1d; animation: mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .mic.on { animation: none; } }
.self { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 8px; }
.self .row-btns { flex-basis: 100%; justify-content: center; }
.link-btn { display: block; margin: 18px auto 0; background: none; border: 0; color: var(--muted, #868e96); text-decoration: underline; font: inherit; font-size: .85rem; cursor: pointer; }
.self[hidden] { display: none; }
