/* La Classe — La Malle's "premium minimal with a playful spark", on a school day.
   Near-monochrome surfaces, hairlines, one tangerine accent; each unit gets a faint hue of its own. */

@font-face {
  font-family: "Geist";
  src: url("/static/geist.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- tokens -------------------------------------------------------------------- */
:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f4f4f3;
  --surface-3: #ececea;
  --line: rgb(24 24 27 / .08);
  --line-2: rgb(24 24 27 / .14);
  --text: #18181b;
  --text-2: #52525b;
  --text-3: #6b6b72;
  --ink: #18181b;
  --ink-text: #fafaf9;
  --ink-text-2: #a1a1aa;
  --accent: #ff6a2b;
  --accent-strong: #f0561a;
  --accent-ink: #1c0a02;
  --accent-text: #c2410c;
  --accent-soft: rgb(255 106 43 / .10);
  --accent-softer: rgb(255 106 43 / .05);
  --hover: rgb(24 24 27 / .035);
  --danger: #b42318;
  --danger-soft: #fef1ef;
  --ok: #15803d;
  --ok-soft: rgb(22 163 74 / .10);
  --glow: rgb(255 106 43 / .10);
  --glow-edge: rgb(255 106 43 / .45);
  --shadow-sm: 0 1px 2px rgb(24 24 27 / .05);
  --shadow: 0 1px 2px rgb(24 24 27 / .04), 0 6px 20px -6px rgb(24 24 27 / .08);
  --shadow-lg: 0 2px 4px rgb(24 24 27 / .06), 0 24px 48px -12px rgb(24 24 27 / .22);
  --dots: rgb(24 24 27 / .09);
  --thumb: #ffffff;
  --stone: #d6d3d1;
  --stone-2: #a8a29e;
  --star-off: #e4e4e1;
  /* trophy tiers */
  --t-bronze: #b9773f;
  --t-bronze-2: #e3a46b;
  --t-silver: #8a96a3;
  --t-silver-2: #d6dde4;
  --t-gold: #d29a12;
  --t-gold-2: #f8d667;
  --t-legend: #ff6a2b;
  --t-legend-2: #ffb547;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --surface: #111113; --surface-2: #19191c; --surface-3: #232327;
    --line: rgb(255 255 255 / .07); --line-2: rgb(255 255 255 / .13);
    --text: #ededef; --text-2: #a8a8b0; --text-3: #8c8c95;
    --ink: #f4f4f5; --ink-text: #111113; --ink-text-2: #5c5c66;
    --accent: #ff7a3d; --accent-strong: #ff8a52; --accent-ink: #1c0a02; --accent-text: #ff9a66;
    --accent-soft: rgb(255 122 61 / .14); --accent-softer: rgb(255 122 61 / .06);
    --hover: rgb(255 255 255 / .035);
    --danger: #ff8a80; --danger-soft: rgb(255 90 80 / .12);
    --ok: #4ade80; --ok-soft: rgb(74 222 128 / .12);
    --glow: rgb(255 122 61 / .10); --glow-edge: rgb(255 122 61 / .55);
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .6);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 56px -12px rgb(0 0 0 / .8);
    --dots: rgb(255 255 255 / .07); --thumb: #2a2a2f;
    --stone: #3f3f46; --stone-2: #52525b;
    --star-off: #2c2c31;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --surface: #111113; --surface-2: #19191c; --surface-3: #232327;
  --line: rgb(255 255 255 / .07); --line-2: rgb(255 255 255 / .13);
  --text: #ededef; --text-2: #a8a8b0; --text-3: #8c8c95;
  --ink: #f4f4f5; --ink-text: #111113; --ink-text-2: #5c5c66;
  --accent: #ff7a3d; --accent-strong: #ff8a52; --accent-ink: #1c0a02; --accent-text: #ff9a66;
  --accent-soft: rgb(255 122 61 / .14); --accent-softer: rgb(255 122 61 / .06);
  --hover: rgb(255 255 255 / .035);
  --danger: #ff8a80; --danger-soft: rgb(255 90 80 / .12);
  --ok: #4ade80; --ok-soft: rgb(74 222 128 / .12);
  --glow: rgb(255 122 61 / .10); --glow-edge: rgb(255 122 61 / .55);
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -8px rgb(0 0 0 / .6);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 56px -12px rgb(0 0 0 / .8);
  --dots: rgb(255 255 255 / .07); --thumb: #2a2a2f;
  --stone: #3f3f46; --stone-2: #52525b;
  --star-off: #2c2c31;
  color-scheme: dark;
}

/* ---- base ---------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 "Geist", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
small { font-size: .72em; font-weight: 500; color: var(--text-3); margin-left: 2px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.center { text-align: center; }
.accent-text { color: var(--accent-text); font-weight: 600; }
.link { font-size: 13.5px; font-weight: 550; color: var(--accent-text); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

/* ---- buttons ------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 10px;
  font-size: 14px; font-weight: 550; letter-spacing: -.005em; white-space: nowrap;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn .ico { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-sm), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-primary:hover { box-shadow: var(--shadow), inset 0 1px 0 rgb(255 255 255 / .12); }
.btn-accent { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(0 0 0 / .1), 0 6px 18px -6px var(--glow-edge), inset 0 1px 0 rgb(255 255 255 / .25); }
.btn-accent:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--line-2); background: var(--surface); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: var(--surface); color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-block { width: 100%; height: 44px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-2);
  transition: background-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn .ico { width: 18px; height: 18px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }

/* ---- logo ---------------------------------------------------------------------- */
.logo { width: 28px; height: 28px; flex: none; overflow: visible; }
.logo-bg { fill: var(--ink); }
.logo-fg { fill: var(--ink-text); }
/* the punt volat (the dot of l·l, "flying dot") takes off – with La Malle's spring */
.logo-dot { fill: var(--accent); transform-box: view-box; transform-origin: 16px 19.4px; transition: transform .42s cubic-bezier(.3,1.6,.5,1); }
.brand:hover .logo-dot { transform: translateY(-8px) scale(1.12); }

/* ---- theme toggle -------------------------------------------------------------- */
.theme-toggle { --seg: 32px; position: relative; display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); }
.theme-toggle button { position: relative; z-index: 1; display: grid; place-items: center; width: var(--seg); height: calc(var(--seg) - 4px); padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text-3); transition: color .2s ease; }
.theme-toggle button:hover, .theme-toggle button[aria-pressed="true"] { color: var(--text); }
.theme-toggle .ico { width: 16px; height: 16px; }
.theme-thumb { position: absolute; top: 2px; left: 2px; width: var(--seg); height: calc(var(--seg) - 4px); border-radius: 999px; background: var(--thumb); box-shadow: 0 0 0 1px var(--line), var(--shadow-sm); transition: transform .32s cubic-bezier(.3,1.3,.5,1); }
:root[data-theme-pref="light"] .theme-thumb { transform: translateX(var(--seg)); }
:root[data-theme-pref="dark"] .theme-thumb { transform: translateX(calc(var(--seg) * 2)); }
.theme-toggle button[data-set-theme="light"][aria-pressed="true"] .ico { animation: spin-in .45s cubic-bezier(.3,1.4,.5,1); }
.theme-toggle button[data-set-theme="dark"][aria-pressed="true"] .ico { animation: tilt-in .45s cubic-bezier(.3,1.4,.5,1); }
html.theme-vt::view-transition-old(root), html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.theme-vt::view-transition-old(root) { z-index: 1; }
html.theme-vt::view-transition-new(root) { z-index: 2; }

