/* ── Kvíz app – alkalmazás-réteg a Kvíz UI (PixelKit) felett ───────────────
   A tokenek, gombok, jelvények, űrlapelemek a ../pixelkit/pixelkit.css-ből jönnek.
   Itt az app saját elrendezése (app-keret, főoldal, kvíz, admin) van. */
html { background: var(--bg); }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; }
body { background: var(--bg); color: var(--ink); font: 500 16px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  display: flex; flex-direction: column; height: 100dvh; width: 100%; max-width: 100vw; position: relative; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable], .rt, .sheet .bio, .entry .body, .rm-body, .ferr, code { -webkit-user-select: text; user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
img, svg, video, canvas { max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: 26px; line-height: 1.1; }
.sub { color: var(--muted); font-size: 15px; font-weight: 600; }
.center { text-align: center; }
.spacer { flex: 1; }
:focus-visible { outline: none; }
:root { --maxw: 760px; --tabh: 74px; }
@media (min-width: 1100px) { :root { --maxw: 1040px; } }
main *, .topbar *, .tabbar * { min-width: 0; }

/* ── Betöltő ──────────────────────────────────────────────────────────── */
.loading { position: fixed; inset: 0; z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 26px; background: var(--bg); transition: opacity .25s ease; }
.loading.hide { opacity: 0; pointer-events: none; }
.loading .logo-wrap { flex: none; }
.loading img { flex: none; object-fit: contain; width: 108px; height: 126px; image-rendering: pixelated; animation: logo-hop 1.1s var(--ease) infinite; filter: drop-shadow(4px 4px 0 var(--hard)); }
.loading .bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; font-weight: 700; flex: none; }
.dots { display: flex; gap: 6px; } .dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: var(--bw-sm) solid var(--line); animation: pk-hop .9s ease-in-out infinite; }
.dots i:nth-child(2) { animation-delay: .15s; background: var(--lime); } .dots i:nth-child(3) { animation-delay: .3s; background: var(--pink); }
@keyframes logo-hop { 0%, 100% { transform: translateY(0) rotate(-2deg); } 40% { transform: translateY(-12px) rotate(2deg); } }

/* ── Váz: felső sáv, navigáció, tartalom ─────────────────────────────── */
.topbar { position: static; flex: none; z-index: 30; background: var(--panel); border-bottom: var(--bw) solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-in { max-width: none; margin: 0; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 6px max(16px, env(safe-area-inset-right), calc((100% - var(--maxw)) / 2)) 6px max(16px, env(safe-area-inset-left), calc((100% - var(--maxw)) / 2)); }
.brand { display: flex; align-items: center; gap: 10px; font: 800 20px var(--font-display); letter-spacing: -.03em; }
.brand img { width: 36px; height: 42px; object-fit: contain; image-rendering: pixelated; }
.brand .badge { font-size: 11px; }
.topbar .btn { margin: 0; }
main { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; margin: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 18px max(16px, env(safe-area-inset-right), calc((100% - var(--maxw)) / 2)) 28px max(16px, env(safe-area-inset-left), calc((100% - var(--maxw)) / 2)); }
main:has(.atabs), main:has(.alogin) { --maxw: 940px; }
@media (min-width: 1100px) { main:has(.atabs) { --maxw: 1040px; } }
.tabbar { position: static; flex: none; display: flex; align-items: stretch; background: var(--panel); border-top: var(--bw) solid var(--line); padding: 8px max(4px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(4px, env(safe-area-inset-left)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; font: 800 11px var(--font-body); color: var(--muted); text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.tabbar .pill { position: relative; width: 56px; height: 32px; display: grid; place-items: center; border-radius: var(--r-pill); border: var(--bw-sm) solid transparent; transition: background-color .2s, transform .25s var(--ease); }
.tabbar a.on { color: var(--ink); } .tabbar a.on .pill { background: var(--lime); color: var(--on-bright); border-color: var(--line); box-shadow: 2px 2px 0 var(--hard); }
.tabbar a:active .pill { transform: scale(.9); }
body[data-newlog] .tabbar a[href="#/changelog"] .pill::after { content: ""; position: absolute; top: -4px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--pink); border: var(--bw-sm) solid var(--line); }
body.focus .topbar, body.focus .tabbar { display: none; }
@media (min-width: 900px) {
  body { padding-left: 220px; } body.focus { padding-left: 0; }
  .tabbar { position: fixed; top: 0; bottom: 0; left: 0; width: 220px; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 86px 14px 0; border-top: 0; border-right: var(--bw) solid var(--line); }
  .tabbar a { flex: none; flex-direction: row; gap: 12px; padding: 5px 8px; font-size: 15px; border-radius: var(--r-pill); }
  .tabbar .pill { width: 44px; } .tabbar a.on { background: var(--sunken); }
  main { padding-top: 26px; padding-bottom: 56px; }
}
@media (max-width: 899px) { .toast-area { bottom: calc(var(--tabh) + 14px + env(safe-area-inset-bottom)); } }

/* ── Gombok az app saját elemeire ─────────────────────────────────────── */
.icon-btn { width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; background: var(--panel); color: var(--ink); border: var(--bw) solid var(--line); box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s; }
.icon-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.btn.red, .btn.wrongc { --c: var(--pink); --ci: var(--on-bright); }
.btn.small { font-size: 14px; padding: 9px 14px; border-radius: var(--r-sm); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: var(--shadow-sm); transform: none; }

/* ── Főoldal ──────────────────────────────────────────────────────────── */
.ph { margin: 2px 0 14px; } .ph .sub { margin-top: 4px; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; margin: 4px 4px 16px; }
@media (max-width: 420px) { .actions { grid-template-columns: 1fr 1fr; gap: 12px; } }
.act { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 78px; text-align: left; font-family: var(--font-body);
  background: var(--c); color: var(--ci); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.act.study { --c: var(--violet); --ci: #fff; } .act.mix { --c: var(--lime); --ci: var(--on-bright); }
.act:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--hard); }
.act:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--hard); }
.act:disabled { opacity: .5; cursor: not-allowed; }
.act > .ico { flex: none; width: 52px; height: 52px; padding: 12px; border-radius: var(--r-md); background: var(--panel); color: var(--on-bright); border: var(--bw-sm) solid var(--line); transform: rotate(-6deg); }
.act.mix > .ico { transform: rotate(6deg); }
.act b { display: block; font: 800 15px/1.15 var(--font-display); letter-spacing: -.03em; }
.act small { display: block; margin-top: 3px; font: 700 12.5px var(--font-body); opacity: .85; }
.act > span:last-child { min-width: 0; }
.sec { margin: 26px 4px 12px; display: flex; align-items: center; gap: 10px; }
.sec h2 { font-size: 17px; font-weight: 800; color: var(--ink); }
.sec .btn { margin: 0; }
.offline-note { color: var(--bad-text); font-weight: 800; font-size: 13px; }

/* színes csoportkártyák */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; padding: 4px; }
.cc { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 0; min-height: 76px; padding: 12px 70px 12px 14px; overflow: hidden; cursor: pointer; text-align: left;
  background: var(--cc); color: var(--cf); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s; }
