/* ICH_Quiz — quiz player + builder + results (organisms) | BMSoft1024
   Minden kérdéstípus stílusa itt él, egységesen. */
.hero{text-align:center;padding:56px 0 10px}
.hero h1{font-size:3rem;line-height:1.06;margin:12px 0}
.hero p{color:var(--muted);max-width:580px;margin:0 auto 22px;font-size:var(--fs-lg)}
.cta{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}
.stats-row{display:flex;gap:14px;justify-content:center;margin-top:34px;flex-wrap:wrap}
.stats-row .stat{flex:1 1 0;min-width:120px;max-width:150px;text-align:center}

.play-wrap{margin:0 auto;width:100%}
.progress{height:9px;border-radius:var(--r-full);background:rgba(255,255,255,.08);overflow:hidden;margin:10px 0 6px}
.progress > i{display:block;height:100%;background:var(--grad-brand);transition:width .3s}
.timer{font-weight:700;color:var(--amber)}
.q-text{font-size:1.3rem;margin:14px 0 4px}

/* Non-destructive image "fit" frame (2026-07-08) — the ORIGINAL uploaded image is never baked/cropped
   on disk; a .fit-frame wraps it and CSS (plus a little JS for the cover-v pan, see image-fit.js)
   decides how it's DISPLAYED, per the creator's chosen mode (stored as imageFit/coverFit etc. next to
   the URL — see includes/api_drive.php quiz schema). Re-editing the crop later always starts from the
   full original image again, nothing is ever lost. Three modes:
   - mode-cover:    fills the frame completely, cropping the minimum needed (pan/zoom adjustable —
                    object-position is the stored focal point, transform:scale is the stored zoom).
   - mode-cover-v:  height ALWAYS fills the frame; width is left as-is (pillarboxed) if the image is
                    narrower than the frame, or center-cropped (pannable — see image-fit.js) if wider.
   - mode-contain:  the WHOLE image is always visible, letterboxed on whichever axis doesn't fill —
                    this is the DEFAULT for new images (never crops anything).
   .fit-frame itself carries the fixed box the old .q-media/.ans-img img tags used to size themselves
   to directly — a determinate box is required for all three modes to size correctly against. */
.fit-frame{position:relative;overflow:hidden;background:var(--glass-2,rgba(255,255,255,.05))}
.fit-frame img{display:block}
.fit-frame.mode-cover img,.fit-frame.mode-contain img{position:absolute;inset:0;width:100%;height:100%}
.fit-frame.mode-cover img{object-fit:cover}
.fit-frame.mode-contain img{object-fit:contain}
.fit-frame.mode-cover-v{display:flex;align-items:center;justify-content:center}
.fit-frame.mode-cover-v img{position:relative;height:100%;width:auto;max-width:none;flex-shrink:0}

.q-media.fit-frame{border-radius:var(--r-md);margin:10px 0;height:260px;width:100%}
.ans-img.fit-frame{border-radius:10px;height:120px;width:100%;margin-bottom:8px}

