/* =========================================================================
   Kvíz UI (PixelKit) – felületi elemek keretrendszere
   Fiatalos, játékos stílus: vastag körvonal, éles árnyék, lekerekített formák,
   élénk színek. Egyetlen CSS: tokenek + komponensek. Világos/sötét: [data-theme]
   vagy a rendszerbeállítás. Betűk: Unbounded (címek, számok) és Figtree (szöveg),
   saját tárhelyről (fonts/), így offline is működnek.
   Használat:  <link rel="stylesheet" href="pixelkit/pixelkit.css">
   ========================================================================= */

/* ── Betűtípusok ───────────────────────────────────────────────────────── */
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(fonts/unbounded-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 200 900; font-display: swap; src: url(fonts/unbounded-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 300 900; font-display: swap; src: url(fonts/figtree-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ── Tokenek ───────────────────────────────────────────────────────────── */
:root {
  /* márkaszínek: világos és sötét módban is ugyanazok */
  --violet: #6C4CFF; --lime: #C6F432; --pink: #FF5FA2; --sky: #43C6FF; --sunny: #FFD23F; --orange: #FF9F43; --lilac: #B9A8FF;
  --on-bright: #1E1A33;               /* szöveg az élénk felületeken, mindkét módban */

  --bg: #F4F2FF; --panel: #FFFFFF; --sunken: #F1EEFF; --ink: #1E1A33; --muted: #615C7A;
  --line: #1E1A33; --soft: #DCD6F5; --hard: #1E1A33;
  --primary: var(--violet); --primary-ink: #FFFFFF; --primary-text: #5536E6;
  --good: var(--lime); --bad: var(--pink); --warn: var(--orange); --info: var(--sky); --gold: var(--sunny);
  --bad-text: #C8175F; --good-text: #3F7A00;

  --font-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 28px; --r-pill: 999px;
  --bw: 2.5px; --bw-sm: 2px;
  --shadow: 4px 4px 0 var(--hard); --shadow-sm: 3px 3px 0 var(--hard);
  --ease: cubic-bezier(.3, 1.3, .5, 1);
  --dur-fast: .12s; --dur-med: .3s; --dur-slow: .6s; --ease-out: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #16141F; --panel: #221F31; --sunken: #1B1828; --ink: #F2F0FF; --muted: #A7A2C2;
    --line: #4A4468; --soft: #36314D; --hard: #07060B;
    --primary-text: #A996FF; --bad-text: #FF8CC0; --good-text: #C6F432;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16141F; --panel: #221F31; --sunken: #1B1828; --ink: #F2F0FF; --muted: #A7A2C2;
  --line: #4A4468; --soft: #36314D; --hard: #07060B;
  --primary-text: #A996FF; --bad-text: #FF8CC0; --good-text: #C6F432;
}
*, *::before, *::after { box-sizing: border-box; }
/* Csökkentett mozgásnál a díszítő animációk (pattogás, belépők) kikapcsolnak, a rövid gombnyomás-átmenetek megmaradnak. */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
.pixel, .display { font-family: var(--font-display); font-weight: 700; }

/* ── Alap felület: keret + éles árnyék ─────────────────────────────────── */
.px-box { background: var(--panel); position: relative; border: var(--bw) solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.px-box.flat { border-width: var(--bw-sm); border-radius: var(--r-md); box-shadow: none; }

/* ── Elrendezés segédek ────────────────────────────────────────────────── */
.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.stack { display: grid; gap: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ── Tipográfia ────────────────────────────────────────────────────────── */
.t-display { font-family: var(--font-display); font-size: 44px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.t-h1 { font-family: var(--font-display); font-size: 30px; line-height: 1.1; font-weight: 800; }
.t-h2 { font-family: var(--font-display); font-size: 22px; line-height: 1.2; font-weight: 700; }
.t-h3 { font-size: 20px; font-weight: 800; }
.t-small { font-size: 14px; color: var(--muted); }
kbd { font-family: var(--font-body); font-weight: 800; font-size: .85em; background: var(--panel); border: var(--bw-sm) solid var(--line); border-radius: 8px; box-shadow: 2px 2px 0 var(--hard); padding: 1px 7px; }

/* ── Gombok ────────────────────────────────────────────────────────────── */
.btn {
  --c: var(--primary); --ci: var(--primary-ink);
  font-family: var(--font-body); font-weight: 800; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--c); color: var(--ci); cursor: pointer; text-decoration: none;
  padding: 12px 20px; border: var(--bw) solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s ease;
}
.btn:not(.text):not([disabled]):hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--hard); }
.btn:not(.text):not([disabled]):active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--hard); transition-duration: .06s; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.good { --c: var(--lime); --ci: var(--on-bright); }
.btn.bad { --c: var(--pink); --ci: var(--on-bright); }
.btn.warn { --c: var(--orange); --ci: var(--on-bright); }
.btn.ghost { --c: var(--panel); --ci: var(--ink); }
.btn.text { background: transparent; color: var(--primary-text); border-color: transparent; box-shadow: none; padding: 8px 6px; text-decoration: underline; text-underline-offset: 4px; }
.btn.sm { font-size: 14px; padding: 9px 14px; border-radius: var(--r-sm); }
.btn.lg { font-size: 18px; padding: 16px 28px; font-family: var(--font-display); font-weight: 700; box-shadow: var(--shadow); }
.btn.icon { padding: 0; width: 44px; height: 44px; }
.btn.icon.sm { width: 38px; height: 38px; }
.btn.block { display: flex; width: 100%; }
.btn-group { display: inline-flex; gap: 4px; padding: 4px; background: var(--sunken); border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); }
.btn-group button { font: 800 15px var(--font-body); background: transparent; color: var(--muted); border: var(--bw-sm) solid transparent; border-radius: var(--r-pill); padding: 7px 16px; cursor: pointer; transition: background-color .18s, color .18s; }
.btn-group button.on { background: var(--primary); color: var(--primary-ink); border-color: var(--line); }

.ico { width: 20px; height: 20px; flex: none; }

/* ── Jelvények, címkék, avatarok ───────────────────────────────────────── */
.badge { --c: var(--primary); --ci: var(--primary-ink); display: inline-block; font: 800 12px/1 var(--font-body); padding: 5px 10px; border-radius: var(--r-pill); background: var(--c); color: var(--ci); border: var(--bw-sm) solid var(--line); }
.badge.good { --c: var(--lime); --ci: var(--on-bright); }
.badge.bad { --c: var(--pink); --ci: var(--on-bright); }
.badge.warn { --c: var(--orange); --ci: var(--on-bright); }
.badge.info { --c: var(--sky); --ci: var(--on-bright); }
.badge.outline { --c: transparent; --ci: var(--ink); border-style: dashed; }
.chip-tag { display: inline-flex; align-items: center; gap: 8px; padding: 4px 5px 4px 12px; border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); background: var(--panel); font-size: 14px; font-weight: 700; }
.chip-tag button { border: 0; background: var(--sunken); color: var(--ink); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; font-weight: 800; line-height: 1; }
.chip-tag button:hover { background: var(--pink); color: var(--on-bright); }
.avatar { width: 44px; height: 44px; display: grid; place-items: center; font: 800 16px var(--font-display); color: var(--on-bright); border: var(--bw) solid var(--line); border-radius: 50%; flex: none; position: relative; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; border-width: var(--bw-sm); }
.avatar.lg { width: 68px; height: 68px; font-size: 24px; box-shadow: var(--shadow-sm); }
.avatar .dot { position: absolute; right: -3px; bottom: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--lime); border: var(--bw-sm) solid var(--line); }

