/* RecoveryEdX gamification + interactive activities. Loaded on every page (small). */

/* ---- XP chip ---- */
.xp-chip { display: inline-flex; align-items: center; gap: .6rem; flex: none; padding: .3rem .85rem .3rem .35rem; border-radius: 999px; background: var(--violet-pale); color: var(--violet-dk); transition: transform .3s var(--ease), box-shadow .3s; }
.xp-chip.is-bump { transform: scale(1.08); box-shadow: 0 0 0 5px rgba(244,185,64,.45); }
.xp-chip__ring { --p: 0; position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--violet) calc(var(--p) * 1%), rgba(120,24,93,.16) 0); }
.xp-chip__ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
.xp-chip__ring b { position: relative; font-size: .85rem; font-weight: 800; color: var(--violet); }
.xp-chip__txt { display: grid; line-height: 1.15; font-size: .82rem; font-weight: 800; }
.xp-chip__txt small { font-size: .72rem; font-weight: 600; color: var(--grey-600); }

/* ---- Toasts + confetti (learning app; tokens fall back to brand colors elsewhere) ---- */
.g-toasts { position: fixed; z-index: 9999; top: 96px; right: 22px; display: grid; gap: .6rem; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.g-toast { display: flex; align-items: center; gap: .8rem; padding: .85rem 1.1rem; border-radius: 16px; background: var(--lms-surface, #fff); color: var(--lms-text, #201A1D); box-shadow: var(--lms-shadow-pop, 0 16px 40px rgba(60,16,50,.22)); border: 1px solid var(--lms-border, #E7DDCF); transform: translateX(120%); opacity: 0; transition: transform .35s cubic-bezier(.2,.7,.2,1), opacity .35s; font-family: inherit; }
.g-toast.is-in { transform: none; opacity: 1; }
.g-toast strong { display: block; font-size: .95rem; color: var(--lms-text, #201A1D); }
.g-toast small { display: block; font-size: .8rem; color: var(--lms-text-2, #7A6F65); line-height: 1.35; }
.g-toast__ic { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--lms-xp-bg, #FDF3DE); font-size: 1.5rem; }
.g-toast--xp { justify-self: end; width: fit-content; padding: .45rem 1rem; background: var(--lms-gradient, #78185D); border: 0; transform: translateY(14px); }
.g-toast--xp.is-in { transform: translateY(0); }
.g-toast__xp { color: #fff; font-weight: 800; font-size: 1rem; }
.g-toast--badge { border-color: var(--lms-xp-border, #F4B940); }
.g-toast--level { border-color: var(--lms-border-strong, #78185D); }
.g-confetti { position: fixed; inset: 0; z-index: 9998; pointer-events: none; }
@media (max-width: 640px) { .g-toasts { top: auto; bottom: 14px; right: 50%; transform: translateX(50%); } .g-toast { transform: translateY(140%); } }
@media (prefers-reduced-motion: reduce) { .g-toast, .xp-chip { transition: none; } }

/* ---- Activities (inside the "Try it" card) ---- */
.act { position: relative; padding: clamp(18px, 2.6vw, 30px); border-top: 1px solid var(--lms-border); overflow: hidden; }
.act:first-child { border-top: 0; }
.act__head { display: flex; align-items: center; gap: .9rem; margin-bottom: 1rem; position: relative; z-index: 1; }
.act__ic { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 15px; background: var(--lms-gradient); color: #fff; box-shadow: 0 8px 20px rgba(120,40,245,.28); }
.act__hd { min-width: 0; flex: 1; }
.act__tag { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--lms-accent-ink); }
.act h3 { margin: .15rem 0 0; font-size: clamp(1.15rem, 2vw, 1.35rem); font-weight: 800; line-height: 1.25; color: var(--lms-text); }
.act__xp { flex: none; font-size: .75rem; font-weight: 800; padding: .25rem .7rem; border-radius: 999px; background: var(--lms-xp-bg); border: 1px solid var(--lms-xp-border); color: var(--lms-xp); }
.act__done { flex: none; display: inline-flex; align-items: center; gap: .3rem; font-size: .78rem; font-weight: 800; color: var(--lms-success); background: var(--lms-success-bg); padding: .25rem .7rem; border-radius: 999px; }
.act__deco { position: absolute; right: 26px; top: 84px; width: 88px; color: var(--lms-accent); opacity: .16; pointer-events: none; }
.act__body { position: relative; z-index: 1; }
.act__intro { margin: 0 0 1rem; color: var(--lms-text-2); line-height: 1.6; max-width: 62ch; }
.act__ta, .act__f input { width: 100%; font: 500 1rem/1.5 inherit; font-family: inherit; color: var(--lms-text); background: var(--lms-surface-2); border: 1.5px solid var(--lms-border); border-radius: 14px; padding: .85rem 1rem; transition: var(--lms-theme-t); }
.act__ta::placeholder, .act__f input::placeholder { color: var(--lms-text-3); }
.act__ta { resize: vertical; min-height: 120px; }
.act__ta:focus, .act__f input:focus { outline: none; background: var(--lms-surface); border-color: var(--lms-accent); box-shadow: 0 0 0 4px rgba(120,40,245,.14); }
.act__grid { display: grid; gap: .75rem; margin-bottom: 1rem; }
.act__f { display: grid; grid-template-columns: 140px 1fr; gap: .9rem; align-items: center; }
.act__f span { font-weight: 700; color: var(--lms-text); }
.act__f span b { color: var(--lms-accent-ink); font-size: 1.25em; margin-right: 1px; }
.act__row { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: 1rem; }
.act__msg { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--lms-text-2); font-weight: 600; }
.act__msg .ic { color: var(--lms-accent-ink); }
.act__msg.is-win { color: var(--lms-success); background: var(--lms-success-bg); padding: .7rem 1rem; border-radius: 12px; }
@media (max-width: 640px) { .act__f { grid-template-columns: 1fr; gap: .3rem; } .act__deco { display: none; } }

/* sorting */
.mt-pool { display: flex; flex-wrap: wrap; gap: .5rem; padding: .8rem; min-height: 60px; background: var(--lms-surface-2); border: 1.5px dashed var(--lms-border); border-radius: 16px; margin-bottom: 1rem; }
.mt-empty { color: var(--lms-text-2); font-weight: 600; align-self: center; }
.mt-buckets { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.mt-bucket { border: 1.5px solid var(--lms-border); border-radius: 16px; overflow: hidden; background: var(--lms-surface); transition: var(--lms-theme-t); }
.mt-bucket.is-over { border-color: var(--lms-accent); background: var(--lms-accent-soft); }
.mt-bucket__h { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: .6rem .85rem; background: var(--lms-gradient-soft); color: var(--lms-text); border: 0; font: 800 .9rem/1.2 inherit; font-family: inherit; text-align: left; cursor: pointer; }
.mt-bucket__h::after { content: "+"; font-size: 1.2rem; color: var(--lms-accent-ink); }
.mt-bucket__h:hover { background: var(--lms-accent-soft); }
.mt-bucket__list { display: flex; flex-wrap: wrap; gap: .4rem; padding: .6rem; min-height: 64px; }
.mt-chip { min-height: 40px; padding: .5rem .9rem; border-radius: 999px; border: 1.5px solid var(--lms-border); background: var(--lms-surface); font: 600 .9rem/1.3 inherit; font-family: inherit; color: var(--lms-text); cursor: pointer; transition: transform .12s, border-color .15s, background-color .15s; text-align: left; }
.mt-chip:hover { border-color: var(--lms-border-strong); transform: translateY(-1px); }
.mt-chip.is-picked { border-color: var(--lms-accent); background: var(--lms-accent-soft); box-shadow: 0 0 0 3px rgba(120,40,245,.14); }
.mt-chip.is-ok { border-color: var(--lms-success); background: var(--lms-success-bg); color: var(--lms-success); cursor: default; }
.mt-chip.is-ok::before { content: "\2713  "; font-weight: 800; }
.mt-chip.is-bad { border-color: var(--lms-danger); background: var(--lms-danger-bg); color: var(--lms-danger); animation: mtShake .35s; }
.mt-chip.is-bad::before { content: "\2715  "; font-weight: 800; }
@keyframes mtShake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* scenarios: an accessible radio group of answer tiles */
.sc__count { font-size: .75rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--lms-text-3); margin: 0 0 .5rem; }
.sc__sit { font-size: 1.05rem; line-height: 1.6; margin: 0 0 1.1rem; color: var(--lms-text); max-width: min(64ch, calc(100% - 110px)); }
@media (max-width: 640px) { .sc__sit { max-width: none; } }
.sc__opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.sc__opts.is-stacked { grid-template-columns: minmax(0, 1fr); }
.sc__opt { position: relative; display: grid; grid-template-columns: 22px 1fr; gap: .8rem; align-items: start; min-height: 64px; padding: 1rem 1.05rem; text-align: left; border-radius: 16px; border: 1.5px solid var(--lms-border); background: var(--lms-surface-2); font: 500 .96rem/1.45 inherit; font-family: inherit; color: var(--lms-text); cursor: pointer; transition: var(--lms-theme-t), transform .15s cubic-bezier(.2,.7,.2,1); }
.sc__opt:hover:not([aria-disabled="true"]) { border-color: var(--lms-border-strong); transform: translateY(-2px); box-shadow: var(--lms-shadow-card); }
.sc__mark { width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--lms-text-3); display: grid; place-items: center; transition: .15s; }
.sc__mark::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .15s; }
.sc__opt[aria-checked="true"] { border-color: var(--lms-accent); background: var(--lms-accent-soft); box-shadow: 0 0 0 3px rgba(120,40,245,.14), var(--lms-shadow-card); }
.sc__opt[aria-checked="true"] .sc__mark { border-color: var(--lms-accent); background: var(--lms-accent); }
.sc__opt[aria-checked="true"] .sc__mark::after { transform: scale(1); }
.sc__opt[aria-disabled="true"] { cursor: default; }
.sc__opt.is-best { border-color: var(--lms-success); background: var(--lms-success-bg); box-shadow: none; }
.sc__opt.is-best .sc__mark { border-color: var(--lms-success); background: var(--lms-success); }
.sc__opt.is-other { border-color: var(--lms-xp-border); background: var(--lms-warn-bg); box-shadow: none; }
.sc__opt.is-other .sc__mark { border-color: var(--lms-warn); background: var(--lms-warn); }
.sc__opt .sc__verdict { grid-column: 2; display: block; margin-top: .35rem; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.sc__opt.is-best .sc__verdict { color: var(--lms-success); }
.sc__opt.is-other .sc__verdict { color: var(--lms-warn); }
.sc__foot { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: 1rem; }
.sc__hint { display: inline-flex; align-items: center; gap: .45rem; margin: 0; font-size: .88rem; color: var(--lms-text-2); }
.sc__hint .ic { color: var(--lms-accent-ink); }
.sc__fb { display: grid; grid-template-columns: 40px 1fr; gap: .9rem; align-items: start; margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 16px; background: var(--lms-surface-2); border: 1px solid var(--lms-border); animation: scIn .25s ease; }
.sc__fb[hidden] { display: none; }
.sc__fb-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: #fff; }
.sc__fb.is-best .sc__fb-ic { background: var(--lms-success); }
.sc__fb.is-other .sc__fb-ic { background: var(--lms-warn); }
.sc__fb strong { display: block; color: var(--lms-text); margin-bottom: .2rem; }
.sc__fb p { margin: 0 0 .9rem; color: var(--lms-text-2); line-height: 1.6; }
@keyframes scIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 767px) { .sc__opts { grid-template-columns: minmax(0, 1fr); } }

/* flashcards */
.fc { display: grid; gap: .9rem; }
.fc__card { display: grid; place-items: center; align-content: center; gap: .6rem; min-height: 200px; padding: 1.8rem; border-radius: 20px; border: 0; cursor: pointer; text-align: center; background: var(--lms-gradient); color: #fff; box-shadow: 0 16px 34px rgba(120,40,245,.28); transition: transform .3s cubic-bezier(.2,.7,.2,1), filter .3s; font-family: inherit; }
.fc__card:hover { transform: translateY(-2px); }
.fc__card.is-flipped { filter: hue-rotate(-40deg) saturate(.9); }
.fc__side { font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 800; line-height: 1.35; }
.fc__card.is-flipped .fc__side { font-size: 1.08rem; font-weight: 600; line-height: 1.6; }
.fc__card small { color: rgba(255,255,255,.82); font-weight: 700; font-size: .8rem; }
.fc__nav { display: flex; align-items: center; justify-content: space-between; }
.fc__pos { font-weight: 700; color: var(--lms-text-2); }

/* in-video check-in */
.lp-ci__card { width: min(560px, 100%); max-height: 100%; overflow: auto; background: var(--lms-surface, #fff); color: var(--lms-text, #201A1D); border-radius: 20px; padding: clamp(16px, 3vw, 26px); }
.lp-ci__tag { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--lms-accent-ink, #78185D); }
.lp-ci__card h3 { font-size: 1.15rem; line-height: 1.4; margin: .3rem 0 .9rem; }
.lp-ci__opts { display: grid; gap: .5rem; }
.lp-ci__opts button { min-height: 46px; text-align: left; padding: .75rem 1rem; border-radius: 12px; border: 1.5px solid var(--lms-border, #E7DDCF); background: var(--lms-surface-2, #FAF6F0); color: var(--lms-text, #201A1D); font: 500 .95rem inherit; font-family: inherit; cursor: pointer; }
.lp-ci__opts button:hover:not(:disabled) { border-color: var(--lms-accent, #78185D); }
.lp-ci__opts .is-ok { border-color: var(--lms-success, #127A65); background: var(--lms-success-bg, #E2F5EF); }
.lp-ci__opts .is-ok::before { content: "\2713  "; font-weight: 800; }
.lp-ci__opts .is-bad { border-color: var(--lms-danger, #B42318); background: var(--lms-danger-bg, #FDECEA); }
.lp-ci__opts .is-bad::before { content: "\2715  "; font-weight: 800; }
.lp-ci__fb { margin-top: .9rem; }
.lp-ci__fb p { margin: 0 0 .7rem; font-weight: 600; }

/* ---- Dashboard: level card, week dots, badges, journey ---- */
.gm { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 1.2rem; margin-bottom: 1.6rem; }
.gm__card { background: #fff; border: 1px solid var(--grey-200); border-radius: 24px; padding: clamp(18px,2.4vw,28px); box-shadow: var(--shadow-sm); }
.gm__lvl { display: flex; align-items: center; gap: 1.2rem; }
.gm__ring { --p: 0; flex: none; position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--violet) calc(var(--p) * 1%), var(--grey-100) 0); }
.gm__ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #fff; }
.gm__ring b { position: relative; font: 800 1.9rem var(--font-display); color: var(--violet); }
.gm__lvl h2 { font: 700 1.35rem var(--font-display); margin: 0 0 .15rem; }
.gm__lvl p { margin: 0; color: var(--grey-600); }
.gm__bar { height: 8px; border-radius: 999px; background: var(--grey-100); overflow: hidden; margin-top: .7rem; }
.gm__bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--violet), var(--gold)); border-radius: inherit; }
.gm__week h3, .gm__badges h3 { font-size: 1rem; margin: 0 0 .8rem; }
.gm__days { display: flex; gap: .5rem; }
.gm__day { flex: 1; text-align: center; font-size: .72rem; font-weight: 700; color: var(--grey-600); }
.gm__day i { display: block; width: 100%; aspect-ratio: 1; max-width: 38px; margin: 0 auto .3rem; border-radius: 50%; background: var(--grey-100); border: 2px solid transparent; }
.gm__day.is-on i { background: var(--violet); }
.gm__day.is-today i { border-color: var(--gold); }
.gm__streak { margin-top: .9rem; font-weight: 700; color: var(--violet-dk); }
.gm__streak small { display: block; font-weight: 500; color: var(--grey-600); }
.gm__badges { grid-column: 1 / -1; }
.gm__shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: .8rem; }
.bdg { text-align: center; padding: .9rem .5rem; border-radius: 18px; background: var(--gold-pale); border: 1px solid var(--gold-lt); }
.bdg__ic { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto .4rem; border-radius: 50%; background: #fff; font-size: 1.6rem; box-shadow: var(--shadow-sm); }
.bdg strong { display: block; font-size: .82rem; line-height: 1.25; }
.bdg small { display: block; font-size: .7rem; color: var(--grey-600); margin-top: .15rem; line-height: 1.3; }
.bdg.is-locked { background: var(--grey-50); border-color: var(--grey-200); }
.bdg.is-locked .bdg__ic { filter: grayscale(1); opacity: .45; box-shadow: none; }
.bdg.is-locked strong { color: var(--grey-600); }
@media (max-width: 860px) { .gm { grid-template-columns: 1fr; } }

.jm { background: #fff; border: 1px solid var(--grey-200); border-radius: 24px; padding: clamp(18px,2.4vw,28px); margin-bottom: 1.6rem; box-shadow: var(--shadow-sm); }
.jm__head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.jm__head h2 { font: 700 1.25rem var(--font-display); margin: 0; }
.jm__head span { color: var(--grey-600); font-weight: 600; font-size: .9rem; }
.jm__track { list-style: none; margin: 0; padding: 1.4rem .2rem 1rem; display: flex; gap: 0; overflow-x: auto; scrollbar-width: thin; }
.jm__node { flex: 1 0 96px; min-width: 96px; position: relative; text-align: center; padding-top: 0; }
.jm__node::before { content: ""; position: absolute; top: 25px; left: -50%; width: 100%; height: 4px; background: var(--grey-200); z-index: 0; }
.jm__node:first-child::before { display: none; }
.jm__node.is-done::before, .jm__node.is-current::before { background: var(--violet); }
.jm__dot { position: relative; z-index: 1; display: grid; place-items: center; width: 54px; height: 54px; margin: 0 auto .5rem; border-radius: 50%; background: #fff; border: 4px solid var(--grey-200); color: var(--grey-600); font-weight: 800; text-decoration: none; transition: transform .2s; }
.jm__dot:hover { transform: scale(1.08); }
.jm__node.is-done .jm__dot { background: var(--violet); border-color: var(--violet); color: #fff; }
.jm__node.is-current .jm__dot { border-color: var(--gold); color: var(--violet); box-shadow: 0 0 0 6px rgba(244,185,64,.3); animation: jmPulse 2s infinite; }
@keyframes jmPulse { 50% { box-shadow: 0 0 0 10px rgba(244,185,64,.12); } }
.jm__lbl { display: block; font-size: .74rem; font-weight: 700; line-height: 1.3; color: var(--grey-800); padding: 0 .3rem; }
.jm__flag { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); font-size: .65rem; font-weight: 800; background: var(--gold); color: #3a2a00; padding: .1rem .5rem; border-radius: 999px; z-index: 2; white-space: nowrap; }
.jm__cta { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--violet-pale); border-radius: 16px; padding: .9rem 1.1rem; }
.jm__cta p { margin: 0; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .jm__node.is-current .jm__dot { animation: none; } }
.act__msg.is-win { color: var(--blue-dk); background: var(--blue-pale); padding: .7rem 1rem; border-radius: 12px; font-weight: 600; }