/* video quiz: intro / per-question clip / cue-points */
.video-wrap{position:relative;margin:12px 0;border-radius:var(--r-md);overflow:hidden;background:#000;aspect-ratio:16/9}
.video-wrap iframe,.video-wrap video{position:absolute;inset:0;width:100%;height:100%;border:0;display:block}
.watch-gate{display:flex;justify-content:center;margin:14px 0}
.cue-overlay{margin-top:0}
.cue-overlay.active{margin-top:16px;padding-top:16px;border-top:1px solid var(--line);animation:cueIn .25s ease}
@keyframes cueIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* MCQ / multi-select / image / true-false grid */
.answers{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}
.answers.single{grid-template-columns:1fr}
.ans{padding:18px;border-radius:var(--r-md);background:var(--glass-2);border:1px solid var(--line);
  cursor:pointer;font-weight:600;transition:.16s;display:flex;align-items:center;gap:10px}
.ans:hover{border-color:var(--primary);transform:translateY(-2px)}
.ans.sel{background:rgba(99,102,241,.22);border-color:var(--primary)}
.ans.correct{background:rgba(16,185,129,.18);border-color:var(--green)}
.ans.wrong{background:rgba(239,68,68,.18);border-color:var(--red)}
.ans .sym{width:24px;height:24px;border-radius:6px;display:flex;align-items:center;justify-content:center;background:var(--glass);flex:none}

/* text input / fill blank */
.ans-text{margin-top:14px}
/* slider */
.slider-wrap{margin-top:22px}
.slider-wrap input[type=range]{width:100%}
.slider-val{font-size:2rem;font-weight:800;text-align:center;color:var(--primary)}
/* sorting */
.sortable{margin-top:14px;display:flex;flex-direction:column;gap:8px}
.sort-item{padding:13px;border-radius:var(--r-sm);background:var(--glass-2);border:1px solid var(--line);
  cursor:grab;display:flex;align-items:center;gap:10px}
.sort-item .handle{color:var(--muted)}
.sort-item.dragging{opacity:.5;border-color:var(--primary)}

/* feedback / explanation */
.feedback{margin-top:16px;padding:14px;border-radius:var(--r-md);border:1px solid var(--line)}
.feedback.ok{background:rgba(16,185,129,.12);border-color:rgba(16,185,129,.35)}
.feedback.no{background:rgba(239,68,68,.12);border-color:rgba(239,68,68,.35)}

/* results */
.score-ring{width:120px;height:120px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  margin:0 auto;box-shadow:0 0 40px -8px rgba(16,185,129,.5)}
.score-ring b{background:var(--bg);width:92px;height:92px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:1.5rem}
.lb-row{display:flex;align-items:center;gap:12px;padding:11px 10px;border-bottom:1px solid var(--line)}
.lb-row.me{background:rgba(99,102,241,.16);border-radius:var(--r-sm);border:1px solid rgba(99,102,241,.3)}
.rank{width:30px;font-weight:800;background:var(--grad-brand);-webkit-background-clip:text;background-clip:text;color:transparent}

/* builder */
.b-side a{display:block;padding:9px 12px;border-radius:var(--r-sm);color:var(--muted);font-size:.88rem;margin-bottom:4px;cursor:pointer}
.b-side a.on{background:rgba(99,102,241,.18);color:var(--text);border:1px solid rgba(99,102,241,.3)}
.opt{display:flex;align-items:center;gap:10px;background:var(--glass-2);border:1px solid var(--line);
  border-radius:var(--r-sm);padding:11px;margin-bottom:8px}
.opt.correct{border-color:var(--green);background:rgba(16,185,129,.12)}
.opt .dot{width:17px;height:17px;border-radius:50%;border:2px solid var(--muted);flex:none;cursor:pointer}
.opt.correct .dot{border-color:var(--green);background:var(--green)}

/* xp + badges */
.xp{height:11px;border-radius:var(--r-full);background:rgba(255,255,255,.08);overflow:hidden;margin-top:6px}
.xp > i{display:block;height:100%;background:linear-gradient(90deg,var(--green),var(--primary))}
.badges{display:flex;gap:13px;flex-wrap:wrap}
.embed-frame{border:1px dashed var(--line);border-radius:var(--r-md);padding:14px;background:rgba(0,0,0,.2)}

/* asset picker (builder) */
.asset-field{background:var(--glass-2);border:1px solid var(--line);border-radius:var(--r-sm);padding:10px;margin-top:6px}
.asset-current{display:flex;align-items:center;gap:10px;margin-top:8px;flex-wrap:wrap;min-height:20px}
.asset-thumb{height:46px;width:46px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.asset-name{font-size:.82rem;color:var(--text);max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.asset-modal{position:fixed;inset:0;background:rgba(0,0,0,.85);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);z-index:var(--z-modal);display:flex;align-items:center;justify-content:center;padding:20px}
/* Any open .asset-modal (confirm dialogs, cropper, bulk-action popups, category form, ...) must lock
   the page behind it — position:fixed alone doesn't stop wheel/touch scroll from reaching the body.
   :has() is a single global fix instead of patching every JS file that creates one of these overlays. */
body:has(.asset-modal){overflow:hidden}
.asset-modal-box{max-width:680px;width:100%;max-height:80vh;display:flex;flex-direction:column;overflow:hidden}
/* Generic modal layout: title stays at the top, the second-to-last child is the scrollable body,
   and the last direct .row is the fixed action-footer. No extra background is added to the footer —
   the buttons sit directly on the modal glass. */
.glass.pad.asset-modal-box{padding:0 var(--sp-lg)}
.asset-modal-box > h3:first-child{margin:0;padding:18px 0 14px;line-height:1.2}
.asset-modal-box > *{flex:0 0 auto}
.asset-modal-box > *:nth-last-child(2){flex:1 1 auto;min-height:0;overflow:auto}
.asset-modal-box > .row:last-child{flex:0 0 auto;padding:12px 0 20px;margin-top:0}
.asset-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;margin-top:6px}
.asset-cell{border:1px solid var(--line);border-radius:var(--r-sm);padding:8px;cursor:pointer;text-align:center;transition:.15s;background:var(--glass-2)}
.asset-cell:hover{border-color:var(--primary);transform:translateY(-2px)}
.asset-cell img{height:84px;width:100%;object-fit:cover;border-radius:8px}
.asset-cell .asset-audio{height:84px;display:flex;align-items:center;justify-content:center;font-size:2rem;background:var(--glass);border-radius:8px}
.asset-cell-name{font-size:.74rem;color:var(--muted);margin-top:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* toast */
#toast{position:fixed;bottom:20px;left:50%;transform:translateX(-50%) translateY(20px);opacity:0;
  background:var(--glass);border:1px solid var(--line);-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);padding:12px 18px;
  border-radius:var(--r-md);z-index:var(--z-toast);transition:.25s;max-width:90vw}
#toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

@media(max-width:900px){.answers{grid-template-columns:1fr}.hero h1{font-size:2.1rem}.q-text{font-size:1.1rem}}

/* Start gate (user-reported 2026-07-10: opening a shared quiz link used to jump straight into
   question 1 with the timer already running) — a deliberate "Kvíz indítása" tap card. */
.start-gate{padding:44px 24px}
.start-gate-icon{width:64px;height:64px;margin:0 auto 14px;border-radius:50%;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));display:flex;align-items:center;
  justify-content:center;font-size:1.6rem;color:#fff}
