/* =====================================================================
   QUIZLINO – Author box (blog) + Game guides (brain games)
   Works in both dark and light theme (uses the site colour tokens).
   ===================================================================== */

/* ---------- Author box ---------- */
.qz-author-box {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.10), rgba(217, 70, 239, 0.05));
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    padding: 1.5rem;
    color: var(--text-primary);
}
.qz-author-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.9rem; }
.qz-author-avatar {
    width: 72px; height: 72px; min-width: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(139, 92, 246, 0.45);
    box-shadow: 0 6px 18px rgba(139, 92, 246, 0.25);
}
.qz-author-initials {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    color: #ffffff;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.6rem;
}
.qz-author-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
}
.qz-author-name { font-size: 1.25rem; font-weight: 700; margin: 0.1rem 0 0.15rem; color: var(--text-primary); }
.qz-author-role { font-size: 0.88rem; color: var(--primary-hover); font-weight: 600; }
.qz-author-bio { color: var(--text-secondary); line-height: 1.65; margin-bottom: 0.9rem; font-size: 0.97rem; }
.qz-author-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1rem; }
.qz-author-tag {
    font-size: 0.75rem; font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.28);
    color: var(--text-primary);
}
.qz-author-foot {
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem;
    padding-top: 0.9rem;
    border-top: 1px dashed rgba(139, 92, 246, 0.3);
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.qz-author-foot a { color: var(--primary-hover); font-weight: 600; text-decoration: none; }
.qz-author-foot a:hover { text-decoration: underline; }
@media (max-width: 576px) {
    .qz-author-box { padding: 1.15rem; }
    .qz-author-avatar { width: 58px; height: 58px; min-width: 58px; }
    .qz-author-initials { font-size: 1.3rem; }
}

/* ---------- Game guide ---------- */
.qz-game-guide {
    max-width: 760px;
    margin: 2rem auto 1rem;
    padding: 1.75rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.25rem;
    color: var(--text-primary);
    line-height: 1.7;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.qz-guide-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 1rem; }
.qz-guide-icon {
    width: 52px; height: 52px; min-width: 52px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    border-radius: 1rem;
    background: rgba(139, 92, 246, 0.14);
    border: 1px solid rgba(139, 92, 246, 0.3);
}
.qz-guide-title { font-size: 1.45rem; font-weight: 700; margin: 0; color: var(--text-primary); }
.qz-guide-skill { font-size: 0.82rem; font-weight: 600; color: var(--primary-hover); }
.qz-guide-about { color: var(--text-secondary); font-size: 1rem; }
.qz-guide-h3 { font-size: 1.08rem; font-weight: 700; margin: 1.4rem 0 0.6rem; color: var(--text-primary); }
.qz-guide-steps, .qz-guide-tips { padding-left: 1.3rem; color: var(--text-secondary); margin-bottom: 0; }
.qz-guide-steps li, .qz-guide-tips li { margin-bottom: 0.35rem; }
.qz-guide-steps li::marker { color: var(--primary-hover); font-weight: 700; }
.qz-guide-tips li::marker { color: var(--gold); }
.qz-game-guide strong { color: var(--text-primary); }
.qz-guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.1rem; }
.qz-guide-panel {
    padding: 0.4rem 1.1rem 0.9rem;
    border-radius: 1rem;
    background: rgba(139, 92, 246, 0.07);
    border: 1px solid rgba(139, 92, 246, 0.18);
}
.qz-guide-panel p { color: var(--text-secondary); margin: 0; font-size: 0.95rem; }
.qz-guide-panel .qz-guide-h3 { margin-top: 0.8rem; }
.qz-guide-faq details {
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 0.8rem;
    padding: 0.7rem 1rem;
    margin-bottom: 0.55rem;
    background: rgba(139, 92, 246, 0.05);
}
.qz-guide-faq summary { cursor: pointer; font-weight: 600; color: var(--text-primary); }
.qz-guide-faq details p { margin: 0.5rem 0 0; color: var(--text-secondary); font-size: 0.95rem; }
.qz-guide-more { margin-top: 1.4rem; padding-top: 0.3rem; border-top: 1px dashed rgba(139, 92, 246, 0.3); }
.qz-guide-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.qz-guide-links a {
    text-decoration: none;
    font-size: 0.86rem; font-weight: 600;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.28);
    transition: background 0.2s ease, transform 0.2s ease;
}
.qz-guide-links a:hover { background: rgba(139, 92, 246, 0.22); transform: translateY(-1px); }
.qz-guide-note { font-size: 0.82rem; color: var(--text-secondary); margin: 0.9rem 0 0; }
@media (max-width: 640px) {
    .qz-game-guide { padding: 1.2rem; margin-top: 1.5rem; }
    .qz-guide-grid { grid-template-columns: 1fr; }
    .qz-guide-title { font-size: 1.25rem; }
}

