/* Student experience polish (Nov 2026). Loaded last so these rules win over the older layers. */

/* 1. When the plan chip stands alone (no "Renew now" button, e.g. the season pass), it fills the whole bar. */
#mfExpiry .mf-exp-text:only-child{flex:1 1 auto;width:100%}
#mfExpiry .mf-exp-text:only-child .mf-days-chip{display:block;width:100%;text-align:center;box-sizing:border-box}

/* 13. A card opened from the card library: the back arrow points the way "back" reads (right in Arabic, left in English). */
html[dir=rtl] #backToHomeFromStudyBtn .mf-back-arrow{transform:scaleX(-1)}

/* 12 + 15. Finished-session celebrations (built by /assets/celebrate.js). */
#sessionCompletedBox.mf-celebrating{padding-block:8px 24px;max-width:28rem}
#sessionCompletedBox.mf-celebrating>#completedTitleText,#sessionCompletedBox.mf-celebrating>#completedSubText{display:none}
#returnHomeAfterDoneBtn{display:none!important}
#flashcardContainer.hidden{display:none!important}
.mfc{--mfc-ink:#0B2E59;--mfc-blue:#378AE6;--mfc-sky:#8BC7FF;--mfc-gold:#F5B83D;--mfc-track:#E3EEFA;--mfc-text:#334155;--mfc-chip:#FFFFFF;--mfc-line:#D8E5F2;
  position:relative;display:grid;justify-items:center;gap:10px;text-align:center;padding:12px 8px 6px;overflow:visible}