.cc:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--hard); }
.cc:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--hard); }
.cc[disabled] { opacity: .55; cursor: not-allowed; filter: grayscale(.4); }
.cc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.cc-name { font: 800 14.5px/1.2 var(--font-display); letter-spacing: -.03em; overflow-wrap: anywhere; }
.cc-sub { font-size: 13px; font-weight: 700; opacity: .9; margin-top: 3px; }
.cc-bot { display: flex; align-items: flex-end; min-height: 0; padding: 0; }
.cc-info { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; min-width: 0; }
.cc .cc-info:not(:empty) { margin-top: 12px; }
.cc-note { font: 800 12px var(--font-body); background: var(--ink); color: var(--bg); padding: 3px 8px; border-radius: var(--r-pill); }
.cc .badge { display: inline-flex; align-items: center; gap: 4px; margin: 0; padding: 3px 8px; font-size: 11.5px; --c: var(--panel); --ci: var(--ink); }
.cc .badge .ico { width: 15px; height: 15px; }
.cc .badge.upd { --c: var(--orange); --ci: var(--on-bright); }
.cc .mono { display: none; }
/* teljes magasságú műveleti sáv jobb oldalt: letöltés (lime) / törlés (pink) */
.cc .dl, .cc .dl-prog { position: absolute; top: 0; right: 0; bottom: 0; width: 60px; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; border-left: var(--bw) solid var(--line); color: var(--on-bright); background: var(--lime); transition: filter .2s; }
.cc .dl.del { background: var(--pink); }
.cc .dl:hover { filter: brightness(1.08); } .cc .dl:active { filter: brightness(.92); }
.cc .dl .ico { width: 24px; height: 24px; } .cc .dl-t { display: none; }
.cc .dl:hover .ico { animation: k-wiggle .5s ease; }
.cc .dl-prog { background: var(--panel); color: var(--ink); font: 800 14px var(--font-display); text-align: center; }
.dl-prog i { display: none; }
.cc.parent { min-height: 66px; padding-right: 14px; flex-direction: row; align-items: center; justify-content: flex-start; }
.cc.parent .cc-top { flex: 1; align-items: center; } .cc.parent .cc-bot { margin-left: auto; }
.cc.parent .chev { margin-left: 10px; transition: transform .2s var(--ease); }
.accc { grid-column: 1 / -1; } .accc > summary { list-style: none; } .accc > summary::-webkit-details-marker { display: none; }
.accc[open] > summary .chev { transform: rotate(180deg); }
.accc > .cards { margin-top: 10px; padding-left: 20px; border-left: 4px solid var(--soft); }
.dl.wide { display: inline-flex; align-items: center; gap: 6px; }
.sec .dl { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; font: 800 14px var(--font-body); background: var(--panel); color: var(--ink); border: var(--bw) solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }
.sec .dl .dl-t { display: inline; }
.sec .dl:active { transform: translate(3px, 3px); box-shadow: none; }

