/* CELEHub Quiz: only what css/style.css (copied from CELEHub) does not already provide. */
.quiz-wrap { max-width: 860px; margin-inline: auto; }
.topic-badge { background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .85rem; padding: .25rem .7rem; border-radius: 999px; }
.topic-badge[hidden], .q-fatal[hidden], .q-modal[hidden] { display: none; }
.quiz-foot { text-align: center; margin: 1.5rem 0 0; font-size: .85rem; }
.quiz-foot a { color: var(--muted); }
.q-fatal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; }

/* topics */
.topic-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.topic-card {
  position: relative; display: flex; flex-direction: column; gap: .2rem; padding: 1.2rem 1.2rem 1.1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s;
}
a.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--tint); color: var(--text); }
a.topic-card:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; }
.topic-card.is-empty { opacity: .6; }
.topic-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 1.4rem; color: #fff; background: var(--tint); margin-bottom: .5rem; }
.topic-name { font-size: 1.35rem; font-weight: 750; letter-spacing: .01em; }
.topic-full { font-size: .85rem; color: var(--muted); }
.topic-meta { font-size: .82rem; color: var(--muted); margin-top: .3rem; min-height: 1.2em; }
.topic-go { position: absolute; right: 1rem; bottom: 1rem; color: var(--tint); font-size: 1.1rem; }

/* panels */
.q-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.2rem; }
@media (min-width: 768px) { .q-panel { padding: 1.6rem 1.8rem; } }
.q-panel[hidden] { display: none; }
.q-back { display: inline-block; font-size: .85rem; color: var(--muted); text-decoration: none; margin-bottom: .7rem; }
.q-back:hover { color: var(--accent); }
.q-group { margin-bottom: 1.2rem; }
.q-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .4rem; }
.q-seg { display: flex; flex-wrap: wrap; gap: .45rem; }
.q-seg button {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 999px;
  padding: .45rem .95rem; font-weight: 600; font-size: .9rem; transition: background .12s, border-color .12s, color .12s;
}
.q-seg button:hover { border-color: var(--accent); }
.q-seg button[aria-checked="true"], .q-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.q-seg button:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; }
.q-help { font-size: .85rem; color: var(--muted); margin-top: .5rem; min-height: 2.4em; }
.q-time { display: flex; align-items: center; gap: .6rem; margin-top: .4rem; flex-wrap: wrap; }
.q-time[hidden] { display: none; }
.q-time label { font-size: .88rem; font-weight: 600; }
.q-time .form-control { width: 6rem; }
.q-start { width: 100%; padding: .7rem 1rem; font-weight: 650; }
@media (min-width: 576px) { .q-start { width: auto; min-width: 12rem; } }
#startMsg:empty { display: none; }
#startMsg { margin: .6rem 0 0; text-align: left; }

