/* OpenVibe.Quest — theme-token driven (openvibe-shared presets). Every page works without JavaScript. */
:root { color-scheme: dark; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg-primary, #0a0f1c); color: var(--text-primary, #e6edf7); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-light, #60a5fa); }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid var(--accent, #3b82f6); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--bg-card, #131c2e); padding: 8px 12px; z-index: 10; }
.account-bar { max-width: 1080px; margin: 0 auto; padding: 6px 16px 0; text-align: right; font-size: 14px; color: var(--text-secondary, #96a7c2); }
.page { max-width: 1080px; margin: 0 auto; padding: 16px 16px 64px; min-height: 60vh; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 1rem 0 .6rem; overflow-wrap: anywhere; }
h2 { font-size: 1.3rem; margin: 1.8rem 0 .5rem; }
h3 { font-size: 1.08rem; margin: 1.2rem 0 .4rem; }
.muted { color: var(--text-muted, #7386a3); }
.small { font-size: .85rem; }
.crumbs { font-size: .9rem; color: var(--text-muted, #7386a3); margin: 8px 0; overflow-wrap: anywhere; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; }
code { overflow-wrap: anywhere; }
pre { background: var(--bg-secondary, #0f1729); border: 1px solid var(--border, #1f2d47); border-radius: 8px; padding: 10px 12px; overflow-x: auto; white-space: pre; }
pre code { overflow-wrap: normal; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { text-align: left; vertical-align: top; padding: 7px 9px; border-bottom: 1px solid var(--border, #1f2d47); }
th { color: var(--text-secondary, #96a7c2); font-weight: 600; }
.badge { display: inline-block; font-size: .75rem; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border-light, #2c3d5c); white-space: nowrap; line-height: 1.6; }
.badge.ok { border-color: var(--success, #22c55e); color: var(--success, #22c55e); }
.badge.info { border-color: var(--info, #38bdf8); color: var(--info, #38bdf8); }
.badge.warn { border-color: var(--warning, #f59e0b); color: var(--warning, #f59e0b); }
.badge.bad { border-color: var(--error, #ef4444); color: var(--error, #ef4444); }
.notice { border-left: 3px solid var(--info, #38bdf8); padding: 8px 12px; margin: 12px 0; background: var(--bg-card, #131c2e); border-radius: 0 8px 8px 0; }
.notice.ok { border-left-color: var(--success, #22c55e); }
.notice.warn { border-left-color: var(--warning, #f59e0b); }
.notice.bad { border-left-color: var(--error, #ef4444); }
button { font: inherit; cursor: pointer; }
form.inline { display: inline; }
.prose { max-width: 820px; overflow-wrap: anywhere; }
.prose table { margin: .6rem 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* The home page's showcase sections (openvibe-shared/showcase.css) sit inside .page, which has its own gutter. */
.page .sc-hero, .page .sc-sec, .page .sc-cta { padding-left: 0; padding-right: 0; }
.page .sc-ic .ov-icon { --ovi-size: 28px !important; }
button.sc-btn { background: transparent; }
button.sc-btn.sc-primary { border: 0; }

/* ── OpenVibe.Quest: the quest pages (server/http/pages.js, server/render/quests.js) ──
   Structure only — the design pass comes later. Every class below is one the pages render. */
p.lede { font-size: 1.05rem; color: var(--text-secondary, #96a7c2); max-width: 780px; }
.site-group { margin: 1.2rem 0; }
.site-group small { color: var(--text-muted, #7386a3); font-weight: 400; }
.site-group { margin: 22px 0 0; }
.site-group h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 0 0 10px; font-size: 1.1rem; }
.site-group h3 a { color: var(--text-primary, #e6edf7); text-decoration: none; }
.site-group h3 a:hover { color: var(--accent-light, #60a5fa); }
.site-group h3 small { flex-basis: 100%; font-weight: 400; font-size: .86rem; color: var(--text-muted, #7386a3); }
.site-count { font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border-light, #2c3d5c); color: var(--text-muted, #7386a3); }
.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.quest { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; padding: 16px; border-radius: 16px; border: 1px solid var(--border, #1f2d47); background: var(--bg-card, #131c2e); transition: border-color .15s, transform .15s; }
.quest:hover { border-color: color-mix(in srgb, var(--accent, #3b82f6) 55%, var(--border, #1f2d47)); transform: translateY(-1px); }
.medal { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1rem; letter-spacing: .02em; color: hsl(var(--h) 85% 82%); background: radial-gradient(circle at 35% 30%, hsl(var(--h) 55% 34%), hsl(var(--h) 50% 18%) 70%); box-shadow: inset 0 0 0 3px hsl(var(--h) 55% 42% / .55), 0 6px 16px -8px hsl(var(--h) 70% 40% / .8); }
.medal.earned { box-shadow: inset 0 0 0 3px hsl(var(--h) 80% 62%), 0 0 0 3px hsl(var(--h) 80% 62% / .25), 0 8px 20px -8px hsl(var(--h) 80% 50%); }
.quest-main { min-width: 0; }
.quest-title { font-weight: 700; font-size: 1.02rem; color: var(--text-primary, #e6edf7); text-decoration: none; }
.quest-title:hover { color: var(--accent-light, #60a5fa); text-decoration: underline; text-underline-offset: 3px; }
.quest-why { margin: 4px 0 8px; color: var(--text-secondary, #96a7c2); font-size: .92rem; line-height: 1.45; }
.quest-steps { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 4px; font-size: .9rem; }
.quest-steps li { position: relative; padding-left: 22px; color: var(--text-primary, #e6edf7); }
.quest-steps li::before { content: ''; position: absolute; left: 0; top: .28em; width: 13px; height: 13px; border-radius: 4px; border: 1.5px solid var(--border-light, #2c3d5c); }
.step-count { font-size: .78rem; font-weight: 700; color: var(--text-muted, #7386a3); }
.quest-reward { margin: 0; }
.reward { display: flex; flex-wrap: wrap; gap: 6px; }
.reward-badge, .reward-coins { font-size: .78rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-light, #2c3d5c); color: var(--text-secondary, #96a7c2); }
.reward-badge strong { color: var(--text-primary, #e6edf7); }
.reward-coins { color: var(--warning, #f59e0b); border-color: color-mix(in srgb, var(--warning, #f59e0b) 40%, transparent); }
.reward-item { font-size: .78rem; padding: 3px 10px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent, #3b82f6) 45%, transparent); color: var(--text-primary, #e6edf7); background: color-mix(in srgb, var(--accent, #3b82f6) 10%, transparent); }
.reward-item small { color: var(--text-secondary, #96a7c2); }   /* muted failed AA on the tinted chip */
.reward-coins.soon { color: var(--text-muted, #7386a3); border-style: dashed; border-color: var(--border-light, #2c3d5c); }
.quest-series { border-style: dashed; }
.quest-series .medal { font-size: 1.15rem; }
@media (prefers-reduced-motion: reduce) { .quest { transition: none; } }
.steps { margin: .4rem 0; }
.done { color: var(--success, #22c55e); font-weight: 700; }
.progress { display: grid; grid-template-columns: minmax(8rem, 1fr) 2fr auto; gap: .5rem; align-items: center; margin: .3rem 0; font-size: .9rem; }
.progress progress { width: 100%; }
.progress-count { color: var(--text-muted, #7386a3); font-variant-numeric: tabular-nums; }
.badges { list-style: none; display: flex; flex-wrap: wrap; gap: .6rem; padding: 0; }
.badges li { border: 1px solid var(--border-light, #2c3d5c); border-radius: 999px; padding: .2rem .8rem; }
.badges small { color: var(--text-muted, #7386a3); }
.quest-block { margin: .8rem 0; }
/* The home's live parts (server/http/pages.js): figures, the most-earned badges, open badges, sites followed, questions. */
.q-stats { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); }
.q-stats li { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border, #1f2d47); background: var(--bg-card, #131c2e); }
.q-stats b { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.q-stats span { font-size: .86rem; color: var(--text-secondary, #96a7c2); }
.quest-count { margin: 6px 0 0; font-size: .84rem; font-weight: 600; color: var(--success, #34d399); }
.q-top { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); }
.q-top li { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--border, #1f2d47); background: var(--bg-card, #131c2e); }
.q-top-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.q-top-main span { font-size: .88rem; color: var(--text-secondary, #96a7c2); }
.q-top-n { font-weight: 800; white-space: nowrap; }
@media (max-width: 520px) {
    .q-top li { grid-template-columns: 44px minmax(0, 1fr); }
    .q-top .medal { width: 44px; height: 44px; font-size: .85rem; }
    .q-top-n { grid-column: 2; font-size: .9rem; }
    .q-stats b { font-size: 1.3rem; }
}
.q-open { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.q-open li { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1px dashed var(--border, #1f2d47); }
.q-open .medal { width: 44px; height: 44px; font-size: .85rem; }
.q-open span { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.q-open small { color: var(--text-muted, #7386a3); }
.q-sites { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.q-sites li { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border, #1f2d47); background: var(--bg-card, #131c2e); min-width: 0; }
.q-sites a { font-weight: 700; }
.q-sites small { color: var(--text-muted, #7386a3); }
.q-sites span { display: flex; flex-wrap: wrap; gap: 4px; }
.q-sites code { font-size: .78rem; overflow-wrap: anywhere; }
.q-faq { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.q-faq details { border: 1px solid var(--border, #1f2d47); border-radius: 14px; background: var(--bg-card, #131c2e); padding: 0 16px; }
.q-faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; }
.q-faq details p { margin: 0 0 14px; color: var(--text-secondary, #96a7c2); line-height: 1.6; }
