/* lev. — playful, chunky, Duolingo-inspired design system */
:root {
  --bg: #ffffff; --surface: #ffffff; --soft: #f7f7f7; --ink: #3c3c3c; --muted: #777777; --line: #e5e5e5; --line2: #d0d0d0;
  --green: #58cc02; --green-d: #58a700; --green-l: #d7ffb8;
  --blue: #1cb0f6; --blue-d: #1899d6; --blue-l: #ddf4ff;
  --red: #ff4b4b; --red-d: #ea2b2b; --red-l: #ffdfe0;
  --orange: #ff9600; --orange-d: #e08600; --orange-l: #fff0d9;
  --gold: #ffc800; --gold-d: #e5a400; --purple: #ce82ff; --he: #1899d6;
  --r: 16px; --display: "Fredoka", "Nunito", system-ui, sans-serif; --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif; --hebrew: "Rubik", "Arial Hebrew", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131f24; --surface: #131f24; --soft: #1b2b33; --ink: #f1f7fb; --muted: #8fa1ab; --line: #37464f; --line2: #4b5c66;
    --green-l: #1f3b12; --blue-l: #10324a; --red-l: #3f1a1d; --orange-l: #3a2a10; --he: #49c0f8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 700 17px/1.5 var(--body); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
a { color: var(--blue-d); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: .3em 0; letter-spacing: .01em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h2 { font-size: 1.35rem; }
p { margin: .5em 0; }
img { user-select: none; }
.he { font-family: var(--hebrew); font-weight: 700; color: var(--he); unicode-bidi: isolate; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .78rem; font-weight: 600; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr) 360px; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; border-right: 2px solid var(--line); padding: 22px 16px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--green); font: 700 2rem/1 var(--display); padding: 4px 12px 22px; }
.logo b { color: var(--red); }
.logo-mark .lev { width: 44px; height: 44px; }
.sidenav { display: grid; gap: 6px; }
.sidenav a, .tabbar a { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-radius: 14px; border: 2px solid transparent;
  text-decoration: none; color: var(--muted); font: 800 .95rem var(--body); text-transform: uppercase; letter-spacing: .05em; transition: background .15s; }
.sidenav a img { width: 34px; height: 34px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.sidenav a:hover { background: var(--soft); }
.sidenav a:hover img { transform: scale(1.15) rotate(-8deg); }
.sidenav a.active { background: var(--blue-l); border-color: #84d8ff; color: var(--blue-d); }
main { padding: 26px 28px 120px; max-width: 680px; width: 100%; margin: 0 auto; overflow-x: clip; }
main.wide { max-width: 1040px; }
.rail { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.mbar, .tabbar { display: none; }
.enter > * { animation: rise .45s cubic-bezier(.2, .9, .3, 1.2) both; animation-delay: var(--d, 0ms); }
.enter > *:nth-child(2) { --d: 50ms; } .enter > *:nth-child(3) { --d: 100ms; } .enter > *:nth-child(4) { --d: 150ms; } .enter > *:nth-child(n+5) { --d: 200ms; }

/* ---------- stats & rail ---------- */
.stats-row { display: flex; justify-content: space-between; padding: 4px 6px; }
.stat { display: inline-flex; align-items: center; gap: 6px; font: 800 1.05rem var(--body); color: var(--muted); }
.stat img { width: 28px; height: 28px; }
.stat.fire img { filter: grayscale(1) opacity(.5); }
.stat.fire.lit { color: var(--orange); }
.stat.fire.lit img { filter: none; animation: flame 1.4s ease-in-out infinite; }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r); padding: 18px; }
.card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1.15rem; }
.card h3 img { width: 28px; height: 28px; }
.countdown { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, #1cb0f6, #7c5cff); color: #fff; border: 0; box-shadow: 0 5px 0 #4a3bbf; }
.countdown img { width: 78px; height: 78px; }
.countdown small { font-weight: 800; opacity: .9; text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; }
.countdown .big { display: block; font: 700 2.8rem/1 var(--display); }
.countdown span { font-weight: 800; }
.goalbar { position: relative; height: 22px; border-radius: 99px; background: var(--line); overflow: hidden; }
.goalbar i { position: absolute; inset: 0 auto 0 0; background: var(--gold); border-radius: 99px; transition: width .6s cubic-bezier(.2, .9, .3, 1.2); }
.goalbar i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 5px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .45); }
.goalbar span { position: relative; display: block; text-align: center; font-size: .8rem; line-height: 22px; color: var(--ink); }
.wod-word { width: 100%; display: grid; justify-items: center; gap: 2px; padding: 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--soft);
  cursor: pointer; font: inherit; color: var(--ink); box-shadow: 0 4px 0 var(--line); transition: transform .1s; }