/* =====================================================================
   v3 additions: breadcrumbs, TOC, reading progress, related posts,
   author page, blog tools, share, back-to-top, cookie notice
   ===================================================================== */
.qz-author-name a { color: inherit; text-decoration: none; }
.qz-author-name a:hover { color: var(--primary-hover); }

/* Breadcrumbs */
.qz-breadcrumb {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
    font-size: 0.82rem; color: var(--text-secondary);
    margin: 0 0 0.9rem 0.25rem;
}
.qz-breadcrumb a { color: var(--primary-hover); text-decoration: none; font-weight: 600; }
.qz-breadcrumb a:hover { text-decoration: underline; }
.qz-breadcrumb-current {
    max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Reading progress bar */
.qz-read-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 3px;
    z-index: 2000; pointer-events: none; background: transparent;
}
.qz-read-progress span {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, #8b5cf6, #d946ef, #f5b942);
    transition: width 0.1s linear;
}

/* Table of contents */
.qz-toc {
    background: rgba(139, 92, 246, 0.07);
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 1rem;
    padding: 0.9rem 1.2rem;
    margin-bottom: 1.75rem;
}
.qz-toc summary { cursor: pointer; font-weight: 700; color: var(--text-primary); }
.qz-toc ol { margin: 0.7rem 0 0; padding-left: 1.2rem; }
.qz-toc li { margin-bottom: 0.3rem; font-size: 0.95rem; }
.qz-toc li.qz-toc-h3 { margin-left: 0; }
.qz-toc a { color: var(--primary-hover); text-decoration: none; }
.qz-toc a:hover { text-decoration: underline; }
#qzArticleBody h2, #qzArticleBody h3 { scroll-margin-top: 90px; }

/* Related / list cards */
.qz-related-card {
    display: flex; flex-direction: column; gap: 0.35rem; height: 100%;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    text-decoration: none;
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.18);
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.qz-related-card:hover { transform: translateY(-2px); border-color: rgba(139, 92, 246, 0.45); background: rgba(139, 92, 246, 0.11); }
.qz-related-cat {
    align-self: flex-start;
    font-size: 0.7rem; font-weight: 700;
    padding: 0.2rem 0.6rem; border-radius: 999px;
    background: rgba(139, 92, 246, 0.15); color: var(--primary-hover);
}
.qz-related-title { font-weight: 700; color: var(--text-primary); line-height: 1.35; }
.qz-related-meta { font-size: 0.78rem; color: var(--text-secondary); margin-top: auto; }

/* Share buttons */
.qz-share-btn {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-primary);
    font-weight: 700; font-size: 0.95rem;
    text-decoration: none; cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.qz-share-btn:hover { background: rgba(139, 92, 246, 0.25); transform: translateY(-1px); color: var(--text-primary); }

