/* Qwizmo V36 polish layer. Loaded LAST on every page.
   Fixes contrast in both themes, removes duplicate page headers now that the shared
   top bar exists, and tidies the home layout. No game logic is touched. */

/* ───────────────────────── HOME (index.html) ───────────────────────── */

/* Status row: one tidy row of five tiles on desktop instead of 3 + 2 with a hole */
@media (min-width:1100px){.qw-mini{grid-template-columns:repeat(5,minmax(0,1fr))!important}}
@media (min-width:701px) and (max-width:1099px){.qw-mini{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))!important}}
.qw-mini>div{display:flex;flex-direction:column;justify-content:center;min-height:74px;box-sizing:border-box}

/* Rewards and Anki tiles read like the other tiles: title link + subtitle */
#qw-rewards-shortcut{background:none!important;padding:0!important;border-radius:0!important;justify-content:flex-start!important;
  color:var(--qw-text)!important;font-weight:700!important;font-size:16px!important;margin:0!important;box-shadow:none!important}
#qw-rewards-shortcut::after,#qw-import a::after{content:" →";color:var(--qw-primary)}
#qw-rewards-shortcut:hover,#qw-import a:hover{text-decoration:underline;text-underline-offset:3px}
#qw-import a{color:var(--qw-primary)!important;font-weight:600;text-decoration:none}
#qw-import a::after{content:""}

/* "Not available yet" button reads as unavailable, not as a faded primary button */
.qw-actions button:disabled{background:transparent!important;color:var(--qw-muted)!important;border:1px dashed var(--qw-edge)!important;
  box-shadow:none!important;opacity:1!important;transform:none!important;filter:none!important}
.qw-actions button:disabled::after{content:"\00a0· soon";font-weight:600}

/* Lower page (disclaimer, "Built for learning", footer) aligns with the content column */
body:has(.qw-shell)>main,body:has(.qw-shell)>footer{box-sizing:border-box;max-width:1440px!important;margin-left:auto!important;margin-right:auto!important;
  padding-left:92px!important;padding-right:26px!important}
body.qw-pinned:has(.qw-shell)>main,body.qw-pinned:has(.qw-shell)>footer{padding-left:250px!important}
body:has(.qw-shell)>footer{padding-bottom:28px!important;color:var(--qw-muted)}
@media (max-width:700px){body:has(.qw-shell)>main,body:has(.qw-shell)>footer{padding-left:12px!important;padding-right:12px!important}}