/* üzenetek */
.banner { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-md); border: var(--bw-sm) solid var(--line); background: color-mix(in srgb, var(--sky) 22%, var(--panel)); font-size: 14px; font-weight: 700; }
.banner.err { background: color-mix(in srgb, var(--pink) 25%, var(--panel)); }
.empty, .end { text-align: center; color: var(--muted); }
.empty { padding: 30px 0; font-weight: 700; }
.end { padding: 48px 8px; }
.end h2 { font-size: 24px; color: var(--ink); margin-bottom: 8px; }

/* ── Fókusz mód: kvíz / tanulókártya – egyetlen képernyő ──────────────── */
body.focus { overflow: hidden; }
body.focus main { height: auto; width: 100%; max-width: 560px; margin: 0 auto; padding: calc(10px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; overflow: hidden; }
body.focus main:has(.imgrid), body.focus main:has(.sentence) { overflow-y: auto; }
.fh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fh .progress { flex: 1; }
.score { font: 800 15px var(--font-display); min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.ftitle { font: 700 13px var(--font-body); color: var(--muted); text-align: center; margin: 0 0 8px; }
.streak { display: inline-flex; align-items: center; gap: 4px; font: 800 13px var(--font-body); background: var(--orange); color: var(--on-bright); padding: 5px 10px; border-radius: var(--r-pill); border: var(--bw-sm) solid var(--line); }
.streak .ico { width: 16px; height: 16px; animation: k-wiggle 1.2s ease-in-out infinite; }
.person { flex: 1 1 0; min-height: 84px; width: auto; max-width: 100%; aspect-ratio: 3 / 4; align-self: center; margin: 6px 0 12px; overflow: hidden; background: var(--sunken); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.person img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.q-title { font: 800 17px/1.3 var(--font-display); letter-spacing: -.02em; margin: 0 0 10px; }
.opts { display: grid; gap: 10px; flex: none; }
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: 700 16px var(--font-body); color: var(--ink); min-height: 50px; padding: 8px 12px; background: var(--panel); border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); transition: transform .1s, box-shadow .1s, background-color .2s; }
.opt:active:not(:disabled) { transform: translate(3px, 3px); box-shadow: none; }
.opt .lt { font: 800 13px var(--font-display); width: 30px; height: 30px; display: grid; place-items: center; border: var(--bw-sm) solid currentColor; border-radius: 10px; flex: none; }
.opt.sel { background: color-mix(in srgb, var(--violet) 20%, var(--panel)); box-shadow: 0 0 0 3px var(--violet), var(--shadow-sm); }
.opt.sel .lt { background: var(--violet); color: #fff; border-color: var(--violet); }
.opt.right { background: var(--lime); color: var(--on-bright); animation: k-jelly .45s ease; }
.opt.wrong { background: var(--pink); color: var(--on-bright); animation: k-shake .4s; }
.opt.dim { opacity: .45; box-shadow: none; }
.opt:disabled { cursor: default; }
.opt > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.dock { flex: none; margin-top: 10px; }
.sheet { flex: none; margin-top: 12px; padding: 12px 14px; background: var(--panel); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); animation: k-rise .3s var(--ease-out); }
.sheet.good { background: color-mix(in srgb, var(--lime) 30%, var(--panel)); } .sheet.bad { background: color-mix(in srgb, var(--pink) 28%, var(--panel)); }
.sheet h3 { font-size: 17px; display: flex; align-items: center; gap: 8px; }
.sheet h3 .ico { width: 26px; height: 26px; padding: 4px; border-radius: 50%; border: var(--bw-sm) solid var(--line); color: var(--on-bright); }
.sheet.good h3 .ico { background: var(--lime); } .sheet.bad h3 .ico { background: var(--pink); }
.sheet .ans { margin-top: 4px; font-weight: 800; font-size: 15px; } .sheet .ans small { display: block; color: var(--muted); font-weight: 700; font-size: 12.5px; }
.sheet .bio { margin-top: 4px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.sheet .btn { margin-top: 10px; }
.imgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.imgopt { aspect-ratio: 1; overflow: hidden; border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); background: var(--sunken); padding: 0; }
.imgopt img { width: 100%; height: 100%; object-fit: contain; display: block; }
.imgopt.sel { box-shadow: 0 0 0 3px var(--violet), var(--shadow-sm); } .imgopt.right { outline: 4px solid var(--lime); outline-offset: -1px; animation: k-jelly .45s ease; } .imgopt.wrong { outline: 4px solid var(--pink); outline-offset: -1px; animation: k-shake .4s; }
.hintcard { padding: 16px; text-align: center; font-weight: 700; margin: 4px 4px 12px; background: var(--panel); border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); }
.sentence { padding: 16px; font-size: 18px; line-height: 2.3; margin: 4px; background: var(--panel); border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); }
.gap { display: inline-block; min-width: 64px; margin: 2px 3px; padding: 0 10px; border: var(--bw-sm) dashed var(--muted); border-radius: var(--r-sm); background: var(--sunken); vertical-align: middle; min-height: 34px; font-weight: 800; font-size: 16px; line-height: 30px; }
.gap.filled { border: var(--bw-sm) solid var(--line); background: color-mix(in srgb, var(--violet) 18%, var(--panel)); cursor: pointer; } .gap.right { border: var(--bw-sm) solid var(--line); background: var(--lime); color: var(--on-bright); } .gap.wrong { border: var(--bw-sm) solid var(--line); background: var(--pink); color: var(--on-bright); animation: k-shake .4s; }
.bank { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.tilebtn { font: 800 16px var(--font-body); padding: 10px 16px; min-height: 44px; background: var(--panel); border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); transition: transform .1s, box-shadow .1s; }
.tilebtn:active { transform: translate(3px, 3px); box-shadow: none; }