/* ── Űrlap elemek ──────────────────────────────────────────────────────── */
.field { display: grid; gap: 6px; }
.field label, .label { font-weight: 800; font-size: 15px; }
.hint { font-size: 13px; color: var(--muted); }
.hint.err { color: var(--bad-text); font-weight: 800; }
.hint.ok { color: var(--good-text); font-weight: 800; }
.input, .select, .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: 11px 14px; transition: box-shadow .15s, border-color .15s; }
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: .8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 3px 3px 0 var(--primary); }
.input.is-err { border-color: var(--pink); box-shadow: 3px 3px 0 var(--pink); }
.input.is-ok { border-color: var(--good-text); box-shadow: 3px 3px 0 var(--lime); }
.input[disabled] { opacity: .5; }
.textarea { min-height: 100px; resize: vertical; }
.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; }
.input-group { display: flex; align-items: center; gap: 8px; background: var(--sunken); border: var(--bw) solid var(--line); border-radius: var(--r-md); padding-left: 12px; }
.input-group:focus-within { border-color: var(--primary); box-shadow: 3px 3px 0 var(--primary); }
.input-group .addon { display: grid; place-items: center; color: var(--muted); }
.input-group .input { flex: 1; border: 0; box-shadow: none !important; background: transparent; padding-left: 4px; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; font-weight: 700; }
.check input { appearance: none; width: 24px; height: 24px; margin: 0; border: var(--bw) solid var(--line); border-radius: 8px; background: var(--panel); display: grid; place-items: center; cursor: pointer; flex: none; transition: background-color .15s; }
.check input[type=radio] { border-radius: 50%; }
.check input:checked { background: var(--primary); }
.check input[type=checkbox]:checked::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: translateY(-2px) rotate(45deg); }
.check input[type=radio]:checked::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.switch { display: flex; gap: 12px; align-items: center; cursor: pointer; font-weight: 700; }
.switch input { appearance: none; width: 54px; height: 30px; margin: 0; background: var(--soft); border: var(--bw) solid var(--line); border-radius: var(--r-pill); position: relative; cursor: pointer; flex: none; transition: background-color .2s; }
.switch input::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); }
.switch input:checked { background: var(--lime); }
.switch input:checked::after { left: 27px; background: var(--on-bright); border-color: var(--on-bright); }
.range { appearance: none; -webkit-appearance: none; width: 100%; height: 14px; background: var(--sunken); border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); margin: 10px 0; }
.range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); border: var(--bw) solid var(--line); box-shadow: 2px 2px 0 var(--hard); cursor: pointer; }
.range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--primary); border: var(--bw) solid var(--line); cursor: pointer; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); background: var(--panel); }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: var(--bw-sm) solid var(--line); background: var(--sunken); color: var(--ink); font: 800 20px/1 var(--font-body); cursor: pointer; }
.stepper button:active { background: var(--lime); color: var(--on-bright); }
.stepper output { min-width: 44px; text-align: center; font: 800 20px var(--font-display); }