/* Author page */
.qz-author-avatar-lg { width: 120px !important; height: 120px !important; min-width: 120px !important; font-size: 2.6rem !important; }
.qz-author-hero { background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(217, 70, 239, 0.06)) !important; }
.qz-author-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
    margin-top: 1.5rem; padding-top: 1.25rem;
    border-top: 1px dashed rgba(139, 92, 246, 0.3);
    text-align: center;
}
.qz-author-stats strong { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--text-primary); }
.qz-author-stats span { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-secondary); }
.qz-prose { color: var(--text-secondary); line-height: 1.8; font-size: 0.98rem; }
.qz-prose h2 { font-size: 1.12rem; font-weight: 700; color: var(--text-primary); margin: 1.6rem 0 0.6rem; }
.qz-prose a { color: var(--primary-hover); font-weight: 600; }
.qz-prose strong { color: var(--text-primary); }
.qz-prose ul { padding-left: 1.2rem; }
.qz-prose li { margin-bottom: 0.4rem; }

/* About page founder chip */
.qz-about-founder { display: flex; align-items: center; gap: 0.8rem; margin: 0.4rem 0 0.8rem; color: var(--text-primary); }
.qz-about-founder .qz-author-avatar { width: 52px; height: 52px; min-width: 52px; font-size: 1.1rem; }