/* eredménykártya */
.result { padding: 24px 4px; }
.result-card { position: relative; overflow: hidden; text-align: center; padding: 28px 18px 24px; background: var(--violet); color: #fff; border: var(--bw) solid var(--line); border-radius: var(--r-xl); box-shadow: 6px 6px 0 var(--hard); }
.result-card h2 { color: #fff; font-size: 14px; letter-spacing: .02em; opacity: .9; }
.result-card .trophy-emoji { display: block; font-size: 72px; line-height: 1; margin: 10px 0 0; animation: k-bounce 1.2s var(--ease-out) .2s both; }
.result-card .score { font: 800 clamp(56px, 16vw, 84px)/1 var(--font-display); letter-spacing: -.03em; margin: 10px 0 6px; text-align: center; min-width: 0; }
.result-card .res-msg { margin: 0 auto; max-width: 32ch; font-weight: 700; font-size: 16px; }
.res-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.res-pills span { padding: 6px 14px; border-radius: var(--r-pill); background: #fff; color: var(--on-bright); border: var(--bw-sm) solid var(--line); box-shadow: var(--shadow-sm); font-weight: 800; font-size: 14px; }
.res-pills span:nth-child(1) { background: var(--sunny); } .res-pills span:nth-child(2) { background: var(--lime); } .res-pills span:nth-child(3) { background: var(--sky); }
.end-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.end-btns .btn { flex: 1 1 130px; max-width: 220px; }

/* ── Egyéb nézetek ────────────────────────────────────────────────────── */
div.list { list-style: none; padding: 6px; margin: 4px; background: var(--panel); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
div.list > .stat { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border-top: var(--bw-sm) solid var(--soft); }
div.list > .stat:first-child { border-top: 0; } .stat > span:last-child { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.gmeta { font-size: 13px; color: var(--muted); margin-top: 2px; font-weight: 600; }
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--sunken); border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); }
.seg button { font: 800 14px var(--font-body); background: transparent; color: var(--muted); border: var(--bw-sm) solid transparent; border-radius: var(--r-pill); padding: 7px 12px; min-height: 36px; }
.seg button.on { background: var(--primary); color: var(--primary-ink); border-color: var(--line); }
.donut-wrap { display: grid; place-items: center; padding: 20px 0 10px; }
.ring.lg { width: 168px; height: 168px; margin: 4px auto; } .ring.lg .mid b { font-size: 30px; }
.ring .mid .pc { margin-top: 6px; padding: 2px 10px; border-radius: var(--r-pill); background: var(--lime); color: var(--on-bright); font: 800 12px var(--font-body); border: var(--bw-sm) solid var(--line); }
.confetti { position: fixed; z-index: 10000; width: 9px; height: 14px; border-radius: 3px; border: 1.5px solid rgba(30, 26, 51, .6); pointer-events: none; animation: confetti .95s cubic-bezier(.15, .7, .3, 1) forwards; }
@keyframes confetti { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }
dialog { border: var(--bw) solid var(--line); border-radius: var(--r-xl); padding: 20px; background: var(--panel); color: var(--ink); width: min(92vw, 380px); box-shadow: 6px 6px 0 var(--hard); max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); overflow: auto; }
dialog[open] { animation: k-pop-in .3s var(--ease); }
@keyframes k-pop-in { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
dialog::backdrop { background: rgba(22, 20, 31, .55); }
dialog h3 { margin-bottom: 10px; font-size: 18px; }

/* ── Mozgás ───────────────────────────────────────────────────────────── */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes cardin { from { opacity: 0; transform: translateX(24px) rotate(1.5deg); } }
@keyframes cardin-l { from { opacity: 0; transform: translateX(-24px) rotate(-1.5deg); } }
@keyframes bump { 45% { transform: scale(1.25); } }
.view-enter { animation: rise .22s var(--ease-out) both; }
.stagger > * { animation: rise .28s var(--ease-out) both; animation-delay: calc(min(var(--i, 0), 6) * 30ms); }
.noanim .stagger > *, .noanim .view-enter { animation: none; }
.opts.fresh > * { animation: rise .26s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.person.fresh { animation: cardin .3s var(--ease-out) both; } .person.fresh.back { animation-name: cardin-l; }
.score.bump { animation: bump .28s ease; }
.fresh-q { animation: rise .26s var(--ease-out) both; }
@media (prefers-reduced-motion: reduce) { .view-enter, .stagger > *, .opts.fresh > * { animation: none; } }

/* ── Roadmap (Újdonságok) ─────────────────────────────────────────────── */
.rm-sum { margin: 4px; padding: 16px; background: var(--panel); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.rm-sum-top { display: flex; justify-content: space-between; align-items: baseline; font: 800 16px var(--font-display); margin-bottom: 10px; }
.rm-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.rm-h { display: flex; align-items: center; gap: 10px; margin: 26px 4px 12px; font-size: 17px; }
.rm { list-style: none; margin: 0 4px; padding: 0 0 0 24px; border-left: 4px solid var(--soft); }
.rm-node { position: relative; padding: 0 0 18px 16px; } .rm-node:last-child { padding-bottom: 6px; }
.rm-dot { position: absolute; left: -41px; top: 16px; width: 22px; height: 22px; border-radius: 50%; border: var(--bw) solid var(--line); background: var(--panel); }
.st-done .rm-dot { background: var(--lime); }
.st-progress .rm-dot { background: var(--orange); animation: k-jelly 1.4s ease-in-out infinite; }
.st-planned .rm-dot { border-style: dashed; background: var(--bg); }
.rm-card { background: var(--panel); padding: 14px 16px; margin: 4px 4px 0 0; border: var(--bw-sm) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.st-planned .rm-card { background: var(--sunken); border-style: dashed; box-shadow: none; }
.rm-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; }
.rm-type { color: var(--muted); font-weight: 700; } .rm-date { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.rm-card h3 { font-size: 15px; line-height: 1.25; margin-bottom: 4px; }
.rm-body { max-height: 4.8em; overflow: hidden; line-height: 1.6; color: var(--muted); font-size: 15px; font-weight: 500; }
.rm-body img { max-width: 100%; border: var(--bw-sm) solid var(--line); border-radius: var(--r-sm); margin: 6px 0; }
.rm-card.open .rm-body { max-height: none; color: var(--ink); }
.rm-more { margin-top: 8px; font-weight: 800; color: var(--primary-text); }

/* ── Admin ────────────────────────────────────────────────────────────── */
.ahead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 14px; }
.ahead h1 { font-size: 24px; }
.atabs { display: flex; gap: 4px; padding: 4px; overflow-x: auto; margin: 0 4px 16px; background: var(--sunken); border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); scrollbar-width: none; }
.atabs::-webkit-scrollbar { display: none; }
.atabs a { flex: none; font: 800 14px var(--font-body); color: var(--muted); padding: 8px 14px; border-radius: var(--r-pill); border: var(--bw-sm) solid transparent; transition: background-color .18s, color .18s; }
.atabs a.on { background: var(--primary); color: var(--primary-ink); border-color: var(--line); }
.atools { display: flex; align-items: center; gap: 10px; margin: 0 4px 12px; flex-wrap: wrap; }
.atools .btn { margin: 0; }
.atitle { font: 800 15px var(--font-display); }
.asel { flex: 1; min-width: 0; font: 700 15px var(--font-body); color: var(--ink); background: var(--sunken); border: var(--bw) solid var(--line); border-radius: var(--r-md); padding: 10px 14px; appearance: none; }
.alist { display: flex; flex-direction: column; gap: 12px; padding: 4px; }
.arow { display: flex; align-items: center; gap: 12px; padding: 10px; margin-left: calc(var(--d, 0) * 22px); background: var(--panel); border: var(--bw-sm) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.arow[data-act="edit"], .arow[data-act="open"], .arow[data-act="edititem"] { cursor: pointer; }
.arow[data-act]:hover { background: var(--sunken); }
.gdot { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-md); font: 800 20px var(--font-display); background: var(--gc, var(--primary)); color: var(--gf, #fff); border: var(--bw-sm) solid var(--line); }
.gdot .gi-txt { font-size: 22px; line-height: 1; }
.athumb { flex: none; width: 48px; height: 48px; overflow: hidden; background: var(--sunken); display: grid; place-items: center; color: var(--muted); border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); }
.athumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.amain { flex: 1; min-width: 0; } .amain b { display: block; line-height: 1.2; overflow-wrap: anywhere; font-weight: 800; } .amain small { display: block; margin-top: 2px; font-size: 12.5px; overflow-wrap: anywhere; }
.abtn { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--panel); color: var(--ink); border: var(--bw-sm) solid var(--line); transition: background-color .18s; }
.abtn:hover { background: var(--sunken); } .abtn[data-act="del"], .abtn[data-act="delcat"], .abtn[data-act="delitem"] { background: var(--pink); color: var(--on-bright); }
.tag { display: inline-block; padding: 2px 8px; font: 800 11px var(--font-body); border-radius: var(--r-pill); background: var(--soft); color: var(--ink); }
.tag.warn { background: var(--orange); color: var(--on-bright); } .tag.ok { background: var(--lime); color: var(--on-bright); }
.alogin { display: grid; place-items: center; padding: 24px 0; }
.alogin-card { width: min(100%, 380px); padding: 28px 22px; text-align: center; background: var(--panel); border: var(--bw) solid var(--line); border-radius: var(--r-xl); box-shadow: 6px 6px 0 var(--hard); }
.alogin-card h1 { font-size: 22px; margin: 12px 0 4px; } .alogin-card form { text-align: left; margin-top: 18px; }
.alogin-ic { width: 64px; height: 64px; margin: 0 auto; display: grid; place-items: center; background: var(--lime); color: var(--on-bright); border: var(--bw) solid var(--line); border-radius: 50%; box-shadow: var(--shadow-sm); } .alogin-ic .ico { width: 32px; height: 32px; }
dialog.adlg { width: min(94vw, 520px); padding: 0; overflow: auto; }
dialog.adlg form { padding: 20px 20px 16px; } dialog.adlg h3 { background: var(--violet); color: #fff; margin: -20px -20px 14px; padding: 16px 20px; border-bottom: var(--bw) solid var(--line); font-size: 16px; }
.fgrid { display: grid; gap: 14px; }
.fld { display: block; margin-top: 12px; } .fgrid .fld { margin-top: 0; }
.lbl { display: block; font-weight: 800; font-size: 14.5px; margin: 0 0 5px; }
.fld input[type=text], .fld input[type=password], .fld input[type=number], .fld select, .fld textarea { width: 100%; font: 600 16px var(--font-body); color: var(--ink); background: var(--sunken); border: var(--bw) solid var(--line); border-radius: var(--r-md); padding: 10px 14px; transition: box-shadow .15s, border-color .15s; }
.fld select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(-45deg, transparent 50%, var(--ink) 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.fld textarea { resize: vertical; line-height: 1.4; min-height: 80px; }
.fld input:focus, .fld select:focus, .fld textarea:focus, .asel:focus, .rt:focus { outline: none; border-color: var(--primary); box-shadow: 3px 3px 0 var(--primary); }
.fhint { display: block; margin: 5px 0 0; font-size: 13px; color: var(--muted); line-height: 1.35; font-weight: 600; }
.colorrow { display: flex; align-items: center; gap: 10px; } .colorrow input { width: 56px; height: 42px; border: var(--bw) solid var(--line); border-radius: var(--r-sm); padding: 2px; background: var(--sunken); cursor: pointer; } .colorrow code { font-size: 13px; color: var(--muted); }
.fsw { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 0; cursor: pointer; font-weight: 700; }
.fsw small { display: block; font-size: 12.5px; margin-top: 2px; font-weight: 600; }
.fsw input { position: absolute; opacity: 0; }
.sw { flex: none; width: 54px; height: 30px; background: var(--soft); border: var(--bw) solid var(--line); border-radius: var(--r-pill); position: relative; transition: background-color .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: var(--panel); border: var(--bw-sm) solid var(--line); transition: left .22s var(--ease); }
.fsw input:checked + .sw { background: var(--lime); } .fsw input:checked + .sw::after { left: 27px; background: var(--on-bright); border-color: var(--on-bright); }
.ferr { margin: 12px 0 0; padding: 10px 14px; background: color-mix(in srgb, var(--pink) 25%, var(--panel)); border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); font-weight: 800; font-size: 14px; }
.fbtns { margin-top: 18px; gap: 8px; } .fbtns .btn { margin: 0; }
.imgs { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.ph-thumb { position: relative; margin: 0; width: 88px; height: 88px; overflow: hidden; background: var(--sunken); border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); }
.ph-thumb.main { box-shadow: 0 0 0 3px var(--violet); } .ph-thumb.new { border-style: dashed; }
.ph-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ph-thumb .tb { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); color: var(--ink); border: var(--bw-sm) solid var(--line); font: 800 13px var(--font-body); display: grid; place-items: center; }
.ph-thumb .rm { top: 3px; right: 3px; } .ph-thumb .star { bottom: 3px; left: 3px; } .ph-thumb .ed { bottom: 3px; right: 3px; } .ph-thumb.main .star { background: var(--sunny); color: var(--on-bright); }
.ph-thumb .tb .ico { width: 15px; height: 15px; }
.upl { cursor: pointer; }
.rt-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.rt-bar button, .rtimg { padding: 6px 12px; background: var(--panel); border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); font: 800 13px var(--font-body); cursor: pointer; color: var(--ink); }
.rt-bar button:hover, .rtimg:hover { background: var(--sunken); }
.rt { min-height: 160px; max-height: 40dvh; overflow: auto; padding: 12px 14px; background: var(--sunken); line-height: 1.5; border: var(--bw) solid var(--line); border-radius: var(--r-md); }
.rt img { max-width: 100%; border-radius: var(--r-sm); } .rt h3 { margin: 8px 0 4px; }
.astats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin: 4px 4px 16px; }
.astat { padding: 16px; background: var(--panel); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.astat b { display: block; font: 800 30px var(--font-display); line-height: 1; } .astat small { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.amonth { padding: 14px 16px 6px; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; } .amonth h3 { font-size: 16px; }
.abar { padding: 8px 16px 12px; } .abar-l { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 700; }
.iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; margin-top: 10px; max-height: 190px; overflow: auto; padding: 8px; border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); background: var(--sunken); }
.iconpick button { height: 44px; font-size: 22px; line-height: 1; background: var(--panel); border: var(--bw-sm) solid transparent; border-radius: var(--r-sm); }
.iconpick button.on { border-color: var(--line); background: var(--lime); }
dialog.ie { width: min(96vw, 600px); }
.ie-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; } .ie-tools .btn { margin: 0; }
.ie-ratios { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.ie-ratios button { padding: 6px 14px; border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); background: var(--panel); color: var(--ink); font-weight: 800; }
.ie-ratios button.on { background: var(--primary); color: var(--primary-ink); }
.ie-stage { display: grid; place-items: center; background: var(--sunken); padding: 10px; border: var(--bw) solid var(--line); border-radius: var(--r-md); }
.ie-stage canvas { max-width: 100%; display: block; touch-action: none; }
.ie-info { margin-top: 8px; }
.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 4px; }
.qcard { display: flex; flex-direction: column; text-align: left; padding: 0; overflow: hidden; cursor: pointer; color: var(--ink); }
.qimg { aspect-ratio: 3 / 4; background: var(--sunken); display: grid; place-items: center; border-bottom: var(--bw) solid var(--line); overflow: hidden; }
.qimg img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.qnone { display: grid; place-items: center; gap: 4px; color: var(--muted); } .qnone .ico { width: 40px; height: 40px; }
.qbody { padding: 10px 12px 12px; display: grid; gap: 4px; } .qbody b { overflow-wrap: anywhere; font-weight: 800; line-height: 1.25; }
.qbadges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.qd-meta { display: flex; gap: 6px; flex-wrap: wrap; } .qd-hint { font-weight: 700; margin: 10px 0 0; }
.qd-imgs { display: flex; gap: 10px; overflow-x: auto; margin: 12px 0; padding-bottom: 4px; } .qd-imgs img { height: 150px; flex: none; border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); }
.qd-bio { max-height: 30dvh; overflow: auto; line-height: 1.5; }