/* ── Visszajelzés ──────────────────────────────────────────────────────── */
.alert { --c: var(--sky); display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md); border: var(--bw-sm) solid var(--line); background: color-mix(in srgb, var(--c) 22%, var(--panel)); }
.alert .ico { flex: none; width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--c); color: var(--on-bright); border: var(--bw-sm) solid var(--line); }
.alert b { display: block; font-weight: 800; }
.alert.good { --c: var(--lime); } .alert.bad { --c: var(--pink); } .alert.warn { --c: var(--orange); }
.progress { height: 16px; border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); background: var(--sunken); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: inherit; background: var(--primary); transition: width .5s var(--ease); }
.progress.good i { background: var(--lime); } .progress.warn i { background: var(--orange); }
.loader { display: inline-flex; gap: 6px; }
.loader 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; }
.loader i:nth-child(2) { animation-delay: .15s; background: var(--lime); } .loader i:nth-child(3) { animation-delay: .3s; background: var(--pink); }
@keyframes pk-hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-8px); } }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 5px solid var(--soft); border-top-color: var(--primary); border-right-color: var(--pink); animation: pk-spin .8s linear infinite; }
@keyframes pk-spin { to { transform: rotate(360deg); } }
.skeleton { height: 14px; border-radius: var(--r-pill); background: var(--soft); position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); animation: pk-shimmer 1.4s infinite; }
@keyframes pk-shimmer { to { transform: translateX(100%); } }
.toast-area { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 90; display: grid; gap: 10px; width: min(340px, calc(100vw - 32px)); }
.toast { display: flex; gap: 10px; align-items: center; padding: 12px 14px; font-weight: 800; border-radius: var(--r-pill) !important; animation: pk-pop .35s var(--ease); }
.toast .ico { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--lime); color: var(--on-bright); border: var(--bw-sm) solid var(--line); }
.toast.err .ico { background: var(--pink); }
@keyframes pk-pop { from { transform: translateY(12px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── Kártyák ───────────────────────────────────────────────────────────── */
.card { display: flex; flex-direction: column; overflow: hidden; }
.card .card-media { height: 120px; background: var(--primary); display: grid; place-items: center; border-bottom: var(--bw) solid var(--line); background-image: radial-gradient(rgba(255, 255, 255, .22) 2px, transparent 2.5px); background-size: 16px 16px; }
.card .card-body { padding: 18px; flex: 1; }
.card .card-body h3 { margin: 0 0 6px; font: 700 18px/1.2 var(--font-display); }
.card .card-body p { margin: 0; color: var(--muted); font-size: 15px; }
.card .card-foot { padding: 12px 18px; border-top: var(--bw-sm) solid var(--soft); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-card { padding: 20px; }
.stat-card .num { font: 800 38px/1 var(--font-display); letter-spacing: -.02em; }
.stat-card .lbl { color: var(--muted); font-size: 14px; margin-top: 8px; }
.quiz-opt { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; font: 700 16px var(--font-body); color: var(--ink); background: var(--panel); border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); padding: 10px 12px; margin-bottom: 10px; cursor: pointer; transition: transform .1s, box-shadow .1s, background-color .2s; }
.quiz-opt:active { transform: translate(3px, 3px); box-shadow: none; }
.quiz-opt .k { font: 700 13px var(--font-display); width: 30px; height: 30px; display: grid; place-items: center; border: var(--bw-sm) solid currentColor; border-radius: 10px; flex: none; }
.quiz-opt.ok { background: var(--lime); color: var(--on-bright); } .quiz-opt.no { background: var(--pink); color: var(--on-bright); }

/* ── Navigáció ─────────────────────────────────────────────────────────── */
.navbar { display: flex; align-items: center; gap: 18px; padding: 12px 18px; flex-wrap: wrap; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; max-width: 100%; overflow-x: auto; background: var(--sunken); border: var(--bw-sm) solid var(--line); border-radius: var(--r-pill); }
.tabs button, .tabs a { font: 800 15px var(--font-body); background: transparent; color: var(--muted); border: var(--bw-sm) solid transparent; border-radius: var(--r-pill); padding: 8px 16px; cursor: pointer; flex: none; text-decoration: none; transition: background-color .18s, color .18s; }
.tabs [aria-selected=true], .tabs .on { background: var(--primary); color: var(--primary-ink); border-color: var(--line); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 15px; }
.crumbs a { text-decoration: none; font-weight: 800; color: var(--primary-text); }
.pager { display: flex; gap: 6px; flex-wrap: wrap; }
.pager button { font: 700 14px var(--font-display); min-width: 42px; height: 42px; border-radius: 50%; background: var(--panel); color: var(--ink); border: var(--bw-sm) solid var(--line); cursor: pointer; }
.pager button.on { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-sm); }
.pager button:disabled { opacity: .4; cursor: default; }
.dropdown { position: relative; display: inline-block; }
.menu { position: absolute; top: calc(100% + 10px); left: 0; min-width: 210px; z-index: 20; padding: 6px; display: none; }
.menu.open { display: block; animation: pk-pop .25s var(--ease); }
.menu button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; font: 700 15px var(--font-body); background: transparent; color: var(--ink); border: 0; border-radius: var(--r-sm); padding: 9px 10px; cursor: pointer; }
.menu button:hover { background: var(--sunken); }
.menu .danger { color: var(--bad-text); }

/* ── Adatok ────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: calc(var(--r-lg) - 3px); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.tbl th { font: 700 13px var(--font-display); text-align: left; background: var(--ink); color: var(--bg); padding: 12px 14px; }
.tbl td { padding: 11px 14px; border-bottom: var(--bw-sm) solid var(--soft); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:nth-child(even) td { background: var(--sunken); }
.list { list-style: none; margin: 0; padding: 6px; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); }
.list > li:hover { background: var(--sunken); }
.list .grow { flex: 1; } .list .t { font-weight: 800; } .list .s { font-size: 13px; color: var(--muted); }
.timeline { list-style: none; margin: 0 0 0 8px; padding: 0 0 0 22px; border-left: 4px solid var(--soft); }
.timeline li { position: relative; padding: 0 0 20px 16px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -35px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--primary); border: var(--bw) solid var(--line); }

/* ── Harmonika, ablak, súgó, üres állapot ──────────────────────────────── */
.acc { padding: 6px; }
.acc details { border-radius: var(--r-md); }
.acc details + details { margin-top: 4px; }
.acc details[open] { background: var(--sunken); }
.acc summary { list-style: none; cursor: pointer; padding: 14px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-radius: var(--r-md); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: "+"; flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; border: var(--bw-sm) solid var(--line); font: 800 16px/1 var(--font-body); transition: transform .25s var(--ease), background-color .2s; }
.acc details[open] summary::after { transform: rotate(45deg); background: var(--lime); color: var(--on-bright); }
.acc .acc-body { padding: 0 14px 16px; color: var(--muted); }
dialog.modal { border: var(--bw) solid var(--line); border-radius: var(--r-xl); padding: 0; max-width: 440px; width: calc(100% - 40px); color: var(--ink); background: var(--panel); box-shadow: 6px 6px 0 var(--hard); overflow: hidden; }
dialog.modal[open] { animation: pk-pop .3s var(--ease); }
dialog.modal::backdrop { background: rgba(22, 20, 31, .55); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; background: var(--pink); color: var(--on-bright); border-bottom: var(--bw) solid var(--line); }
.modal-head h3 { margin: 0; font: 800 18px var(--font-display); }
.modal-head button { width: 34px; height: 34px; border-radius: 50%; background: var(--panel); border: var(--bw-sm) solid var(--line); color: var(--ink); font: 800 18px/1 var(--font-body); cursor: pointer; }
.modal-body { padding: 18px; }
.modal-foot { padding: 4px 18px 18px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.tip { position: relative; display: inline-block; }
.tip .bubble { position: absolute; bottom: calc(100% + 12px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 800; padding: 7px 12px; border-radius: var(--r-sm); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; }
.tip:hover .bubble, .tip:focus-within .bubble { opacity: 1; }
.empty-state { text-align: center; padding: 34px 20px; }
.empty-state h3 { margin: 0 0 4px; font: 700 18px var(--font-display); } .empty-state p { margin: 0 0 14px; color: var(--muted); }

/* ── Mobil: appbar, alsó navigáció ─────────────────────────────────────── */
.appbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px 10px; background: var(--primary); color: var(--primary-ink); border-bottom: var(--bw) solid var(--line); }
.appbar h3 { flex: 1; margin: 0 0 0 6px; font: 800 18px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar.surface { background: var(--panel); color: var(--ink); }
.ab-btn { width: 40px; height: 40px; display: grid; place-items: center; background: transparent; border: 0; border-radius: 50%; color: inherit; cursor: pointer; transition: background-color .18s; }
.ab-btn:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.bnav { display: flex; align-items: stretch; background: var(--panel); border-top: var(--bw) solid var(--line); padding: 8px 4px 12px; }
.bnav > a, .bnav > button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: transparent; border: 0; color: var(--muted); font: 800 11px var(--font-body); cursor: pointer; padding: 0; position: relative; text-decoration: none; }
.bnav .pill { width: 54px; 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); }
.bnav > [aria-current="page"], .bnav > .on { color: var(--ink); }
.bnav > [aria-current="page"] .pill, .bnav > .on .pill { background: var(--lime); color: var(--on-bright); border-color: var(--line); box-shadow: 2px 2px 0 var(--hard); }

/* ── Tanulós elemek: témacsempe, fordítókártya, portrés válasz, gyűjthető kártya ─ */
.topic { --tc: var(--violet); --ts: #D9D1FF; position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; aspect-ratio: 5/4; padding: 16px; text-align: left; cursor: pointer; background: var(--ts); color: var(--on-bright); border: var(--bw) solid var(--line); border-radius: 26px; box-shadow: var(--shadow); font: inherit; transition: transform .12s, box-shadow .12s; }
.topic:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--hard); }
.topic .t-ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r-md); font-size: 24px; background: var(--tc); border: var(--bw-sm) solid var(--line); box-shadow: var(--shadow-sm); transform: rotate(-6deg); }
.topic b { display: block; font: 700 16px/1.15 var(--font-display); } .topic small { font-size: 13px; font-weight: 800; opacity: .7; }
.flip { perspective: 1200px; width: 250px; height: 330px; margin: 0 auto; cursor: pointer; }
.flip-in { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .6s var(--ease); }
.flip.is-flipped .flip-in { transform: rotateY(180deg); }
.flip-side { position: absolute; inset: 0; overflow: hidden; border-radius: var(--r-lg); border: var(--bw) solid var(--line); box-shadow: var(--shadow); background: #D9D1FF; color: var(--on-bright); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.flip-back { transform: rotateY(180deg); }
.ans-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ans-p { position: relative; padding: 0; aspect-ratio: 3/4; overflow: hidden; border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); background: var(--sunken); cursor: pointer; transition: transform .1s, box-shadow .1s, opacity .2s; }
.ans-p.ok { outline: 4px solid var(--lime); outline-offset: -1px; } .ans-p.no { outline: 4px solid var(--pink); outline-offset: -1px; } .ans-p.dim { opacity: .4; }