/* Blog tools */
.qz-blog-tools { display: flex; flex-direction: column; gap: 0.8rem; }
.qz-blog-tools .form-control { max-width: 460px; margin: 0 auto; border-radius: 999px; padding: 0.6rem 1.1rem; }
.qz-blog-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.45rem; }
.qz-chip {
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.08);
    color: var(--text-primary);
    font-size: 0.8rem; font-weight: 600;
    padding: 0.35rem 0.85rem; border-radius: 999px;
    cursor: pointer; transition: background 0.2s ease;
}
.qz-chip:hover { background: rgba(139, 92, 246, 0.2); }
.qz-chip.active { background: linear-gradient(135deg, #8b5cf6, #d946ef); color: #fff; border-color: transparent; }

/* Footer credit */
.qz-footer-credit { font-size: 0.78rem; }
.qz-footer-credit a { color: inherit; font-weight: 700; }

/* Back to top */
.qz-back-top {
    position: fixed; right: 18px; bottom: 22px; z-index: 1040;
    width: 44px; height: 44px; border-radius: 50%;
    border: none; color: #fff; font-size: 1.2rem; font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6, #d946ef);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.qz-back-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* Cookie notice */
.qz-cookie {
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 1060;
    max-width: 640px; margin: 0 auto;
    display: flex; align-items: center; gap: 1rem;
    padding: 0.9rem 1.1rem;
    border-radius: 1rem;
    background: rgba(20, 14, 50, 0.97);
    border: 1px solid rgba(139, 92, 246, 0.35);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    color: #e2e8f0;
}
.qz-cookie[hidden] { display: none; }
.qz-cookie p { margin: 0; font-size: 0.82rem; line-height: 1.5; }
.qz-cookie a { color: #c4b5fd; font-weight: 600; }
.qz-cookie .btn { white-space: nowrap; }
html[data-theme="light"] .qz-cookie { background: #ffffff; color: #1e1b3a; box-shadow: 0 12px 35px rgba(60, 40, 120, 0.18); }
html[data-theme="light"] .qz-cookie a { color: #6d28d9; }

@media (max-width: 768px) {
    /* keep clear of the mobile bottom navigation */
    .qz-back-top { bottom: 86px; }
    .qz-cookie { bottom: 80px; }
}
@media (max-width: 576px) {
    .qz-cookie { flex-direction: column; align-items: stretch; text-align: center; }
    .qz-author-stats strong { font-size: 1.2rem; }
}

/* Quiz links written inside blog articles */
.qz-inline-quiz-link {
    color: var(--primary-hover);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 2px solid rgba(139, 92, 246, 0.35);
    transition: border-color 0.2s ease, color 0.2s ease;
}
.qz-inline-quiz-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.qz-inline-quiz-link::after { content: " →"; font-weight: 700; }

/* =====================================================================
   Educational Articles: Knowledge Check + reading progress
   ===================================================================== */
.qz-kc {
    border-radius: 1.25rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(139, 92, 246, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.28);
}
.qz-kc-head { display: flex; gap: 0.9rem; align-items: center; margin-bottom: 1.1rem; }
.qz-kc-icon {
    width: 50px; height: 50px; min-width: 50px; border-radius: 1rem;
    display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
    background: rgba(139, 92, 246, 0.16);
}
.qz-kc-title { font-size: 1.3rem; font-weight: 700; margin: 0; color: var(--text-primary); }
.qz-kc-sub { margin: 0.15rem 0 0; font-size: 0.9rem; color: var(--text-secondary); }
.qz-kc-list { list-style: none; padding: 0; margin: 0; counter-reset: kc; }
.qz-kc-q { counter-increment: kc; padding: 1rem 0; border-top: 1px dashed rgba(139, 92, 246, 0.25); }
.qz-kc-q:first-child { border-top: none; padding-top: 0; }
.qz-kc-text { font-weight: 600; color: var(--text-primary); margin-bottom: 0.7rem; }
.qz-kc-text::before { content: counter(kc) ". "; color: var(--primary-hover); }
.qz-kc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.qz-kc-opt {
    display: flex; align-items: center; gap: 0.6rem; text-align: left;
    padding: 0.65rem 0.85rem; border-radius: 0.8rem;
    border: 1px solid rgba(139, 92, 246, 0.25);
    background: rgba(139, 92, 246, 0.06);
    color: var(--text-primary); font-size: 0.93rem; cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.qz-kc-opt:hover:not(:disabled) { background: rgba(139, 92, 246, 0.16); transform: translateY(-1px); }
.qz-kc-opt:disabled { cursor: default; opacity: 0.85; }
.qz-kc-letter {
    width: 26px; height: 26px; min-width: 26px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700;
    background: rgba(139, 92, 246, 0.2); color: var(--text-primary);
}
.qz-kc-opt.right { background: rgba(16, 185, 129, 0.18); border-color: #10b981; opacity: 1; }
.qz-kc-opt.right .qz-kc-letter { background: #10b981; color: #fff; }
.qz-kc-opt.wrong { background: rgba(239, 68, 68, 0.15); border-color: #ef4444; opacity: 1; }
.qz-kc-opt.wrong .qz-kc-letter { background: #ef4444; color: #fff; }
.qz-kc-expl { margin: 0.7rem 0 0; font-size: 0.9rem; color: var(--text-secondary); }
.qz-kc-result {
    margin-top: 1rem; padding: 0.9rem 1rem; border-radius: 0.9rem;
    background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--text-primary);
}
@media (max-width: 576px) { .qz-kc-options { grid-template-columns: 1fr; } .qz-kc { padding: 1.15rem; } }

.qz-learn-progress {
    padding: 1rem 1.2rem; border-radius: 1rem;
    background: rgba(139, 92, 246, 0.08); border: 1px solid rgba(139, 92, 246, 0.25);
    color: var(--text-primary);
}
.qz-learn-progress a { color: var(--primary-hover); font-weight: 700; }
.qz-learn-bar { height: 8px; border-radius: 999px; background: rgba(139, 92, 246, 0.15); overflow: hidden; }
.qz-learn-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8b5cf6, #d946ef); border-radius: 999px; transition: width 0.6s ease; }
.qz-read-badge {
    font-size: 0.72rem; font-weight: 700; padding: 0.2rem 0.55rem; border-radius: 999px;
    background: rgba(16, 185, 129, 0.15); color: #059669; border: 1px solid rgba(16, 185, 129, 0.35);
}
html:not([data-theme="light"]) .qz-read-badge { color: #6ee7b7; }
.qz-read-badge[hidden] { display: none; }

/* ---------- Article tools, key takeaways, glossary tooltips, badges ---------- */
.qz-article-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.qz-tool-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.4rem 0.9rem; border-radius: 999px;
    font-size: 0.82rem; font-weight: 600; text-decoration: none; cursor: pointer;
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.1); border: 1px solid rgba(139, 92, 246, 0.28);
}
.qz-tool-btn:hover { background: rgba(139, 92, 246, 0.2); color: var(--text-primary); }
.qz-takeaways {
    border-left: 4px solid var(--gold);
    background: rgba(245, 185, 66, 0.08);
    border-radius: 0 1rem 1rem 0;
    padding: 1rem 1.2rem;
    margin-bottom: 1.5rem;
}
.qz-takeaways-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 0.6rem; color: var(--text-primary); }
.qz-takeaways ul { margin: 0; padding-left: 1.2rem; color: var(--text-secondary); }
.qz-takeaways li { margin-bottom: 0.35rem; line-height: 1.55; }
.qz-term {
    border-bottom: 2px dotted var(--primary-hover);
    cursor: help; color: inherit; font-weight: 600;
}
.qz-term:focus { outline: 2px solid rgba(139, 92, 246, 0.5); outline-offset: 2px; border-radius: 3px; }
.qz-term-tip {
    position: absolute; z-index: 1070; max-width: 300px;
    padding: 0.8rem 0.95rem; border-radius: 0.9rem;
    background: #1b1440; color: #e2e8f0;
    border: 1px solid rgba(139, 92, 246, 0.45);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
    font-size: 0.85rem; line-height: 1.5;
}
.qz-term-tip strong { display: block; color: #fff; margin-bottom: 0.25rem; }
.qz-term-tip p { margin: 0 0 0.4rem; }
.qz-term-tip a { color: #c4b5fd; font-weight: 600; font-size: 0.8rem; }
.qz-term-tip[hidden] { display: none; }
html[data-theme="light"] .qz-term-tip { background: #ffffff; color: #3d3a5c; box-shadow: 0 12px 30px rgba(60, 40, 120, 0.18); }
html[data-theme="light"] .qz-term-tip strong { color: #1e1b3a; }
html[data-theme="light"] .qz-term-tip a { color: #6d28d9; }

.qz-badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.8rem; }
.qz-badge-chip {
    font-size: 0.74rem; font-weight: 700; padding: 0.25rem 0.65rem; border-radius: 999px;
    border: 1px dashed rgba(139, 92, 246, 0.35); color: var(--text-secondary); opacity: 0.6;
}
.qz-badge-chip.earned {
    opacity: 1; border-style: solid; color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #d946ef); border-color: transparent;
}
.qz-badge-toast {
    position: fixed; left: 50%; bottom: 24px; z-index: 1080;
    transform: translate(-50%, 30px); opacity: 0;
    padding: 0.8rem 1.2rem; border-radius: 999px;
    background: linear-gradient(135deg, #8b5cf6, #d946ef); color: #fff;
    font-weight: 700; font-size: 0.9rem; box-shadow: 0 12px 30px rgba(139, 92, 246, 0.45);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.qz-badge-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 768px) { .qz-badge-toast { bottom: 90px; width: max-content; max-width: 92vw; text-align: center; border-radius: 1rem; } }

/* ---------- Print: clean "study notes" layout for articles ---------- */
@media print {
    nav, .navbar, footer, .mobile-bottom-nav, .qz-cookie, .qz-back-top, .qz-read-progress,
    .qz-share, .qz-article-tools, .qz-kc, .article-play-cta, .qz-breadcrumb, .qz-term-tip,
    .qz-badge-toast, .adsbygoogle, ins, iframe, .btn, .qz-related-card { display: none !important; }
    html, body { background: #fff !important; color: #111 !important; }
    body * { color: #111 !important; background: transparent !important; box-shadow: none !important; text-shadow: none !important; -webkit-text-fill-color: #111 !important; }
    .card { border: none !important; }
    .qz-takeaways { border-left: 4px solid #999 !important; }
    .qz-term { border-bottom: none !important; font-weight: 600; }
    #qzArticleBody { font-size: 12pt; line-height: 1.6; }
    #qzArticleBody h2, #qzArticleBody h3 { page-break-after: avoid; }
    a[href]::after { content: none !important; }
    .qz-author-box { page-break-inside: avoid; }
}