.wod-word:active { transform: translateY(4px); box-shadow: none; }
.wod-word .he { font-size: 2.2rem; }
.wod-word i { color: var(--muted); }
.mini-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-badges span { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); }
.mini-badges img { width: 30px; height: 30px; filter: grayscale(1) opacity(.35); }
.mini-badges .on img { filter: none; }
.mini-badges .on { background: #fff4cc; animation: pop .4s both; }

/* ---------- buttons ---------- */
.btn { --c: var(--surface); --s: var(--line); --t: var(--blue-d);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 22px; border-radius: 16px; border: 2px solid var(--s);
  background: var(--c); color: var(--t); font: 800 .95rem var(--body); text-transform: uppercase; letter-spacing: .06em; text-decoration: none;
  cursor: pointer; box-shadow: 0 4px 0 var(--s); transition: transform .08s, box-shadow .08s, filter .15s; -webkit-tap-highlight-color: transparent; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 var(--s); }
.btn img { width: 26px; height: 26px; }
.btn.green { --c: var(--green); --s: var(--green-d); --t: #fff; }
.btn.blue { --c: var(--blue); --s: var(--blue-d); --t: #fff; }
.btn.red { --c: var(--red); --s: var(--red-d); --t: #fff; }
.btn.orange { --c: var(--orange); --s: var(--orange-d); --t: #fff; }
.btn.ghost { --t: var(--muted); }
.btn.small { padding: 8px 14px; font-size: .8rem; }
.btn.big { padding: 16px 40px; font-size: 1.1rem; }
.btn.wide { width: 100%; max-width: 420px; }
.btn.round { width: 56px; height: 56px; padding: 0; border-radius: 50%; }
.btn[disabled] { --c: var(--line); --s: var(--line); --t: var(--muted); cursor: default; filter: none; transform: none; box-shadow: 0 4px 0 var(--line); }
.row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.row.center, .center-card .row { justify-content: center; }
.btn:focus-visible, .choice:focus-visible, .node:focus-visible, .ptile:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.chip { display: inline-block; padding: 4px 12px; border-radius: 99px; background: var(--soft); border: 2px solid var(--line); font-size: .8rem; color: var(--muted); }
.crumb { display: inline-block; margin-bottom: 12px; text-decoration: none; color: var(--muted); font-weight: 800; text-transform: uppercase; font-size: .85rem; letter-spacing: .05em; }
.crumb:hover { color: var(--blue-d); }

/* ---------- mascot ---------- */
.lev { width: 120px; height: 120px; overflow: visible; }
.lev.mini { width: 40px; height: 40px; }
.lev.big { width: 150px; height: 150px; }
.lev-shadow { fill: rgba(0, 0, 0, .12); }
.lev-eyes { transform-origin: 60px 52px; animation: blink 4.2s infinite; }
.lev.bounce .lev-body, .lev.talk .lev-body { transform-origin: 60px 104px; }
.lev.bounce .lev-body { animation: hop 2.4s ease-in-out infinite; }
.lev.talk .lev-body { animation: sway 1.8s ease-in-out infinite; }
.lev.jump .lev-body { transform-origin: 60px 104px; animation: jump 1s cubic-bezier(.3, 1.6, .5, 1) 2; }
.lev.sad .lev-body { animation: droop 2.6s ease-in-out infinite; transform-origin: 60px 104px; }
.lev-cap { transform-origin: 60px 20px; animation: cap 3.2s ease-in-out infinite; }

/* ---------- learn path ---------- */
.hello { display: flex; align-items: flex-end; gap: 12px; justify-content: center; margin-bottom: 18px; }
.bubble { position: relative; flex: 1; max-width: 420px; background: var(--surface); border: 2px solid var(--line); border-radius: 18px; padding: 14px 18px; animation: pop .5s both .2s; }
.bubble::after { content: ""; position: absolute; right: -11px; bottom: 26px; width: 18px; height: 18px; background: var(--surface); border-right: 2px solid var(--line); border-top: 2px solid var(--line); transform: rotate(45deg); }
.bubble p { color: var(--muted); margin: 6px 0 0; font-size: .95rem; }
.hint { display: inline-flex; align-items: baseline; gap: 6px; padding: 1px 8px; border-radius: 10px; background: var(--blue-l); cursor: pointer; border-bottom: 2px dashed #84d8ff; transition: transform .15s; }
.hint:hover { transform: translateY(-1px) scale(1.03); }
.hint i { color: var(--muted); font-size: .85em; font-weight: 700; }
.sim-cta { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 4px 0 28px; border-radius: 18px; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, #ff4b4b, #ff9600); box-shadow: 0 5px 0 #c4381f; }
.sim-cta img { width: 60px; height: 60px; }
.sim-cta b { display: block; font: 600 1.35rem var(--display); }
.sim-cta span { opacity: .9; }
.sim-cta .go { margin-left: auto; font-size: 1.8rem; transition: transform .2s; }
.sim-cta:hover .go { transform: translateX(6px); }
.unit { margin-bottom: 40px; }
.unit-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #fff; background: var(--u);
  border-radius: var(--r); padding: 18px 20px; box-shadow: 0 5px 0 color-mix(in srgb, var(--u) 72%, #000); overflow: hidden; }
.unit-head::before { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.unit-head small { font-weight: 900; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.unit-head h2 { margin: 2px 0; font-size: 1.5rem; }
.unit-head p { margin: 0; font-size: .9rem; opacity: .92; font-weight: 600; }
.unit-img { width: 84px; height: 84px; flex: none; position: relative; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .18)); }
.path { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 70px 0 10px; }
.node-wrap { position: relative; transform: translateX(var(--x)); }
.node { position: relative; display: grid; place-items: center; width: 78px; height: 72px; border-radius: 50%; background: var(--u);
  box-shadow: 0 8px 0 color-mix(in srgb, var(--u) 70%, #000); transition: transform .1s, box-shadow .1s, filter .2s; }
.node img { width: 42px; height: 42px; transition: transform .3s cubic-bezier(.3, 1.6, .5, 1); }
.node:hover { filter: brightness(1.08); }
.node:hover img { transform: scale(1.15) rotate(-6deg); }
.node:active { transform: translateY(8px); box-shadow: 0 0 0 transparent; }
.node.todo { background: var(--line); box-shadow: 0 8px 0 var(--line2); }
.node.todo img { filter: grayscale(.8) opacity(.6); }
.node.quiz { width: 88px; height: 80px; }
.node.cur::before { content: ""; position: absolute; inset: -12px; border-radius: 50%; border: 6px solid var(--u); opacity: .35; animation: ring 1.6s ease-out infinite; }
.node::after { content: attr(data-tip); position: absolute; left: 50%; top: calc(100% + 14px); transform: translate(-50%, 6px) scale(.9); white-space: nowrap;
  background: var(--ink); color: var(--bg); padding: 6px 12px; border-radius: 10px; font-size: .8rem; opacity: 0; pointer-events: none; transition: .18s; z-index: 5; }
.node:hover::after { opacity: 1; transform: translate(-50%, 0) scale(1); }
.start-bubble { position: absolute; left: 50%; bottom: calc(100% + 16px); transform: translateX(-50%); background: var(--surface); color: var(--u);
  border: 2px solid var(--line); border-radius: 12px; padding: 8px 14px; font: 900 .9rem var(--body); letter-spacing: .08em; animation: bob 1.2s ease-in-out infinite; z-index: 3; }
.start-bubble::after { content: ""; position: absolute; left: 50%; top: 100%; width: 12px; height: 12px; background: var(--surface); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translate(-50%, -6px) rotate(45deg); }

/* ---------- session overlay ---------- */
#overlay { position: fixed; inset: 0; z-index: 100; background: var(--bg); }
.sess { height: 100%; display: grid; grid-template-rows: auto 1fr auto; }
.sess.center { place-items: center; grid-template-rows: 1fr; padding: 20px; }
.sess-top { display: flex; align-items: center; gap: 18px; width: 100%; max-width: 1000px; margin: 0 auto; padding: 28px 20px 10px; }
.x { border: 0; background: none; font-size: 1.6rem; color: var(--line2); cursor: pointer; padding: 4px 8px; border-radius: 10px; }
.x:hover { color: var(--muted); background: var(--soft); }
.pbar { flex: 1; height: 18px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pbar i { position: relative; display: block; height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width .5s cubic-bezier(.2, .9, .3, 1.2); }
.pbar i::after { content: ""; position: absolute; left: 10px; right: 10px; top: 4px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .35); }
.hearts, .clock { display: flex; align-items: center; gap: 6px; font: 800 1.15rem var(--body); color: var(--red); }
.hearts img { width: 30px; height: 30px; animation: beat 1.4s ease-in-out infinite; }
.hearts.lost img { animation: hurt .6s; }
.clock { color: var(--blue-d); }
.clock.big { font-size: 1.6rem; }
.sess-body { overflow-y: auto; display: flex; justify-content: center; padding: 10px 20px 30px; }
.card-in { width: 100%; max-width: 620px; animation: slideIn .4s cubic-bezier(.2, .9, .3, 1.15) both; }
.ctitle { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; margin: 10px 0 20px; }
.ctitle img { width: 36px; height: 36px; }
.qtext { font-size: 1.2rem; font-weight: 800; }
.choices { display: grid; gap: 12px; margin-top: 18px; }
.choice { display: flex; align-items: center; gap: 14px; text-align: start; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font: 700 1rem var(--body); cursor: pointer; box-shadow: 0 4px 0 var(--line); transition: transform .08s, box-shadow .08s, background .15s; }
.choice:hover:not(:disabled) { background: var(--soft); }
.choice:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.choice kbd { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 9px; font: 800 .85rem var(--body); color: var(--muted); }
.choice.sel { border-color: #84d8ff; background: var(--blue-l); box-shadow: 0 4px 0 #84d8ff; color: var(--blue-d); }
.choice.sel kbd { border-color: #84d8ff; color: var(--blue-d); }
.choice.right { border-color: var(--green); background: var(--green-l); box-shadow: 0 4px 0 var(--green); color: var(--green-d); animation: pop .35s; }
.choice.bad { border-color: var(--red); background: var(--red-l); box-shadow: 0 4px 0 var(--red); color: var(--red-d); animation: shake .4s; }
.choice.meh { border-color: var(--orange); background: var(--orange-l); box-shadow: 0 4px 0 var(--orange); }
.choice .he { font-size: 1.6rem; }
.choices.tiles { grid-template-columns: 1fr 1fr; }
.choices.tiles .choice { justify-content: center; padding: 24px 10px; flex-direction: column; }
.choices.tiles kbd { display: none; }
.he-prompt { display: grid; justify-items: center; margin: 0 auto; padding: 18px 40px; border-radius: 22px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 5px 0 var(--line); cursor: pointer; font: inherit; color: var(--ink); transition: transform .1s; }
.he-prompt:active { transform: translateY(5px); box-shadow: none; }
.he-prompt .he { font-size: 3.4rem; line-height: 1.2; }
.he-prompt i { color: var(--muted); }
.listen-q { display: grid; place-items: center; }
.speaker-big { width: 120px; height: 120px; border-radius: 30px; border: 0; background: var(--blue); box-shadow: 0 6px 0 var(--blue-d); cursor: pointer; display: grid; place-items: center; transition: transform .1s; }
.speaker-big img { width: 64px; height: 64px; }
.speaker-big:active { transform: translateY(6px); box-shadow: none; }
.speaker-big:hover img { animation: wiggle .5s; }
.teach { display: flex; align-items: flex-start; gap: 16px; margin-top: 30px; }
.teach .lev { flex: none; width: 110px; height: 110px; }
.speech { position: relative; flex: 1; font-size: 1.15rem; line-height: 1.6; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 20px 22px; }
.speech::before { content: ""; position: absolute; left: -11px; top: 34px; width: 18px; height: 18px; background: var(--surface); border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }
.word-card { display: grid; justify-items: center; gap: 6px; width: 100%; padding: 34px 20px; border-radius: 24px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 6px 0 var(--line); cursor: pointer; font: inherit; color: var(--ink); position: relative; transition: transform .15s; }
.word-card:hover { transform: rotate(-1deg) translateY(-3px); }
.word-card .he { font-size: clamp(3rem, 12vw, 4.6rem); line-height: 1.15; }
.word-card i { color: var(--muted); font-size: 1.15rem; }
.word-card b { font: 600 1.5rem var(--display); }
.word-card .spk { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; animation: wiggle 2s ease-in-out infinite; }
.sess-foot { border-top: 2px solid var(--line); transition: background .25s; }
.foot-in { max-width: 1000px; margin: 0 auto; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.foot-in > .btn:only-child { margin-left: auto; }
.sess-foot.good { background: var(--green-l); border-color: transparent; color: var(--green-d); }
.sess-foot.bad { background: var(--red-l); border-color: transparent; color: var(--red-d); }
.sess-foot.good .foot-in, .sess-foot.bad .foot-in { animation: slideUp .3s cubic-bezier(.2, .9, .3, 1.2); }
.fb-txt h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.5rem; }
.fb-txt h3 img { width: 34px; height: 34px; }
.fb-txt .ans, .fb-txt .why { margin: 4px 0 0; color: var(--ink); font-weight: 700; }
.fb-txt .why { font-size: .92rem; opacity: .85; }
.fb .btn { flex: none; }
.end { display: grid; justify-items: center; text-align: center; gap: 10px; width: 100%; max-width: 520px; }
.end h1 { color: var(--gold-d); font-size: 2rem; }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; margin: 10px 0 20px; }
.es { border: 2px solid; border-radius: 16px; overflow: hidden; animation: pop .5s both; }
.es:nth-child(2) { animation-delay: .15s; } .es:nth-child(3) { animation-delay: .3s; }
.es small { display: block; color: #fff; font-weight: 900; text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; padding: 4px; }
.es b { display: block; padding: 12px 4px; font: 700 1.6rem var(--display); background: var(--surface); }
.es.gold { border-color: var(--gold); } .es.gold small { background: var(--gold); } .es.gold b { color: var(--gold-d); }
.es.green { border-color: var(--green); } .es.green small { background: var(--green); } .es.green b { color: var(--green-d); }
.es.blue { border-color: var(--blue); } .es.blue small { background: var(--blue); } .es.blue b { color: var(--blue-d); }
.topics { width: 100%; display: grid; gap: 8px; text-align: start; }
.topics > div { display: grid; grid-template-columns: 30px 1fr 110px 44px; align-items: center; gap: 8px; font-size: .85rem; }
.topics img { width: 26px; height: 26px; }
.mbar-mini { height: 12px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mbar-mini i { display: block; height: 100%; background: var(--green); border-radius: 99px; transition: width .8s cubic-bezier(.2, .9, .3, 1.2); }
.mbar-mini.wide { height: 16px; margin-top: 8px; }

/* pairs */
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pairs > div { display: grid; gap: 12px; align-content: start; }
.ptile { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font: 700 1rem var(--body); cursor: pointer; box-shadow: 0 4px 0 var(--line); transition: transform .08s, box-shadow .08s, opacity .4s; }
.ptile.he { font: 700 1.6rem var(--hebrew); color: var(--he); }
.ptile small { font: 700 .72rem var(--body); color: var(--muted); }
.ptile:active { transform: translateY(4px); box-shadow: none; }
.ptile.sel { border-color: #84d8ff; background: var(--blue-l); box-shadow: 0 4px 0 #84d8ff; }
.ptile.ok { border-color: var(--green); background: var(--green-l); box-shadow: 0 4px 0 var(--green); opacity: .45; pointer-events: none; animation: pop .3s; }
.shake { animation: shake .4s !important; border-color: var(--red) !important; box-shadow: 0 4px 0 var(--red) !important; }

/* ---------- page heads, grids ---------- */
.page-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.page-head p { color: var(--muted); font-weight: 600; }
.head-img { width: 90px; height: 90px; flex: none; }
.tilt { transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .2s; }
.tilt:hover { transform: translateY(-4px) rotate(-.6deg); }
.tilt:active { transform: translateY(2px) scale(.98); }
.wiggle { transition: transform .3s; }
a:hover .wiggle, .tilt:hover .wiggle { animation: wiggle .6s; }
.float { animation: float 3.4s ease-in-out infinite; }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.game { position: relative; display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink); overflow: hidden; box-shadow: 0 5px 0 var(--line); animation: rise .5s both var(--d); }
.game::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--g); }
.game img { width: 64px; height: 64px; }
.game h3 { margin: 6px 0 0; font-size: 1.25rem; }
.game p { margin: 0; color: var(--muted); font-size: .9rem; font-weight: 600; flex: 1; }
.game .chip { align-self: flex-start; margin-top: 8px; }
.center-card { text-align: center; display: grid; justify-items: center; gap: 6px; }
.game-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: space-between; }
.game-top h1 { display: flex; align-items: center; gap: 10px; margin: 0; }
.game-top h1 img { width: 44px; height: 44px; }
.deck { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; text-transform: uppercase; }
.deck select { font: 700 .95rem var(--body); padding: 8px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); max-width: 230px; }

/* flashcards */
.flip { perspective: 1200px; height: 300px; max-width: 460px; margin: 22px auto; cursor: pointer; position: relative; }
.face { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; text-align: center; padding: 20px; border-radius: 26px;
  border: 2px solid var(--line); background: var(--surface); box-shadow: 0 6px 0 var(--line); backface-visibility: hidden; transition: transform .55s cubic-bezier(.3, 1.4, .5, 1); }
.face b { font: 600 1.6rem var(--display); }
.face-img { width: 70px; height: 70px; }
.back { transform: rotateY(180deg); background: var(--blue-l); border-color: #84d8ff; box-shadow: 0 6px 0 #84d8ff; }
.back .he.huge { font-size: 4rem; line-height: 1.1; }
.back i { color: var(--muted); font-size: 1.1rem; }
.flip.on .front { transform: rotateY(180deg); } .flip.on .back { transform: rotateY(360deg); }

/* speed */
.speed-top { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.speed-top .pbar i { background: var(--orange); transition: width .2s linear; }
.speed-top .score { font: 800 1.2rem var(--body); }
.combo { font: 800 1.2rem var(--body); color: var(--orange); }
.speed-card .ctitle { font-size: 1.3rem; }

/* dosage */
.dose-card .qtext { font-size: 1.3rem; }
.doseform { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.doseform input { width: 150px; font: 800 1.5rem var(--body); padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--soft); color: var(--ink); text-align: center; }
.doseform input:focus { outline: none; border-color: var(--blue); background: var(--blue-l); }
.unit { font-weight: 800; color: var(--muted); }

/* ---------- sim ward ---------- */
.sim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.sim-card { display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--ink); box-shadow: 0 5px 0 var(--line); animation: rise .5s both var(--d); }
.sim-card h3 { margin: 0; font-size: 1.1rem; }
.sim-card p { margin: 2px 0; color: var(--muted); font-size: .9rem; }
.sim-pic { position: relative; flex: none; width: 76px; height: 76px; border-radius: 20px; background: var(--soft); display: grid; place-items: center; }
.sim-pic > img { width: 60px; height: 60px; transition: transform .3s; }
.sim-card:hover .sim-pic > img { transform: scale(1.1) rotate(-4deg); }
.sim-pic .area { position: absolute; right: -6px; bottom: -6px; width: 32px; height: 32px; border-radius: 10px; background: var(--surface); border: 2px solid var(--line); display: grid; place-items: center; }
.sim-pic .area img { width: 22px; height: 22px; }
.stars { display: flex; align-items: center; gap: 2px; font-size: 1.3rem; color: var(--line); }
.stars .on { color: var(--gold); }
.stars small { margin-left: 8px; color: var(--muted); font-size: .8rem; }
.stars.big { font-size: 2.6rem; }
.stars.big .pop { animation: pop .5s both; }
.ward { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 18px; align-items: start; }
.bed { position: sticky; top: 16px; }
.pt { display: flex; align-items: center; gap: 12px; }
.pt-img { width: 66px; height: 66px; animation: float 4s ease-in-out infinite; }
.pt h2 { margin: 0; font-size: 1.25rem; }
.pt small { color: var(--muted); text-transform: uppercase; font-size: .72rem; letter-spacing: .06em; }
.pt p { margin: 0; color: var(--muted); }
.ctx { font-size: .92rem; color: var(--muted); font-weight: 600; }
.monitor { background: #071510; border-radius: 16px; padding: 10px; border: 3px solid #1d3a2c; box-shadow: inset 0 0 30px rgba(76, 255, 122, .08); transition: border-color .3s; }
.monitor canvas { width: 100%; height: 70px; display: block; }
.monitor.crit { border-color: var(--red); animation: alarmGlow .5s ease-in-out infinite alternate; }
.vitals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.vt { padding: 6px 8px; border-radius: 10px; background: rgba(255, 255, 255, .03); font-family: var(--display); }
.vt small { display: block; font-size: .7rem; letter-spacing: .08em; color: #9fb4a8; }
.vt b { font-size: 1.5rem; line-height: 1.1; }
.vt i { font-size: .65rem; color: #6f8578; margin-left: 3px; font-style: normal; }
.vt.hr b { color: #4cff7a; } .vt.bp b { color: #ff7a7a; } .vt.spo2 b { color: #3ee0ff; } .vt.rr b { color: #ffe14d; } .vt.t b { color: #f2f2f2; } .vt.gl b { color: #ffb347; }
.vt.alarm { background: rgba(255, 75, 75, .22); animation: blinkBg 1s steps(2) infinite; }
.simprog { display: flex; gap: 6px; margin-top: 12px; }
.simprog i { flex: 1; height: 8px; border-radius: 9px; background: var(--line); transition: background .3s; }
.simprog i.done { background: var(--green); } .simprog i.cur { background: var(--blue); animation: pulse 1.2s infinite; }
.situation { font-size: 1.15rem; font-weight: 800; }
.skill { display: inline-block; padding: 4px 12px; border-radius: 99px; color: #fff; font-size: .75rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.skill.safety { background: var(--blue); } .skill.assess { background: var(--purple); } .skill.act { background: var(--red); } .skill.comm { background: var(--orange); } .skill.doc { background: #2b70c9; }
.simfb { margin-top: 16px; padding: 14px 16px; border-radius: 16px; display: grid; gap: 4px; }
.simfb b { font: 600 1.25rem var(--display); }
.simfb p { margin: 0 0 8px; color: var(--ink); font-weight: 600; }
.simfb .btn { justify-self: end; }
.simfb.good { background: var(--green-l); color: var(--green-d); }
.simfb.meh { background: var(--orange-l); color: var(--orange-d); }
.simfb.bad { background: var(--red-l); color: var(--red-d); }
.debrief .db-head { display: flex; align-items: center; gap: 18px; }
.pct b { font: 700 2.2rem var(--display); color: var(--green-d); }
.skillbars { display: grid; gap: 10px; margin: 16px 0; }
.skillbars > div { display: grid; grid-template-columns: 140px 1fr 50px; align-items: center; gap: 10px; }
.db-steps { padding-left: 20px; display: grid; gap: 10px; }
.db-steps li { padding: 10px 14px; border-radius: 14px; background: var(--soft); border-left: 6px solid var(--line); }
.db-steps li.good { border-color: var(--green); } .db-steps li.meh { border-color: var(--orange); } .db-steps li.bad { border-color: var(--red); }
.db-steps p { margin: 2px 0; font-weight: 600; font-size: .92rem; }
.db-steps small { color: var(--muted); text-transform: uppercase; font-size: .7rem; font-weight: 900; }

/* ---------- plan ---------- */
.sprint { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; position: relative; }
.sprint::before { content: ""; position: absolute; left: 21px; top: 10px; bottom: 10px; width: 4px; border-radius: 4px; background: var(--line); }
.sprint li { position: relative; display: grid; grid-template-columns: 46px 110px 1fr; align-items: center; gap: 10px; padding: 12px 14px 12px 0;
  border-radius: 16px; animation: rise .45s both var(--d); }
.sprint li.today { background: var(--blue-l); box-shadow: 0 0 0 2px #84d8ff; }
.sprint li.done .tasks { opacity: .55; text-decoration: line-through; text-decoration-thickness: 2px; }
.sprint li.missed .day b { color: var(--red); }
.tick { position: relative; display: grid; place-items: center; z-index: 1; cursor: pointer; }
.tick input { position: absolute; opacity: 0; width: 34px; height: 34px; cursor: pointer; }
.tick span { width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line2); transition: .2s cubic-bezier(.3, 1.6, .5, 1); }
.tick input:checked + span { background: var(--green); border-color: var(--green-d); transform: scale(1.1); }
.tick input:checked + span::after { content: "✓"; display: grid; place-items: center; height: 100%; color: #fff; font-weight: 900; }
.tick input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.day b { font-family: var(--display); font-weight: 600; font-size: 1.05rem; display: block; }
.day em { font-style: normal; font-size: .72rem; background: var(--blue); color: #fff; padding: 2px 8px; border-radius: 99px; text-transform: uppercase; }
.tasks { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tasks a, .tasks span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 12px; background: var(--surface); border: 2px solid var(--line); text-decoration: none; color: var(--ink); font-size: .88rem; }
.tasks a:hover { border-color: var(--blue); color: var(--blue-d); }
.tasks img { width: 22px; height: 22px; }
.tasks .muted { border-style: dashed; color: var(--muted); }
.exam-day { background: linear-gradient(135deg, #ffc800, #ff9600); color: #fff; box-shadow: 0 5px 0 #d97a00; grid-template-columns: 46px 110px 1fr !important; }
.exam-day .tasks { font-size: 1.05rem; } .exam-day .tasks img { width: 40px; height: 40px; }
.exam-day .day b { color: #fff; padding-left: 8px; }

/* ---------- exam info & profile ---------- */
.exam-hero { display: flex; align-items: center; gap: 18px; background: linear-gradient(135deg, #58cc02, #1cb0f6); color: #fff; border: 0; box-shadow: 0 6px 0 #3a8a12; margin-bottom: 18px; }
.exam-hero img { width: 110px; height: 110px; flex: none; }
.kicker { text-transform: uppercase; font-weight: 900; letter-spacing: .08em; opacity: .9; }
.big-date { font: 600 1.4rem var(--display); margin: 4px 0; }
.cards2 { display: grid; gap: 16px; }
.info h2 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.info h2 img { width: 36px; height: 36px; }
.info li { margin: 6px 0; font-weight: 600; }
.links { display: flex; flex-wrap: wrap; gap: 14px; }
.profile { display: flex; align-items: center; gap: 18px; }
.avatar-big { width: 110px; height: 110px; }
.pstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.pstats .card { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 14px 8px; }
.pstats img { width: 38px; height: 38px; }
.pstats b { font: 700 1.4rem var(--display); }
.pstats small { color: var(--muted); font-size: .75rem; text-transform: uppercase; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; }
.badge { display: grid; justify-items: center; gap: 4px; padding: 14px 6px; border-radius: 16px; border: 2px dashed var(--line); text-align: center; }
.badge img { width: 50px; height: 50px; filter: grayscale(1) opacity(.35); }
.badge small { font-size: .78rem; color: var(--muted); }
.badge.on { border: 2px solid var(--gold); background: #fff9db; box-shadow: 0 4px 0 var(--gold); }
.badge.on img { filter: none; animation: float 3s ease-in-out infinite; }
@media (prefers-color-scheme: dark) { .badge.on, .mini-badges .on { background: #3a3110; } }
.settings { display: grid; gap: 14px; }
.settings label { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.settings input { font: 700 1rem var(--body); padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--soft); color: var(--ink); }
.seg { display: inline-flex; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--muted); font: 800 .85rem var(--body); padding: 9px 14px; cursor: pointer; }
.seg button.on { background: var(--blue-l); color: var(--blue-d); }
.avatar img { width: 36px; height: 36px; }

/* sources, Priority Rush, clinical match */
.fb-txt .src { margin: 6px 0 0; font-size: .78rem; font-weight: 800; opacity: .75; color: var(--ink); }
.rush-img { width: 44px; height: 44px; float: right; margin: 0 0 6px 10px; }
.pairs.clinical .ptile { font-size: .92rem; line-height: 1.3; padding: 10px 8px; text-align: center; }
.pairs.clinical .ptile .he { font-size: .95rem; margin-top: 3px; }

/* backup reminder + QR */
.remind { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; border-color: var(--gold); background: linear-gradient(135deg, #fff9db, var(--surface)); }
.remind img { width: 48px; height: 48px; flex: none; }
.remind p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.remind .row { margin-top: 10px; }
@media (prefers-color-scheme: dark) { .remind { background: linear-gradient(135deg, #3a3110, var(--surface)); } }
.qr { display: inline-block; padding: 12px; background: #fff; border-radius: 16px; border: 2px solid var(--line); margin-top: 10px; }
.qr img, .qr canvas { display: block; }

/* save progress card */
h2 > img { width: 30px; height: 30px; vertical-align: -6px; margin-right: 4px; }
#cloudbox hr { border: 0; border-top: 2px solid var(--line); margin: 6px 0; }
#cloudbox form.row { margin-top: 0; }
#cloudbox input[type=email] { flex: 1; min-width: 200px; }
#cloudbox label.btn { cursor: pointer; }

/* read-aloud controls */
.readbtn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface);
  box-shadow: 0 3px 0 var(--line); cursor: pointer; transition: transform .08s, box-shadow .08s; }
.readbtn img { width: 26px; height: 26px; }
.readbtn:hover img { animation: wiggle .5s; }
.readbtn:active { transform: translateY(3px); box-shadow: none; }
body.speaking .readbtn { border-color: #84d8ff; background: var(--blue-l); box-shadow: 0 3px 0 #84d8ff; }
body.speaking .readbtn img { animation: talkpulse .7s ease-in-out infinite; }
.autochip { flex: none; padding: 6px 10px; border-radius: 99px; border: 2px solid var(--line); background: var(--surface); color: var(--muted);
  font: 900 .72rem var(--body); letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }
.autochip::before { content: "○ "; }
.autochip.on { border-color: var(--green); background: var(--green-l); color: var(--green-d); }
.autochip.on::before { content: "● "; }
.step-top { display: flex; align-items: center; gap: 10px; }
.step-top .skill { margin-right: auto; }
.fb .readbtn { margin-left: auto; }
.audiotest { display: grid; gap: 8px; justify-items: start; }
.audiotest ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; font-size: .9rem; }
.audiotest li.ok { color: var(--green-d); } .audiotest li.no { color: var(--red-d); }
@keyframes talkpulse { 50% { transform: scale(1.2); } }

/* toast & confetti */
.toast { position: fixed; left: 50%; top: 22px; transform: translateX(-50%); z-index: 300; display: flex; align-items: center; gap: 10px; padding: 10px 18px 10px 10px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 18px; box-shadow: 0 6px 0 var(--line); font-weight: 800; animation: dropIn .5s cubic-bezier(.3, 1.6, .5, 1); }
.toast img { width: 36px; height: 36px; }
.toast.out { animation: fadeOut .4s forwards; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; }
.pop { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1) both; }

/* ---------- keyframes ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } }
@keyframes dropIn { from { opacity: 0; transform: translate(-50%, -40px) scale(.8); } }
@keyframes fadeOut { to { opacity: 0; transform: translate(-50%, -20px); } }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes hop { 0%, 100% { transform: translateY(0) scale(1, 1); } 40% { transform: translateY(-10px) scale(.97, 1.03); } 55% { transform: translateY(0) scale(1.05, .95); } 65% { transform: scale(1); } }
@keyframes jump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-34px) rotate(-6deg) scale(1.05); } 60% { transform: translateY(0) scale(1.1, .9); } 100% { transform: scale(1); } }
@keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes droop { 0%, 100% { transform: rotate(-2deg) translateY(2px); } 50% { transform: rotate(2deg) translateY(4px); } }
@keyframes cap { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -7px); } }
@keyframes ring { 0% { transform: scale(.85); opacity: .55; } 100% { transform: scale(1.25); opacity: 0; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg) scale(1.1); } 75% { transform: rotate(10deg) scale(1.1); } }
@keyframes flame { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.12) rotate(3deg); } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.18); } 30% { transform: scale(1); } 45% { transform: scale(1.1); } }
@keyframes hurt { 0% { transform: scale(1.4) rotate(-15deg); filter: grayscale(1); } 100% { transform: scale(1); } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes blinkBg { 50% { background: transparent; } }
@keyframes alarmGlow { to { box-shadow: 0 0 22px rgba(255, 75, 75, .55), inset 0 0 30px rgba(255, 75, 75, .15); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 96px minmax(0, 1fr); }
  .rail { display: none; }
  .side { padding: 22px 12px; }
  .logo > span:last-child, .sidenav span { display: none; }
  .logo { justify-content: center; padding: 4px 0 22px; }
  .sidenav a { justify-content: center; padding: 10px; }
  .mbar { display: flex; grid-column: 2; position: sticky; top: 0; z-index: 20; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 20px;
    background: var(--bg); border-bottom: 2px solid var(--line); }
  .mbar .logo { display: none; }
  main { grid-column: 2; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .mbar { grid-column: 1; padding: 10px 16px; }
  .mbar .logo { display: flex; padding: 0; }
  main { grid-column: 1; padding: 18px 16px 110px; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; background: var(--bg); border-top: 2px solid var(--line); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { flex-direction: column; gap: 2px; padding: 6px 8px; font-size: .62rem; border-radius: 12px; }
  .tabbar a img { width: 30px; height: 30px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
  .tabbar a.active { background: var(--blue-l); border-color: #84d8ff; color: var(--blue-d); }
  .tabbar a.active img { transform: scale(1.12); }
  .hello .lev.big { width: 100px; height: 100px; }
  .unit-img { width: 64px; height: 64px; }
  .node-wrap { transform: translateX(calc(var(--x) * .7)); }
  .ward { grid-template-columns: 1fr; }
  .bed { position: static; }
  .game-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .game img { width: 52px; height: 52px; }
  .game p { display: none; }
  .pstats { grid-template-columns: 1fr 1fr; }
  .sprint li { grid-template-columns: 46px 1fr; }
  .sprint li .tasks { grid-column: 2; }
  .exam-day { grid-template-columns: 46px 1fr !important; }
  .exam-hero { flex-direction: column; text-align: center; }
  .teach { flex-direction: column; align-items: center; }
  .speech::before { left: 50%; top: -11px; transform: translateX(-50%) rotate(135deg); }
  .end-stats .es b { font-size: 1.3rem; }
  .skillbars > div { grid-template-columns: 110px 1fr 40px; }
  .topics > div { grid-template-columns: 26px 1fr 70px 36px; }
  .sess-top { padding: 16px 16px 8px; gap: 12px; }
  .foot-in { padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .fb .btn { width: 100%; }
  .choices.tiles .choice { padding: 18px 8px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
