/* Teaching voice in the lesson player (public/js/app-voice.js). Lives inside the dark player: night surfaces, lime for
 * the voice itself. The one moving thing is the voice: the equaliser and the ring move only while it speaks. */

/* ---------- intro: "Listen to this lesson" ---------- */
.vn-listen { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; width: min(560px, 100%); text-align: left; padding: 14px 20px 14px 14px; border-radius: 24px; background: var(--night2); border: 1px solid var(--nline); color: #fff; margin-top: 4px; transition: transform .25s var(--ease), border-color .25s, background .25s; animation: rise .5s .15s var(--ease) both; }
.vn-listen:hover { transform: translateY(-2px); border-color: #3B5A2A; background: #13241B; }
.vn-listen:active { transform: scale(.99); }
.vn-lp { width: 56px; height: 56px; border-radius: 50%; background: var(--lime); color: #14200A; display: grid; place-items: center; position: relative; flex: none; }
.vn-lp .ico { width: 24px; height: 24px; margin-left: 3px; }
.vn-lp i { position: absolute; inset: -5px; border-radius: 50%; border: 2px solid rgba(201,246,91,.45); animation: vnhalo 2.4s var(--ease) infinite; }
@keyframes vnhalo { 0% { transform: scale(.92); opacity: 1; } 80%, 100% { transform: scale(1.18); opacity: 0; } }
.vn-lt { min-width: 0; display: grid; gap: 2px; }
.vn-lt b { font-size: 18px; letter-spacing: -.03em; line-height: 1.2; }
.vn-lt small { font-size: 13.5px; color: var(--muted2); font-weight: 600; line-height: 1.35; }
.vn-lw { display: flex; align-items: center; gap: 3px; height: 34px; }
.vn-lw i { width: 3px; border-radius: 3px; background: var(--lime); opacity: .55; height: 30%; transform-origin: center; animation: vnbreath 2.8s ease-in-out infinite; }
.vn-lw i:nth-child(3n) { height: 70%; animation-delay: -.4s; } .vn-lw i:nth-child(3n+1) { height: 45%; animation-delay: -1.1s; } .vn-lw i:nth-child(4n) { height: 92%; animation-delay: -1.7s; } .vn-lw i:nth-child(5n) { height: 58%; animation-delay: -.8s; } .vn-lw i:nth-child(7n) { height: 24%; }
.vn-listen:hover .vn-lw i { animation-duration: 1.1s; opacity: .9; }
.vn-listen.on { border-color: #3B5A2A; }
.vn-listen.on .vn-lp i { animation: none; opacity: 0; }
.vn-listen.on .vn-lw i { animation-duration: .8s; opacity: 1; }
.vn-listen.on .vn-lp .ico { margin-left: 0; }
@keyframes vnbreath { 50% { transform: scaleY(.45); } }
.vn-offline { font-size: 14px; color: var(--muted2); }
.vn-offline .lnk { color: var(--lime); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- the narration bar (inside the slide controls) ---------- */
.ssp-ctl { position: relative; }
.vn { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.vn-play { width: 48px; height: 48px; border-radius: 50%; position: relative; display: grid; place-items: center; flex: none; }
.vn-play:disabled { opacity: .4; cursor: default; }
.vn-ring { position: absolute; inset: 0; width: 48px; height: 48px; transform: rotate(-90deg); }
.vn-ring circle { fill: none; stroke: var(--nline); stroke-width: 3; }
.vn-ring .vn-ring-v { stroke: var(--lime); stroke-linecap: round; stroke-dasharray: 132; stroke-dashoffset: 132; transition: stroke-dashoffset .12s linear; }
.vn-pi { width: 38px; height: 38px; border-radius: 50%; background: var(--lime); color: #14200A; display: grid; place-items: center; transition: transform .2s var(--ease); }
.vn-pi .ico { width: 18px; height: 18px; }
.vn-play:not(:disabled):hover .vn-pi { transform: scale(1.07); }
.vn:not(.on) .vn-pi .ico { margin-left: 2px; }
.vn-eq { display: flex; align-items: center; gap: 3px; height: 22px; width: 23px; flex: none; }
.vn-eq i { width: 3px; height: 22%; border-radius: 3px; background: var(--muted2); transition: height .3s var(--ease), background .3s; }
.vn.on .vn-eq i { background: var(--lime); animation: vneq .9s ease-in-out infinite alternate; }
.vn.on .vn-eq i:nth-child(2) { animation-delay: -.3s; animation-duration: .7s; } .vn.on .vn-eq i:nth-child(3) { animation-delay: -.55s; animation-duration: 1.05s; } .vn.on .vn-eq i:nth-child(4) { animation-delay: -.15s; animation-duration: .8s; } .vn.on .vn-eq i:nth-child(5) { animation-delay: -.7s; }
@keyframes vneq { from { height: 18%; } to { height: 100%; } }
.vn-time { font-family: var(--f-m); font-size: 12.5px; color: var(--muted2); white-space: nowrap; margin-right: 4px; font-variant-numeric: tabular-nums; }
.vn-time b { color: #fff; font-weight: 700; }
.vn-b { height: 38px; min-width: 38px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--nline); background: var(--night2); color: var(--ntext); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 800; font-size: 13px; transition: background .2s, color .2s, border-color .2s; flex: none; }
.vn-b .ico { width: 18px; height: 18px; }
.vn-b:hover { background: var(--night3); color: #fff; }
.vn-b[aria-pressed="true"] { color: var(--lime); border-color: #3B5A2A; background: rgba(201,246,91,.08); }
.vn-b[data-vn="mute"][aria-pressed="true"] { color: #FFB98E; border-color: #5A3A26; background: rgba(255,185,142,.08); }
.vn-speed { font-family: var(--f-m); min-width: 50px; }
.vn-morebtn { display: none; }
.vn.none .vn-eq, .vn.none .vn-time { opacity: .35; }
.vn-pop { position: absolute; right: 12px; bottom: calc(100% + 10px); width: min(300px, calc(100vw - 24px)); background: var(--night2); border: 1px solid var(--nline); border-radius: 20px; padding: 6px; box-shadow: 0 30px 70px -20px rgba(0,0,0,.75); z-index: 6; animation: rise .25s var(--ease); }
.vn-pop button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 14px; text-align: left; color: #fff; }
.vn-pop button:hover { background: var(--night3); }
.vn-pop button > span { flex: 1; display: grid; }
.vn-pop b { font-size: 14.5px; letter-spacing: -.02em; }
.vn-pop small { font-size: 12.5px; color: var(--muted2); }
.vn-pop .ico { color: var(--muted2); }
.vn-sw { width: 34px; height: 20px; border-radius: 99px; background: var(--nline); position: relative; flex: none; transition: background .2s; }
.vn-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.vn-pop [aria-pressed="true"] .vn-sw { background: var(--lime); }
.vn-pop [aria-pressed="true"] .vn-sw::after { transform: translateX(14px); background: #14200A; }
.vn-pop [data-vn="off"] b { color: #FFB98E; }
/* Intro and recap while listening: only the voice controls, centred. */
.ssp-ctl.vn-solo [data-prev], .ssp-ctl.vn-solo [data-next], .ssp-ctl.vn-solo .cnt { display: none; }
.ssp-ctl.vn-solo .vn { justify-content: center; }

/* ---------- captions: the line being read, lit word by word ---------- */
.vn-cap { flex: none; display: flex; justify-content: center; align-items: center; min-height: 78px; padding: 10px 20px 12px; border-top: 1px solid var(--nline); background: linear-gradient(180deg, #0C1A13, var(--night)); }
.vn-cap p { max-width: 64ch; text-align: center; font-size: 17.5px; line-height: 1.45; font-weight: 600; letter-spacing: -.01em; color: rgba(255,255,255,.34); text-wrap: balance; animation: vncap .35s var(--ease); }
.vn-cap span { transition: color .25s; }
.vn-cap span.lit { color: #fff; }
.vn-cap p.still { color: #fff; animation: none; }
.vn-cap .vn-note { font-family: var(--f-s); font-style: italic; font-weight: 400; font-size: 21px; color: var(--lime); letter-spacing: 0; }
@keyframes vncap { from { opacity: 0; transform: translateY(6px); } }

/* ---------- profile: lesson settings ---------- */
.vn-prefs .switch { display: flex; margin-top: 12px; }
.vn-prefs .hint { margin-top: 12px; }

/* ---------- small screens ---------- */
@media (max-width: 720px) {
  .vn-wide { display: none; }
  .vn-morebtn { display: inline-flex; }
  .ssp-ctl:has(.vn) .cnt { display: none; }
  .ssp-ctl:has(.vn) { gap: 8px; }
  .vn { gap: 6px; }
  .vn-cap { min-height: 70px; padding: 8px 14px 10px; }
  .vn-cap p { font-size: 15.5px; }
  .vn-cap .vn-note { font-size: 19px; }
  .vn-listen { grid-template-columns: auto minmax(0, 1fr); padding: 12px 16px 12px 12px; gap: 14px; }
  .vn-lw { display: none; }
  .vn-lp { width: 50px; height: 50px; }
}
@media (max-width: 400px) {
  .vn-time { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .vn-listen, .vn-cap p, .vn-pop { animation: none; }
  .vn-lp i, .vn-lw i, .vn.on .vn-eq i { animation: none; }
  .vn.on .vn-eq i { height: 60%; }
  .vn-ring .vn-ring-v { transition: none; }
}
