/* TimSchool — brand: deep indigo, lime dot, white. */
:root {
  --indigo: #1e0547;
  --indigo-2: #2c0f63;
  --lime: #e7fd54;
  --bg: #f6f5fb;
  --surface: #ffffff;
  --surface-2: #eeebf6;
  --ink: #1e0547;
  --ink-2: #463a63;
  --muted: #776e8c;
  --line: #e2ddee;
  --ok: #1f8a54;
  --bad: #d13b3b;
  --a2: #0f8b8d;
  --b1: #2f9e5b;
  --b2: #2f6bd1;
  --c1: #7a3fd1;
  --c2: #c03a74;
  --radius: 18px;
  --gutter: 16px;
  --head: 'Montserrat', 'Inter', system-ui, sans-serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
body[data-page="home"] { --bg: var(--indigo); color-scheme: dark; }
body[data-page="lesson"] {
  --bg: #0f0624;
  --surface: #1a0f36;
  --surface-2: #261a48;
  --ink: #f5f3fb;
  --ink-2: #d7d1e8;
  --muted: #a69dbf;
  --line: #2f2453;
  --ok: #5fdb94;
  --bad: #ff7f7f;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 2px; }
.muted { color: var(--muted); }

/* ---------- top bar ---------- */
.topbar { max-width: 1080px; margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-link { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.top-link:hover { border-color: var(--indigo); }
body[data-page="home"] .topbar, body[data-page="lesson"] .topbar { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 19px/1 var(--head); letter-spacing: -.01em; }
.brand img { width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
main { max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter) 48px; }

/* ---------- buttons, chips, levels ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px;
  border-radius: 999px; border: 1.5px solid transparent; background: var(--surface-2); color: var(--ink);
  font: 700 15px/1.2 var(--sans); text-decoration: none; transition: transform .12s, opacity .15s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .38; cursor: default; transform: none; }
.btn.primary { background: var(--indigo); color: #fff; }
body[data-page="lesson"] .btn.primary { background: var(--lime); color: var(--indigo); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.link { background: none; min-height: 32px; padding: 4px 2px; color: var(--muted); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 42px; min-height: 42px; padding: 0; font-size: 24px; line-height: 1; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.dark { background: rgba(15, 6, 36, .78); color: #fff; }
.level { display: inline-grid; place-items: center; min-width: 36px; height: 24px; padding: 0 8px; border-radius: 7px; font: 800 12.5px/1 var(--head); letter-spacing: .03em; color: #fff; }
.lvl-a2 { background: var(--a2); } .lvl-b1 { background: var(--b1); } .lvl-b2 { background: var(--b2); }
.lvl-c1 { background: var(--c1); } .lvl-c2 { background: var(--c2); }

/* ---------- home (welcome page) ---------- */
body[data-page="home"] { background: #12032e; }
body[data-page="home"] main { overflow-x: clip; max-width: 1180px; }
.home { position: relative; color: #fff; min-height: 100dvh; display: flex; flex-direction: column; }
.home-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, #1e0547 0%, #14032f 55%, #0e0226 100%);
}
.home-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(65% 55% at 50% 40%, #000 15%, transparent 72%); mask-image: radial-gradient(65% 55% at 50% 40%, #000 15%, transparent 72%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(80px); animation: drift 20s ease-in-out infinite; }
.orb-a { width: 460px; height: 460px; left: -140px; top: 6%; background: rgba(124, 77, 255, .55); }
.orb-b { width: 380px; height: 380px; right: -110px; top: 26%; background: rgba(231, 253, 84, .2); animation-duration: 24s; animation-delay: -7s; }
.orb-c { width: 420px; height: 420px; left: 34%; bottom: -200px; background: rgba(192, 48, 111, .35); animation-duration: 26s; animation-delay: -13s; }
@keyframes drift { 0%, 100% { transform: translate(0, 0) scale(1); } 33% { transform: translate(50px, -36px) scale(1.08); } 66% { transform: translate(-36px, 30px) scale(.94); } }

.home-nav { position: relative; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.home-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 800 19px/1 var(--head); letter-spacing: -.01em; }
.home-brand img { width: 44px; height: 44px; border-radius: 50%; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
.home-links { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); backdrop-filter: blur(10px); }
.home-links a { padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; color: rgba(255, 255, 255, .8); }
.home-links a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
@media (max-width: 460px) { .home-links a:not(.link-progress) { display: none; } }
.home-links .link-progress { color: var(--lime); }

/* hero: headline + the two paths */
.hero3 { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 0 56px; text-align: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); font-size: 13.5px; font-weight: 600; color: rgba(255, 255, 255, .88);
}
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 0 rgba(231, 253, 84, .6); animation: pulse 2.2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(231, 253, 84, 0); } 100% { box-shadow: 0 0 0 0 rgba(231, 253, 84, 0); } }
.hero-title { max-width: 960px; margin: 22px 0 0; font: 800 clamp(40px, 7vw, 78px)/1.02 var(--head); letter-spacing: -.045em; text-wrap: balance; }
.hero-title mark {
  background: none; color: var(--lime); padding-bottom: .06em;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 9 C 40 3, 80 3, 110 6 S 170 10, 198 4' fill='none' stroke='%23e7fd54' stroke-width='3' stroke-linecap='round' opacity='.55'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 0 100%; background-size: 100% .2em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.hero-sub { max-width: 620px; margin: 20px auto 0; font-size: clamp(16px, 2.1vw, 18px); line-height: 1.65; color: rgba(255, 255, 255, .7); text-wrap: pretty; }

.paths2 { display: grid; gap: 16px; width: 100%; max-width: 980px; margin-top: 40px; }
@media (min-width: 760px) { .paths2 { grid-template-columns: 1fr 1fr; gap: 20px; } }
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.path-btn {
  --glow: #e7fd54;
  position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 16px 18px 16px 16px; border-radius: 28px; text-align: left; text-decoration: none; color: #fff;
  background: linear-gradient(135deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 255, 255, .12);
  backdrop-filter: blur(14px); box-shadow: 0 24px 50px rgba(5, 0, 20, .45);
  animation: pathIn .8s cubic-bezier(.2, .8, .2, 1) both; transition: transform .25s ease, box-shadow .25s, background .25s;
}
.path-movie { --glow: #ff9a6c; animation-delay: .12s; }
@keyframes pathIn { from { opacity: 0; transform: translateY(26px) scale(.98); } }
/* a light that runs around the border */
.path-btn::before {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--a), transparent 0deg 250deg, var(--glow) 305deg, #fff 322deg, var(--glow) 338deg, transparent 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: spinA 4.5s linear infinite;
}
.path-movie::before { animation-delay: -2.25s; }
@keyframes spinA { to { --a: 360deg; } }
.path-btn:hover {
  transform: translateY(-4px);
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .05));
  box-shadow: 0 30px 60px rgba(5, 0, 20, .55), 0 0 46px -12px var(--glow);
}
.path-btn:active { transform: scale(.99); }
.path-art { flex: none; width: 92px; height: 92px; border-radius: 22px; overflow: hidden; box-shadow: 0 12px 26px rgba(5, 0, 20, .45); transition: transform .35s cubic-bezier(.2, 1.4, .4, 1); }
.path-art svg { display: block; width: 100%; height: 100%; }
.path-btn:hover .path-art { transform: rotate(-5deg) scale(1.06); }
.art-disc { transform-origin: 60px 62px; animation: discSpin 9s linear infinite; }
.path-music:hover .art-disc { animation-duration: 2.2s; }
@keyframes discSpin { to { transform: rotate(360deg); } }
.art-note { transform-origin: 80px 50px; animation: noteBob 2.6s ease-in-out infinite; }
@keyframes noteBob { 50% { transform: translateY(-5px) rotate(-6deg); } }
.art-clap { transform-origin: 22px 50px; animation: clap 3.4s ease-in-out infinite; }
.path-movie:hover .art-clap { animation-duration: 1.1s; }
@keyframes clap { 0%, 68%, 100% { transform: rotate(0); } 76% { transform: rotate(-18deg); } 84% { transform: rotate(0); } }
.art-ring { transform-origin: 60px 75px; animation: ring 2s ease-out infinite; }
@keyframes ring { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
.path-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.path-kicker { font: 800 11px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--glow); }
.path-name { font: 800 clamp(28px, 3.4vw, 36px)/1 var(--head); letter-spacing: -.035em; }
.path-desc { font-size: 14px; line-height: 1.35; color: rgba(255, 255, 255, .72); }
.path-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; margin-top: 4px; font-size: 12.5px; font-weight: 600; color: rgba(255, 255, 255, .55); }
.path-done { display: inline-flex; color: #7ef0ad; }
.path-done .ic { width: 13px; height: 13px; }
.path-go { flex: none; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--glow); color: #14032f; box-shadow: 0 10px 24px -6px var(--glow); transition: transform .25s; }
.path-go .ic { width: 20px; height: 20px; }
.path-btn:hover .path-go { transform: translateX(4px); }
@media (max-width: 480px) {
  .path-btn { gap: 14px; padding: 13px 14px 13px 13px; border-radius: 24px; }
  .path-art { width: 74px; height: 74px; border-radius: 18px; }
  .path-go { width: 40px; height: 40px; }
  .path-desc { display: none; }
}
.hero-chips { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 28px 0 0; padding: 0; animation: pathIn .8s .24s cubic-bezier(.2, .8, .2, 1) both; }
.hero-chips li { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .75); }
.hero-chips .ic { width: 15px; height: 15px; color: var(--lime); }
@media (prefers-reduced-motion: reduce) {
  .orb, .pill-dot, .path-btn, .path-btn::before, .art-disc, .art-note, .art-clap, .art-ring, .hero-chips { animation: none; }
}

.home-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 20px 0 10px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; color: rgba(255, 255, 255, .5); }
.home-foot-brand { display: inline-flex; align-items: center; gap: 10px; }
.home-foot-brand img { width: 28px; height: 28px; border-radius: 50%; }
@media (max-width: 560px) { .home-foot { justify-content: center; text-align: center; } }