/* Dark theme on home: lighter primary needs dark text; untheme'd bits get themed */
html:has(body.qw-dark){background:#0d1428!important}
body.qw-dark{min-height:100vh}
body.qw-dark .qw-actions a:not(:first-child),body.qw-dark .qw-anki-upload,body.qw-dark .qw-dialog-actions a,
body.qw-dark .v33-inline button,body.qw-dark .v33-file{color:#10183a!important}
body.qw-dark .qw-anki-home p,body.qw-dark #qw-anki-status,body.qw-dark .qw-anki-hint{color:var(--qw-muted)!important}
body.qw-dark>main h2,body.qw-dark>main h3{color:var(--qw-text)!important}
body.qw-dark>main>section>p,body.qw-dark>footer{color:var(--qw-muted)!important}

/* ───────────────────────── GAME PAGES (qz-theme) ───────────────────────── */

/* The shared top bar already carries brand + home + game library, so drop the in-page copies */
body.qz-theme-light .top>a.brand,body.qz-theme-dark .top>a.brand{display:none!important}
body.qz-theme-light .top,body.qz-theme-dark .top{justify-content:flex-end!important}
body.qz-theme-light .arena-brand,body.qz-theme-dark .arena-brand,
body.qz-theme-light .arena-brand+a,body.qz-theme-dark .arena-brand+a{display:none!important}
body.qz-theme-light main>header,body.qz-theme-dark main>header{display:none!important}
body.qz-theme-light main,body.qz-theme-dark main{padding-top:20px}

/* Inputs: one consistent look per theme (file inputs were stuck dark in light mode) */
body.qz-theme-light main input[type=file]{background:#f8faff!important;color:var(--qz-ink)!important;border:1px solid var(--qz-border)!important}
body.qz-theme-light main label{color:var(--qz-ink)}

/* Study Party — progress panel in light mode */
body.qz-theme-light #profile b,body.qz-theme-light #profile .sb span,body.qz-theme-light #profile .lvl,
body.qz-theme-light #profile .stat,body.qz-theme-light #profile .badge{color:var(--qz-ink)!important}
body.qz-theme-light #profile .stat,body.qz-theme-light #profile .badge,body.qz-theme-light #profile .chip{
  background:#eef3ff!important;border:1px solid var(--qz-border)!important}
body.qz-theme-light #profile .stat small,body.qz-theme-light #profile .badge small,body.qz-theme-light #profile .lvl small,
body.qz-theme-light #profile .lvl div{color:var(--qz-sub)!important}
body.qz-theme-light #profile .badge.locked{background:#f6f8fc!important;color:var(--qz-sub)!important}
body.qz-theme-light #profile .sb i{background:#e2e9f6!important}
body.qz-theme-light #profile .lvl-badge span{background:#fff!important;color:var(--qz-ink)}

/* MCAT Showdown lobby — light mode */
body.qz-theme-light main>h1{color:var(--qz-ink)!important;text-shadow:none!important}
body.qz-theme-light .v29-toolbar{background:var(--qz-surface)!important;border-color:var(--qz-border)!important;box-shadow:var(--qz-shadow)}
body.qz-theme-light .v29-kicker{color:#5b4fd6!important}

/* Top bar: keep the active page and the dropdown legible in both themes */
#qwn-bar [aria-current="page"]{background:var(--qz-page)!important;box-shadow:inset 0 -3px 0 var(--qz-accent)!important}

/* ───────────── V38.1 Study Party — full light theme ─────────────
   Light UI chrome; the illustrated game scenes (race track, tug arena, card art) keep their colours. */
body.qz-theme-light{--sp-soft:#f4f7fd;--sp-line:#d3dff2;--sp-acc:#5b4fd6}
/* top pills + disclaimer */
body.qz-theme-light .top .chip,body.qz-theme-light .top a.chip,body.qz-theme-light #soundBtn{background:#fff!important;color:var(--qz-ink)!important;border:1px solid var(--sp-line)!important;box-shadow:none!important}
body.qz-theme-light .disclaimer{background:#fff7e6!important;color:#5f4522!important;border:1px solid #ecd49a!important}
body.qz-theme-light .disclaimer strong{color:#8a4b00!important}
/* panels */
body.qz-theme-light main .panel,body.qz-theme-light #game{background:#fff!important;border:1px solid var(--sp-line)!important;box-shadow:0 14px 34px #1d3e7514!important}
body.qz-theme-light #results{background:radial-gradient(circle at 50% 0%,#ebe6ff,#fff 58%)!important}
body.qz-theme-light .backlink{color:var(--sp-acc)!important}
body.qz-theme-light .setup-kicker,body.qz-theme-light .results-eyebrow,body.qz-theme-light .quiz-eyebrow{color:var(--sp-acc)!important}
body.qz-theme-light #setupHeading,body.qz-theme-light .res-title,body.qz-theme-light #question{color:var(--qz-ink)!important;text-shadow:none!important}
body.qz-theme-light .setup-intro{color:var(--qz-sub)!important}
/* setup */
body.qz-theme-light .game-card{background:#fff!important;border:2px solid var(--sp-line)!important;color:var(--qz-ink)!important;box-shadow:0 6px 0 #dfe7f6!important}
body.qz-theme-light .game-card small{color:var(--qz-sub)!important}
body.qz-theme-light .game-card[aria-pressed=true]{background:#fffdf3!important;border-color:#f2b33d!important;box-shadow:0 0 0 3px #f2b33d inset,0 6px 0 #ecd49a!important}
body.qz-theme-light .howto{background:var(--sp-soft)!important;color:var(--qz-ink)!important;border:1px solid var(--sp-line)!important;border-left:5px solid var(--sp-acc)!important}
body.qz-theme-light .setup-options{background:var(--sp-soft)!important;border:1px solid var(--sp-line)!important}
body.qz-theme-light .setup-options label{color:var(--qz-ink)!important}
body.qz-theme-light .setup-options .ux-hint,body.qz-theme-light .setup-options p{color:var(--qz-sub)!important}
body.qz-theme-light .seg button{background:#fff!important;color:var(--qz-ink)!important;border:1px solid #c6d4ec!important}
body.qz-theme-light .seg button:hover{border-color:var(--sp-acc)!important}
body.qz-theme-light .seg button[aria-pressed=true]{background:#ffe077!important;color:#2a2410!important;border-color:#e9be3f!important;box-shadow:0 4px 0 #d9ad3c!important}
body.qz-theme-light main input:not([type=file]):not([type=checkbox]){background:#fff!important;color:var(--qz-ink)!important;border:1px solid #c6d4ec!important}
/* game */
body.qz-theme-light .hud{background:var(--sp-soft)!important;border:1px solid var(--sp-line)!important;color:var(--qz-ink)!important}
body.qz-theme-light .hud *{color:var(--qz-ink)}
body.qz-theme-light .sc,body.qz-theme-light .sc.active{background:#fff!important;color:var(--qz-ink)!important;border-color:#c6d4ec!important}
body.qz-theme-light .sc.active{border-color:#e9be3f!important;box-shadow:0 0 0 2px #ffe077}
body.qz-theme-light #timeChip,body.qz-theme-light .hud .chip{background:#fff!important;color:var(--qz-ink)!important;border:1px solid #c6d4ec!important}
body.qz-theme-light .timebar{background:#e2e9f6!important}
body.qz-theme-light .quiz-stage{background:var(--sp-soft)!important;border:1px solid var(--sp-line)!important;color:var(--qz-ink)!important}
body.qz-theme-light .qcat{background:#ece8ff!important;color:#4a35b8!important}
body.qz-theme-light .answers button{background:#fff!important;color:var(--qz-ink)!important;border:2px solid #c6d4ec!important;box-shadow:0 4px 0 #dbe3f3!important}
body.qz-theme-light .answers button:hover:not(:disabled){background:#eef2ff!important;border-color:var(--sp-acc)!important}
body.qz-theme-light .answers button:disabled{opacity:1!important;color:#5d6b86!important}
body.qz-theme-light .answers button .k{background:#1a2850!important;color:#ffe18b!important}
body.qz-theme-light .answers button.correct{background:#ddf6ea!important;border-color:#1f9d6a!important;color:#0c4b31!important;box-shadow:0 4px 0 #b4e4cd!important}
body.qz-theme-light .answers button.wrong{background:#fde7eb!important;border-color:#d0455e!important;color:#7a1d2e!important;box-shadow:0 4px 0 #f4c3cd!important}
body.qz-theme-light .answers.frozen button{background:#fbe9ef!important;color:#7a1d2e!important}
body.qz-theme-light .feedback{color:var(--qz-ink)!important}
body.qz-theme-light .feedback .ok{color:#127548!important}
body.qz-theme-light .feedback .bad{color:#b3263e!important}
/* results */
body.qz-theme-light #resSub,body.qz-theme-light #xpLabel{color:var(--qz-sub)!important}
body.qz-theme-light #resStats .stat{background:#fff!important;border:1px solid var(--sp-line)!important;color:var(--qz-ink)!important}
body.qz-theme-light #resStats .stat b{color:var(--qz-ink)!important}
body.qz-theme-light #resStats .stat small{color:var(--qz-sub)!important}
body.qz-theme-light .xpbar{background:#e2e9f6!important}
body.qz-theme-light #resBadges b,body.qz-theme-light #resBadges{color:var(--qz-ink)!important}
body.qz-theme-light details.review{background:var(--sp-soft)!important;color:var(--qz-ink)!important;border:1px solid var(--sp-line)}
body.qz-theme-light details.review summary,body.qz-theme-light .rv b{color:var(--qz-ink)!important}
body.qz-theme-light .rv .yours{color:#b3263e!important}
body.qz-theme-light .rv .right{color:#127548!important}
body.qz-theme-light .board,body.qz-theme-light .board th,body.qz-theme-light .board td{color:var(--qz-ink)!important;border-color:var(--sp-line)!important}
body.qz-theme-light .board th{background:var(--sp-soft)!important}
body.qz-theme-light .results-crown{color:#f2b33d!important;text-shadow:0 4px 18px #f2b33d66!important}
body.qz-theme-light #turn,body.qz-theme-light .turn{color:var(--qz-ink)!important}
/* dark mode: results stats & badges were light boxes with light labels */
body.qz-theme-dark #resStats .stat,body.qz-theme-dark #resBadges .badge{background:#263764!important;color:#fff!important;border-color:#4b5f99!important}
body.qz-theme-dark #resStats .stat small,body.qz-theme-dark #resBadges .badge .muted{color:#c8d5f4!important}

/* V39: 'Coming soon' cards stay readable (dashed outline instead of faded text) */
.qw-upcoming{opacity:1!important}
.qw-upcoming .qw-note{color:var(--qw-muted)!important}

/* V42: the shared top bar now shows streak, goal, sound and home, so Study Party's own chip row is hidden */
#qwn-bar ~ main > .top{display:none!important}
/* V42: locked items stay readable (dashed outline + lock, not faded text) */
.badge.locked{opacity:1!important}
body.qz-theme-dark .badge.locked{background:#22305a!important;color:#c3cee4!important}
.btn.locked:disabled,.btn.locked[disabled]{opacity:1!important}
body.qz-theme-light .btn.locked{background:#eef0f7!important;color:#4f5d7d!important}
body.qz-theme-dark .btn.locked{background:#26335f!important;color:#c3cee4!important}