/* ---- top bar ------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 24px;
  padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right));
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; font-size: 15px; letter-spacing: -.015em; min-height: 40px; white-space: nowrap; }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 18px; }
.nav a { position: relative; padding: 7px 11px; border-radius: 9px; font-size: 14px; font-weight: 520; color: var(--text-2); transition: color .15s ease, background-color .15s ease; }
.nav a:hover { color: var(--text); background: var(--hover); }
.nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: -11px; height: 2px; border-radius: 2px; background: var(--accent); }
.topbar-end { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.userbox { display: flex; align-items: center; gap: 4px; padding-left: 10px; border-left: 1px solid var(--line); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--text-2); transition: background-color .15s ease, color .15s ease, transform .4s cubic-bezier(.3,1.4,.5,1); }
.avatar:hover { background: var(--hover); color: var(--text); }
.avatar:hover .ico { transform: rotate(60deg); transition: transform .5s cubic-bezier(.3,1.4,.5,1); }
.avatar .ico { width: 19px; height: 19px; }

.banner {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 16px; border-top: 1px solid var(--line);
  background: var(--danger-soft); color: var(--danger); font-size: 13.5px; font-weight: 520;
}
.banner .ico { width: 17px; height: 17px; }
.banner a { font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }

/* ---- bottom tab bar (phones) -------------------------------------------------------- */
.tabbar { display: none; }
@media (max-width: 899px) {
  .nav { display: none; }
  .tabbar {
    position: fixed; z-index: 25; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    -webkit-backdrop-filter: saturate(1.6) blur(16px); backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 2px; border-radius: 12px; font-size: 11px; font-weight: 550; color: var(--text-3); transition: color .15s ease; }
  .tabbar a .ico { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar a[aria-current="page"] .ico { color: var(--accent-text); stroke-width: 2; }
  .tabbar .tab-add {
    justify-self: center; width: 54px; height: 54px; margin-top: -22px; padding: 0; justify-content: center;
    border-radius: 18px; background: var(--accent); color: var(--accent-ink);
    box-shadow: 0 6px 20px -4px var(--glow-edge), 0 0 0 4px var(--bg);
    transition: transform .2s cubic-bezier(.3,1.5,.5,1);
  }
  .tabbar .tab-add .ico { width: 26px; height: 26px; stroke-width: 2; color: var(--accent-ink); }
  .tabbar .tab-add:active { transform: scale(.92); }
  body.has-tabbar .page, body:not(.login-page):not(.add-page) .page { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .add-page .tabbar { display: none; }
}

/* ---- page / hero --------------------------------------------------------------- */
.page {
  max-width: 1120px; margin: 0 auto;
  padding: 40px 24px 120px;
  padding-left: max(24px, env(safe-area-inset-left)); padding-right: max(24px, env(safe-area-inset-right));
}
.hero { margin-bottom: 24px; animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.hero-tight { margin-bottom: 18px; }
.eyebrow { display: flex; align-items: center; flex-wrap: wrap; gap: 0; font-size: 13px; font-weight: 550; color: var(--text-3); letter-spacing: .01em; margin-bottom: 8px; }
.dot { margin: 0 7px; opacity: .55; }
.greeting { font-size: clamp(28px, 4.2vw, 38px); line-height: 1.12; font-weight: 650; letter-spacing: -.032em; text-wrap: balance; overflow-wrap: anywhere; }
.wave { display: inline-block; transform-origin: 70% 75%; animation: wave 1.4s .35s ease-in-out both; }
.greeting .who { text-transform: capitalize; }
.hero-sub { margin-top: 10px; color: var(--text-3); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.back { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 14px -6px; padding: 4px 8px; border-radius: 8px; font-size: 13.5px; font-weight: 550; color: var(--text-3); }
.back:hover { color: var(--text); background: var(--hover); }
.back .ico { width: 16px; height: 16px; }

/* ---- cards & grid ---------------------------------------------------------------- */
.card {
  position: relative; isolation: isolate;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 20px;
}
a.card { display: block; transition: transform .25s cubic-bezier(.3,1.4,.5,1), box-shadow .2s ease, border-color .2s ease; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid > .card { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.grid > .card:nth-child(2) { animation-delay: 40ms; } .grid > .card:nth-child(3) { animation-delay: 80ms; } .grid > .card:nth-child(4) { animation-delay: 120ms; }
.grid > .card:nth-child(5) { animation-delay: 160ms; } .grid > .card:nth-child(n+6) { animation-delay: 200ms; }
@media (min-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .span-2 { grid-column: span 2; }
}
.grid-2 { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -.015em; }
.card-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.card-eyebrow .ico { width: 15px; height: 15px; color: var(--accent-text); }
.card-title { font-size: 22px; font-weight: 680; letter-spacing: -.028em; line-height: 1.2; }
.card-sub { margin-top: 4px; color: var(--text-2); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill .ico { width: 14px; height: 14px; }
.pill-accent { background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.pill-ok { background: var(--ok-soft); color: var(--ok); box-shadow: none; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); font-size: 11px; font-weight: 600; color: var(--text-3); vertical-align: 1px; letter-spacing: .02em; }

.tile { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; color: var(--k, var(--text-2)); background: color-mix(in srgb, var(--k, var(--text-3)) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k, var(--text-3)) 18%, transparent); }
.tile .ico { width: 19px; height: 19px; }
.tile-sm { width: 30px; height: 30px; border-radius: 9px; }
.tile-sm .ico { width: 16px; height: 16px; }
.tile-lg { width: 64px; height: 64px; border-radius: 18px; }
.tile-lg .ico { width: 30px; height: 30px; }

/* XP / HP bars */
.xpbar { display: block; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.xpbar i { display: block; height: 100%; width: var(--p); border-radius: inherit; background: linear-gradient(90deg, var(--metal-2, var(--accent)), var(--metal, var(--accent-strong))); box-shadow: 0 0 12px var(--glow-edge); animation: grow 1s .2s cubic-bezier(.2,.8,.2,1) both; }

/* medals */
.medal { width: 100%; height: 100%; overflow: visible; }
.medal .m-outer { fill: var(--t1, var(--metal, var(--stone-2))); }
.medal .m-inner { fill: var(--t2, var(--metal-2, var(--stone))); stroke: rgb(255 255 255 / .35); stroke-width: 1; }
.medal .m-glyph { color: var(--t1, var(--metal)); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.medal .m-num { fill: color-mix(in srgb, var(--metal) 65%, black); font: 750 21px/1 "Geist", ui-sans-serif, sans-serif; letter-spacing: -.04em; }
.tier-bronze { --t1: var(--t-bronze); --t2: var(--t-bronze-2); }
.tier-silver { --t1: var(--t-silver); --t2: var(--t-silver-2); }
.tier-gold { --t1: var(--t-gold); --t2: var(--t-gold-2); }
.tier-legendary { --t1: var(--t-legend); --t2: var(--t-legend-2); }
.medal.tier-legendary { filter: drop-shadow(0 0 8px rgb(255 120 50 / .45)); }
.medal.locked { --t1: var(--stone-2); --t2: var(--surface-3); filter: none; }
.medal.locked .m-inner { stroke: var(--line-2); }
.medal.locked .m-glyph { color: var(--text-3); opacity: .7; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 10px; align-items: end; }
@media (max-width: 640px) { .inline-form { grid-template-columns: 1fr 1fr; } .inline-form .btn { grid-column: 1 / -1; } }
.field { display: grid; gap: 6px; }
.field span { font-size: 13px; font-weight: 550; color: var(--text-2); }
.field input {
  height: 44px; padding: 0 13px; width: 100%; min-width: 0;
  border: 1px solid var(--line-2); border-radius: 11px; background: var(--bg);
  font-size: 15px; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.level-hero { display: grid; grid-template-columns: 150px 1fr; gap: 24px; align-items: center; background: radial-gradient(80% 130% at 0% 50%, color-mix(in srgb, var(--metal) 14%, transparent), transparent 70%), var(--surface); }
.level-hero .medal-big { width: 150px; height: 150px; animation: float-y 4s ease-in-out infinite; filter: drop-shadow(0 10px 20px color-mix(in srgb, var(--metal) 35%, transparent)); }
.level-hero .stat-value { font-size: 30px; }
@media (max-width: 640px) { .level-hero { grid-template-columns: 96px 1fr; gap: 16px; } .level-hero .medal-big { width: 96px; height: 96px; } .level-hero .stat-value { font-size: 23px; } }
.trophy-group { margin-top: 26px; }
.trophy-group > header { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 10px; }
.trophy-group h2 { font-size: 17px; font-weight: 680; letter-spacing: -.02em; }
.trophy-group header span { font-size: 13px; color: var(--text-3); }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.trophy { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.3,1.4,.5,1), box-shadow .2s ease; scroll-margin-top: 90px; }
.trophy:hover { transform: translateY(-3px) rotate(-.5deg); box-shadow: var(--shadow-lg); }
.trophy .medal { width: 64px; height: 64px; transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.trophy:hover .medal:not(.locked) { transform: rotateY(180deg) scale(1.05); }
.trophy h3 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; }
.trophy p { font-size: 12px; color: var(--text-3); line-height: 1.35; }
.trophy .when { font-size: 11.5px; font-weight: 600; color: var(--accent-text); }
.trophy.locked h3 { color: var(--text-2); }
.trophy .prog { width: 100%; margin-top: 2px; }

/* ---- settings ----------------------------------------------------------------------------- */
.settings { display: grid; gap: 16px; max-width: 760px; }
.settings .card { scroll-margin-top: 80px; }
.status-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.status-row:last-of-type { border-bottom: 0; }
.status-row .k { color: var(--text-3); width: 150px; flex: none; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-3); flex: none; }
.status-dot.ok { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.status-dot.bad { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.status-dot.warn { background: #f59e0b; }
.form-grid { display: grid; gap: 12px; margin-top: 14px; }
.form-grid .btn { justify-self: start; }
.steps-guide { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 9px; font-size: 14px; color: var(--text-2); }
.steps-guide strong, .steps-guide b { color: var(--text); }
.steps-guide a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
code, .code { font: 500 12.5px/1.5 ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.copy-line { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-radius: 10px; background: var(--surface-2); margin-top: 6px; }
.copy-line code { flex: 1; background: transparent; padding: 0; }
.ok-msg { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--ok-soft); color: var(--ok); font-size: 14px; font-weight: 550; }
.alert { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 14px; font-weight: 500; animation: shake .4s cubic-bezier(.36,.07,.19,.97) both; }
.progress-line { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.progress-line i { display: block; height: 100%; width: var(--p); background: var(--accent); transition: width .4s ease; }

/* ---- celebrations ------------------------------------------------------------------------ */
.celebrate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgb(9 9 11 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade .3s ease both; }
.celebrate .sparks, .dialog .sparks { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cel-card { display: none; position: relative; width: 100%; max-width: 400px; padding: 32px 28px 28px; border-radius: 26px; background: var(--surface); text-align: center; box-shadow: var(--shadow-lg), 0 0 80px -20px var(--glow-edge); }
.cel-card.on { display: block; animation: cel-in .6s cubic-bezier(.3,1.4,.5,1) both; }
.cel-badge { width: 112px; height: 112px; margin: -86px auto 14px; display: grid; place-items: center; border-radius: 30px; background: var(--surface); box-shadow: var(--shadow-lg); padding: 12px; animation: badge-spin 1s .1s cubic-bezier(.3,1.4,.5,1) both; }
.cel-badge > .ico { width: 54px; height: 54px; color: var(--accent-text); }
.pass-badge { background: var(--accent); color: var(--accent-ink); font-size: 46px; font-weight: 800; letter-spacing: -.05em; }
.cel-eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }
.cel-card h2, .dialog h2 { font-size: 26px; font-weight: 720; letter-spacing: -.03em; margin: 6px 0 8px; }
.cel-card p, .dialog p { color: var(--text-2); }
.cel-sub { margin-top: 10px; font-size: 13.5px; }
.cel-actions { position: fixed; left: 0; right: 0; bottom: calc(40px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.cel-actions .btn { min-width: 160px; height: 48px; border-radius: 14px; font-size: 15px; }
.dialog { width: min(420px, calc(100% - 32px)); border: 0; padding: 0; border-radius: 26px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: visible; }
.dialog::backdrop { background: rgb(9 9 11 / .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog-body { padding: 30px 26px 24px; text-align: center; display: grid; gap: 4px; }
.dialog-body .cel-badge { margin-top: -84px; }
.dialog-body .btn { margin-top: 16px; }
.toast { position: fixed; z-index: 90; left: 50%; top: calc(76px + env(safe-area-inset-top)); translate: -50% 0; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; background: var(--ink); color: var(--ink-text); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; animation: toast-in .4s cubic-bezier(.3,1.4,.5,1) both; max-width: calc(100% - 32px); }
.toast .ico { color: var(--accent); }
.toast.pr { background: var(--accent); color: var(--accent-ink); }
.toast.pr .ico { color: var(--accent-ink); }

/* ---- empty / login ----------------------------------------------------------------------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 56px 24px 64px; border: 1px dashed var(--line-2); border-radius: 20px; background: radial-gradient(ellipse 55% 65% at 50% 0%, var(--accent-softer), transparent); animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.empty h1, .empty h2 { font-size: 20px; font-weight: 650; letter-spacing: -.02em; margin-top: 6px; }
.empty p { color: var(--text-3); max-width: 360px; font-size: 14.5px; }
.empty .btn { margin-top: 14px; }
.empty-art { width: 168px; height: 126px; overflow: visible; }
.ea-shadow { fill: var(--text); opacity: .07; transform-origin: 80px 106px; animation: shadow 3.2s ease-in-out infinite; }
.ea-float { animation: bob 3.2s ease-in-out infinite; }
.ea-board { fill: var(--ink); }
.ea-chalk { fill: var(--ink-text); stroke: none; }
path.ea-chalk:last-of-type { fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.ea-dot { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: bob 1.6s ease-in-out infinite; }
.ea-spark { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: twinkle 2.4s ease-in-out infinite; }
.ea-spark-2 { animation-delay: .8s; } .ea-spark-3 { animation-delay: 1.5s; }

.login-page { display: grid; place-items: center; align-content: center; gap: 20px; padding: 80px 16px 40px; position: relative; overflow-x: hidden; }
.login-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(var(--dots) 1px, transparent 1.2px); background-size: 22px 22px; -webkit-mask: radial-gradient(ellipse 60% 55% at 50% 45%, #000 30%, transparent 75%); mask: radial-gradient(ellipse 60% 55% at 50% 45%, #000 30%, transparent 75%); }
.login-page::after { content: ""; position: fixed; z-index: -1; pointer-events: none; width: 520px; height: 520px; left: 50%; top: 42%; translate: -50% -50%; border-radius: 50%; background: radial-gradient(circle, var(--glow), transparent 65%); filter: blur(10px); }
.login-corner { position: fixed; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.login-card { width: 100%; max-width: 380px; padding: 36px 32px 32px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-lg); animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.login-mark { margin-bottom: 22px; }
.login-mark .logo { width: 44px; height: 44px; }
.login-mark .logo-dot { animation: dot-hop 1.3s .35s cubic-bezier(.3,1.4,.5,1) both; }
.login-card h1 { font-size: 26px; font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.login-lede { margin-top: 6px; color: var(--text-3); font-size: 14.5px; }
.login-form { display: grid; gap: 14px; margin-top: 26px; }
.login-form .btn-block { margin-top: 8px; }
.login-foot { font-size: 12.5px; color: var(--text-3); }

/* ---- small screens --------------------------------------------------------------------- */
@media (max-width: 719px) {
  .topbar-inner { height: 56px; gap: 8px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  .topbar-end { gap: 4px; }
  .userbox { padding-left: 6px; gap: 0; }
  .icon-btn { width: 40px; height: 40px; }
  .theme-toggle { display: none; }
  .settings .theme-toggle { display: inline-flex; }
  .page { padding: 24px 16px 120px; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .hero { margin-bottom: 18px; }
  .card { padding: 16px; border-radius: 16px; }
  .card-title { font-size: 20px; }
  .login-card { padding: 30px 22px 24px; border-radius: 20px; }
}
@media (pointer: coarse) { .theme-toggle { --seg: 40px; } }


/* ---- keyframes ----------------------------------------------------------------------------- */
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes wave {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(14deg); } 30% { transform: rotate(-8deg); }
  45% { transform: rotate(14deg); } 60% { transform: rotate(-4deg); } 75% { transform: rotate(10deg); }
}
@keyframes dot-hop { 0%, 100% { transform: none; } 22% { transform: translateY(1px) scale(1.15, .85); } 45% { transform: translateY(-9px) scale(.95, 1.08); } 70% { transform: translateY(0) scale(1.1, .9); } }
@keyframes fade { from { opacity: 0; } }
@keyframes grow { from { width: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-in { from { transform: rotate(-90deg) scale(.6); } }
@keyframes tilt-in { from { transform: rotate(40deg) scale(.6); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes float-y { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(1deg); } }
@keyframes arm { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(4deg); } }
@keyframes shadow { 0%, 100% { transform: scaleX(1); opacity: .08; } 50% { transform: scaleX(.86); opacity: .05; } }
@keyframes twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.5) rotate(45deg); opacity: .4; } }
@keyframes twinkle-once { 0% { transform: scale(0) rotate(-120deg); } 100% { transform: none; } }
@keyframes ember { 0% { opacity: 0; transform: translateY(2px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes shake { 20%, 80% { transform: translateX(-2px); } 40%, 60% { transform: translateX(3px); } }
@keyframes pop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 33% { transform: scale(1.08, .95) rotate(2deg); } 66% { transform: scale(.95, 1.06) rotate(-1deg); } }
@keyframes glow { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes blink { 0%, 46%, 50%, 100% { transform: scaleY(1); } 48% { transform: scaleY(.1); } }
@keyframes draw { from { stroke-dashoffset: 400; } to { stroke-dashoffset: 0; } }
@keyframes slide-up { from { transform: translateY(30px); opacity: 0; } }
@keyframes nudge { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes cel-in { from { opacity: 0; transform: translateY(30px) scale(.9); } }
@keyframes badge-spin { from { transform: rotateY(-180deg) scale(.4); opacity: 0; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.95); } }
@keyframes bubble { 0% { opacity: 0; transform: translateY(1px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes star-pop { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes crown-bob { 0%, 100% { transform: translateY(-10px) rotate(-6deg); } 50% { transform: translateY(-13px) rotate(6deg); } }
@keyframes shot-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes develop { from { opacity: 0; filter: blur(8px) saturate(.4); transform: scale(1.04); } }
@keyframes heartbeat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.25); } 40% { transform: scale(.95); } 60% { transform: scale(1.15); } }
@keyframes take { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes hex-in { from { opacity: 0; transform: scale(.6); } }

/* ---- reduced motion ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
}

/* ---- utilities (inline styles are blocked by the CSP) --------------------------------------- */
.mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mb-16 { margin-bottom: 16px; }
.bleed { margin-left: -10px; margin-right: -10px; }
.page-narrow { max-width: 820px; }
.pr-card { background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
.num-r { text-align: right; }

/* ============================================================================================
   La Classe
   ============================================================================================ */

/* unit hues: banners and path rings only – the app accent stays tangerine */
.u1 { --u: #ff6a2b; } .u2 { --u: #0ea5a4; } .u3 { --u: #7c5cff; } .u4 { --u: #e0457b; } .u5 { --u: #2f86eb; } .u6 { --u: #5aa02c; }

/* ---- top bar extras ---------------------------------------------------------------------- */
.streak-chip { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-3); font-weight: 650; font-variant-numeric: tabular-nums; }
.streak-chip .ico { width: 18px; height: 18px; }
.streak-chip.lit { color: var(--accent-text); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent); }
.streak-chip.lit .ico { fill: var(--accent); stroke: var(--accent-strong); animation: flicker 2.4s ease-in-out infinite; }
@media (max-width: 899px) { .go-top { display: none; } }
@media (min-width: 900px) { .topbar-end .streak-chip { margin-right: 2px; } }
.tabbar .tab-go {
  justify-self: center; width: 54px; height: 54px; margin-top: -22px; padding: 0; justify-content: center;
  border-radius: 18px; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 20px -4px var(--glow-edge), 0 0 0 4px var(--bg);
  transition: transform .2s cubic-bezier(.3,1.5,.5,1);
}
.tabbar .tab-go .ico { width: 24px; height: 24px; fill: var(--accent-ink); stroke: var(--accent-ink); stroke-width: 1.5; margin-left: 3px; }
.tabbar .tab-go:active { transform: scale(.92); }

/* ---- home -------------------------------------------------------------------------------- */
.queue-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 12px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); font-size: 14px; font-weight: 550; }
.queue-banner span { flex: 1; }
.home-grid { display: grid; gap: 16px; }
.home-side { display: grid; gap: 14px; align-content: start; }
@media (min-width: 960px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
  .home-side { order: 2; position: sticky; top: 84px; }
  .home-path { order: 1; }
}
.today { display: grid; gap: 16px; }
.streak-box { display: flex; align-items: center; gap: 12px; }
.flame-big { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--surface-2); color: var(--stone-2); }
.flame-big .ico { width: 30px; height: 30px; }
.streak-box.lit .flame-big { background: radial-gradient(circle at 50% 65%, rgb(255 180 80 / .35), var(--accent-soft) 70%); color: var(--accent-strong); }
.streak-box.lit .flame-big .ico { fill: var(--accent); stroke: var(--accent-strong); animation: flicker 2.4s ease-in-out infinite; transform-origin: 50% 85%; }
.streak-n { font-size: 15px; color: var(--text-2); }
.streak-n b { font-size: 26px; font-weight: 720; letter-spacing: -.03em; color: var(--text); font-variant-numeric: tabular-nums; margin-right: 2px; }
.freeze-chip { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; height: 28px; padding: 0 10px 0 7px; border-radius: 999px; background: rgb(56 189 248 / .12); color: #0284c7; font-weight: 650; font-size: 13px; font-variant-numeric: tabular-nums; }
:root[data-resolved="dark"] .freeze-chip { color: #7dd3fc; }
.freeze-chip .ico { width: 16px; height: 16px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.wd { display: grid; justify-items: center; gap: 4px; }
.wd-dot { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--text-3); }
.wd-dot .ico { width: 16px; height: 16px; stroke-width: 2.4; }
.wd-l { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.wd.done .wd-dot { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 10px -3px var(--glow-edge); }
.wd.frozen .wd-dot { background: rgb(56 189 248 / .16); color: #0ea5e9; box-shadow: none; }
.wd.asleep .wd-dot { background: var(--surface-3); color: var(--text-2); box-shadow: none; }
.wd.today .wd-dot { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.wd.today .wd-l { color: var(--accent-text); }
.wd.future .wd-dot { opacity: .55; }
.goal { display: flex; align-items: center; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ring { width: 54px; height: 54px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--n, 0)); transition: stroke-dashoffset 1s .2s cubic-bezier(.2,.8,.2,1); }
.ring-fg.met { stroke: var(--ok); }
.goal-n { color: var(--text-2); }
.goal-n b { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.go-card { display: flex !important; align-items: center; gap: 14px; background: radial-gradient(120% 140% at 0% 0%, var(--accent-soft), transparent 60%), var(--surface); }
.go-art { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 18px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 22px -8px var(--glow-edge); }
.go-art .ico { width: 28px; height: 28px; stroke-width: 1.8; }
.go-body { display: grid; gap: 2px; min-width: 0; flex: 1; }
.go-body .card-eyebrow { margin: 0; }
.go-title { font-size: 20px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; }
.go-title-sm { font-size: 15.5px; font-weight: 650; letter-spacing: -.015em; }
.go-sub { color: var(--text-2); font-size: 14px; }
.go-btn { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--ink); color: var(--ink-text); transition: transform .3s cubic-bezier(.3,1.6,.5,1); }
.go-btn .ico { width: 20px; height: 20px; fill: currentColor; margin-left: 2px; }
.go-card:hover .go-btn { transform: scale(1.1); }
.done-all .go-art { background: linear-gradient(135deg, var(--t-gold-2), var(--t-gold)); }
.review-card { display: flex !important; align-items: center; gap: 14px; padding: 16px 18px; }
.review-card > .ico { color: var(--text-3); }
.review-card .tile { --k: #0ea5a4; }
.quests ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.quest { display: flex; align-items: center; gap: 12px; }
.quest .tile { --k: var(--accent-text); }
.q-body { flex: 1; display: grid; gap: 6px; min-width: 0; }
.q-label { font-size: 14px; font-weight: 550; }
.q-n { font-size: 13px; font-weight: 650; color: var(--text-3); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }
.quest.done .tile { --k: var(--ok); }
.quest.done .q-n { color: var(--ok); }
.quest.done .q-n .ico { width: 18px; height: 18px; stroke-width: 2.4; }
.quest.done .xpbar i { background: var(--ok); box-shadow: none; }
.chest { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--text-3); }
.chest.open { background: linear-gradient(135deg, var(--t-gold-2), var(--t-gold)); color: #4a3200; animation: nudge 1.6s ease-in-out infinite; }

/* ---- the path ------------------------------------------------------------------------------ */
.unit { margin-bottom: 28px; }
.unit-banner {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; overflow: hidden;
  padding: 18px 18px 22px; border-radius: 20px; color: #fff;
  background: radial-gradient(120% 160% at 100% 0%, rgb(255 255 255 / .22), transparent 55%), linear-gradient(135deg, var(--u), color-mix(in srgb, var(--u) 70%, #000));
  box-shadow: 0 10px 30px -14px color-mix(in srgb, var(--u) 80%, transparent);
  transition: transform .25s cubic-bezier(.3,1.4,.5,1);
}
.unit-banner:hover { transform: translateY(-2px); }
.unit-locked .unit-banner { background: linear-gradient(135deg, var(--stone-2), color-mix(in srgb, var(--stone-2) 70%, #000)); box-shadow: none; }
.ub-text { display: grid; gap: 2px; min-width: 0; }
.ub-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.ub-title { font-size: 22px; font-weight: 720; letter-spacing: -.03em; line-height: 1.15; }
.ub-sub { font-size: 14px; opacity: .85; }
.ub-guide { display: grid; justify-items: center; gap: 2px; padding: 8px 10px; border-radius: 12px; background: rgb(255 255 255 / .16); font-size: 11.5px; font-weight: 650; }
.ub-guide .ico { width: 20px; height: 20px; }
.ub-bar { position: absolute; left: 18px; right: 18px; bottom: 10px; height: 4px; border-radius: 4px; background: rgb(255 255 255 / .25); overflow: hidden; }
.ub-bar i { display: block; height: 100%; width: var(--p); background: #fff; border-radius: inherit; }
.nodes { margin: 0; padding: 22px 0 8px; list-style: none; display: grid; gap: 14px; }
.node-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 120px; justify-self: center; }
.lane-0 { transform: translateX(-108px); } .lane-1 { transform: translateX(-56px); } .lane-3 { transform: translateX(56px); } .lane-4 { transform: translateX(108px); }
@media (max-width: 380px) { .lane-0 { transform: translateX(-84px); } .lane-4 { transform: translateX(84px); } }
.node {
  position: relative; display: grid; place-items: center; width: 72px; height: 66px; border-radius: 50%;
  background: var(--u, var(--accent)); color: #fff;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--u, var(--accent)) 60%, #000), 0 10px 18px -8px color-mix(in srgb, var(--u, var(--accent)) 70%, transparent);
  transition: transform .15s ease, box-shadow .15s ease;
}
.node .ico { width: 30px; height: 30px; stroke-width: 2; }
a.node:hover { transform: translateY(-2px); }
a.node:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--u, var(--accent)) 60%, #000); }
.node.done { background: color-mix(in srgb, var(--u) 82%, #fff); }
.node.perfect { background: linear-gradient(135deg, var(--t-gold-2), var(--t-gold)); box-shadow: 0 6px 0 #9a6f06, 0 10px 18px -8px rgb(210 154 18 / .7); color: #4a3200; }
.node.locked { background: var(--surface-3); color: var(--text-3); box-shadow: 0 6px 0 var(--stone); }
.node.locked .ico { width: 24px; height: 24px; }
.node.listen:not(.locked) { --u: #2f86eb; }
.node.test { width: 64px; height: 58px; border-radius: 18px; background: var(--ink); color: var(--ink-text); box-shadow: 0 6px 0 color-mix(in srgb, var(--ink) 60%, #000); }
.node.test.done { background: linear-gradient(135deg, var(--t-gold-2), var(--t-gold)); color: #4a3200; box-shadow: 0 6px 0 #9a6f06; }
.node.current { animation: node-pulse 2s ease-in-out infinite; }
.node.current::before { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--u) 45%, transparent); }
.node-bubble { position: absolute; bottom: calc(100% + 14px); left: 50%; translate: -50% 0; padding: 7px 12px; border-radius: 12px; background: var(--surface); color: var(--u); font-size: 13px; font-weight: 750; white-space: nowrap; box-shadow: var(--shadow-lg); animation: bob 2.4s ease-in-out infinite; }
.node-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; translate: -50% 0; border: 7px solid transparent; border-top-color: var(--surface); }
.node-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); text-align: center; line-height: 1.25; max-width: 130px; }

/* ---- unit page ------------------------------------------------------------------------------- */
.unit-hero { padding: 26px 22px 22px; border-radius: 22px; color: #fff; background: radial-gradient(120% 160% at 100% 0%, rgb(255 255 255 / .22), transparent 55%), linear-gradient(135deg, var(--u), color-mix(in srgb, var(--u) 68%, #000)); box-shadow: 0 14px 34px -16px color-mix(in srgb, var(--u) 80%, transparent); animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.unit-hero h1 { font-size: clamp(28px, 4.2vw, 36px); font-weight: 720; letter-spacing: -.035em; margin-top: 2px; }
.unit-goal { margin-top: 12px; font-size: 15px; opacity: .95; max-width: 620px; }
.unit-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.unit-hero .pill { background: rgb(255 255 255 / .18); color: #fff; box-shadow: none; }
.unit-hero .btn-ghost { background: #fff; color: #18181b; border-color: transparent; }
.section { margin-top: 28px; }
.section > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 12px; }
.section h2 { font-size: 18px; font-weight: 680; letter-spacing: -.02em; }
.lesson-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.lesson-row, .track-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .2s cubic-bezier(.3,1.4,.5,1), box-shadow .2s ease; }
a.lesson-row:hover, a.track-row:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.lesson-row .tile { --k: var(--u, var(--accent)); }
.lesson-row.locked { opacity: .55; }
.lesson-row.locked .tile { --k: var(--text-3); }
.lr-body { display: grid; flex: 1; min-width: 0; }
.lr-body b { font-weight: 650; letter-spacing: -.01em; }
.lr-body span { font-size: 13.5px; color: var(--text-3); }
.lr-end { color: var(--text-3); }
.tips { display: grid; gap: 12px; }
@media (min-width: 900px) { .tips { grid-template-columns: 1fr 1fr; } }
.tip { padding: 18px 18px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.tip-kind { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.tip-kind .ico { width: 16px; height: 16px; }
.tip-trap .tip-kind { color: #c2410c; }
:root[data-resolved="dark"] .tip-trap .tip-kind { color: #fb923c; }
.tip-trap { background: linear-gradient(180deg, rgb(251 146 60 / .08), transparent 60%), var(--surface); }
.tip-culture .tip-kind { color: #0e7490; }
:root[data-resolved="dark"] .tip-culture .tip-kind { color: #22d3ee; }
.tip h3 { font-size: 17px; font-weight: 680; letter-spacing: -.02em; margin: 6px 0 8px; }
.tip-body { display: grid; gap: 8px; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.tip-body b { color: var(--text); font-weight: 650; }
.tip-body ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.conj { border-collapse: collapse; width: 100%; font-size: 14px; }
.conj td { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.conj tr:last-child td { border-bottom: 0; }
.conj td:first-child { color: var(--text-3); white-space: nowrap; }
.conj td:nth-child(2) { color: var(--text); font-weight: 650; }
.word-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
@media (min-width: 720px) { .word-list { grid-template-columns: 1fr 1fr; } }
.word { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.word.unseen { opacity: .5; }
.w-ca { font-weight: 650; display: inline-flex; align-items: center; gap: 6px; }
.w-e { font-size: 18px; }
.w-fr { flex: 1; text-align: right; color: var(--text-3); font-size: 13.5px; display: grid; }
.w-note { font-size: 12px; font-style: italic; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 4px; border-radius: 2px; background: var(--surface-3); }
.bars i:nth-child(1) { height: 5px; } .bars i:nth-child(2) { height: 8px; } .bars i:nth-child(3) { height: 11px; } .bars i:nth-child(4) { height: 14px; }
.bars.s1 i:nth-child(-n+1), .bars.s2 i:nth-child(-n+2), .bars.s3 i:nth-child(-n+3), .bars.s4 i { background: var(--accent); }
.say { display: grid; place-items: center; width: 34px; height: 34px; flex: none; padding: 0; border: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.say:hover { transform: scale(1.08); }
.say .ico { width: 18px; height: 18px; }
.say.playing .ico { animation: pulse .8s ease-in-out infinite; }
.unit-nav { display: flex; justify-content: space-between; margin-top: 32px; }
.page-title { font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -.032em; line-height: 1.15; }
.page-title .muted { font-weight: 500; }

/* lexicon */
.lex-tools { display: flex; gap: 10px; margin-bottom: 8px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-3); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--text); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---- Veus tracks ---------------------------------------------------------------------------- */
.track-list { display: grid; gap: 8px; }
.track-row .tile { --k: #2f86eb; }
.track-row .tile.heard { --k: var(--ok); }
.tr-dur { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.track-hero { margin-bottom: 16px; }
.player-card { position: sticky; top: 72px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
@media (max-width: 719px) { .player-card { top: 64px; } }
.tp-play { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px -6px var(--glow-edge); }
.tp-play .ico { width: 22px; height: 22px; fill: currentColor; }
.tp-play.on .ico { fill: none; stroke-width: 2.6; }
.tp-mid { flex: 1; display: grid; gap: 4px; min-width: 0; }
.tp-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; cursor: pointer; }
.tp-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: inherit; }
.tp-time { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tp-rate { font-size: 13px; font-weight: 700; width: auto; padding: 0 8px; }
.tr-tools { display: flex; flex-wrap: wrap; gap: 16px; margin: 16px 2px; font-size: 14px; color: var(--text-2); }
.transcript { display: grid; gap: 18px; }
.tr-label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin: 0 4px 6px; }
.tr-part { display: grid; gap: 4px; }
.tr-line { display: grid; gap: 1px; padding: 8px 12px; border-radius: 12px; cursor: pointer; transition: background-color .2s ease; }
.tr-line:hover { background: var(--hover); }
.tr-line.on { background: var(--accent-soft); }
.tr-line.extra { opacity: .6; font-style: italic; }
.tr-who { font-size: 11.5px; font-weight: 700; color: var(--accent-text); text-transform: uppercase; letter-spacing: .04em; }
.tr-ca { font-size: 16px; font-weight: 550; }
.tr-fr { font-size: 13.5px; color: var(--text-3); }
.transcript.no-fr .tr-fr { display: none; }
.quiz-q { padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 10px; }
.quiz-text { font-weight: 600; margin-bottom: 10px; }
.quiz-opts { display: grid; gap: 8px; }

/* switches */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch input + span { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); transition: background-color .2s ease; }
.switch input + span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .25s cubic-bezier(.3,1.4,.5,1); }
.switch input:checked + span { background: var(--accent); box-shadow: none; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.switch-row:first-of-type { border-top: 0; }
.switch-row > span:first-child { display: grid; gap: 2px; }
.switch-row small { margin: 0; font-size: 13px; font-weight: 400; color: var(--text-3); }

/* ---- profile ------------------------------------------------------------------------------- */
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpi { display: grid; gap: 2px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.kpi .tile { --k: var(--accent-text); margin-bottom: 6px; }
.kpi b { font-size: 26px; font-weight: 720; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi b small { font-size: 14px; }
.kpi span:last-child { font-size: 13px; color: var(--text-3); }
.cal-card { margin-bottom: 28px; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.c { display: block; width: 100%; min-width: 14px; aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); }
.c.done.l1 { background: color-mix(in srgb, var(--accent) 35%, var(--surface-3)); }
.c.done.l2 { background: color-mix(in srgb, var(--accent) 60%, var(--surface-3)); }
.c.done.l3 { background: color-mix(in srgb, var(--accent) 82%, var(--surface-3)); }
.c.done.l4 { background: var(--accent-strong); }
.c.frozen { background: rgb(56 189 248 / .55); }
.c.asleep { background: repeating-linear-gradient(45deg, var(--surface-3) 0 3px, var(--stone) 3px 5px); }
.c.future { opacity: .35; }
.cal-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.cal-legend .c { width: 12px; min-width: 12px; display: inline-block; margin-left: 6px; }
.cal-legend .c.l1 { background: color-mix(in srgb, var(--accent) 60%, var(--surface-3)); }
.trophy-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 4px; }
.trophy-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.trophy-group h3 { font-size: 15px; font-weight: 650; color: var(--text-2); }
.trophy h4 { font-size: 14px; font-weight: 650; letter-spacing: -.01em; line-height: 1.25; margin: 0; }

/* ---- settings ------------------------------------------------------------------------------ */
.goal-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 640px) { .goal-choices { grid-template-columns: repeat(4, 1fr); } }
.goal-choice input { position: absolute; opacity: 0; }
.goal-choice span { display: grid; gap: 2px; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line-2); cursor: pointer; transition: border-color .15s ease, background-color .15s ease, transform .2s cubic-bezier(.3,1.5,.5,1); }
.goal-choice span i { font-style: normal; font-weight: 700; color: var(--accent-text); font-size: 14px; }
.goal-choice span small { margin: 0; font-weight: 450; }
.goal-choice input:checked + span { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.02); }
.goal-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.form-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.time-input { height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg); font-size: 15px; font-variant-numeric: tabular-nums; }
.push-box { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.push-state { font-size: 14px; color: var(--text-2); }
.push-box .row-actions { margin-top: 10px; }

/* ============================================================================================
   The player
   ============================================================================================ */
.player-page { background: var(--bg); }
.player { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; max-width: 760px; margin: 0 auto; }
.pl-top { display: flex; align-items: center; gap: 14px; padding: max(14px, env(safe-area-inset-top)) 16px 10px; }
.pl-close { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--text-3); flex: none; }
.pl-close:hover { background: var(--hover); color: var(--text); }
.pl-bar { flex: 1; height: 14px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.pl-bar i { display: block; height: 100%; width: var(--p, 0%); border-radius: inherit; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 70%, #fff), var(--accent)); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .08); transition: width .5s cubic-bezier(.3,1.3,.5,1); position: relative; }
.pl-bar i::after { content: ""; position: absolute; left: 10px; right: 10px; top: 3px; height: 3px; border-radius: 3px; background: rgb(255 255 255 / .45); }
.pl-combo { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-text); font-weight: 750; font-variant-numeric: tabular-nums; }
.pl-combo .ico { width: 20px; height: 20px; fill: var(--accent); stroke: var(--accent-strong); }
.pl-combo.pop { animation: bump .45s cubic-bezier(.3,1.6,.5,1); }
.pl-stage { flex: 1; display: flex; flex-direction: column; padding: 8px 16px 24px; }
.pl-intro { margin: auto 0; text-align: center; }
.pl-intro h1 { font-size: 30px; font-weight: 720; letter-spacing: -.03em; }
.pl-foot { position: sticky; bottom: 0; display: flex; gap: 10px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.pl-foot .btn { height: 52px; border-radius: 16px; font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.pl-check { flex: 1; }
.pl-skip { background: var(--surface); border-color: var(--line-2); color: var(--text-2); }
.pl-check[disabled] { opacity: 1; background: var(--surface-3); color: var(--text-3); box-shadow: none; }
@media (min-width: 720px) { .pl-foot { justify-content: flex-end; } .pl-check { flex: 0 0 200px; } }

/* an exercise */
.ex { display: flex; flex-direction: column; gap: 18px; animation: ex-in .35s cubic-bezier(.2,.8,.2,1) both; }
.ex-ins { font-size: 21px; font-weight: 720; letter-spacing: -.025em; line-height: 1.25; }
.ex-new { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: rgb(124 92 255 / .12); color: #6d4bff; font-size: 12px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
:root[data-resolved="dark"] .ex-new { color: #b4a2ff; }
.prompt { display: flex; align-items: flex-start; gap: 12px; }
.prompt-bubble { position: relative; padding: 12px 16px; border-radius: 16px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 18px; line-height: 1.45; }
.prompt-emoji { font-size: 54px; line-height: 1; filter: drop-shadow(0 6px 10px rgb(0 0 0 / .12)); }
.prompt-sub { margin-top: 4px; font-size: 14px; color: var(--text-3); }
.speak-btn { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border: 0; border-radius: 16px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 5px 0 color-mix(in srgb, var(--accent) 60%, #000); transition: transform .12s ease; }
.speak-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.speak-btn .ico { width: 26px; height: 26px; }
.speak-btn.slow { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); box-shadow: 0 4px 0 var(--stone); }
.speak-btn.slow .ico { width: 22px; height: 22px; }
.speak-btn.playing { animation: nudge .8s ease-in-out infinite; }
.listen-big { display: flex; justify-content: center; align-items: flex-end; gap: 14px; padding: 18px 0 6px; }
.listen-big .speak-btn { width: 110px; height: 96px; border-radius: 26px; }
.listen-big .speak-btn .ico { width: 44px; height: 44px; }
.listen-big .speak-btn.slow { width: 64px; height: 60px; border-radius: 18px; }
.listen-big .speak-btn.slow .ico { width: 30px; height: 30px; }
.hint { border-bottom: 2px dotted color-mix(in srgb, var(--text-3) 60%, transparent); cursor: help; }
.hint:hover, .hint.on { border-bottom-color: var(--accent); color: var(--accent-text); }
.hint-pop { position: fixed; z-index: 50; max-width: 240px; padding: 8px 12px; border-radius: 12px; background: var(--ink); color: var(--ink-text); font-size: 14px; font-weight: 550; box-shadow: var(--shadow-lg); pointer-events: none; animation: toast-in .25s cubic-bezier(.3,1.4,.5,1) both; }
.gap-blank { display: inline-block; min-width: 72px; margin: 0 2px; padding: 0 6px; border-bottom: 2.5px solid var(--text-3); text-align: center; color: var(--accent-text); font-weight: 650; }
.gap-blank.filled { border-bottom-color: var(--accent); }

/* choices */
.opts { display: grid; gap: 10px; }
.opts.cards { grid-template-columns: repeat(2, 1fr); }
.opts.cards.n3 { grid-template-columns: repeat(3, 1fr); }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px;
  border: 1.5px solid var(--line-2); border-radius: 16px; background: var(--surface); text-align: left; font-size: 16.5px; font-weight: 550;
  box-shadow: 0 3px 0 var(--line-2); transition: transform .1s ease, border-color .15s ease, background-color .15s ease;
}
.opt:hover { background: var(--surface-2); }
.opt:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line-2); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 55%, transparent); color: var(--accent-text); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); box-shadow: 0 3px 0 color-mix(in srgb, var(--ok) 55%, transparent); }
.opt.wrong { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); box-shadow: 0 3px 0 color-mix(in srgb, var(--danger) 45%, transparent); animation: shake .4s cubic-bezier(.36,.07,.19,.97); }
.opt[disabled] { cursor: default; }
.opt .k { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 8px; border: 1.5px solid var(--line-2); font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.opts.cards .opt { flex-direction: column; justify-content: center; text-align: center; min-height: 128px; gap: 8px; }
.opts.cards .opt .k { position: absolute; top: 8px; left: 8px; }
.opt-e { font-size: 44px; line-height: 1; }
@media (pointer: coarse) { .opt .k { display: none; } }

/* tiles */
.tiles-answer { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; min-height: 108px; padding: 10px 0; background-image: linear-gradient(var(--line-2), var(--line-2)), linear-gradient(var(--line-2), var(--line-2)); background-size: 100% 1.5px; background-repeat: no-repeat; background-position: 0 52px, 0 104px; }
.tiles-bank { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 8px; }
.tile-w {
  height: 44px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: 13px; background: var(--surface);
  font-size: 16.5px; font-weight: 550; box-shadow: 0 3px 0 var(--line-2); transition: transform .12s ease, opacity .15s ease;
}
.tile-w:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line-2); }
.tile-w.used { background: var(--surface-3); color: transparent; box-shadow: none; border-color: transparent; pointer-events: none; }
.tile-w.pop { animation: pop .22s cubic-bezier(.3,1.6,.5,1); }

/* pairs */
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pairs .col { display: grid; gap: 10px; align-content: start; }
.pairs .opt { justify-content: center; text-align: center; min-height: 58px; }
.opt.matched { opacity: .35; border-color: var(--line); box-shadow: none; pointer-events: none; transition: opacity .4s ease .25s; }
.opt.flash-ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }

/* typing */
.type-box { display: grid; gap: 8px; }
.type-box textarea { width: 100%; min-height: 120px; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: 16px; background: var(--surface); font-size: 18px; line-height: 1.4; resize: none; outline: none; }
.type-box textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.type-box input { width: 100%; height: 60px; padding: 0 16px; border: 1.5px solid var(--line-2); border-radius: 16px; background: var(--surface); font-size: 26px; font-weight: 650; letter-spacing: .04em; text-align: center; outline: none; font-variant-numeric: tabular-nums; }
.type-box input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.charbar { display: flex; flex-wrap: wrap; gap: 6px; }
.charbar button { min-width: 38px; height: 36px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-size: 16px; font-weight: 600; }
.charbar button:hover { background: var(--surface-2); }

/* speaking */
.mic-zone { display: grid; justify-items: center; gap: 12px; padding: 18px 0; }
.mic-btn { display: grid; place-items: center; width: 96px; height: 96px; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 0 color-mix(in srgb, var(--accent) 60%, #000), 0 12px 28px -10px var(--glow-edge); transition: transform .12s ease; }
.mic-btn .ico { width: 40px; height: 40px; }
.mic-btn.on { animation: mic-pulse 1.2s ease-in-out infinite; }
.mic-btn:active { transform: translateY(4px); }
.heard { min-height: 24px; font-size: 16px; color: var(--text-2); text-align: center; }
.heard .w-ok { color: var(--ok); font-weight: 650; }
.heard .w-ko { color: var(--danger); text-decoration: line-through; }
.mic-skip { font-size: 14px; color: var(--text-3); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; }

/* the clock */
.clock-wrap { display: grid; place-items: center; padding: 6px 0; }
.clock { width: 180px; height: 180px; filter: drop-shadow(0 10px 24px rgb(0 0 0 / .12)); }
.clock-face { fill: var(--surface); stroke: var(--ink); stroke-width: 3; }
.clock .tick { stroke: var(--text-3); stroke-width: 1; stroke-linecap: round; }
.clock .tick.big { stroke: var(--text); stroke-width: 2.4; }
.clock .hand { stroke-linecap: round; }
.clock .hand.hour { stroke: var(--ink); stroke-width: 5; }
.clock .hand.min { stroke: var(--accent); stroke-width: 3.2; }
.clock-pin { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }

/* Veus clip */
.clip { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: linear-gradient(135deg, rgb(47 134 235 / .12), transparent 70%), var(--surface); border: 1px solid var(--line); }
.clip .speak-btn { background: #2f86eb; color: #fff; box-shadow: 0 5px 0 #1d5fae; }
.clip-meta { display: grid; gap: 4px; flex: 1; }
.clip-meta b { font-size: 14px; }
.clip-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.clip-bar i { display: block; height: 100%; width: 0; background: #2f86eb; }
.clip-text { margin-top: 6px; white-space: pre-line; font-size: 15px; }

/* tip cards */
.ex-tip .tip { padding: 22px 20px; border-radius: 22px; box-shadow: var(--shadow); }
.ex-tip .tip h3 { font-size: 22px; }

/* the sheet that slides up */
.pl-sheet { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; animation: sheet-in .32s cubic-bezier(.3,1.2,.5,1) both; }
.sheet-inner { max-width: 760px; margin: 0 auto; padding: 18px 16px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.pl-sheet.ok { background: color-mix(in srgb, var(--ok) 14%, var(--bg)); }
.pl-sheet.ko { background: color-mix(in srgb, var(--danger) 13%, var(--bg)); }
.pl-sheet.info { background: var(--surface-2); }
.sheet-head { display: flex; align-items: center; gap: 10px; }
.sheet-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); }
.sheet-ico .ico { width: 22px; height: 22px; stroke-width: 2.6; }
.ok .sheet-ico { color: var(--ok); } .ko .sheet-ico { color: var(--danger); }
.sheet-head h2 { font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.ok .sheet-head h2 { color: var(--ok); } .ko .sheet-head h2 { color: var(--danger); }
.sheet-body { display: grid; gap: 4px; font-size: 15.5px; }
.sheet-body .sol { font-weight: 650; }
.ko .sheet-body .sol { color: var(--danger); }
.sheet-body .trans { color: var(--text-2); font-size: 14.5px; }
.sheet-body .note { font-size: 14px; color: var(--text-2); }
.sheet-body .note b { color: var(--text); }
.pl-next { height: 52px; border-radius: 16px; font-size: 16px; font-weight: 700; color: #fff; }
.ok .pl-next { background: var(--ok); box-shadow: 0 4px 0 color-mix(in srgb, var(--ok) 60%, #000); }
.ko .pl-next { background: var(--danger); box-shadow: 0 4px 0 color-mix(in srgb, var(--danger) 60%, #000); }
.info .pl-next { background: var(--ink); color: var(--ink-text); }
:root[data-resolved="dark"] .ok .pl-next, :root[data-resolved="dark"] .ko .pl-next { color: #0b0b0d; }

/* end of a lesson */
.end { display: grid; justify-items: center; gap: 18px; margin: auto 0; padding: 12px 0 24px; text-align: center; animation: ex-in .5s cubic-bezier(.2,.8,.2,1) both; }
.end-art { position: relative; width: 120px; height: 120px; display: grid; place-items: center; border-radius: 36px; background: var(--accent); color: var(--accent-ink); box-shadow: 0 16px 40px -12px var(--glow-edge); animation: badge-spin .9s cubic-bezier(.3,1.4,.5,1) both; }
.end-art .ico { width: 64px; height: 64px; stroke-width: 1.6; }
.end-art.fail { background: var(--surface-3); color: var(--text-2); box-shadow: none; }
.end h1 { font-size: 30px; font-weight: 750; letter-spacing: -.035em; }
.end-sub { color: var(--text-2); max-width: 420px; }
.end-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 460px; }
.end-stat { display: grid; gap: 4px; padding: 12px 8px; border-radius: 16px; border: 2px solid var(--k, var(--accent)); background: var(--surface); }
.end-stat span { font-size: 11.5px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--k, var(--accent-text)); }
.end-stat b { font-size: 24px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.end-stat.acc { --k: var(--ok); } .end-stat.time { --k: #2f86eb; }
.end-streak { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 18px; background: var(--accent-soft); color: var(--accent-text); font-weight: 650; animation: cel-in .6s .4s cubic-bezier(.3,1.4,.5,1) both; }
.end-streak .ico { width: 34px; height: 34px; fill: var(--accent); stroke: var(--accent-strong); animation: flicker 2s ease-in-out infinite; }
.end-streak b { font-size: 22px; }
.end-lines { width: 100%; max-width: 460px; display: grid; gap: 8px; }
.end-line { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; text-align: left; animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.end-line .tile { --k: var(--accent-text); }
.end-line > span:not(.tile) { flex: 1; }
.end-line b { color: var(--accent-text); font-variant-numeric: tabular-nums; }
.end-line.chest .tile { --k: #b7791f; }
.end-actions { display: grid; gap: 10px; width: 100%; max-width: 460px; }
.end-actions .btn { height: 52px; border-radius: 16px; font-size: 16px; font-weight: 700; }
.burst { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

@keyframes ex-in { from { opacity: 0; transform: translateX(18px); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes node-pulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes mic-pulse { 0%, 100% { box-shadow: 0 8px 0 color-mix(in srgb, var(--accent) 60%, #000), 0 0 0 0 var(--glow-edge); } 50% { box-shadow: 0 8px 0 color-mix(in srgb, var(--accent) 60%, #000), 0 0 0 18px transparent; } }