/* ---------- catalog ---------- */
.page-head { display: flex; align-items: center; gap: 14px; padding: 10px 0 6px; }
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.page-title { margin: 0; font: 800 clamp(30px, 7vw, 42px)/1.05 var(--head); letter-spacing: -.02em; }
.back { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); border: 1.5px solid var(--line); text-decoration: none; font-size: 20px; }
.filters {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 6px; padding: 12px var(--gutter); background: var(--bg);
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 700; font-size: 14.5px;
}
.filter-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--surface-2); font-size: 11.5px; color: var(--muted); }
.filter[aria-current="true"] { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.filter[aria-current="true"] .filter-n { background: var(--lime); color: var(--indigo); }

.cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(30, 5, 71, .07); }
.card-cover { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--indigo); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; }
.card-cover.music img { object-fit: contain; }
.card-badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; align-items: center; }
.card-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.card-kicker { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.card-title { margin: 0; font: 800 20px/1.2 var(--head); letter-spacing: -.01em; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card-reason { flex: 1; margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.empty { text-align: center; padding: 40px 20px; margin: 8px 0; border: 2px dashed var(--line); border-radius: var(--radius); background: var(--surface); }
.empty-icon { font-size: 34px; }
.empty h3 { margin: 8px 0 6px; font: 800 20px/1.25 var(--head); }
.empty p { margin: 0 auto 16px; max-width: 380px; color: var(--muted); }

/* ---------- lesson (dark) ---------- */
.lesson { max-width: 820px; margin: 0 auto; }
.lesson-head { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.lesson-head .back { background: var(--surface); border-color: var(--line); }
.lesson-titles { flex: 1; min-width: 0; }
.lesson-kicker { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-title { margin: 0; font: 700 17px/1.25 var(--head); }

.player-host { position: sticky; top: 0; z-index: 10; background: var(--bg); margin: 0 calc(var(--gutter) * -1); }
@media (min-width: 760px) { .player-host { position: static; margin: 0; } }
.pc-frame { position: relative; aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
@media (min-width: 760px) { .pc-frame { border-radius: 16px; } }
.pc-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.pc-overlay { position: absolute; inset: 0; border: 0; background: transparent; }
.pc-overlay::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  border-radius: 50%; background: var(--lime); transition: opacity .2s, transform .2s;
}
.pc-overlay::before {
  content: ''; position: absolute; z-index: 1; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -11px;
  background: var(--indigo); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 4.8v14.4a.8.8 0 0 0 1.2.7l11.4-7.2a.8.8 0 0 0 0-1.4L8.7 4.1a.8.8 0 0 0-1.2.7Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 4.8v14.4a.8.8 0 0 0 1.2.7l11.4-7.2a.8.8 0 0 0 0-1.4L8.7 4.1a.8.8 0 0 0-1.2.7Z'/%3E%3C/svg%3E") center / contain no-repeat; transition: opacity .2s;
}
.is-playing .pc-overlay::before { opacity: 0; }
.is-playing .pc-overlay::after { opacity: 0; transform: scale(.8); }
.pc-status { position: absolute; left: 10px; right: 10px; bottom: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(0, 0, 0, .78); color: #fff; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.pc-status.show { opacity: 1; }
.pc-status.error { background: rgba(150, 30, 30, .94); }
.pc-controls { display: flex; align-items: center; gap: 12px; padding: 8px var(--gutter) 10px; }
@media (min-width: 760px) { .player-video .pc-controls { padding: 10px 2px; } }
.pc-play { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--lime); color: var(--indigo); display: grid; place-items: center; font-size: 15px; }
.pc-play::before { content: ''; width: 17px; height: 17px; margin-left: 2px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 4.8v14.4a.8.8 0 0 0 1.2.7l11.4-7.2a.8.8 0 0 0 0-1.4L8.7 4.1a.8.8 0 0 0-1.2.7Z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.5 4.8v14.4a.8.8 0 0 0 1.2.7l11.4-7.2a.8.8 0 0 0 0-1.4L8.7 4.1a.8.8 0 0 0-1.2.7Z'/%3E%3C/svg%3E") center / contain no-repeat; }
.is-playing .pc-play::before { margin-left: 0; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='4.5' width='4' height='15' rx='1.2'/%3E%3Crect x='14' y='4.5' width='4' height='15' rx='1.2'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='4.5' width='4' height='15' rx='1.2'/%3E%3Crect x='14' y='4.5' width='4' height='15' rx='1.2'/%3E%3C/svg%3E"); }
.pc-time { flex: none; min-width: 84px; text-align: right; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-seek { flex: 1; min-width: 0; height: 30px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; }
.pc-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--lime) var(--p, 0%), var(--line) var(--p, 0%)); }
.pc-seek::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--lime) var(--p, 0%), var(--line) var(--p, 0%)); }
.pc-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%; background: #fff; }
.pc-seek::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: #fff; }

.player-audio { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; padding: 10px var(--gutter) 12px; background: linear-gradient(180deg, #1d0d44, var(--bg)); }
@media (min-width: 760px) { .player-audio { grid-template-columns: 140px 1fr; padding: 16px; border-radius: 18px; } }
.pc-art { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.pc-main { position: relative; min-width: 0; }
.pc-title { font: 700 17px/1.2 var(--head); }
.pc-sub { font-size: 13px; color: var(--muted); }
.player-audio .pc-controls { padding: 6px 0 0; }
.player-audio .pc-status { position: static; margin-top: 6px; }
.player-audio .pc-status:not(.show) { display: none; }

.exercise { padding: 4px 0 8px; }
.mode-title { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 8px; font: 800 13px/1 var(--head); letter-spacing: .1em; text-transform: uppercase; color: var(--lime); }
.mode-title .muted { font: 600 13px/1 var(--sans); letter-spacing: 0; text-transform: none; }
.hint { margin: 8px 0 14px; font-size: 14px; color: var(--muted); }
.hint.center { text-align: center; }

/* sentence + inline blanks */
.sentence { line-height: 2.2; }
.blank-wrap { position: relative; display: inline-flex; vertical-align: baseline; margin: 0 2px; }
.blank {
  min-width: 3ch; max-width: 100%; height: 1.85em; padding: 2px 6px; border: 0; border-bottom: 2px solid var(--muted);
  border-radius: 7px 7px 2px 2px; background: rgba(255, 255, 255, .08); color: var(--ink); font: 600 1em/1 var(--sans); text-align: center;
}
.blank:focus { outline: none; border-bottom-color: var(--lime); background: rgba(231, 253, 84, .14); }
.blank.ok { border-bottom-color: var(--ok); background: rgba(95, 219, 148, .16); }
.blank.bad { border-bottom-color: var(--bad); background: rgba(255, 127, 127, .14); }
.fix { position: absolute; top: calc(100% - 4px); left: 0; right: 0; text-align: center; font-size: 11.5px; line-height: 1.2; font-weight: 700; color: var(--ok); white-space: nowrap; }

/* sentence-by-sentence dictation */
.sm-head { display: flex; justify-content: space-between; align-items: center; }
.sm-counter { font-weight: 700; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.sm-progress { height: 4px; margin: 6px 0 10px; border-radius: 4px; background: var(--line); overflow: hidden; }
.sm-progress span { display: block; height: 100%; background: var(--lime); transition: width .3s; }
.sm-card { padding: 14px 16px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.sm-context { min-height: 1.3em; font-size: 14px; font-style: italic; color: var(--muted); }
.sm-sentence { font-size: clamp(19px, 5vw, 23px); font-weight: 500; overflow-wrap: anywhere; }
.sm-status { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.sm-status[data-state="paused"] { color: var(--lime); }
.sm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.sm-actions .btn.primary { grid-column: 1 / -1; order: -1; }
@media (min-width: 560px) { .sm-actions { grid-template-columns: auto auto 1fr; } .sm-actions .btn.primary { grid-column: auto; order: 0; } }

/* results */
.result-slot:empty { display: none; }
.result-slot { margin-top: 14px; }
.score { display: grid; grid-template-columns: auto 1fr; grid-template-areas: 'num text' 'btn btn'; gap: 10px 14px; align-items: center; padding: 16px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); }
@media (min-width: 520px) { .score { grid-template-columns: auto 1fr auto; grid-template-areas: 'num text btn'; } }
.score-num { grid-area: num; font: 800 34px/1 var(--head); font-variant-numeric: tabular-nums; }
.score-text { grid-area: text; display: flex; flex-direction: column; font-size: 14px; color: var(--ink-2); }
.score-text strong { font-size: 16px; color: var(--ink); }
.score .btn { grid-area: btn; }
.score.pass { border-color: var(--ok); } .score.pass .score-num { color: var(--ok); }
.score.fail .score-num { color: var(--bad); }
.review { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.review li { border-left: 3px solid var(--bad); border-radius: 4px; background: var(--surface); }
.review li.ok { border-left-color: var(--ok); }
.review-jump { width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; font-size: 14px; color: var(--ink-2); }

/* karaoke */
.ly-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.ly-head .btn.icon { background: var(--surface); border: 1px solid var(--line); }
.ly-label { font-size: 13px; font-weight: 600; color: var(--muted); text-align: center; }
.lyrics { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); }
.ly-line { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: start; padding: 4px 8px; border-radius: 12px; color: var(--muted); transition: background .25s, color .25s, opacity .25s; }
.ly-line.sung { opacity: .55; }
.ly-line.active { background: rgba(255, 255, 255, .07); color: #fff; }
.ly-num { margin-top: 10px; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; font-weight: 700; }
.ly-line.active .ly-num { border-color: var(--lime); color: var(--lime); }
.ly-text { position: relative; padding-bottom: 8px; font-size: clamp(17px, 4.7vw, 21px); font-weight: 500; overflow-wrap: anywhere; }
.ly-track { position: absolute; left: 0; right: 0; bottom: 3px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .1); opacity: 0; transition: opacity .2s; }
.ly-track::before { content: ''; position: absolute; inset: 0; border-radius: 3px; background: rgba(255, 255, 255, .5); transform-origin: left; transform: scaleX(var(--p, 0)); }
.ly-marker { position: absolute; inset: 0; will-change: transform; }
.ly-marker::before { content: ''; position: absolute; left: -6px; top: -4.5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .18), 0 0 14px rgba(255, 255, 255, .85); }
.ly-line.active .ly-track { opacity: 1; }

/* karaoke helpers: speed, block repeat, easy mode */
.ly-settings { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 10px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.seg-group { display: inline-flex; align-items: center; gap: 4px; }
.seg-label { margin-right: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.seg { min-width: 52px; min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.seg[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--indigo); }
.switches { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.switch { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0; border: 0; background: none; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.switch-knob { position: relative; flex: none; width: 36px; height: 22px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); transition: background .2s; }
.switch-knob::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform .2s, background .2s; }
.switch[aria-checked="true"] .switch-knob { background: var(--lime); border-color: var(--lime); }
.switch[aria-checked="true"] .switch-knob::after { transform: translateX(14px); background: var(--indigo); }
.ly-notice { display: none; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: rgba(231, 253, 84, .1); border: 1px solid rgba(231, 253, 84, .35); font-size: 14px; color: var(--ink); }
.ly-notice.show { display: flex; }
.ly-notice > span { flex: 1 1 200px; }
.ly-notice b { color: var(--lime); }

.attribution { margin: 26px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--muted); }
.attribution a { color: var(--ink-2); }

/* ---------- progress ---------- */
.card { position: relative; }
.card.is-done { border-color: color-mix(in srgb, var(--ok) 55%, var(--line)); }
.done-flag { position: absolute; right: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; background: var(--ok); color: #fff; font-size: 12.5px; font-weight: 700; }
.score-link { margin-top: 4px; font-weight: 700; color: var(--ok); text-decoration: none; }
.notice { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: #fff5d6; border: 1px solid #f0d27a; font-size: 14px; }
.center { margin: 22px 0; text-align: center; }
.page-sub { margin: 4px 0 16px; max-width: 680px; color: var(--ink-2); font-size: 15px; }
.prog-summary { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--indigo); color: #fff; }
.prog-summary > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.prog-summary strong { font: 800 18px/1.25 var(--head); }
.prog-summary .muted { color: rgba(255, 255, 255, .7); font-size: 14px; }
.prog-ring {
  flex: none; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--lime) calc(var(--pct) * 1%), rgba(255, 255, 255, .14) 0);
}
.prog-ring span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--indigo); font: 800 16px/1 var(--head); }
.prog-card { margin-bottom: 16px; padding: 4px 16px 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(30, 5, 71, .06); }
.prog-head { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 0 8px; }
.prog-head h2 { margin: 0; font: 800 22px/1.2 var(--head); }
.prog-row { display: grid; grid-template-columns: 44px 1fr 56px; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; }
a.prog-row:hover .prog-bar { outline: 2px solid var(--surface-2); }
.prog-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.prog-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--indigo), #6a3fd6); transition: width .5s ease; }
.prog-count { margin-top: 4px; font-size: 13px; color: var(--muted); }
.prog-num { text-align: right; font: 800 18px/1 var(--head); }
.prog-empty { font-size: 14px; font-style: italic; color: var(--muted); }
.prog-row.is-empty .prog-num { color: var(--muted); }

/* ---------- YouTube player ---------- */
.pc-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pc-status.error { pointer-events: auto; }
.pc-status a { color: var(--lime); font-weight: 700; }
.player-yt .pc-status:not(.show) { display: none; }
.card-cover.youtube img { object-fit: cover; }
.chip.draft { background: #fff1c7; color: #6b4b00; }
.grow { flex: 1; min-width: 0; }
.add-song { flex: none; }
@media (max-width: 480px) { .add-song { padding: 6px 12px; font-size: 13px; } }
.center-row { justify-content: center; }

/* ---------- studio ---------- */
.studio-grid { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: start; padding-bottom: 40px; }
@media (min-width: 960px) { .studio-grid { grid-template-columns: minmax(360px, 440px) 1fr; } }
.studio-side { position: sticky; top: 0; z-index: 8; background: var(--bg); padding-top: 4px; }
@media (min-width: 960px) { .studio-side { top: 12px; } }
.studio-player-host { border-radius: 16px; overflow: hidden; background: var(--indigo); color: #fff; }
.studio-player-host .pc-controls { background: var(--indigo); }
.studio-player-host .pc-time { color: rgba(255, 255, 255, .7); }
.studio-player-host .pc-play { background: var(--lime); color: var(--indigo); }
.studio-player-host .pc-seek::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--lime) var(--p, 0%), rgba(255, 255, 255, .2) var(--p, 0%)); }
.studio-player-empty { aspect-ratio: 16 / 9; display: grid; place-items: center; font-weight: 700; color: rgba(255, 255, 255, .6); }
.studio-msg { display: none; margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-size: 14px; background: var(--surface); border: 1px solid var(--line); }
.studio-msg.show { display: block; }
.studio-msg[data-kind="ok"] { background: #e8f7ee; border-color: #9bd8b3; color: #155c34; }
.studio-msg[data-kind="error"] { background: #fdecec; border-color: #f2a7a7; color: #8a1f1f; }
.studio-steps { display: grid; gap: 16px; min-width: 0; }
.studio-step { padding: 16px 18px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(30, 5, 71, .05); min-width: 0; }
.studio-step h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 800 18px/1.2 var(--head); }
.step-badge { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--indigo); color: var(--lime); font-size: 14px; }
.lbl { display: block; margin: 10px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.fld { display: block; min-width: 0; }
.field { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font: 500 15px/1.4 var(--sans); color: var(--ink); }
.field:focus { outline: none; border-color: var(--indigo); }
textarea.field { resize: vertical; }
.lyrics-in { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.form-grid { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.row .field { flex: 1; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.hint.light { color: var(--muted); margin: 0 0 10px; }
.suggest { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.suggest-item { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; text-align: left; }
.suggest-item:hover { border-color: var(--indigo); }
.suggest-text { display: flex; flex-direction: column; line-height: 1.2; }
.suggest-text strong { font-size: 14px; }
.suggest-text small { font-size: 12px; color: var(--muted); }

.sync-box { display: grid; gap: 6px; padding: 16px; border-radius: 16px; background: var(--indigo); color: #fff; text-align: center; }
.sync-count { font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .6); letter-spacing: .04em; }
.sync-now { min-height: 1.4em; font: 700 clamp(18px, 3vw, 22px)/1.35 var(--head); }
.sync-next { min-height: 1.3em; font-size: 14px; color: rgba(255, 255, 255, .55); }
.hold-btn {
  margin-top: 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 16px; border: 0; border-radius: 14px;
  background: var(--lime); color: var(--indigo); touch-action: none; user-select: none; -webkit-user-select: none; transition: transform .08s, box-shadow .08s;
}
.hold-btn strong { font: 800 18px/1.2 var(--head); }
.hold-btn span { font-size: 13px; font-weight: 600; opacity: .75; }
.hold-btn.is-holding { transform: scale(.98); box-shadow: 0 0 0 6px rgba(231, 253, 84, .35); background: #f4ff9e; }
.times summary { cursor: pointer; margin-top: 12px; font-weight: 700; font-size: 14px; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.times-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.times-table th, .times-table td { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; }
.times-table tr.is-cur { background: #f5f2ff; }
.t-text { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time-in { width: 84px; min-height: 34px; padding: 4px 6px; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; }
.sm-icon { width: 34px; min-height: 34px; font-size: 13px; }

.blank-editor { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; padding: 4px; }
.be-line { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; }
.be-num { margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; }
.be-words { display: flex; flex-wrap: wrap; gap: 4px; }
.word { padding: 5px 8px; border-radius: 8px; border: 1.5px solid var(--line); background: #fff; font-size: 14.5px; }
.word:hover { border-color: var(--indigo); }
.word[aria-pressed="true"] { background: var(--indigo); border-color: var(--indigo); color: var(--lime); font-weight: 700; }

.lib-title { margin: 20px 0 8px; font: 800 16px/1.2 var(--head); }
.lib-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lib-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
.lib-name { flex: 1 1 160px; display: flex; flex-direction: column; line-height: 1.25; }
.lib-name small { color: var(--muted); }
.btn.danger { color: var(--bad); }

/* studio: media source switch */
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 8px; border-radius: 14px; background: var(--surface-2); }
.mode-seg { min-height: 42px; border: 0; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.mode-seg[aria-pressed="true"] { background: var(--indigo); color: var(--lime); }
.mode-panel[hidden] { display: none; }
.file-info { font-size: 14px; overflow-wrap: anywhere; }
.lib-path { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px !important; overflow-wrap: anywhere; }
.studio-player-host .player-audio { background: var(--indigo); border-radius: 0; }
.studio-player-host .pc-title { color: #fff; }

/* studio: automatic timing + review */
.auto-box { margin-bottom: 14px; padding: 14px; border-radius: 14px; background: #f3f0ff; border: 1.5px dashed #c9bdf2; }
.auto-box .row { margin-top: 0; }
.auto-box .hint { margin: 8px 0 0; }
.auto-btn { min-height: 46px; }
.auto-info { font-size: 13px; }
.row-gap { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.times-table tr.is-weak { background: #fff6e0; }
.warn { display: inline-flex; align-items: center; gap: 6px; color: #8a5a00; font-weight: 700; white-space: nowrap; }
.warn .btn { min-height: 28px; padding: 2px 10px; }
.ok-mark { color: var(--ok); font-weight: 800; }

/* studio: lesson type tabs + scene cutting */
.studio-tabs { display: inline-flex; gap: 4px; padding: 4px; margin: 4px 0 10px; border-radius: 14px; background: var(--surface-2); }
.studio-tabs a { padding: 9px 16px; border-radius: 10px; text-decoration: none; font-weight: 700; font-size: 14.5px; color: var(--ink-2); }
.studio-tabs a[aria-current="true"] { background: var(--indigo); color: var(--lime); }
.trim-box { margin: 10px 0 6px; padding: 14px; border-radius: 14px; background: #f3f0ff; border: 1.5px dashed #c9bdf2; }
.trim-box[hidden] { display: none; }
.trim-box .hint { margin: 6px 0 4px; }
.trim-fld { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.trim-info { font-size: 13.5px; }

.lib-path.warn-text { color: #8a5a00; }

/* lesson: exercise type switch + 🎯 choice mode */
.ex-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 14px 0 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ex-mode { min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; font-size: 15px; }
.ex-mode[aria-pressed="true"] { background: var(--lime); color: var(--indigo); }
.choice-sentence { line-height: 2.2; }
.slot { display: inline-block; text-align: center; padding: 0 6px; margin: 0 2px; border-bottom: 2px solid var(--muted); border-radius: 6px 6px 2px 2px; background: rgba(255, 255, 255, .06); font-weight: 700; line-height: 1.6; }
.slot.active { border-bottom-color: var(--lime); background: rgba(231, 253, 84, .14); animation: slotPulse 1.4s ease-in-out infinite; }
.slot.ok { border-bottom-color: var(--ok); background: rgba(95, 219, 148, .18); color: var(--ok); }
.slot.bad { border-bottom-color: var(--bad); background: rgba(255, 127, 127, .16); color: var(--bad); text-decoration: line-through; }
.slot-wrap { position: relative; display: inline-block; }
@keyframes slotPulse { 50% { background: rgba(231, 253, 84, .28); } }
@media (prefers-reduced-motion: reduce) { .slot.active { animation: none; } }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.opts[hidden] { display: none; }
.opt { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 17px; font-weight: 600; text-align: left; transition: border-color .15s, background .15s, opacity .15s; }
.opt:hover:not(:disabled) { border-color: var(--lime); }
.opt:disabled { cursor: default; }
.opt-key { flex: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; background: rgba(255, 255, 255, .08); color: var(--muted); font-size: 12px; font-weight: 800; }
.opt.right { border-color: var(--ok); background: rgba(95, 219, 148, .18); }
.opt.wrong { border-color: var(--bad); background: rgba(255, 127, 127, .16); }
.opt.dim { opacity: .45; }
.sm-status[data-state="answered"] { color: var(--ok); }
.sm-status[data-state="answered"][data-ok="false"] { color: var(--bad); }

/* karaoke: 🎯 choice mode */
.ly-choice { margin-top: 10px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ly-choice[hidden] { display: none; }
.ly-choice-label { font-size: 13.5px; font-weight: 700; color: var(--muted); }
.ly-choice .opts { margin-top: 8px; }
.ly-choice .opts:empty { display: none; }
button.slot { font: inherit; font-weight: 700; color: inherit; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
button.slot:disabled { cursor: default; opacity: 1; }
.ly-line .slot { color: #fff; }
.ly-line .slot.ok { color: var(--ok); }
.ly-line .slot.bad { color: var(--bad); }

/* lesson: 🔍 spot the wrong word */
.ex-modes { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
@media (max-width: 400px) { .ex-mode { font-size: 13.5px; padding: 0 4px; } }
.spot-sentence { line-height: 2.3; }
.tap { font: inherit; color: inherit; padding: 2px 6px; margin: 0 -2px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; transition: background .15s; }
.tap:hover:not(:disabled) { background: rgba(255, 255, 255, .1); }
.tap:disabled { cursor: default; }
.tap.ok { background: rgba(95, 219, 148, .2); color: var(--ok); text-decoration: line-through; }
.tap.bad { background: rgba(255, 127, 127, .18); color: var(--bad); }
.tap.changed { background: rgba(231, 253, 84, .22); color: var(--lime); text-decoration: line-through; }
.none-btn { width: 100%; margin-top: 6px; }
.none-btn.right { border-color: var(--ok); color: var(--ok); background: rgba(95, 219, 148, .14); }
.none-btn.wrong, .none-btn.missed { border-color: var(--bad); color: var(--bad); }
.none-btn:disabled { opacity: 1; cursor: default; }
.spot-note { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.opts:has(.none-btn) { display: block; }

/* karaoke: 🔍 spot mode */
.ly-line .tap { color: inherit; }
.ly-line.active .tap:not(:disabled) { color: #fff; }
.ly-line .tap.ok { color: var(--ok); }
.ly-line .tap.bad { color: var(--bad); }
.ly-line .tap.changed { color: var(--lime); }
.spot-badge { margin-left: 4px; font-size: .8em; opacity: .7; }
.ly-line .tap { padding: 2px 3px; margin: 0 -1px; }

/* lesson: 🧩 build the sentence */
@media (max-width: 460px) { .ex-modes { grid-template-columns: 1fr 1fr; } }
.order-line { display: flex; flex-wrap: wrap; gap: 6px 8px; line-height: 1.5; min-height: 2em; }
.order-word { color: var(--ink); animation: popIn .18s ease-out; }
.order-gap { display: inline-block; border-bottom: 2px dashed var(--line); height: 1.3em; }
.order-line.ok .order-word { color: var(--ok); }
.order-line.bad .order-word { color: var(--ink); }
@keyframes popIn { from { transform: translateY(4px); opacity: 0; } }
.chip-bank { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-word, .chip-used { min-height: 44px; padding: 8px 14px; border-radius: 12px; font-size: 17px; font-weight: 600; }
.chip-word { border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); }
.chip-word:hover:not(:disabled) { border-color: var(--lime); }
.chip-word:disabled { opacity: .5; cursor: default; }
.chip-used { border: 1.5px dashed var(--line); color: transparent; user-select: none; }
.chip-word.shake { animation: shake .35s; border-color: var(--bad); background: rgba(255, 127, 127, .16); }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) { .chip-word.shake, .order-word { animation: none; } }
.order-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.order-mistakes { color: var(--bad); font-weight: 700; }
.opts:has(.chip-bank) { display: block; }

/* The hidden attribute must always win over display rules on .btn etc. */
[hidden] { display: none !important; }
.order-line.building { outline: 2px dashed rgba(231, 253, 84, .55); outline-offset: 4px; border-radius: 6px; }
.ly-line .order-line[role="button"] { cursor: pointer; }
.ly-line .order-word { color: inherit; }
.ly-line .order-line.ok .order-word { color: var(--ok); }
.ly-line .order-line.bad .order-word { color: var(--bad); }
.ly-line.sung:has(.order-line.ok, .order-line.bad, .tap.ok, .tap.bad, .tap.changed, .slot.ok, .slot.bad, .blank.ok, .blank.bad) { opacity: .95; }

/* 📒 audio cards */
.top-links { display: flex; gap: 6px; }
@media (max-width: 420px) { .top-link { padding: 7px 10px; font-size: 13px; } }
.home-links .link-cards { position: relative; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--lime); color: var(--indigo); font-size: 12px; font-weight: 800; }
.cards-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: rgba(231, 253, 84, .1); border: 1px solid rgba(231, 253, 84, .35); font-size: 14px; }
.cards-note a { color: var(--lime); font-weight: 700; }
.cards-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; padding: 18px; border-radius: var(--radius); background: var(--indigo); color: #fff; }
.cards-stats { display: flex; gap: 22px; }
.cards-stats div { display: flex; flex-direction: column; }
.cards-stats strong { font: 800 28px/1 var(--head); color: var(--lime); }
.cards-stats span { font-size: 13px; color: rgba(255, 255, 255, .75); }
.cards-start { background: var(--lime); color: var(--indigo); }
.cards-done { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cards-done p { margin: 0; font-weight: 700; }
.cards-done .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.card-group h2 { margin: 18px 0 8px; font: 800 18px/1.2 var(--head); }
.card-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card-list li { display: grid; grid-template-columns: minmax(90px, auto) 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
@media (max-width: 520px) { .card-list li { grid-template-columns: 1fr auto; } .card-word { grid-column: 1 / -1; } }
.card-word { font: 800 18px/1.2 var(--head); color: var(--indigo); }
.card-sent { font-size: 14.5px; color: var(--ink-2); }
.card-sent mark { background: #f1ffb0; color: var(--indigo); font-weight: 700; padding: 0 3px; border-radius: 4px; }
.card-meta { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.card-boxes { display: flex; gap: 3px; margin-top: 6px; }
.card-boxes span { width: 16px; height: 5px; border-radius: 3px; background: var(--surface-2); }
.card-boxes span.on { background: var(--ok); }
.card-del { background: transparent; border: 1px solid var(--line); font-size: 14px; }
.card-source { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.cards-actions { grid-template-columns: 1fr 2fr; }
.prog-cards { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.prog-cards > div { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.prog-cards strong { font: 800 17px/1.2 var(--head); }
.prog-cards .muted { font-size: 13.5px; }
.prog-cards-icon { font-size: 28px; }
.prog-cards-go { font-size: 20px; color: var(--muted); }
@media (max-width: 460px) {
  .home-links a.link-cards, .home-links a.link-progress { display: inline-flex !important; align-items: center; }
  .home-links a.link-cat { display: none; }
  .home-links .lt { display: none; }
}
@media (max-width: 460px) { .top-links .lt { display: none; } .top-link { padding: 7px 12px; font-size: 16px; } }
.btn.primary.cards-start { background: var(--lime); color: var(--indigo); }
@media (max-width: 559px) { .cards-actions .btn.ghost { grid-column: 1 / -1; } }

/* 🎬 three-step lesson */
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 14px 0 4px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); counter-reset: none; }
.stage-btn { position: relative; min-height: 46px; padding: 6px 4px; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; }
.stage-btn + .stage-btn { border-left: 1px solid var(--line); }
.stage-btn[aria-current="true"] { background: var(--lime); color: var(--indigo); }
@media (max-width: 400px) { .stage-btn { font-size: 12.5px; } }
.stage { padding: 6px 0 8px; }
.stage-intro h2 { margin: 12px 0 4px; font: 800 18px/1.25 var(--head); color: var(--lime); }
.stage-intro p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; }
.gist { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.gist h3 { margin: 4px 0 10px; font: 700 17px/1.3 var(--head); }
.gist h3 + .rate { margin-bottom: 4px; }
.gist-opts { display: grid; gap: 8px; margin-bottom: 8px; }
.gist-why { margin: 6px 0 14px; font-size: 14.5px; color: var(--ink-2); }
.gist-why[data-ok="true"] { color: var(--ok); }
.gist-why[data-ok="false"] { color: var(--bad); }
.rate { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rate-btn { min-height: 44px; padding: 8px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 14px; }
.rate-btn[aria-pressed="true"] { border-color: var(--lime); background: rgba(231, 253, 84, .16); color: var(--lime); }
.light-on-dark { color: var(--muted); font-size: 13px; margin: 10px 0 14px; }
.transcript { list-style: none; margin: 12px 0 0; padding: 6px; display: grid; gap: 4px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.transcript li { padding: 10px 12px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.transcript li:hover { background: rgba(255, 255, 255, .05); }
.transcript li.active { background: rgba(231, 253, 84, .12); box-shadow: inset 3px 0 0 var(--lime); }
.tr-en { font-size: 17px; font-weight: 500; color: var(--ink); }
.tr-en mark { background: rgba(231, 253, 84, .22); color: var(--lime); padding: 0 3px; border-radius: 4px; }
.tr-uz { margin-top: 2px; font-size: 14.5px; color: var(--muted); }
.transcript.no-uz .tr-uz { display: none; }
.rate-compare { margin: 10px 0 12px; font-weight: 700; color: var(--lime); min-height: 1em; }
.rate-compare:empty { display: none; }

/* 🔥 points, streak, daily goal */
.xp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap; }
.xp-pill .xp-fire { filter: grayscale(1); opacity: .6; }
.xp-pill .xp-fire.on { filter: none; opacity: 1; }
.xp-pill .xp-sep { color: var(--muted); }
.home-links .xp-pill.on-dark { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; padding: 6px 12px; }
.xp-pill.in-lesson { padding: 5px 10px; font-size: 13px; background: var(--surface); border-color: var(--line); color: var(--ink); }
@media (max-width: 460px) { .xp-pill .xp-sep, .xp-pill .xp-today { display: none; } .xp-pill.in-lesson { display: none; } }
.xp-pop { position: fixed; left: 50%; top: 18px; z-index: 80; transform: translate(-50%, -10px); padding: 8px 16px; border-radius: 999px; background: var(--lime); color: var(--indigo); font: 800 16px/1 var(--head); box-shadow: 0 10px 30px rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; }
.xp-pop.show { animation: xpPop 1.4s ease forwards; }
@keyframes xpPop { 0% { opacity: 0; transform: translate(-50%, -10px) scale(.9); } 15% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 25% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -6px); } }
@media (prefers-reduced-motion: reduce) { .xp-pop.show { animation: none; opacity: 1; } }
.xp-celebrate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(10, 2, 30, .6); backdrop-filter: blur(4px); }
.xp-card { width: min(360px, 100%); padding: 26px 22px 22px; border-radius: 24px; background: var(--indigo); color: #fff; text-align: center; box-shadow: 0 30px 60px rgba(0, 0, 0, .4); animation: popIn .25s ease-out; }
.xp-card .xp-big { font-size: 54px; line-height: 1; }
.xp-card h2 { margin: 10px 0 6px; font: 800 22px/1.2 var(--head); color: var(--lime); }
.xp-card p { margin: 4px 0; }
.xp-card .muted { color: rgba(255, 255, 255, .7); font-size: 14px; }
.xp-streak { margin: 12px 0 6px; font-size: 18px; }
.xp-streak strong { font: 800 28px/1 var(--head); color: var(--lime); }
.xp-card .btn.primary { margin-top: 14px; background: var(--lime); color: var(--indigo); }
.xp-card-big { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; margin-bottom: 16px; padding: 18px; border-radius: var(--radius); background: var(--indigo); color: #fff; }
@media (max-width: 560px) { .xp-card-big { grid-template-columns: 1fr; justify-items: start; } }
.xp-ring { width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--lime) calc(var(--pct) * 1%), rgba(255, 255, 255, .14) 0); }
.xp-ring > span { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; align-content: center; background: var(--indigo); }
.xp-ring strong { font: 800 26px/1 var(--head); color: var(--lime); }
.xp-ring small { font-size: 12px; color: rgba(255, 255, 255, .7); }
.xp-main { min-width: 0; width: 100%; }
.xp-main h2 { margin: 2px 0 2px; font: 800 20px/1.2 var(--head); }
.xp-main .muted { color: rgba(255, 255, 255, .72); margin: 0 0 12px; font-size: 14px; }
.xp-facts { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 14px; }
.xp-facts div { display: flex; flex-direction: column; }
.xp-facts strong { font: 800 18px/1.2 var(--head); }
.xp-facts span { font-size: 12.5px; color: rgba(255, 255, 255, .7); }
.xp-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; max-width: 360px; margin-bottom: 14px; }
.xp-day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.xp-bar { width: 100%; height: 56px; display: flex; align-items: flex-end; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.xp-bar span { display: block; width: 100%; min-height: 0; background: rgba(255, 255, 255, .45); border-radius: 6px 6px 0 0; }
.xp-bar span.met { background: var(--lime); }
.xp-day small { font-size: 11px; color: rgba(255, 255, 255, .7); }
.xp-goals { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.xp-goals .muted { margin: 0 4px 0 0; }
.xp-goals .seg { color: #fff; border-color: rgba(255, 255, 255, .2); }
.xp-goals .seg[aria-pressed="true"] { color: var(--indigo); }
@media (max-width: 460px) { .home-links a.xp-pill { display: inline-flex !important; } }

/* ============ Focus layout: the lesson fits one screen ============
   header → video (always visible) → step tabs → ONE scrolling area (exercise / text).
   Action buttons stay pinned at the bottom of that area. */
body:has(.lesson.focus) { height: 100dvh; overflow: hidden; padding-bottom: 0; }
body:has(.lesson.focus) main { padding-bottom: 0; }
.lesson.focus { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.lesson.focus > .lesson-head { flex: none; padding: 8px 0; }
.lesson.focus > .lesson-head .lesson-title { font-size: 16px; }
.lesson.focus > .player-host { flex: none; position: static; margin: 0 calc(var(--gutter) * -1); }
@media (min-width: 760px) { .lesson.focus > .player-host { margin: 0; } }
/* Video never takes more than ~40% of the screen; it stays centred. */
.lesson.focus .pc-frame { width: min(100%, calc(40dvh * 16 / 9)); margin: 0 auto; }
.lesson.focus .player-video .pc-controls { padding-top: 6px; padding-bottom: 6px; }
.lesson.focus .player-audio { grid-template-columns: 56px 1fr; gap: 12px; padding: 8px var(--gutter); }
@media (min-width: 760px) { .lesson.focus .player-audio { grid-template-columns: 72px 1fr; padding: 10px 14px; } }
.lesson.focus .pc-art { border-radius: 8px; }
.lesson.focus .pc-title { font-size: 15px; }
.lesson.focus > .stages { flex: none; margin: 8px 0 6px; }
.lesson.focus .stage-btn { min-height: 38px; font-size: 13px; }
.lesson-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 0 2px 10px; scroll-padding-bottom: 90px; }
.lesson.focus .attribution { margin-top: 18px; }

/* Compact exercise chrome so the text gets the space. */
.lesson.focus .ex-modes { display: flex; gap: 4px; margin: 4px 0 8px; overflow-x: auto; scrollbar-width: none; }
.lesson.focus .ex-modes::-webkit-scrollbar { display: none; }
.lesson.focus .ex-mode { flex: 1 0 auto; min-height: 36px; padding: 0 12px; font-size: 13.5px; white-space: nowrap; }
.lesson.focus .karaoke > .hint { display: none; }
.lesson.focus .ly-settings { padding: 6px 10px; margin-bottom: 8px; gap: 6px 10px; }
.lesson.focus .ly-settings .seg { min-width: 44px; min-height: 30px; font-size: 12.5px; }
.lesson.focus .ly-settings .switch { min-height: 30px; font-size: 12.5px; }
.lesson.focus .ly-head { margin-bottom: 6px; }
.lesson.focus .ly-head .btn.icon { width: 34px; min-height: 34px; font-size: 18px; }
.lesson.focus .stage-intro h2 { margin-top: 4px; }

/* Buttons that move the lesson forward are always reachable. */
.lesson.focus .sm-actions,
.lesson.focus .karaoke > .btn.primary.block,
.lesson.focus .cards-actions {
  position: sticky; bottom: 0; z-index: 3; margin: 10px 0 0; padding: 8px 0 4px;
  background: linear-gradient(to top, var(--bg) 80%, rgba(15, 6, 36, 0));
}
.lesson.focus .karaoke > .btn.primary.block { box-shadow: 0 -8px 16px var(--bg); }

/* Phones: while typing, shrink the video so the keyboard leaves room for the text. */
@media (max-width: 759px) {
  .lesson.focus:has(input.blank:focus) .pc-frame { width: min(100%, calc(22dvh * 16 / 9)); }
  .lesson.focus:has(input.blank:focus) .player-video .pc-controls { display: none; }
  .lesson.focus:has(input.blank:focus) > .stages { display: none; }
  .lesson.focus:has(input.blank:focus) .player-audio .pc-audio-sub,
  .lesson.focus:has(input.blank:focus) .player-audio .pc-sub { display: none; }
}
/* Very short screens (landscape phone, keyboard open): smaller video. */
@media (max-height: 520px) {
  .lesson.focus .pc-frame { width: min(100%, calc(30dvh * 16 / 9)); }
  .lesson.focus > .lesson-head { padding: 4px 0; }
  .lesson.focus > .lesson-head .lesson-kicker { display: none; }
}
/* Bottom action bar (replaces the sticky buttons inside the scroll area). */
.lesson.focus .sm-actions, .lesson.focus .karaoke > .btn.primary.block, .lesson.focus .cards-actions { position: static; background: none; box-shadow: none; }
.lesson.focus > .sm-actions, .lesson.focus > .lesson-footer {
  flex: none; margin: 0; padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
}
.lesson.focus > .lesson-footer .btn { width: 100%; }
/* Mode buttons share the row instead of running off the edge. */
.lesson.focus .ex-mode { flex: 1 1 0; min-width: 0; padding: 0 4px; }
@media (max-width: 460px) { .lesson.focus .ex-mode { font-size: 12.5px; } }
/* One-line title in the lesson header. */
.lesson.focus .lesson-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 🎯/🧩 karaoke: options and word chips sit in the bottom bar, under the lyrics. */
.lesson-footer > .ly-choice { margin: 0 0 8px; padding: 8px 10px; border-radius: 14px; }
.lesson-footer > .ly-choice .opts { margin-top: 6px; gap: 6px; }
.lesson-footer > .ly-choice .opt { min-height: 44px; padding: 6px 10px; font-size: 16px; }
.lesson-footer > .ly-choice .chip-bank { margin-top: 6px; gap: 6px; }
.lesson-footer > .ly-choice .order-foot { margin-top: 6px; }
.lesson.focus > .lesson-footer:has(.ly-choice:not([hidden])) .btn.primary.block { min-height: 42px; }


/* 🔍 karaoke: a line with a wrong word has a red frame and a "xato bor" tag; once the
   word is found the frame turns green, if missed the line goes back to normal. */
.ly-line { border: 1.5px solid transparent; }
.ly-line.spot-line, .ly-line.spot-right { position: relative; margin: 9px 0 3px; }
.ly-line.spot-line { border-color: rgba(255, 107, 107, .55); background: rgba(255, 107, 107, .07); }
.ly-line.spot-line.active { border-color: #ff6b6b; background: rgba(255, 107, 107, .13); box-shadow: 0 0 0 3px rgba(255, 107, 107, .16), 0 0 24px rgba(255, 107, 107, .2); }
.ly-line.spot-line.sung { opacity: .85; }
.ly-line.spot-line .ly-num { border-color: rgba(255, 107, 107, .75); color: #ff9a9a; }
.ly-line.spot-right { border-color: rgba(95, 219, 148, .6); background: rgba(95, 219, 148, .08); }
.ly-line.spot-right .ly-num { border-color: var(--ok); color: var(--ok); }
.spot-tag {
  position: absolute; top: -10px; right: 12px; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font: 800 10.5px/1.3 var(--sans); letter-spacing: .06em; text-transform: uppercase; pointer-events: none;
}
.spot-tag .ic { width: 11px; height: 11px; stroke-width: 3; }
.spot-line .spot-tag { background: #ff6b6b; color: #2a0610; }
.spot-right .spot-tag { background: var(--ok); color: #062a16; }
.ly-line.spot-line .tap:hover:not(:disabled) { background: rgba(255, 107, 107, .2); }
@media (prefers-reduced-motion: no-preference) {
  .ly-line.spot-right { animation: spot-found .5s ease-out; }
  @keyframes spot-found { from { box-shadow: 0 0 0 6px rgba(95, 219, 148, .35); } to { box-shadow: 0 0 0 0 rgba(95, 219, 148, 0); } }
}

/* Chosen exercise: a fixed label inside the lesson (no switching mid-lesson). */
.mode-chosen { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0 10px; }
.mode-chosen-name { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(231, 253, 84, .12); border: 1px solid rgba(231, 253, 84, .35); color: var(--lime); font: 800 13.5px/1.2 var(--head); }
.mode-chosen .muted { font-size: 13px; font-weight: 600; }
.lesson.focus .mode-chosen { margin: 6px 0 8px; }
.other-mode { margin-top: 12px; }

/* Exercise picker — the first window of a lesson. */
.picker { padding: 4px 0 32px; }
.picker-hero { position: relative; display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; border-radius: 22px; background: linear-gradient(135deg, rgba(231, 253, 84, .1), rgba(255, 255, 255, .03) 55%); border: 1px solid var(--line); overflow: hidden; }
.picker-cover { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 14px; background: var(--surface-2); }
.picker-hero.is-song .picker-cover { aspect-ratio: 1; }
.picker-kicker { margin: 0 0 4px; font: 800 11.5px/1.3 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--lime); }
.picker-src { margin: 0 0 10px; font-size: 14.5px; font-weight: 600; line-height: 1.35; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.picker-meta .chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.picker-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.picker-meta .chip.dark { background: rgba(255, 255, 255, .08); }
.chip.done { background: rgba(95, 219, 148, .16); color: var(--ok); }
.picker-q { margin: 26px 0 4px; font: 800 clamp(20px, 5vw, 26px)/1.2 var(--head); color: #fff; }
.picker-sub { margin: 0 0 16px; font-size: 14.5px; color: var(--muted); }
.picker-grid { display: grid; gap: 10px; }
@media (min-width: 640px) { .picker-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }
.picker-opt { display: grid; grid-template-columns: 54px 1fr 24px; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s, background .15s; }
.picker-opt:hover, .picker-opt:focus-visible { border-color: var(--lime); background: var(--surface-2); transform: translateY(-2px); }
.picker-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; font-size: 27px; background: rgba(255, 255, 255, .06); }
.picker-opt[data-mode="type"] .picker-icon { background: rgba(231, 253, 84, .14); }
.picker-opt[data-mode="choice"] .picker-icon { background: rgba(84, 182, 253, .16); }
.picker-opt[data-mode="spot"] .picker-icon { background: rgba(255, 107, 107, .16); }
.picker-opt[data-mode="order"] .picker-icon { background: rgba(178, 132, 255, .18); }
.picker-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.picker-name { display: flex; align-items: center; gap: 8px; font: 800 17px/1.2 var(--head); }
.picker-level { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--muted); font: 700 11.5px/1.3 var(--sans); }
.picker-desc { font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.picker-go { font-size: 20px; font-weight: 700; color: var(--muted); transition: color .15s, transform .15s; }
.picker-opt:hover .picker-go { color: var(--lime); transform: translateX(3px); }
@media (max-width: 420px) {
  .picker-hero { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .picker-opt { grid-template-columns: 46px 1fr 18px; gap: 12px; padding: 12px; }
  .picker-icon { width: 46px; height: 46px; font-size: 23px; border-radius: 13px; }
}

/* Line icons (js/icons.js) — replace keyboard emoji everywhere. */
.ic { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; }
.wi { display: inline-flex; align-items: center; gap: .45em; }
.btn.icon .ic { width: 22px; height: 22px; }

/* ---------- Icons inside existing components ---------- */
.top-link, .home-links a { display: inline-flex; align-items: center; gap: 6px; }
.top-link .ic, .home-links a .ic { width: 17px; height: 17px; }
.xp-pill .xp-fire, .xp-pill .xp-today { display: inline-flex; align-items: center; gap: 3px; }
.xp-pill .ic { width: 15px; height: 15px; }
.ic-flame.ic, .xp-pill .ic-star, .xp-pop .ic-star, .stat .ic-star, .score-xp .ic-star { fill: currentColor; stroke: none; }
.xp-pill .xp-fire .ic { color: #ff8a3d; }
.xp-pill .xp-today .ic { color: #ffc83d; }
.xp-pop { display: inline-flex; align-items: center; gap: 5px; }
.xp-pop .ic { width: 17px; height: 17px; }
.xp-card .xp-big .ic { width: 58px; height: 58px; color: var(--lime); stroke-width: 1.6; }
.xp-streak { display: inline-flex; align-items: center; gap: 6px; }
.xp-streak .ic { width: 24px; height: 24px; color: #ff8a3d; }
.empty-icon .ic { width: 40px; height: 40px; color: var(--muted); stroke-width: 1.6; }
.play .ic { width: 24px; height: 24px; margin-left: 3px; }
.choice-cta .arrow { display: inline-flex; }
.hero-cta .ic { width: 18px; height: 18px; }
.chip .ic { width: 14px; height: 14px; }
.done-flag .ic { width: 14px; height: 14px; }
.ly-notice > .ic { width: 20px; height: 20px; color: var(--lime); }
.cards-note { display: block; }
.cards-note > .ic { width: 16px; height: 16px; color: var(--lime); vertical-align: -3px; }
.cards-note a { white-space: nowrap; }
.cards-note a .ic, .score-link .ic { width: 15px; height: 15px; vertical-align: -3px; }
.score-xp { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.score-xp .ic { color: #ffc83d; width: 15px; height: 15px; }
.mode-chosen-name .ic { width: 16px; height: 16px; }
.sm-status .wi { display: inline; }
.sm-status .wi .ic { margin-right: 6px; vertical-align: -3px; }
.gist h3 .wi { align-items: flex-start; }
.gist h3 .ic { margin-top: 2px; color: var(--lime); }
.gist-why .ic { vertical-align: -3px; }
.card-del .ic { width: 18px; height: 18px; }
.picker-icon .ic { width: 26px; height: 26px; }
.picker-opt[data-mode="type"] .picker-icon { color: var(--lime); }
.picker-opt[data-mode="choice"] .picker-icon { color: #6cc1ff; }
.picker-opt[data-mode="spot"] .picker-icon { color: #ff7b7b; }
.picker-opt[data-mode="order"] .picker-icon { color: #c09cff; }
.picker-go .ic { width: 20px; height: 20px; }
.picker-kicker .ic { width: 14px; height: 14px; }
.lesson-head .back .ic, .page-head .back .ic { width: 20px; height: 20px; }

/* ---------- Interface language switcher ---------- */
.lang-switch { position: relative; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 10px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); font: 700 13px/1 var(--sans); cursor: pointer;
}
.lang-btn .ic { width: 16px; height: 16px; }
.lang-btn .lang-caret { width: 13px; height: 13px; opacity: .6; transition: transform .15s; }
.lang-btn[aria-expanded="true"] .lang-caret { transform: rotate(180deg); }
.lang-switch.on-dark .lang-btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .14); color: #fff; height: 34px; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 172px; margin: 0; padding: 6px; list-style: none;
  border-radius: 14px; background: #fff; border: 1px solid #e2ddee; box-shadow: 0 18px 40px rgba(20, 6, 50, .22);
}
.lang-menu[hidden] { display: none; }
.lang-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px;
  background: transparent; color: #1e0547; font: 600 14px/1.2 var(--sans); text-align: left; cursor: pointer;
}
.lang-opt:hover, .lang-opt:focus-visible { background: #f1eefa; outline: none; }
.lang-code { display: grid; place-items: center; width: 30px; height: 22px; border-radius: 6px; background: #ece8f7; font: 800 11px/1 var(--sans); letter-spacing: .04em; color: #463a63; }
.lang-opt[aria-checked="true"] .lang-code { background: var(--indigo); color: var(--lime); }
.lang-name { flex: 1; }
.lang-opt .ic { width: 16px; height: 16px; color: var(--indigo); }
@media (max-width: 460px) { .lang-btn .lang-caret { display: none; } }

/* ---------- Natijalarim dashboard ---------- */
body[data-page="progress"] {
  --bg: #0f0624; --surface: #1a0f36; --surface-2: #261a48; --ink: #f5f3fb; --ink-2: #d7d1e8; --muted: #a69dbf; --line: #2f2453;
  --ok: #5fdb94; --bad: #ff7f7f; color-scheme: dark;
  background: radial-gradient(90% 50% at 50% -10%, #2a0f63 0%, #0f0624 60%) fixed, #0f0624; color: var(--ink);
}
body[data-page="progress"] .brand img { box-shadow: none; }
.dash { padding-bottom: 40px; }
.dash .page-head { margin-bottom: 10px; }
.dash .eyebrow { color: var(--lime); }
.dash-top { display: grid; gap: 14px; margin-bottom: 14px; }
@media (min-width: 880px) { .dash-top { grid-template-columns: 1.15fr 1fr; } }
.goal-card {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 20px; border-radius: 22px;
  background: linear-gradient(140deg, rgba(231, 253, 84, .12), rgba(255, 255, 255, .02) 60%), var(--surface); border: 1px solid var(--line);
}
@media (max-width: 520px) { .goal-card { grid-template-columns: 1fr; justify-items: center; text-align: center; } .goal-pick { justify-content: center; } }
.goal-ring { position: relative; width: 132px; height: 132px; }
.ring { width: 100%; height: 100%; display: block; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .08); }
.ring-fill { fill: none; stroke: var(--lime); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.goal-ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.goal-ring-text strong { font: 800 34px/1 var(--head); color: #fff; font-variant-numeric: tabular-nums; }
.goal-ring-text span { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.dash-kicker { margin: 0 0 4px; font: 800 12px/1.3 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--lime); }
.dash-kicker .ic { width: 15px; height: 15px; }
.goal-title { margin: 0 0 6px; font: 800 clamp(22px, 4.6vw, 28px)/1.15 var(--head); }
.goal-sub { margin: 0 0 14px; font-size: 14px; color: var(--muted); line-height: 1.45; }
.goal-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.goal-opt {
  display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 7px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, .04); border: 1.5px solid var(--line); color: var(--muted); font: 600 11.5px/1.2 var(--sans); cursor: pointer;
}
.goal-opt strong { font: 800 16px/1.2 var(--head); color: var(--ink); }
.goal-opt:hover { border-color: rgba(231, 253, 84, .5); }
.goal-opt[aria-pressed="true"] { border-color: var(--lime); background: rgba(231, 253, 84, .12); color: var(--lime); }
.goal-opt[aria-pressed="true"] strong { color: var(--lime); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.stat-icon { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.stat-icon .ic { width: 20px; height: 20px; }
.stat:nth-child(1) .stat-icon { color: #ff8a3d; background: rgba(255, 138, 61, .14); }
.stat:nth-child(2) .stat-icon { color: #ffc83d; background: rgba(255, 200, 61, .14); }
.stat:nth-child(3) .stat-icon { color: var(--lime); background: rgba(231, 253, 84, .12); }
.stat:nth-child(4) .stat-icon { color: var(--ok); background: rgba(95, 219, 148, .14); }
.stat-body { min-width: 0; }
.stat-value { font: 800 26px/1.05 var(--head); color: #fff; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 3px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.stat-sub { margin-top: 2px; font-size: 12px; color: var(--muted); }
.dash-card { position: relative; margin-bottom: 14px; padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); }
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.dash-card-head h2 { margin: 0; font: 800 18px/1.2 var(--head); }
.dash-card-head h2 .ic { color: var(--lime); }
.dash-card-head .muted { font-size: 13px; }
.dash-card h3 { margin: 0 0 10px; font: 700 12px/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.activity-body { display: grid; gap: 22px; }
@media (min-width: 880px) { .activity-body { grid-template-columns: minmax(260px, 1fr) auto; align-items: start; } }

/* last 7 days: columns from one baseline, goal as a hairline reference */
.week-chart { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; height: 150px; padding-top: 18px; }
.week-goal-layer { position: absolute; left: 0; right: 0; top: 18px; bottom: 21px; pointer-events: none; }
.week-goal { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid rgba(231, 253, 84, .45); }
.week-goal span { position: absolute; right: 0; top: -17px; font-size: 11px; font-weight: 700; color: var(--muted); }
.week-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; border-radius: 8px; outline: none; cursor: default; }
.week-col:hover .week-bar:not(.is-zero), .week-col:focus-visible .week-bar:not(.is-zero) { background: #f3ff9e; }
.week-col:focus-visible { box-shadow: 0 0 0 2px rgba(231, 253, 84, .5); }
.week-plot { position: relative; flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); }
.week-bar { position: relative; width: min(24px, 70%); border-radius: 4px 4px 0 0; background: rgba(231, 253, 84, .78); transition: height .6s ease; }
.week-bar.is-zero { background: var(--line); }
.week-col.is-today .week-bar:not(.is-zero) { background: var(--lime); }
.week-bar em { position: absolute; left: 50%; bottom: calc(100% + 4px); transform: translateX(-50%); font: 700 11.5px/1 var(--sans); font-style: normal; color: var(--ink); }
.week-day { height: 14px; font-size: 11.5px; line-height: 14px; font-weight: 600; color: var(--muted); }
.week-col.is-today .week-day { color: var(--ink); }

/* 16-week calendar: one cell per day, one hue from faint to full */
.heat { display: flex; gap: 6px; max-width: 100%; overflow-x: auto; padding-bottom: 2px; }
.heat-days { display: grid; grid-template-rows: 16px repeat(7, 12px); gap: 3px; font-size: 10px; color: var(--muted); }
.heat-days span { line-height: 12px; }
.heat-grid { display: flex; gap: 3px; }
.heat-col { display: grid; grid-template-rows: 16px repeat(7, 12px); gap: 3px; }
.heat-month { font-size: 10px; color: var(--muted); white-space: nowrap; width: 12px; overflow: visible; }
.heat-cell { width: 12px; height: 12px; border-radius: 3px; background: rgba(255, 255, 255, .06); }
.heat-cell.blank { background: transparent; }
.heat-cell.s1 { background: rgba(231, 253, 84, .22); }
.heat-cell.s2 { background: rgba(231, 253, 84, .45); }
.heat-cell.s3 { background: rgba(231, 253, 84, .72); }
.heat-cell.s4 { background: var(--lime); }
.heat-cell.is-today { box-shadow: 0 0 0 1.5px var(--ink); }
.heat-cell[data-tip]:hover { box-shadow: 0 0 0 1.5px #fff; }
.heat-legend { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--muted); }
.heat-legend span:first-child { margin-right: 4px; }
.heat-legend span:last-child { margin-left: 4px; }
.chart-tip {
  position: absolute; z-index: 5; transform: translate(-50%, -100%); padding: 6px 10px; border-radius: 8px; white-space: nowrap;
  background: #fff; color: #1e0547; font: 700 12px/1.2 var(--sans); box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
  opacity: 0; pointer-events: none; transition: opacity .12s;
}
.chart-tip.show { opacity: 1; }

/* levels per section */
.dash-grid { display: grid; gap: 14px; }
@media (min-width: 760px) { .dash-grid { grid-template-columns: 1fr 1fr; } .dash-grid .dash-card { margin-bottom: 0; } .dash-grid { margin-bottom: 14px; } }
.lvl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lvl-row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 9px 10px; border-radius: 12px; color: inherit; text-decoration: none; }
a.lvl-row:hover { background: rgba(255, 255, 255, .04); }
.lvl-row.is-empty { opacity: .5; }
.lvl-name { margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.meter { height: 6px; border-radius: 999px; background: rgba(231, 253, 84, .12); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--lime); transition: width .6s ease; }
.lvl-num strong { font: 800 15px/1 var(--head); font-variant-numeric: tabular-nums; }

/* audio cards summary */
.cards-sum-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cards-sum-row > div { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .04); }
.cards-sum-row strong { font: 800 22px/1.1 var(--head); color: #fff; }
.cards-sum-row span { font-size: 12.5px; color: var(--muted); }
.dash-note { margin: 4px 0 14px; font-size: 13px; color: var(--muted); text-align: center; }
.dash .btn.danger { color: var(--bad); border-color: rgba(255, 127, 127, .35); }
@media (max-width: 460px) {
  .topbar { gap: 8px; }
  .brand span { display: none; }
  .top-links { gap: 4px; }
  .top-link { padding: 8px 10px; }
  .topbar .xp-pill { padding: 6px 9px; }
  .lang-btn { padding: 0 8px; }
}
@media (max-width: 520px) {
  .goal-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .goal-opt { min-width: 0; padding: 7px 4px; }
}

/* Streak / points indicator: plain text beside the buttons, not a button itself. */
.xp-pill, .home-links .xp-pill.on-dark, .xp-pill.in-lesson {
  background: transparent; border-color: transparent; box-shadow: none; padding-left: 6px; padding-right: 6px; cursor: default; user-select: none;
}
.home-links .xp-pill.on-dark { color: rgba(255, 255, 255, .85); }
.xp-pill .xp-sep { opacity: .5; }
@media (max-width: 520px) {
  .home-brand span { display: none; }
  .home-nav { gap: 8px; }
  .home-links { gap: 2px; }
  .home-links a { padding: 8px 10px; }
  .home-links .lang-btn { height: 32px; padding: 0 8px; }
}

/* ---------- admin sign-in ---------- */
body[data-page="admin"] {
  --bg: #0f0624; --surface: #1a0f36; --surface-2: #261a48; --ink: #f5f3fb; --ink-2: #d7d1e8; --muted: #a69dbf; --line: #2f2453;
  --ok: #5fdb94; --bad: #ff7f7f; color-scheme: dark;
  background: radial-gradient(80% 50% at 50% -10%, #2a0f63 0%, #0f0624 60%) fixed, #0f0624; color: var(--ink);
}
body[data-page="admin"] .btn.primary { background: var(--lime); color: var(--indigo); }
.admin-page { max-width: 520px; margin: 0 auto; padding-bottom: 40px; }
.admin-card { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 12px; padding: 30px 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.admin-card h2 { margin: 6px 0 0; font: 800 22px/1.2 var(--head); }
.admin-card .muted { margin: 0; max-width: 380px; font-size: 14.5px; line-height: 1.5; }
.admin-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: rgba(231, 253, 84, .12); color: var(--lime); }
.admin-icon .ic { width: 28px; height: 28px; }
.admin-icon.ok { background: rgba(95, 219, 148, .14); color: var(--ok); }
.admin-form { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 340px; margin-top: 10px; }
.admin-form .field { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font-size: 16px; }
.admin-form .field:focus { outline: none; border-color: var(--lime); }
.admin-msg { min-height: 1.2em; margin: 0; font-size: 14px; font-weight: 600; color: var(--bad); }
.admin-msg:empty { display: none; }
.admin-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 8px 0 4px; }
.admin-cmd { display: inline-block; margin-top: 8px; padding: 10px 16px; border-radius: 12px; background: #0b0420; border: 1px solid var(--line); color: var(--lime); font: 600 15px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; user-select: all; }
.admin-page .row.center-row { margin-top: 10px; }
.top-link.admin-link { border-color: rgba(231, 253, 84, .5); }
.home-links .link-admin { color: var(--lime); }

/* ---------- Musics / Movies catalog ---------- */
body[data-page="movies"], body[data-page="musics"] {
  --bg: #0f0624; --surface: #1a0f36; --surface-2: #261a48; --ink: #f5f3fb; --ink-2: #d7d1e8; --muted: #a69dbf; --line: #2f2453;
  --ok: #5fdb94; --bad: #ff7f7f; color-scheme: dark; color: var(--ink);
  background: radial-gradient(70% 45% at 85% -5%, rgba(124, 77, 255, .35), transparent 60%), radial-gradient(60% 40% at 0% 20%, rgba(231, 253, 84, .07), transparent 60%), #0f0624;
  background-attachment: fixed;
}
body[data-page="musics"] { --accent: #e7fd54; }
body[data-page="movies"] { --accent: #ff9a6c; }
body[data-page="movies"] .btn.primary, body[data-page="musics"] .btn.primary { background: var(--lime); color: var(--indigo); }
.catalog { padding-bottom: 48px; }

.cat-hero { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px; padding: 18px 0 26px; }
.cat-hero-text { min-width: 0; animation: catRise .7s cubic-bezier(.2, .8, .2, 1) both; }
.cat-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; padding: 6px 12px 6px 8px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; transition: background .2s, color .2s; }
.cat-back:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.cat-back .ic { width: 15px; height: 15px; }
.cat-kicker { margin: 0; font: 800 12px/1.2 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.cat-kicker .ic { width: 15px; height: 15px; }
.cat-title { margin: 6px 0 0; font: 800 clamp(46px, 9vw, 84px)/.95 var(--head); letter-spacing: -.05em; color: #fff; }
.cat-sub { margin: 12px 0 0; font-size: clamp(15px, 2vw, 17px); color: var(--ink-2); }
.cat-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cat-stat { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.cat-stat .ic { width: 15px; height: 15px; color: var(--accent); }
.cat-stat.is-done { color: #7ef0ad; }
.cat-stat.is-done .ic { color: #7ef0ad; }
.cat-add { margin-top: 18px; }
.cat-art { display: block; width: clamp(120px, 20vw, 190px); aspect-ratio: 1; border-radius: 40px; overflow: hidden; box-shadow: 0 30px 60px rgba(5, 0, 20, .55), 0 0 0 1px rgba(255, 255, 255, .1); transform: rotate(6deg); animation: catArt 1s cubic-bezier(.2, 1.2, .4, 1) .1s both, catFloat 7s ease-in-out 1.1s infinite; }
.cat-art svg { display: block; width: 100%; height: 100%; }
@keyframes catArt { from { opacity: 0; transform: rotate(18deg) scale(.7); } }
@keyframes catFloat { 0%, 100% { transform: rotate(6deg) translateY(0); } 50% { transform: rotate(3deg) translateY(-10px); } }
@keyframes catRise { from { opacity: 0; transform: translateY(18px); } }
@media (max-width: 560px) {
  .cat-hero { grid-template-columns: 1fr 96px; gap: 14px; padding-top: 10px; }
  .cat-art { width: 96px; border-radius: 26px; align-self: start; margin-top: 52px; }
  .cat-sub { font-size: 14.5px; }
}

/* level filter with a sliding marker */
.cat-filters {
  position: sticky; top: 0; z-index: 6; display: flex; gap: 4px; width: fit-content; max-width: 100%; margin: 0 0 22px; padding: 5px;
  overflow-x: auto; scrollbar-width: none; border-radius: 999px; background: rgba(26, 15, 54, .82); border: 1px solid var(--line);
  backdrop-filter: blur(14px); box-shadow: 0 12px 30px rgba(5, 0, 20, .35); animation: catRise .7s .08s cubic-bezier(.2, .8, .2, 1) both;
}
.cat-filters::-webkit-scrollbar { display: none; }
.cat-filter-ind { position: absolute; left: 0; top: 5px; bottom: 5px; border-radius: 999px; background: var(--lime); box-shadow: 0 6px 18px rgba(231, 253, 84, .3); transition: transform .35s cubic-bezier(.3, 1.3, .5, 1), width .35s cubic-bezier(.3, 1.3, .5, 1); }
.cat-filter-ind.no-anim { transition: none; }
.cat-filter {
  position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px;
  border-radius: 999px; color: var(--ink-2); font-size: 14px; font-weight: 700; text-decoration: none; transition: color .25s;
}
.cat-filter:hover { color: #fff; }
.cat-filter[aria-current="true"] { color: var(--indigo); }
.cat-filter.is-empty:not([aria-current="true"]) { opacity: .45; }
.cat-dot { width: 8px; height: 8px; border-radius: 50%; }
.cat-filter-n { min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: rgba(255, 255, 255, .08); font-size: 11.5px; color: var(--muted); transition: background .25s, color .25s; }
.cat-filter[aria-current="true"] .cat-filter-n { background: rgba(30, 5, 71, .14); color: var(--indigo); }

/* lesson cards */
.cat-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.cat-card {
  position: relative; isolation: isolate; display: flex; flex-direction: column; overflow: hidden; border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)), var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; box-shadow: 0 18px 40px rgba(5, 0, 20, .35);
  animation: catCard .65s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 70ms + 120ms);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s;
}
@keyframes catCard { from { opacity: 0; transform: translateY(28px) scale(.97); } }
.cat-card::before { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .3s; background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 0%), rgba(255, 255, 255, .09), transparent 60%); }
.cat-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 28px 60px rgba(5, 0, 20, .5), 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent); }
.cat-card:hover::before { opacity: 1; }
.cat-card:focus-visible { outline: 3px solid var(--lime); outline-offset: 3px; }
.cat-card.is-done { border-color: rgba(95, 219, 148, .35); }

.cat-cover { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: #12032e; }
.cat-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.cat-card:hover .cat-cover-img { transform: scale(1.07); }
.cat-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(15, 6, 36, .35) 0%, rgba(15, 6, 36, 0) 35%, rgba(15, 6, 36, .55) 100%); }
/* songs: blurred backdrop, the cover in front, a record slides out on hover */
.cat-cover-bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(26px) saturate(1.3); opacity: .6; transform: scale(1.1); }
.cat-cover-art { position: absolute; z-index: 1; left: 50%; top: 50%; height: 74%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; transform: translate(-50%, -50%); box-shadow: 0 18px 40px rgba(5, 0, 20, .55); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.cat-vinyl {
  position: absolute; z-index: 0; left: 50%; top: 50%; height: 68%; aspect-ratio: 1; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle, var(--lime) 0 15%, #12032e 16% 19%, #1c0c40 20% 100%);
  box-shadow: inset 0 0 0 6px #12032e, inset 0 0 0 7px rgba(255, 255, 255, .06), inset 0 0 0 14px #12032e, inset 0 0 0 15px rgba(255, 255, 255, .05), inset 0 0 0 22px #12032e, inset 0 0 0 23px rgba(255, 255, 255, .05), 0 12px 30px rgba(5, 0, 20, .5);
  transition: transform .6s cubic-bezier(.2, .8, .2, 1);
}
.cat-card:hover .cat-cover-art { transform: translate(-78%, -50%) rotate(-3deg); }
.cat-card:hover .cat-vinyl { transform: translate(-2%, -50%) rotate(200deg); }
.cat-badges { position: absolute; z-index: 3; left: 12px; top: 12px; display: flex; gap: 6px; }
.cat-time { position: absolute; z-index: 3; right: 12px; top: 12px; display: inline-flex; padding: 4px 9px; border-radius: 999px; background: rgba(10, 2, 30, .6); backdrop-filter: blur(8px); font-size: 12px; font-weight: 700; color: #fff; }
.cat-time .ic { width: 13px; height: 13px; }
.cat-done { position: absolute; z-index: 3; left: 12px; bottom: 12px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--ok); color: #062a16; box-shadow: 0 6px 16px rgba(95, 219, 148, .4); }
.cat-done .ic { width: 16px; height: 16px; stroke-width: 3; }
.cat-play {
  position: absolute; z-index: 3; right: 14px; bottom: 14px; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--accent); color: #14032f; box-shadow: 0 10px 26px rgba(5, 0, 20, .45);
  opacity: 0; transform: translateY(10px) scale(.8); transition: opacity .3s, transform .35s cubic-bezier(.2, 1.4, .4, 1);
}
.cat-play .ic { width: 20px; height: 20px; margin-left: 2px; }
.cat-card:hover .cat-play, .cat-card:focus-visible .cat-play { opacity: 1; transform: none; }
@media (hover: none) { .cat-play { opacity: 1; transform: none; } }

.cat-body { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 18px; }
.cat-source { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-name { font: 800 20px/1.2 var(--head); letter-spacing: -.015em; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-reason { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat-reason strong { color: var(--accent); font-weight: 700; }
.cat-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; }
.cat-tags { display: flex; gap: 6px; min-width: 0; }
.cat-tag { display: inline-flex; min-width: 0; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-tag .wi { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cat-tag .ic { width: 13px; height: 13px; color: var(--accent); }
.cat-tag.draft { background: rgba(255, 200, 61, .14); color: #ffd36b; }
.cat-go { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--accent); }
.cat-go .ic { width: 16px; height: 16px; transition: transform .25s; }
.cat-card:hover .cat-go .ic { transform: translateX(4px); }

.cat-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 46px 20px; border-radius: 26px; border: 1px dashed var(--line); background: rgba(255, 255, 255, .02); text-align: center; animation: catCard .6s cubic-bezier(.2, .8, .2, 1) both; }
.cat-empty-art { width: 84px; aspect-ratio: 1; border-radius: 24px; overflow: hidden; opacity: .9; }
.cat-empty-art svg { display: block; width: 100%; height: 100%; }
.cat-empty h3 { margin: 10px 0 0; font: 800 20px/1.2 var(--head); }
.cat-empty p { margin: 0 0 8px; max-width: 380px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .cat-hero-text, .cat-art, .cat-filters, .cat-card, .cat-empty { animation: none; }
  .cat-filter-ind, .cat-card, .cat-cover-img, .cat-cover-art, .cat-vinyl, .cat-play { transition: none; }
}