/* ── Játékosítás: gyűrű, hét, dobogó, kitűzők, eredmény ────────────────── */
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; }
.ring .edge { stroke: var(--line); stroke-width: 2.5; }
.ring .track { stroke: var(--sunken); stroke-width: 15; }
.ring .val { stroke: var(--lime); stroke-width: 15; stroke-linecap: round; transition: stroke-dashoffset .9s var(--ease); }
.ring .mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .mid b { font: 800 26px/1 var(--font-display); } .ring .mid small { font-size: 12px; font-weight: 800; color: var(--muted); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.day { display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--muted); }
.day i { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; border: var(--bw-sm) solid var(--line); background: var(--sunken); font-style: normal; font-size: 16px; }
.day.on i { background: var(--sunny); box-shadow: 2px 2px 0 var(--hard); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; padding-top: 6px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.pod .stand { width: 100%; display: grid; justify-items: center; padding-top: 10px; border: var(--bw) solid var(--line); border-radius: var(--r-md) var(--r-md) 6px 6px; font: 800 28px/1 var(--font-display); color: var(--on-bright); box-shadow: var(--shadow-sm); }
.pod.p1 .stand { height: 124px; background: var(--sunny); } .pod.p2 .stand { height: 92px; background: var(--lilac); } .pod.p3 .stand { height: 70px; background: var(--sky); }
.achs { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.ach { display: grid; justify-items: center; align-content: start; gap: 6px; padding: 18px 10px 16px; text-align: center; border-radius: var(--r-lg); border: var(--bw-sm) solid var(--line); background: var(--panel); }
.ach .medal { --mc: var(--sunny); width: 66px; height: 66px; margin-bottom: 6px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--mc); border: var(--bw) solid var(--line); box-shadow: var(--shadow-sm); transform: rotate(-8deg); }
.ach.locked { background: var(--sunken); border-style: dashed; }
.ach.locked .medal { background: var(--panel); border-style: dashed; box-shadow: none; filter: grayscale(1); opacity: .55; }
.result-card { position: relative; overflow: hidden; text-align: center; padding: 30px 20px 26px; background: var(--violet); color: #fff; }
.result-card .score { font: 800 clamp(64px, 12vw, 92px)/1 var(--font-display); letter-spacing: -.03em; margin: 14px 0 6px; }
.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; }

/* ── Feladattípusok: időzítő, igaz/hamis, párosítás, beírós ────────────── */
.timer { position: relative; width: 76px; height: 76px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: var(--panel); stroke-width: 8; } .timer .track { stroke: var(--sunken); }
.timer .val { fill: none; stroke: var(--lime); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font: 800 22px var(--font-display); }
.timer.low .val { stroke: var(--pink); }
.tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tf-btns .btn.picked { outline: 4px solid var(--ink); outline-offset: 3px; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-item { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 8px 10px; border: var(--bw-sm) solid var(--line); border-radius: var(--r-md); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); font: 800 14px/1.2 var(--font-body); text-align: left; cursor: pointer; }
.m-item.sel { background: color-mix(in srgb, var(--violet) 22%, var(--panel)); outline: 3px solid var(--violet); outline-offset: 2px; }
.m-item.paired { background: color-mix(in srgb, var(--lime) 55%, var(--panel)); box-shadow: none; cursor: default; }
.letters { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.letters span { width: 24px; height: 30px; display: grid; place-items: center; border-bottom: 3px solid var(--line); font: 700 14px var(--font-display); }
.letters span.shown { background: var(--sunny); color: var(--on-bright); border-radius: 6px 6px 0 0; }

/* ── Feltöltés és szűrés ───────────────────────────────────────────────── */
.drop { display: grid; justify-items: center; gap: 8px; padding: 30px 20px; text-align: center; cursor: pointer; border: var(--bw) dashed var(--line); border-radius: var(--r-lg); background: var(--sunken); transition: background-color .2s, transform .25s var(--ease); }
.drop.over { background: color-mix(in srgb, var(--lime) 40%, var(--panel)); border-style: solid; transform: rotate(-1deg) scale(1.01); }
.fchips { display: flex; flex-wrap: wrap; gap: 8px; }
.fchip { padding: 6px 14px; border-radius: var(--r-pill); border: var(--bw-sm) solid var(--line); background: transparent; color: var(--ink); font: 800 14px var(--font-body); cursor: pointer; transition: background-color .15s, color .15s; }
.fchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }

/* ── Animációk ─────────────────────────────────────────────────────────── */
@keyframes k-pop { 0% { scale: 0; rotate: -14deg; opacity: 0; } 65% { scale: 1.15; rotate: 4deg; opacity: 1; } 100% { scale: 1; rotate: 0deg; } }
@keyframes k-slap { 0% { scale: 1.8; rotate: -18deg; opacity: 0; } 55% { scale: .9; rotate: 5deg; opacity: 1; } 100% { scale: 1; rotate: 0deg; } }
@keyframes k-bounce { 0%, 100% { translate: 0 0; scale: 1; } 30% { translate: 0 -18px; scale: 1.05 .95; } 55% { translate: 0 0; scale: .94 1.06; } 75% { translate: 0 -5px; scale: 1; } }
@keyframes k-jelly { 0%, 100% { scale: 1; } 30% { scale: 1.16 .86; } 50% { scale: .9 1.1; } 70% { scale: 1.05 .97; } }
@keyframes k-wiggle { 20% { rotate: -12deg; } 40% { rotate: 10deg; } 60% { rotate: -6deg; } 80% { rotate: 3deg; } }
@keyframes k-rise { from { translate: 0 18px; opacity: 0; } to { translate: 0 0; opacity: 1; } }
@keyframes k-shake { 25% { translate: -6px 0; } 75% { translate: 6px 0; } }
.a-pop { animation: k-pop .45s var(--ease) both; }
.a-slap { animation: k-slap .5s var(--ease) both; }
.a-bounce { animation: k-bounce .7s var(--ease-out); }
.a-shake { animation: k-shake .4s; }
.a-jelly { animation: k-jelly .5s ease; }
.a-wiggle { animation: k-wiggle .7s ease; }
.a-rise { animation: k-rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