/* ── Tanulókártya szövege ─────────────────────────────────────────────── */
.person.contain img { object-fit: contain; object-position: center; background: var(--sunken); }
.study-text { flex: 0 1 auto; overflow: auto; min-height: 0; margin: 4px 4px 14px; background: var(--panel); border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.study-text.fresh-card { flex: 1 1 auto; padding: 22px !important; animation: cardin .28s var(--ease-out) both; } .study-text.fresh-card.back { animation-name: cardin-l; }
.study-text.fresh-card .ans { font-size: 22px !important; line-height: 1.2; } .study-text.fresh-card .bio-s { font-size: 17px !important; line-height: 1.65 !important; }
.study-text .ans { font-family: var(--font-display); letter-spacing: -.02em; }

/* ── Reszponzív réteg ─────────────────────────────────────────────────── */
@media (min-width: 900px) { .set-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; } .set-sec { margin-top: 4px; } }
@media (max-width: 899px) { .set-grid > div + div .set-sec { margin-top: 28px; } }
@media (min-width: 1100px) { .alist { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; } .alist > .arow { margin-left: 0; } }
/* kvíz: fekvő és széles képernyőn kép balra, kérdés és válaszok jobbra */
@media (min-width: 760px) and (orientation: landscape) {
  body.focus main:has(> .person) { max-width: 1040px; display: grid; grid-template-columns: minmax(200px, 40%) minmax(0, 1fr); grid-template-rows: auto auto auto auto 1fr auto; column-gap: 32px; align-content: stretch; padding-top: 16px; padding-bottom: 16px; }
  body.focus main:has(> .person) > .person { grid-column: 1; grid-row: 1 / -1; align-self: center; justify-self: center; margin: 4px; flex: none; width: auto; height: auto; max-height: 100%; max-width: 100%; min-height: 0; }
  body.focus main:has(> .person) > .fh { grid-column: 2; grid-row: 1; }
  body.focus main:has(> .person) > .ftitle { grid-column: 2; grid-row: 2; text-align: left; }
  body.focus main:has(> .person) > .q-title { grid-column: 2; grid-row: 3; }
  body.focus main:has(> .person) > .opts { grid-column: 2; grid-row: 4; }
  body.focus main:has(> .person) > .dock, body.focus main:has(> .person) > .sheet { grid-column: 2; grid-row: 6; align-self: end; }
  body.focus main:has(> .person) .opt { min-height: 54px; font-size: 17px; }
}
@media (min-width: 760px) and (orientation: landscape) and (min-height: 900px) { body.focus main:has(> .person) { max-width: 1180px; } }
@media (min-width: 600px) and (orientation: portrait) { body.focus main { max-width: 620px; } }
@media (max-height: 700px) { body.focus .q-title { display: none; } body.focus .person { min-height: 64px; } }
@media (max-height: 680px) { .sheet .bio { font-size: 12px; line-height: 1.3; margin-top: 2px; } .sheet .btn { margin-top: 6px; } }
@media (max-height: 620px) {
  body.focus .ftitle { display: none; }
  .sheet .bio, .sheet .ans small { display: none; }
  .opt { min-height: 42px; padding-top: 5px; padding-bottom: 5px; } .opts { gap: 7px; }
  body.focus .person { min-height: 56px; margin: 4px auto 8px; }
  .sheet { padding: 8px 12px; margin-top: 8px; } .sheet .btn, .dock .btn { margin-top: 6px; min-height: 42px; padding-top: 10px; padding-bottom: 10px; }
}
@media (max-height: 520px) {
  body.focus main { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  body.focus .ftitle, body.focus .q-title { display: none; }
  .icon-btn { width: 38px; height: 38px; }
  .opt { min-height: 38px !important; padding: 4px 10px; font-size: 15px !important; } .opt .lt { width: 26px; height: 26px; font-size: 12px; }
  .result-card { padding: 14px; } .result-card .trophy-emoji { font-size: 44px; margin: 0; } .result-card .score { font-size: 44px; margin: 4px 0; }
}
@media (max-width: 600px) {
  main { padding-top: 14px; padding-bottom: 24px; }
  .topbar-in { min-height: 54px; }
  .ph h1, .ahead h1 { font-size: 22px; }
  .cards { gap: 14px; }
  .alist { gap: 12px; }
}
@media (max-width: 380px) { .act b { font-size: 13.5px; } .act > .ico { width: 44px; height: 44px; padding: 10px; } .cc-name { font-size: 13.5px; } .seg button { padding: 7px 9px; } .topbar .btn.sm span { display: none; } }
@media (max-width: 340px) { .cc { padding-right: 62px; } .cc .dl, .cc .dl-prog { width: 52px; } .tabbar .pill { width: 44px; } }
@media (pointer: coarse) { .tabbar a { min-height: 48px; } }

@media (max-width: 420px) { .act { flex-direction: column; align-items: flex-start; gap: 10px; min-height: 0; padding: 12px; } .act > .ico { width: 46px; height: 46px; padding: 10px; } .act b { font-size: 13.5px; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; } .act > span:last-child { width: 100%; } }

/* sötét mód: az ikonok mindig kontrasztosak */
.act > .ico { background: #FFFFFF; color: var(--on-bright); }
:root[data-theme="dark"] .brand img, :root[data-theme="dark"] .loading img { filter: drop-shadow(1px 0 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 1px 0 #fff) drop-shadow(0 -1px 0 #fff) drop-shadow(3px 3px 0 var(--hard)); }

/* magasabb, egységesebb csoportkártyák */
.cc { min-height: 112px; padding-top: 16px; padding-bottom: 16px; padding-left: 16px; }
.cc.parent { min-height: 84px; }
.cc-name { font-size: 15px; }
.cc .cc-info:not(:empty) { margin-top: 14px; }
@media (max-width: 380px) { .cc { min-height: 104px; } .cc-name { font-size: 14px; } }

/* frissítés alatt lévő (zárolt) csoport: nem kattintható, csíkos, halvány */
.cc.locked { cursor: not-allowed; filter: grayscale(.55); opacity: .75; box-shadow: var(--shadow-sm); background-image: repeating-linear-gradient(135deg, rgba(30, 26, 51, .1) 0 10px, transparent 10px 20px); }
.cc.locked:hover, .cc.locked:active { transform: none; box-shadow: var(--shadow-sm); }

/* beállítások: keskeny kijelzőn ne lógjon ki a vezérlő, a gyűrű belseje legyen kompakt */
div.list > .stat { flex-wrap: wrap; row-gap: 10px; }
div.list > .stat > div:first-child { flex: 1 1 150px; min-width: 0; }
div.list > .stat > .seg, div.list > .stat > span:has(> .btn) { flex: 0 0 auto; margin-left: auto; }
.ring.lg { width: 196px; height: 196px; }
.ring.lg .mid { gap: 2px; padding: 0 34px; }
.ring.lg .mid b { font-size: 26px; } .ring.lg .mid small { font-size: 11px; line-height: 1.25; }
.ring.lg .mid .pc { margin-top: 4px; padding: 1px 8px; font-size: 11px; }

/* frissítés elérhető: jelvény a Beállítások fülön */
body[data-update] .tabbar a[href="#/settings"] .pill::after { content: ""; position: absolute; top: -4px; right: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); border: var(--bw-sm) solid var(--line); }

/* tanulókártya: szöveges megoldás */
.study-text .sol { margin-top: 12px; padding: 12px 14px; background: var(--lime); color: var(--on-bright); border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); font: 800 17px/1.35 var(--font-body); white-space: pre-line; }
.study-text .sol small { display: block; margin-bottom: 2px; font: 800 11px var(--font-body); letter-spacing: .06em; text-transform: uppercase; opacity: .75; }
