/* Visual tokens taken from Figma "Venus - Dashboard Builder 2021" */
:root {
  --primary: #4318FF;
  --primary-soft: #868CFF;
  --grad: linear-gradient(135deg, #868CFF 0%, #4318FF 100%);
  --navy: #2B3674;
  --navy-900: #1B2559;
  --grey-700: #707EAE;
  --grey-600: #A3AED0;
  --grey-500: #8F9BBA;
  --grey-400: #E9EDF7;
  --bg: #F4F7FE;
  --white: #FFFFFF;
  --green: #05CD99;
  --red: #EE5D50;
  --radius: 20px;
  --shadow: 14px 17px 40px 4px rgba(112, 144, 176, .08);
  --shadow-hover: 14px 22px 50px 6px rgba(112, 144, 176, .16);
  --yellow: #FFD84D;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
/* Dark tokens from Venus' dark variant; system setting unless the user picked one */
:root[data-theme=dark] { --primary: #7551FF; --navy: #FFFFFF; --navy-900: #FFFFFF; --grey-700: #A3AED0; --grey-600: #8F9BBA; --grey-400: #1B254B; --bg: #0B1437; --white: #111C44; --shadow: 0 14px 40px rgba(0, 0, 0, .25); --shadow-hover: 0 18px 50px rgba(0, 0, 0, .35); color-scheme: dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { --primary: #7551FF; --navy: #FFFFFF; --navy-900: #FFFFFF; --grey-700: #A3AED0; --grey-600: #8F9BBA; --grey-400: #1B254B; --bg: #0B1437; --white: #111C44; --shadow: 0 14px 40px rgba(0, 0, 0, .25); --shadow-hover: 0 18px 50px rgba(0, 0, 0, .35); color-scheme: dark; }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: radial-gradient(1200px 600px at 100% -10%, rgba(134, 140, 255, .14), transparent 60%), var(--bg); background-attachment: fixed; color: var(--navy); font: 500 16px/1.6 "DM Sans", system-ui, sans-serif; letter-spacing: -.02em; }
h1, h2, h3, h4 { margin: 0; color: var(--navy); font-weight: 700; line-height: 1.25; }
p { margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--primary-soft); outline-offset: 2px; }
[hidden] { display: none !important; }
.loading { padding: 40px; text-align: center; color: var(--grey-700); }
.muted { color: var(--grey-600); font-size: 14px; }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }
.side { background: var(--white); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; padding: 32px 28px 26px; border-bottom: 1px solid var(--bg); }
.brand .mark { flex: none; filter: drop-shadow(0 8px 14px rgba(67, 24, 255, .28)); transition: transform .4s var(--spring); }
.brand:hover .mark { transform: rotate(-6deg) scale(1.05); }
.brand b { display: block; font-size: 22px; line-height: 1.05; color: var(--navy-900); letter-spacing: -.04em; }
.brand b .dot { font-style: normal; color: var(--yellow); margin: 0 .02em; -webkit-text-stroke: .5px #E8B800; }
.brand b em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand span { font-size: 11px; color: var(--grey-600); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.nav { list-style: none; margin: 0; padding: 24px 20px; display: grid; gap: 6px; }
.nav a, .logout { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 12px; color: var(--grey-600); text-decoration: none; font-weight: 500; border: 0; background: none; width: 100%; text-align: left; transition: background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease); }
.nav a:hover, .logout:hover { color: var(--navy); background: var(--bg); transform: translateX(3px); }
.nav a[aria-current=page] { background: var(--grad); color: #fff; font-weight: 700; box-shadow: 0 10px 20px rgba(67, 24, 255, .25); transform: none; }
.nav svg, .logout svg { width: 20px; height: 20px; flex: none; }
.side-foot { margin-top: auto; padding: 20px; }
.main { padding: 36px 40px 48px; min-width: 0; }
.top { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.top .hi { font-size: 14px; color: var(--grey-700); }
.top h1 { font-size: 34px; letter-spacing: -.03em; }
.menu-btn { display: none; }

/* ---------- cards ---------- */
.card { background: var(--white); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); min-width: 0; transition: box-shadow .3s var(--ease), transform .3s var(--ease); }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card h2 { font-size: 20px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; }
.grid { display: grid; gap: 20px; }
.stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.stat { display: flex; align-items: center; gap: 16px; padding: 20px; }
.stat .ic { width: 56px; height: 56px; border-radius: 50%; background: var(--bg); color: var(--primary); display: grid; place-items: center; flex: none; }
.stat .ic svg { width: 26px; height: 26px; }
.stat .lbl { font-size: 14px; color: var(--grey-600); }
.stat .val { font-size: 24px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.stat.hero { background: linear-gradient(120deg, #868CFF, #4318FF, #7551FF, #868CFF); background-size: 300% 300%; animation: shimmer 10s ease-in-out infinite; position: relative; overflow: hidden; }
.stat.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255,255,255,.12); }
.stat.hero .lbl { color: rgba(255,255,255,.85); }
.stat.hero .val { color: #fff; font-size: 20px; }
.stat.hero .ic { background: rgba(255,255,255,.18); color: #fff; }
.row-2 { grid-template-columns: 2fr 1fr; margin-bottom: 20px; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* charts */
.big { font-size: 34px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; margin-top: 20px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; min-width: 0; }
.chart .track { flex: 1; width: 100%; max-width: 32px; border-radius: 8px; background: var(--bg); display: flex; align-items: flex-end; overflow: hidden; }
.chart .fill { width: 100%; border-radius: 8px; background: linear-gradient(180deg, #C9CCFF, #A3AED0); min-height: 6px; transform-origin: bottom; transition: filter .2s; }
.chart .cur .fill { background: var(--grad); box-shadow: 0 6px 14px rgba(67,24,255,.3); }
.chart .col:hover .fill { filter: brightness(1.08) saturate(1.2); }
.chart .lbl { font-size: 12px; color: var(--grey-600); }
.chart.thin .track { max-width: 18px; border-radius: 10px; background: var(--grey-400); }
.chart.thin .fill { background: var(--grad); border-radius: 10px; }

/* level/profile card */
.profile { text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.avatar { width: 96px; height: 96px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 34px; font-weight: 700; border: 8px solid var(--bg); margin-bottom: 8px; }
.profile h3 { font-size: 22px; }
.profile .nums { display: flex; gap: 20px; margin-top: 14px; }
.profile .nums .muted { font-size: 12px; white-space: nowrap; }
.profile .nums b { display: block; font-size: 22px; color: var(--navy); }

/* timeline (today) */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.timeline li { border-left: 4px solid var(--primary); padding-left: 14px; }
.timeline li.done { border-color: var(--green); }
.timeline b { display: block; color: var(--navy); font-size: 15px; }
.link-arrow { font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--green); }
.badge { display: inline-block; padding: 2px 12px; border-radius: 99px; background: var(--bg); color: var(--primary); font-size: 13px; font-weight: 700; }

/* ---------- planner ---------- */
.weeks { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 10px; margin-bottom: 20px; }
.weeks button { border: 0; border-radius: 12px; background: var(--white); box-shadow: var(--shadow); padding: 10px 0; font-weight: 700; color: var(--navy); }
.weeks button[aria-pressed=true] { background: var(--primary); color: #fff; }
.weeks button.full:not([aria-pressed=true]) { color: var(--green); }
.days { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); align-items: start; }
.day .when { font-size: 12px; color: var(--green); font-weight: 700; }
.day.complete { outline: 2px solid var(--green); }
.acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.acts li { display: grid; grid-template-columns: 28px 1fr; gap: 0 10px; padding: 10px 0; border-bottom: 1px solid var(--bg); }
.acts li:last-child { border: 0; }
.acts input { appearance: none; -webkit-appearance: none; width: 22px; height: 22px; margin: 2px 0 0; border: 2px solid var(--grey-600); border-radius: 7px; background: var(--white); cursor: pointer; display: grid; place-items: center; transition: background .2s var(--ease), border-color .2s var(--ease); }
.acts input:hover { border-color: var(--primary); }
.acts input:checked { border-color: transparent; background: var(--grad) ; }
.acts input:checked::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.acts input.pop { animation: pop .45s var(--spring); }
.acts .t { transition: opacity .3s var(--ease); }
.acts .t { font-weight: 700; color: var(--navy); text-decoration: none; font-size: 15px; }
.acts a.t { color: var(--primary); }
.acts a.t:hover { text-decoration: underline; }
.acts .n { grid-column: 2; color: var(--grey-700); font-size: 14px; }
.acts .go { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.acts .go .in-app { margin: 6px 0 0; white-space: nowrap; }
.acts input:checked ~ .t { text-decoration: line-through; opacity: .55; }
details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--grey-700); }
textarea, .field input, .field select { width: 100%; border: 1px solid var(--grey-400); border-radius: 16px; padding: 12px 16px; background: var(--white); color: var(--navy); }
textarea { min-height: 120px; margin-top: 10px; resize: vertical; }
textarea:focus, .field input:focus, .field select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(67,24,255,.12); }

/* ---------- lists / guide ---------- */
.cols { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.list { margin: 0; padding-left: 18px; color: var(--grey-700); }
.list li { margin: 4px 0; }
.card.cur { outline: 2px solid var(--primary); }
.cefr { display: grid; gap: 12px; margin-top: 12px; }
.cefr div { display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: start; }
.note-item p { color: var(--grey-700); white-space: pre-wrap; font-size: 14px; margin-top: 6px; }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; border: 0; border-radius: 16px; background: var(--primary); color: #fff; font-weight: 700; padding: 14px 24px; text-decoration: none; }
.btn { background: var(--grad); box-shadow: 0 10px 22px rgba(67, 24, 255, .25); transition: transform .2s var(--ease), box-shadow .2s var(--ease), filter .2s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(67, 24, 255, .32); filter: brightness(1.05); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: var(--bg); color: var(--primary); }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 14px; font-weight: 700; color: var(--navy); }
.form-msg { font-size: 14px; margin-bottom: 14px; }
.form-msg.err { color: var(--red); }
.form-msg.ok { color: var(--green); }
.textbtn { border: 0; background: none; color: var(--primary); font-weight: 700; padding: 0; }

/* auth screen */
.auth { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; background: var(--white); }
.auth-form { padding: 48px clamp(16px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; max-width: 620px; width: 100%; }
.auth-form h1 { font-size: 36px; margin: 32px 0 6px; }
.auth-form .btn { width: 100%; margin-top: 4px; }
.auth-form .brand { padding: 0; border: 0; }
.auth-art { position: relative; overflow: hidden; background: linear-gradient(150deg, #868CFF 0%, #4318FF 60%, #2A0FB8 100%); border-bottom-left-radius: 200px; color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px; text-align: center; gap: 18px; }
.auth-art > :not(.orb) { position: relative; }
.auth-art h2 { color: #fff; font-size: 44px; letter-spacing: -.04em; animation: rise .7s var(--ease) .35s both; }
.auth-art p { max-width: 380px; opacity: .9; animation: rise .7s var(--ease) .45s both; }
.hero-mark { filter: drop-shadow(0 24px 40px rgba(20, 0, 120, .45)); animation: float 6s ease-in-out infinite; }
.hero-mark .bubble { fill: rgba(255,255,255,.16); stroke: rgba(255,255,255,.35); stroke-width: 1; }
.hero-mark .i { transform-box: fill-box; transform-origin: bottom; animation: grow .6s var(--spring) .2s backwards; }
.hero-mark .n { stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw 1.2s var(--ease) .45s forwards; }
.hero-mark .spark { transform-origin: 38.5px 27.75px; animation: spark 1.6s var(--spring) 1.3s both, glow 2.4s ease-in-out 3s infinite; }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); background: rgba(255,255,255,.1); animation: drift 14s ease-in-out infinite; }
.o1 { width: 320px; height: 320px; top: -80px; right: -90px; }
.o2 { width: 180px; height: 180px; bottom: 60px; left: -40px; animation-delay: -5s; }
.o3 { width: 90px; height: 90px; top: 30%; left: 18%; background: rgba(255, 216, 77, .25); animation-delay: -9s; }
.skill-chips { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 420px; }
.skill-chips li { padding: 6px 14px; border-radius: 99px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); font-size: 13px; font-weight: 700; backdrop-filter: blur(6px); animation: rise .6s var(--ease) both; animation-delay: calc(.6s + var(--i) * 80ms); }
.levels-pick { display: grid; gap: 10px; margin: 16px 0 24px; }
.levels-pick label { display: flex; gap: 14px; align-items: flex-start; border: 1px solid var(--grey-400); border-radius: 16px; padding: 14px 16px; cursor: pointer; }
.levels-pick label:has(input:checked) { border-color: var(--primary); background: var(--bg); }
.levels-pick input { margin-top: 5px; accent-color: var(--primary); }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1B2559; color: #fff; padding: 12px 20px; border-radius: 14px; box-shadow: 0 18px 40px rgba(27, 37, 89, .3); z-index: 20; max-width: calc(100% - 32px); }
#toast.show { animation: toast-in .45s var(--spring); }

/* ---------- sidebar extras ---------- */
.nav .pill { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 22px; }
.side-foot { display: grid; gap: 4px; }

/* ---------- gamification ---------- */
.xp-bar { height: 10px; border-radius: 99px; background: var(--bg); overflow: hidden; margin: 10px 0 6px; }
.xp-bar i { display: block; height: 100%; background: var(--grad); border-radius: inherit; transform-origin: left; }
.anim .xp-bar i { animation: grow-x 1s var(--ease) .3s backwards; }
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.medal { text-align: center; padding: 18px 12px; border-radius: 16px; background: var(--bg); }
.medal .e { font-size: 34px; line-height: 1; display: block; margin-bottom: 8px; }
.medal b { display: block; font-size: 14px; color: var(--navy); }
.medal span { font-size: 12px; color: var(--grey-600); }
.medal.off { opacity: .45; filter: grayscale(1); }
.heat { display: grid; grid-template-rows: repeat(7, 14px); grid-auto-flow: column; grid-auto-columns: 14px; gap: 4px; overflow-x: auto; padding-bottom: 6px; }
.heat i { border-radius: 4px; background: var(--grey-400); }
.heat i[data-l="1"] { background: #C6C9FF; } .heat i[data-l="2"] { background: #868CFF; } .heat i[data-l="3"] { background: #4318FF; } .heat i.pad { visibility: hidden; }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--grey-600); margin-top: 8px; }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- vocabulary ---------- */
.flash { text-align: center; padding: 40px 24px; }
.flash .word { font-size: 40px; font-weight: 700; color: var(--navy); letter-spacing: -.03em; }
.flash .ex { font-style: italic; color: var(--grey-700); margin-top: 8px; }
.flash .ans { font-size: 20px; color: var(--primary); font-weight: 700; margin-top: 18px; animation: rise .4s var(--ease); }
.grades { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }
.grades .btn { padding: 12px 18px; }
.grades .g0 { background: var(--red); box-shadow: none; } .grades .g1 { background: #FFB547; box-shadow: none; } .grades .g3 { background: var(--green); box-shadow: none; }
.vtable { width: 100%; border-collapse: collapse; font-size: 14px; }
.vtable th { text-align: left; color: var(--grey-600); font-weight: 700; padding: 8px 6px; border-bottom: 1px solid var(--grey-400); }
.vtable td { padding: 10px 6px; border-bottom: 1px solid var(--grey-400); color: var(--grey-700); vertical-align: top; }
.vtable td:first-child { color: var(--navy); font-weight: 700; }
.icon-btn { border: 0; background: none; color: var(--grey-600); padding: 4px; border-radius: 8px; }
.icon-btn:hover { color: var(--red); background: var(--bg); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.danger { color: var(--red) !important; }

/* ---------- in-app activities ---------- */
.ex-page { max-width: 820px; }
.ex-block { margin-bottom: 20px; }
.ex-block h3 { font-size: 18px; margin-bottom: 4px; }
.ex-block .ins { color: var(--grey-700); font-size: 14px; margin-bottom: 14px; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 16px; overflow: hidden; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ex-text p { margin-bottom: 12px; color: var(--navy); line-height: 1.75; font-size: 17px; }
.tip { background: var(--bg); border-left: 4px solid var(--primary); border-radius: 12px; padding: 14px 16px; color: var(--grey-700); font-size: 15px; }
.tip b { color: var(--navy); }
.tip ul { margin: 8px 0 0; padding-left: 18px; }
.q { padding: 14px 0; border-top: 1px solid var(--grey-400); }
.q:first-of-type { border-top: 0; }
.q > p { font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts button, .chip { border: 2px solid var(--grey-400); background: var(--white); color: var(--navy); border-radius: 12px; padding: 8px 14px; font-weight: 500; transition: border-color .2s, background .2s, transform .15s var(--spring); }
.opts button:hover, .chip:hover { border-color: var(--primary-soft); }
.opts button[aria-pressed=true] { border-color: var(--primary); background: var(--bg); }
.ok-ans { border-color: var(--green) !important; background: rgba(5, 205, 153, .12) !important; }
.bad-ans { border-color: var(--red) !important; background: rgba(238, 93, 80, .1) !important; }
.fb { font-size: 14px; margin-top: 8px; min-height: 1em; }
.fb.ok { color: var(--green); } .fb.bad { color: var(--red); }
.gap-in { display: inline-block; width: 150px; border: 0; border-bottom: 2px solid var(--grey-600); background: transparent; padding: 2px 6px; color: var(--primary); font-weight: 700; text-align: center; }
.gap-in:focus { outline: none; border-color: var(--primary); }
.match-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; padding: 8px 0; }
.match-row select { width: 100%; border: 2px solid var(--grey-400); border-radius: 12px; padding: 8px 10px; background: var(--white); color: var(--navy); }
.order-ans { min-height: 48px; border: 2px dashed var(--grey-400); border-radius: 12px; padding: 6px; display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.order-bank { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; }
.play { display: inline-flex; align-items: center; gap: 8px; }
.dict-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; }
.dict-row input { flex: 1; border: 1px solid var(--grey-400); border-radius: 12px; padding: 10px 14px; background: var(--white); color: var(--navy); }
.rec { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 8px; }
.rec .btn.live { background: var(--red); box-shadow: 0 0 0 0 rgba(238, 93, 80, .5); animation: pulse 1.4s infinite; }
.rec audio { height: 40px; max-width: 100%; }
.transcript { font-size: 14px; color: var(--grey-700); font-style: italic; margin-top: 6px; }
.ex-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.ex-score { font-size: 15px; color: var(--grey-700); }
.wc { font-size: 13px; color: var(--grey-600); text-align: right; margin-top: 4px; }
.in-app { display: inline-flex; align-items: center; gap: 6px; margin: 6px 8px 0 0; padding: 4px 12px; border-radius: 99px; background: var(--grad); color: #fff !important; font-size: 13px; font-weight: 700; text-decoration: none; }
.soon { display: inline-block; margin-top: 6px; padding: 3px 12px; border-radius: 99px; background: var(--bg); color: var(--grey-600); font-size: 12px; font-weight: 700; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(238, 93, 80, 0); } 100% { box-shadow: 0 0 0 0 rgba(238, 93, 80, 0); } }

/* ---------- landing ---------- */
.landing { background: var(--white); min-height: 100vh; }
.l-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1160px; margin: 0 auto; padding: 18px 24px; }
.l-nav .brand { padding: 0; border: 0; }
.l-nav .acts-top { display: flex; gap: 10px; align-items: center; }
.l-hero { position: relative; overflow: hidden; background: linear-gradient(150deg, #868CFF 0%, #4318FF 60%, #2A0FB8 100%); color: #fff; border-radius: 0 0 48px 48px; }
.l-hero .in { position: relative; max-width: 1160px; margin: 0 auto; padding: 72px 24px 96px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.l-hero h1 { color: #fff; font-size: 56px; letter-spacing: -.045em; line-height: 1.05; animation: rise .7s var(--ease) .1s backwards; }
.l-hero p { font-size: 19px; opacity: .92; margin: 18px 0 30px; max-width: 520px; animation: rise .7s var(--ease) .2s backwards; }
.l-hero .cta { display: flex; flex-wrap: wrap; gap: 12px; animation: rise .7s var(--ease) .3s backwards; }
.l-hero .btn.light { background: #fff; color: #4318FF; box-shadow: 0 14px 30px rgba(20, 0, 120, .35); }
.l-hero .btn.line { background: transparent; border: 2px solid rgba(255,255,255,.6); box-shadow: none; }
.l-hero .art { display: grid; place-items: center; }
.l-sec { max-width: 1160px; margin: 0 auto; padding: 72px 24px 0; }
.l-sec > h2 { font-size: 36px; letter-spacing: -.035em; text-align: center; }
.l-sec > .muted { text-align: center; font-size: 17px; max-width: 620px; margin: 10px auto 36px; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.steps3 .card::before { counter-increment: s; content: counter(s); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--grad); color: #fff; font-weight: 700; margin-bottom: 14px; }
.feat .ic { width: 48px; height: 48px; border-radius: 50%; background: var(--bg); color: var(--primary); display: grid; place-items: center; margin-bottom: 12px; }
.feat .ic svg { width: 22px; height: 22px; }
.feat h3 { font-size: 18px; margin-bottom: 6px; }
.lvl-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.lvl-row .card { text-align: center; }
.lvl-row b { display: block; font-size: 28px; color: var(--primary); }
.l-cta { margin: 72px auto 0; max-width: 1112px; text-align: center; padding: 56px 24px; border-radius: 32px; background: var(--grad); color: #fff; }
.l-cta h2 { color: #fff; font-size: 34px; margin-bottom: 20px; }
.l-foot { max-width: 1160px; margin: 0 auto; padding: 40px 24px; display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; color: var(--grey-600); font-size: 14px; }
.l-foot a { color: var(--grey-700); margin-left: 16px; }
.legal { max-width: 760px; margin: 0 auto; padding: 24px 24px 64px; }
.legal h1 { font-size: 34px; margin: 24px 0 8px; }
.legal h2 { font-size: 20px; margin: 28px 0 8px; }
.legal p, .legal li { color: var(--grey-700); }
.back { display: inline-flex; gap: 6px; font-weight: 700; text-decoration: none; margin-bottom: 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--grey-700); margin-bottom: 18px; }
.check input { margin-top: 4px; accent-color: var(--primary); }

/* ---------- motion ---------- */
/* "backwards" (not "both") so :hover transforms still work once the entrance is over */
.anim .card, .anim .weeks button { animation: rise .55s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 55ms); }
.anim .chart .fill { animation: grow .9s var(--ease) backwards; animation-delay: calc(.3s + var(--b, 0) * 45ms); }
.day.celebrate { animation: celebrate 1.2s var(--ease); }
.backdrop { display: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes celebrate { 0% { box-shadow: 0 0 0 0 rgba(5, 205, 153, .5); } 70% { box-shadow: 0 0 0 18px rgba(5, 205, 153, 0); } 100% { box-shadow: var(--shadow); } }
@keyframes shimmer { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes spark { from { transform: scale(0); } to { transform: scale(1); } }
@keyframes glow { 0%, 100% { opacity: 1; } 50% { opacity: .6; } }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(20px, -24px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .hero-mark .n { stroke-dashoffset: 0; }
}

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .row-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 10; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .shell.open .side { transform: none; }
  .side { transition: transform .35s var(--ease); }
  .shell.open .backdrop { display: block; position: fixed; inset: 0; z-index: 9; background: rgba(27, 37, 89, .35); backdrop-filter: blur(2px); animation: fade .3s var(--ease); }
  .menu-btn { display: inline-flex; border: 0; background: var(--white); border-radius: 12px; padding: 10px; box-shadow: var(--shadow); color: var(--navy); }
  .main { padding: 16px; }
  .top h1 { font-size: 26px; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .l-hero .in { grid-template-columns: 1fr; padding: 48px 20px 64px; }
  .l-hero .art { display: none; }
  .l-hero h1 { font-size: 40px; }
  .steps3, .lvl-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .steps3, .lvl-row { grid-template-columns: 1fr; }
  .l-nav .acts-top .textbtn, .l-nav .brand span { display: none; }
  .l-nav .btn { padding: 10px 14px; font-size: 14px; white-space: nowrap; }
  .l-nav .brand .mark { width: 36px; height: 36px; }
  .vtable .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .stats { grid-template-columns: 1fr; }
  .chart { gap: 4px; }
  .days { grid-template-columns: 1fr; }
}

/* Google button, daily popup */
.btn.google { width: 100%; justify-content: center; gap: 10px; background: var(--white); color: var(--navy); border: 1px solid var(--grey-400); box-shadow: none; }
.or { display: flex; align-items: center; gap: 12px; color: var(--grey-600); font-size: 14px; margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--grey-400); }
.btn:disabled { opacity: .6; cursor: default; }
dialog.daily { width: min(520px, calc(100% - 32px)); margin: auto; border: 0; color: var(--navy); max-height: calc(100% - 64px); overflow: auto; }
dialog.daily::backdrop { background: rgba(11, 20, 55, .55); backdrop-filter: blur(3px); }
dialog.daily .flash { padding: 24px 0 8px; }
dialog.daily[open] { animation: rise .35s var(--ease); }

/* ---------- new activity types ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mem { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.mem-card { min-height: 76px; border: 0; border-radius: 16px; background: var(--grad); color: #fff; font-family: inherit; font-weight: 700; font-size: 1.4rem; line-height: 1.2; padding: 10px; cursor: pointer; box-shadow: 0 2px 6px rgb(67 24 255 / .12), 0 12px 28px rgb(67 24 255 / .14); transition: transform .3s var(--spring), background .25s; }
.mem-card:active { transform: scale(.95); }
.mem-card.open { background: var(--white); color: var(--navy); font-size: .95rem; box-shadow: inset 0 0 0 2px var(--primary-soft); transform: rotateY(0) scale(1.02); }
.mem-card.ok-ans { background: color-mix(in srgb, var(--green) 14%, var(--white)); box-shadow: inset 0 0 0 2px var(--green); }
.order-ans.spell .chip { letter-spacing: .02em; }
.seq { list-style: none; padding: 0; display: grid; gap: 8px; counter-reset: s; }
.seq li { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--bg); counter-increment: s; }
.seq li::before { content: counter(s); font-weight: 700; color: var(--primary); min-width: 1.2em; }
.seq li span:first-of-type { flex: 1; }
.seq-btns { display: flex; gap: 4px; }
.seq-btns .btn { padding: 6px 12px; min-width: 40px; }
.seq li.ok-ans { box-shadow: inset 0 0 0 2px var(--green); } .seq li.bad-ans { box-shadow: inset 0 0 0 2px var(--red); }
.cloze { line-height: 2.3; }
.cloze select { margin: 0 4px; padding: 4px 8px; border-radius: 10px; font: inherit; }
.speed-bar { height: 8px; border-radius: 8px; background: var(--grey-400); overflow: hidden; margin-bottom: 12px; }
.speed-bar i { display: block; height: 100%; background: var(--grad); transform-origin: left; transition: transform .1s linear; }
.speed-q { font-weight: 700; margin-bottom: 8px; }

/* ---------- motion lessons ---------- */
.mo { container-type: inline-size; margin: -4px 0; }
.mo-poster, .mo-stage { position: relative; aspect-ratio: 16 / 10; border-radius: 22px; overflow: hidden; isolation: isolate;
  background: radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--primary-soft) 35%, transparent), transparent 60%), linear-gradient(160deg, var(--white), var(--bg));
  box-shadow: 0 2px 6px rgb(43 54 116 / .06), 0 24px 60px rgb(67 24 255 / .14); }
@container (max-width: 560px) { .mo-poster, .mo-stage { aspect-ratio: 4 / 5; } }
.mo-poster { display: grid; place-content: center; text-align: center; gap: 8px; padding: 24px; }
.mo-poster h3 { font-size: clamp(1.2rem, 5cqi, 2rem); color: var(--navy); }
.mo-kind, .mo-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); }
.mo-emoji { font-size: clamp(1.6rem, 6cqi, 2.6rem); letter-spacing: .2em; }
.mo-play { justify-self: center; width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--grad); color: #fff; font-size: 1.8rem; cursor: pointer;
  box-shadow: 0 2px 6px rgb(67 24 255 / .2), 0 18px 40px rgb(67 24 255 / .35); transition: transform .3s var(--spring); }
.mo-play:hover { transform: scale(1.06); } .mo-play:active { transform: scale(.95); }
.mo-stage:focus { outline: none; } .mo-stage:focus-visible { outline: 3px solid var(--primary); }
.mo-stage:fullscreen { aspect-ratio: auto; border-radius: 0; }
.mo-bg { position: absolute; inset: -6%; z-index: -1; }
.mo-glow { position: absolute; width: 60%; aspect-ratio: 1; left: 50%; top: 40%; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 18%, transparent), transparent 65%); animation: mo-drift 14s ease-in-out infinite alternate; }
.mo-grid { position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--grey-600) 35%, transparent) 1px, transparent 1px); background-size: 22px 22px; opacity: .5; animation: mo-pan 40s linear infinite; }
.mo-float { position: absolute; left: var(--x); top: var(--y); font-size: clamp(1.2rem, 4.5cqi, 2.2rem); opacity: .22; filter: blur(.5px); animation: mo-drift calc(9s + var(--d) * 3s) ease-in-out infinite alternate; }
@keyframes mo-drift { to { transform: translate(18px, -14px) rotate(6deg); } }
@keyframes mo-pan { to { background-position: 220px 110px; } }
.mo-scene { position: absolute; inset: 0 0 72px; display: grid; place-items: center; padding: 3% 6%; }
.mo-in { width: 100%; text-align: center; display: grid; gap: clamp(4px, 1.4cqi, 12px); justify-items: center; }
.mo-in h2 { font-size: clamp(1.6rem, 6.5cqi, 3.6rem); line-height: 1.02; letter-spacing: -.03em; color: var(--navy); font-weight: 800; }
.mo-title h2 span, .mo-cap .w { display: inline-block; }
.mo-title p, .mo-end p { color: var(--grey-700); font-size: clamp(.95rem, 2.6cqi, 1.25rem); }
.mo-word h2 { color: var(--primary); }
.mo-emo { font-size: clamp(2rem, 7cqi, 4.2rem); filter: drop-shadow(0 10px 18px rgb(43 54 116 / .18)); }
.mo-pt { font-size: clamp(1rem, 3cqi, 1.4rem); color: var(--grey-700); font-weight: 600; }
.mo-cap { font-size: clamp(1rem, 3.3cqi, 1.75rem); line-height: 1.3; font-weight: 700; color: var(--navy); max-width: 30ch; text-wrap: balance; }
.mo-cap .w { opacity: 0; } .mo-cap .w.on { opacity: 1; }
.mo-gap .mo-cap, .mo-quiz .mo-q { max-width: 34ch; }
.mo-cap .acc, .mo-q .mo-blank { color: var(--primary); }
.mo-prev { font-size: clamp(.85rem, 2.6cqi, 1.1rem); color: var(--grey-600); max-width: 40ch; }
.mo-card { max-width: 40ch; padding: clamp(16px, 4cqi, 32px); border-radius: 20px; background: var(--white); text-align: left; font-size: clamp(1rem, 3.2cqi, 1.45rem); line-height: 1.45; color: var(--navy);
  box-shadow: 0 2px 6px rgb(43 54 116 / .06), 0 24px 60px rgb(67 24 255 / .12); }
.mo-card b { color: var(--primary); }
.mo-pill { display: inline-flex; align-items: center; gap: 6px; margin: 0 .2em; padding: 0 .5em; min-width: 2.4em; justify-content: center; border-radius: 12px; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.mo-pill.done { background: var(--primary); color: #fff; }
.mo-check { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.mo-end .mo-check { width: clamp(48px, 12cqi, 84px); height: auto; color: var(--green); }
.mo-q { font-size: clamp(1.05rem, 3.8cqi, 1.9rem); font-weight: 700; color: var(--navy); line-height: 1.3; }
.mo-opts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.mo-opts button { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 14px; padding: 10px 18px; font-family: inherit; font-weight: 700; font-size: clamp(.95rem, 2.8cqi, 1.2rem); background: var(--white); color: var(--navy); cursor: pointer; box-shadow: 0 2px 6px rgb(43 54 116 / .08), 0 10px 24px rgb(43 54 116 / .08); }
.mo-opts button.ok { background: var(--green); color: #fff; } .mo-opts button.bad { background: var(--red); color: #fff; }
.mo-count { position: absolute; right: 6%; top: 8%; font-size: clamp(1.6rem, 6cqi, 3rem); font-weight: 800; color: var(--primary); }
.mo-burst { position: absolute; left: 50%; top: 45%; font-size: 2rem; pointer-events: none; }
.mo-ui { position: absolute; inset: auto 0 0; padding: 10px 14px 12px; display: grid; gap: 8px; background: linear-gradient(transparent, color-mix(in srgb, var(--white) 85%, transparent) 40%); }
.mo-prog { display: flex; gap: 4px; }
.mo-prog button { flex: 1; height: 14px; padding: 5px 0; border: 0; background: none; cursor: pointer; }
.mo-prog i { display: block; height: 4px; border-radius: 4px; background: var(--primary); transform: scaleX(0); transform-origin: left; }
.mo-prog button { background: linear-gradient(var(--grey-400), var(--grey-400)) center / 100% 4px no-repeat; }
.mo-ctrl { display: flex; gap: 6px; align-items: center; }
.mo-ctrl button { width: 40px; height: 40px; border-radius: 12px; border: 0; background: var(--white); color: var(--navy); font-size: 1rem; cursor: pointer; box-shadow: 0 2px 6px rgb(43 54 116 / .08); }
.mo-spacer { flex: 1; }
@media (prefers-reduced-motion: reduce) { .mo-glow, .mo-grid, .mo-float { animation: none; } }
/* welcome video on first login */
dialog.intro { width: min(960px, calc(100% - 32px)); margin: auto; border: 0; color: var(--navy); max-height: calc(100% - 32px); overflow: auto; }
dialog.intro::backdrop { background: rgba(11, 20, 55, .7); backdrop-filter: blur(4px); }
dialog.intro[open] { animation: rise .35s var(--ease); }
dialog.intro video { display: block; width: 100%; aspect-ratio: 16 / 9; margin-top: 14px; border-radius: 14px; background: #0B1437; }
.intro-foot { margin-top: 16px; text-align: right; }