/* exam */
.q-top { display: flex; align-items: center; gap: .8rem; margin-bottom: .9rem; }
.q-count { font-size: .95rem; color: var(--muted); white-space: nowrap; }
.q-count b { color: var(--text); font-size: 1.1rem; }
.q-bar { flex: 1; height: 7px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.q-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 99px; transition: width .25s; }
.q-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .95rem; padding: .25rem .65rem; border-radius: 999px; background: var(--surface-2); color: var(--text); white-space: nowrap; }
.q-timer.warn { background: #fee2e2; color: #b91c1c; animation: qpulse 1s infinite; }
@keyframes qpulse { 50% { opacity: .65; } }

.q-stage { overflow: hidden; margin: 0 -.2rem; padding: .2rem; }
.q-card { background: var(--surface); }
.q-card.in-r { animation: qin-r .26s ease-out; }
.q-card.in-l { animation: qin-l .26s ease-out; }
@keyframes qin-r { from { opacity: 0; transform: translateX(36px); } to { opacity: 1; transform: none; } }
@keyframes qin-l { from { opacity: 0; transform: translateX(-36px); } to { opacity: 1; transform: none; } }
.q-num { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--accent); margin-bottom: .4rem; }
.q-text { font-size: 1.15rem; font-weight: 650; line-height: 1.5; margin: 0 0 1rem; white-space: pre-line; overflow-wrap: anywhere; }
@media (min-width: 768px) { .q-text { font-size: 1.3rem; } }
.q-choices { display: grid; gap: .6rem; }
.q-choice {
  display: flex; align-items: flex-start; gap: .75rem; width: 100%; text-align: left; position: relative;
  border: 2px solid var(--border); background: var(--surface); color: var(--text); border-radius: 14px;
  padding: .75rem .9rem; font-size: 1rem; line-height: 1.45; transition: border-color .12s, background .12s, transform .08s;
}
button.q-choice:hover { border-color: var(--accent); background: var(--accent-soft); }
button.q-choice:active { transform: scale(.995); }
button.q-choice:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 1px; }
.q-choice.is-on { border-color: var(--accent); background: var(--accent-soft); }
.q-letter { flex: none; width: 1.9rem; height: 1.9rem; border-radius: 9px; display: grid; place-items: center; font-weight: 750; font-size: .9rem; background: var(--surface-2); color: var(--muted); }
.q-choice.is-on .q-letter { background: var(--accent); color: #fff; }
.q-ctext { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; padding-top: .15rem; }
.q-nav { display: flex; align-items: center; gap: .6rem; margin-top: 1.1rem; }
.q-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; border-radius: 12px; padding: .55rem 1rem; }
.q-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.q-btn:disabled { opacity: .45; }
.q-btn-main, .q-submit { margin-left: auto; padding: .55rem 1.3rem; font-weight: 650; border-radius: 12px; }
.q-submit { background: #16a34a; color: #fff; border: 0; }
.q-submit:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }
.q-pos { margin: 0 auto; font-size: .88rem; color: var(--muted); }
.q-dots { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; }
.q-dot {
  min-width: 2rem; height: 2rem; padding: 0 .35rem; display: inline-grid; place-items: center; border-radius: 9px; font-size: .8rem; font-weight: 650;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
}
button.q-dot:hover { border-color: var(--accent); }
.q-dot.is-done { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.q-dot.is-past { opacity: .55; }
.q-dot.is-now { outline: 2px solid var(--accent); outline-offset: 1px; color: var(--text); }
.q-dot.is-ok { background: #dcfce7; color: #15803d; border-color: transparent; }
.q-dot.is-bad { background: #fee2e2; color: #b91c1c; border-color: transparent; }
.q-dot.is-skip { background: #e5e7eb; color: #4b5563; border-color: transparent; }
.q-keys { display: none; font-size: .78rem; color: var(--muted); margin: .9rem 0 0; }
@media (hover: hover) and (min-width: 768px) { .q-keys { display: block; } }
kbd { background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 0 .35rem; font-size: .75rem; color: var(--text); }
#examMsg { margin: .8rem 0 0; }

/* review */
.q-score { display: flex; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }
.q-ring {
  --c: var(--accent); flex: none; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-2) 0);
}
.q-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.q-ring span { position: relative; font-weight: 800; font-size: 1.25rem; }
.q-ring.good { --c: #16a34a; } .q-ring.mid { --c: #d97706; } .q-ring.low { --c: #dc2626; }
.q-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.1rem; }
.q-actions .btn { font-weight: 600; border-radius: 12px; }
.q-filters { margin-bottom: .9rem; }
.q-chip { font-size: .7rem; padding: .1rem .5rem; border-radius: 99px; margin-left: .4rem; letter-spacing: .02em; }
.q-chip.ok { background: #dcfce7; color: #15803d; } .q-chip.bad { background: #fee2e2; color: #b91c1c; } .q-chip.skip { background: #e5e7eb; color: #4b5563; }
.q-choice.static { cursor: default; }
.q-choice.is-right { border-color: #16a34a; background: #f0fdf4; }
.q-choice.is-right .q-letter { background: #16a34a; color: #fff; }
.q-choice.is-wrong { border-color: #dc2626; background: #fef2f2; }
.q-choice.is-wrong .q-letter { background: #dc2626; color: #fff; }
.q-tag { flex: none; align-self: center; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #374151; background: rgba(0,0,0,.06); padding: .15rem .5rem; border-radius: 99px; }
.q-choice.is-right .q-tag { background: #bbf7d0; color: #166534; } .q-choice.is-wrong .q-tag { background: #fecaca; color: #991b1b; }
@media (max-width: 480px) { .q-choice.static { flex-wrap: wrap; } .q-tag { margin-left: 2.65rem; } }
.q-expl { display: flex; gap: .7rem; margin-top: 1rem; padding: .9rem 1rem; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }
.q-expl > i { font-size: 1.2rem; color: #d97706; }
.q-expl p { margin: .15rem 0 0; white-space: pre-line; overflow-wrap: anywhere; }

/* confirm */
.q-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 1rem; background: rgba(15, 20, 40, .5); }
.q-modal-card { background: var(--surface); border-radius: var(--radius); padding: 1.3rem; width: min(420px, 100%); box-shadow: 0 20px 50px rgba(0,0,0,.25); }

@media (prefers-reduced-motion: reduce) { .q-card, .q-timer.warn, .q-bar span { animation: none !important; transition: none !important; } }