html[data-theme=dark] .mfc{--mfc-ink:#E6EDF7;--mfc-blue:#8BC7FF;--mfc-sky:#378AE6;--mfc-track:#1F3A5E;--mfc-text:#C9D8EC;--mfc-chip:#162334;--mfc-line:#33465D}
.mfc-art{position:relative;width:168px;height:168px;display:grid;place-items:center;margin-bottom:4px}
.mfc-glow{position:absolute;inset:6px;border-radius:50%;background:radial-gradient(circle,rgba(55,138,230,.32),rgba(55,138,230,0) 68%)}
.mfc-ring{position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}
.mfc-ring circle{fill:none;stroke-width:11;stroke-linecap:round}
.mfc-ring-bg{stroke:var(--mfc-track)}
.mfc-ring-fill{stroke:var(--mfc-blue);stroke-dasharray:339.3;stroke-dashoffset:0}
.mfc-core{position:relative;width:92px;height:92px;border-radius:50%;background:linear-gradient(160deg,#12427A,#0B2E59);display:grid;place-items:center;box-shadow:0 14px 28px -12px rgba(11,46,89,.7),inset 0 -6px 0 rgba(0,0,0,.18)}
.mfc-core svg{width:50px;height:50px;fill:#FFFFFF;filter:drop-shadow(0 0 10px rgba(139,199,255,.9))}
.mfc-pct{position:absolute;bottom:-10px;left:50%;transform:translateX(-50%);padding:3px 12px;border-radius:999px;background:var(--mfc-gold);color:#0B2E59;font:800 15px/1.4 Inter,Cairo,sans-serif;box-shadow:0 6px 14px -6px rgba(180,120,10,.7);direction:ltr;white-space:nowrap}
.mfc-title{margin:12px 0 0;font-size:24px;line-height:1.35;font-weight:900;color:var(--mfc-ink);letter-spacing:-.2px}
.mfc-line{margin:0;max-width:22rem;font-size:15px;line-height:1.75;color:var(--mfc-text);font-weight:600}
.mfc-chips{display:flex;flex-wrap:wrap;justify-content:center;gap:8px;margin-top:8px}
.mfc-chip{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:14px;background:var(--mfc-chip);border:1.5px solid var(--mfc-line);border-bottom-width:3px;color:var(--mfc-text);font-size:13.5px;font-weight:700}
.mfc-chip b{font:800 16px Inter,Cairo,sans-serif;color:var(--mfc-ink)}
.mfc-chip-ico{font-size:17px;line-height:1;min-width:17px;height:17px;display:inline-grid;place-items:center;color:var(--mfc-blue)}
.mfc-confetti{position:absolute;inset:0 auto auto 0;pointer-events:none;z-index:3}

/* weak-spots scene */
.mfc-weak .mfc-glow{background:radial-gradient(circle,rgba(245,184,61,.34),rgba(245,184,61,0) 66%)}
.mfc-shield{position:relative;width:122px;height:138px;overflow:visible;filter:drop-shadow(0 14px 18px rgba(11,46,89,.35))}
.mfc-piece.p1,.mfc-piece.p4{fill:#12427A}.mfc-piece.p2,.mfc-piece.p3{fill:#0B2E59}
.mfc-shield-edge{fill:none;stroke:var(--mfc-gold);stroke-width:5;stroke-linejoin:round}
.mfc-check{fill:none;stroke:#FFFFFF;stroke-width:10;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:80;stroke-dashoffset:0}
.mfc-shine{opacity:0}
.mfc-sparks{position:absolute;inset:0;pointer-events:none}
.mfc-sparks i{position:absolute;bottom:22%;left:calc(14% + var(--i) * 9%);width:7px;height:7px;border-radius:50%;background:var(--mfc-gold);opacity:0;box-shadow:0 0 10px var(--mfc-gold)}
.mfc-sparks i:nth-child(3n){background:var(--mfc-sky);box-shadow:0 0 10px var(--mfc-sky);width:5px;height:5px}

/* the first time only: the animation */
.mfc.is-playing .mfc-glow{animation:mfc-glow 2.4s ease-out 1s both}
.mfc.is-playing .mfc-ring-fill{animation:mfc-ring .95s cubic-bezier(.6,0,.25,1) .15s both}
.mfc.is-playing .mfc-core{animation:mfc-pop .7s cubic-bezier(.3,1.6,.5,1) .95s both}
.mfc.is-playing .mfc-core svg{animation:mfc-spin 1.1s cubic-bezier(.2,.8,.2,1) 1.05s both}
.mfc.is-playing .mfc-pct{animation:mfc-badge .55s cubic-bezier(.3,1.6,.5,1) 1.25s both}
.mfc.is-playing .mfc-art{animation:mfc-thump .5s ease-out 1.05s both}
.mfc.is-playing .mfc-title{animation:mfc-up .55s cubic-bezier(.2,.9,.3,1.2) 1.35s both}
.mfc.is-playing .mfc-line{animation:mfc-up .55s cubic-bezier(.2,.9,.3,1.2) 1.5s both}
.mfc.is-playing .mfc-chip{animation:mfc-up .5s cubic-bezier(.2,.9,.3,1.3) both}
.mfc.is-playing .mfc-chip:nth-child(1){animation-delay:1.68s}.mfc.is-playing .mfc-chip:nth-child(2){animation-delay:1.8s}
.mfc-weak.is-playing .mfc-piece{animation:mfc-piece .7s cubic-bezier(.3,1.35,.5,1) both}
.mfc-weak.is-playing .p1{--fx:-46px;--fy:-38px;--fr:-28deg;animation-delay:.1s}
.mfc-weak.is-playing .p2{--fx:46px;--fy:-38px;--fr:26deg;animation-delay:.2s}
.mfc-weak.is-playing .p3{--fx:-44px;--fy:42px;--fr:24deg;animation-delay:.3s}
.mfc-weak.is-playing .p4{--fx:44px;--fy:42px;--fr:-22deg;animation-delay:.4s}
.mfc-weak.is-playing .mfc-shield-edge{stroke-dasharray:360;animation:mfc-edge .7s ease-out .85s both}
.mfc-weak.is-playing .mfc-check{animation:mfc-check .45s cubic-bezier(.6,0,.3,1) 1.25s both}
.mfc-weak.is-playing .mfc-shine{animation:mfc-shine .9s ease-in-out 1.55s both}
.mfc-weak.is-playing .mfc-shield{animation:mfc-thump .5s ease-out 1.15s both}
.mfc-weak.is-playing .mfc-sparks i{animation:mfc-spark 1.6s ease-out calc(1.4s + var(--i) * .11s) 2 both}
@keyframes mfc-ring{from{stroke-dashoffset:339.3}to{stroke-dashoffset:0}}
@keyframes mfc-pop{from{transform:scale(0) rotate(-30deg);opacity:0}to{transform:none;opacity:1}}
@keyframes mfc-spin{from{transform:rotate(-180deg) scale(.4)}to{transform:none}}
@keyframes mfc-badge{from{transform:translateX(-50%) scale(0)}to{transform:translateX(-50%) scale(1)}}
@keyframes mfc-thump{0%{transform:scale(1)}35%{transform:scale(1.08)}100%{transform:scale(1)}}
@keyframes mfc-up{from{transform:translateY(16px);opacity:0}to{transform:none;opacity:1}}
@keyframes mfc-glow{0%{opacity:0;transform:scale(.6)}25%{opacity:1;transform:scale(1.15)}100%{opacity:.75;transform:scale(1)}}
@keyframes mfc-piece{from{transform:translate(var(--fx),var(--fy)) rotate(var(--fr));opacity:0}to{transform:none;opacity:1}}
@keyframes mfc-edge{from{stroke-dashoffset:360}to{stroke-dashoffset:0}}
@keyframes mfc-check{from{stroke-dashoffset:80}to{stroke-dashoffset:0}}
@keyframes mfc-shine{0%{opacity:1;transform:translateX(0)}100%{opacity:1;transform:translateX(190px)}}
@keyframes mfc-spark{0%{opacity:0;transform:translateY(0) scale(.4)}20%{opacity:1}100%{opacity:0;transform:translateY(-120px) scale(1)}}
@media (prefers-reduced-motion:reduce){.mfc *{animation:none!important}}
/* While the last answers are saved or the next cards load: three quiet dots, no sentence. */
#sessionCompletedBox #completedTitleText:empty,#sessionCompletedBox #completedSubText:empty{display:none}
#sessionCompletedBox.mf-waiting::before{content:"";display:block;width:44px;height:10px;margin:40px auto;background:radial-gradient(circle,#378AE6 4px,transparent 4.5px) 0 0/14px 10px repeat-x;animation:mf-dots 1s steps(3) infinite;opacity:.8}
@keyframes mf-dots{0%{clip-path:inset(0 66% 0 0)}100%{clip-path:inset(0 -10% 0 0)}}
.mfc-base{fill:#0B2E59}
.mfc-weak.is-playing .mfc-base{animation:mfc-fade .2s linear .8s both}
@keyframes mfc-fade{from{opacity:0}to{opacity:1}}

/* 18. Menu close button: a true square with the X drawn in its exact centre. */
html body #mfDrawerClose{width:40px;height:40px;min-width:40px;min-height:40px;font-size:0;align-self:center}
html body #mfDrawerClose svg{display:block;width:20px;height:20px}
/* 19. Menu "longest streak": number and emoji share one centred line. */
#mfDrawerStreak{display:inline-flex;align-items:center;gap:6px;line-height:1}
#mfDrawerStreak .mf-ds-num{font-variant-numeric:tabular-nums}
#mfDrawerStreak .mf-ds-emoji{display:inline-grid;place-items:center;width:1.1em;height:1.1em;font-size:20px;line-height:1;font-weight:400;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;transform:translateY(-1px)}
.mf-drawer-identity .mf-streak-chip{align-items:center;min-height:36px;padding-block:3px}

/* 17. Swipe-to-open menu: while the finger drags it, the dimmed backdrop follows how far the menu is in. */
#mfStudentDrawer.is-swiping{will-change:transform}
#mfStudentDrawer.is-swiping::backdrop{opacity:var(--mf-drawer-shade,1)}

/* 22. Notifications tabs: the count sits in the tab's top corner as a small blue badge, like the bell's. */
.mf-inbox-filters{padding-top:12px}
.mf-inbox-filters button{position:relative;overflow:visible}
.mf-inbox-filters button b.mf-tab-badge{position:absolute;top:-8px;inset-inline-end:-6px;margin:0;min-width:20px;height:20px;padding:0 6px;border-radius:999px;background:#378AE6;color:#fff;font:800 11px/20px Inter,Cairo,sans-serif;text-align:center;box-shadow:0 0 0 2px #fff;direction:ltr}
.mf-inbox-filters button[aria-selected=true] b.mf-tab-badge{background:#378AE6;color:#fff}
.mf-inbox-filters button b.mf-tab-badge[hidden]{display:none}
html[data-theme=dark] .mf-inbox-filters button b.mf-tab-badge{background:#8BC7FF;color:#06182e;box-shadow:0 0 0 2px #162334}
