/* ИИ-караоке: экран «текста нет» и ожидание расшифровки.
   Цвета только из переменных темы, поэтому светлая и тёмная тема работают без правок. */

.ai-karaoke {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 24px 28px 48px;
  text-align: center;
  gap: 10px;
  color: var(--text-secondary);
  animation: ai-appear var(--dur-page) var(--ease) both;
}

/* У контейнера текста снизу большой отступ под прокрутку строк: для этих экранов он лишний. */
#lyricsContent:has(> .ai-karaoke) {
  padding-bottom: 32px;
}

.ai-badge,
.ai-orb,
.ai-btn {
  flex-shrink: 0;
}

.ai-karaoke .ai-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  transition: opacity var(--dur-micro) var(--ease), transform var(--dur-micro) var(--ease);
}

.ai-karaoke .ai-title.is-swapping {
  opacity: 0;
  transform: translateY(5px);
}

.ai-sub {
  max-width: 292px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.ai-note {
  max-width: 300px;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--accent);
  background: var(--accent-soft);
}

.ai-fine {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.75;
}

/* ---- «текста нет»: значок и кнопка ---- */

.ai-badge {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 6px;
  border-radius: 50%;
  color: var(--accent);
  background: radial-gradient(circle at 50% 32%, rgba(var(--accent-rgb), 0.3), rgba(var(--accent-rgb), 0.08) 72%);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.22) inset, 0 10px 30px rgba(var(--accent-rgb), 0.18);
  animation: ai-float var(--dur-ambient) var(--ease-breathe) infinite;
}

.ai-badge svg {
  width: 32px;
  height: 32px;
}

.ai-badge.is-quiet {
  color: var(--text-muted);
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--line) inset;
  animation: none;
}

.ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 13px 26px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-on);
  background: var(--accent-gradient);
  box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.35);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-micro) var(--ease), opacity var(--dur-micro) var(--ease);
}

.ai-btn svg {
  width: 18px;
  height: 18px;
}

.ai-btn.is-pressed {
  scale: 0.96;
}

.ai-btn:disabled {
  opacity: 0.5;
  box-shadow: none;
  cursor: default;
}

/* ---- ожидание: орб с кольцами и эквалайзером ---- */

.ai-orb {
  position: relative;
  display: grid;
  place-items: center;
  width: 156px;
  height: 156px;
  margin-bottom: 14px;
}

/* вращающееся свечение за диском */
.ai-orb::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(var(--accent-rgb), 0), rgba(var(--accent-rgb), 0.6), rgba(255, 205, 175, 0.35), rgba(var(--accent-rgb), 0));
  filter: blur(11px);
  animation: ai-spin var(--dur-ambient-slow) var(--ease-linear) infinite;
}

/* диск */
.ai-orb::after {
  content: "";
  position: absolute;
  inset: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 28%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 60%), var(--bg-surface-raised);
  box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, 0.3);
}

.ai-ring {
  position: absolute;
  inset: 30px;
  border: 1.5px solid rgba(var(--accent-rgb), 0.55);
  border-radius: 50%;
  opacity: 0;
  animation: ai-ring var(--dur-ambient-fast) var(--ease) infinite;
}

.ai-ring:nth-child(2) { animation-delay: 0.9s; }
.ai-ring:nth-child(3) { animation-delay: 1.8s; }

.ai-bars {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
}

.ai-bars i {
  display: block;
  width: 4px;
  height: 100%;
  border-radius: 3px;
  background: var(--accent-gradient);
  transform: scaleY(0.22);
  animation: ai-bar var(--dur-pulse) var(--ease-breathe) infinite;
}

.ai-bars i:nth-child(1) { animation-delay: -0.9s; }
.ai-bars i:nth-child(2) { animation-delay: -0.6s; }
.ai-bars i:nth-child(3) { animation-delay: -0.3s; }
.ai-bars i:nth-child(4) { animation-delay: -0.75s; }
.ai-bars i:nth-child(5) { animation-delay: -0.15s; }
.ai-bars i:nth-child(6) { animation-delay: -0.5s; }
.ai-bars i:nth-child(7) { animation-delay: -0.05s; }

@keyframes ai-bar {
  0%, 100% { transform: scaleY(0.22); }
  50% { transform: scaleY(1); }
}

@keyframes ai-ring {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.1); opacity: 0; }
}

@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

@keyframes ai-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@keyframes ai-appear {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Движение отключено в системе: тот же экран, но спокойный. */
@media (prefers-reduced-motion: reduce) {
  .ai-karaoke,
  .ai-karaoke *,
  .ai-orb::before {
    animation: none !important;
    transition: none !important;
  }
  .ai-bars i { transform: scaleY(0.6); }
  .ai-ring { display: none; }
}

/* Full-screen sing view. Album art supplies the backdrop; player nodes stay live. */
/* Текст и кнопки поверх размытой обложки — всегда белые, в любой теме. */
:root { --lyrics-ink: rgb(255,255,255); }
.ios-lyrics-sheet { background: rgb(var(--tint)); }
.ios-lyrics-sheet .lyrics-backdrop { inset: -18%; filter: blur(64px) saturate(.85); opacity: .8; transform: scale(1.15); }
.ios-lyrics-sheet .lyrics-backdrop::after { background: linear-gradient(180deg,rgba(var(--tint),.12),rgba(20,18,22,.62)); }
.ios-lyrics-sheet .lyrics-top { padding: calc(var(--tg-header-clearance) + 54px) 32px 18px; }
.ios-lyrics-sheet .lyrics-head { gap: 16px; }
.ios-lyrics-sheet .lyrics-head-art { width: 76px; height: 76px; border-radius: 12px; box-shadow: none; }
.ios-lyrics-sheet .lyrics-head-title { font-size: 20px; font-weight: 700; letter-spacing: -.025em; }
.ios-lyrics-sheet .lyrics-head-artist { font-size: 18px; color: rgba(255,255,255,.75); }
.ios-lyrics-sheet #lyricsStarBtn { display: none; }
.ios-lyrics-sheet .lyrics-head-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.15); }
.ios-lyrics-sheet .sheet-lyrics-body { padding: 80px 28px 45vh; gap: 30px; --scroll-mask-top: 50px; --scroll-mask-bottom: 90px; scrollbar-width: none; }
.ios-lyrics-sheet .sheet-lyrics-body::-webkit-scrollbar { display: none; }
.ios-lyrics-sheet .sheet-lyrics-body.scroll-fade-mask--edges {
  -webkit-mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 20px,
    rgba(0, 0, 0, 0.8) 40px,
    #000 var(--scroll-mask-top),
    #000 calc(100% - var(--scroll-mask-bottom)),
    rgba(0, 0, 0, 0.8) calc(100% - var(--scroll-mask-bottom) + 35px),
    rgba(0, 0, 0, 0.2) calc(100% - 20px),
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    transparent 0%,
    rgba(0, 0, 0, 0.2) 20px,
    rgba(0, 0, 0, 0.8) 40px,
    #000 var(--scroll-mask-top),
    #000 calc(100% - var(--scroll-mask-bottom)),
    rgba(0, 0, 0, 0.8) calc(100% - var(--scroll-mask-bottom) + 35px),
    rgba(0, 0, 0, 0.2) calc(100% - 20px),
    transparent 100%
  );
}
.ios-lyrics-sheet .lyrics-line {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
  font-size: clamp(30px,8.5vw,42px);
  line-height: 1.2;
  font-weight: 750;
  letter-spacing: -.025em;
  color: rgba(255,255,255,.28);
  filter: blur(3px);
  border-radius: 20px;
  padding: 8px 14px;
  margin: 2px 0;
  transition: color var(--dur-short) var(--ease),
              filter var(--dur-short) var(--ease),
              opacity var(--dur-short) var(--ease),
              transform var(--dur-short) var(--ease);
  transform-origin: left center;
}
.ios-lyrics-sheet .lyrics-line::before {
  content: "";
  position: absolute;
  inset: -6px -10px;
  border-radius: 24px;
  background: radial-gradient(ellipse 90% 85% at 50% 50%, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.06) 60%, transparent 85%);
  filter: blur(16px);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity var(--dur-short) var(--ease);
}
.ios-lyrics-sheet .lyrics-line.lyrics-near { filter: blur(1.5px); color: rgba(255,255,255,.45); }
.ios-lyrics-sheet .lyrics-line.lyrics-past { opacity: .65; }
.ios-lyrics-sheet .lyrics-line.active {
  filter: none;
  color: var(--lyrics-ink);
  opacity: 1;
  transform: scale(1.02);
  text-shadow: 0 2px 20px rgba(255, 255, 255, 0.28);
}
.ios-lyrics-sheet .lyrics-line.active::before {
  opacity: 1;
}
.ios-lyrics-sheet .lyrics-line.is-pressed::before {
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.16);
}
.ios-lyrics-sheet .sheet-lyrics-body.is-plain .lyrics-line { filter: none; font-size: 30px; font-weight: 650; color: rgba(255,255,255,.9); transform: none; text-shadow: none; }
.ios-lyrics-sheet .sheet-lyrics-body.is-plain .lyrics-line::before { display: none; }
.lyrics-player-controls { position: relative; z-index: 2; display: grid; grid-template-rows: auto 88px 28px 48px; gap: 20px; flex: 0 0 auto; width: 100%; max-width: 620px; margin-inline: auto; padding: 16px 32px max(20px,var(--sab)); color: var(--lyrics-ink); }
.lyrics-player-controls .ios-scrubber-section { margin: 0; }
.lyrics-player-controls .ios-controls-cluster { display: flex; justify-content: space-around; align-items: center; margin: 0; }
.lyrics-player-controls :is(.ctrl-shuffle,.ctrl-repeat) { display: none; }
.lyrics-player-controls .ios-play-hero { width: 80px; height: 80px; background: transparent; }
.lyrics-player-controls .ios-play-hero svg { width: 56px; height: 56px; }
.lyrics-player-controls :is(.ctrl-prev,.ctrl-next) { width: 64px; height: 64px; }
.lyrics-player-controls :is(.ctrl-prev,.ctrl-next) svg { width: 40px; height: 40px; }
.lyrics-player-controls .ios-modal-volume-row { margin: 0; }
.lyrics-player-controls .ios-player-bottom-dock { display: grid; grid-template-columns: repeat(3,1fr); justify-items: center; align-items: center; margin: 0; padding: 0; }
.lyrics-player-controls #playerShareBtn { display: none; }
.lyrics-player-controls #lyricsToggleBtn { order: 1; width: 46px; height: 46px; border-radius: 50%; color: rgb(var(--tint)); background: rgba(255,255,255,.85); }
.lyrics-player-controls #openEqBtn { order: 2; }
.lyrics-player-controls #queueToggleBtn { order: 3; background: transparent; color: var(--lyrics-ink); }
.lyrics-vocal-control { position: absolute; z-index: 2; right: 32px; bottom: calc(320px + var(--sab)); width: 72px; height: 156px; overflow: hidden; border-radius: 36px; background: rgba(255,255,255,.28); color: rgba(var(--tint),.85); pointer-events: none; }
.lyrics-vocal-fill { position: absolute; inset: 42px 0 0; background: rgba(255,255,255,.82); }
.lyrics-vocal-control svg { position: absolute; left: 17px; bottom: 18px; width: 38px; height: 38px; }
.ios-lyrics-sheet .ai-karaoke { color: rgba(255,255,255,.8); padding: 24px 0; }
.ios-lyrics-sheet :is(.ai-title,.ai-sub,.ai-fine) { color: rgba(255,255,255,.9); }
.ios-lyrics-sheet .ai-btn { background: rgba(255,255,255,.9); color: rgb(var(--tint)); }
.ios-lyrics-sheet:has(.lyrics-empty-state,.ai-karaoke,.is-plain) .lyrics-vocal-control { display: none; }
.ios-lyrics-sheet .lyrics-empty-state .empty-title { color: rgba(255,255,255,.9); }
@media (max-height: 740px) {
  .ios-lyrics-sheet .lyrics-top { padding-top: calc(var(--tg-header-clearance) + 40px); padding-inline: 24px; }
  .ios-lyrics-sheet .lyrics-head-art { width: 64px; height: 64px; }
  .ios-lyrics-sheet .sheet-lyrics-body { padding-inline: 24px; padding-top: 40px; gap: 24px; }
  .ios-lyrics-sheet .lyrics-line { font-size: 32px; }
  .lyrics-player-controls { grid-template-rows: auto 64px 24px 44px; gap: 12px; padding: 12px 24px max(12px,var(--sab)); }
  .lyrics-player-controls .ios-play-hero { width: 64px; height: 64px; }
  .lyrics-vocal-control { bottom: calc(244px + var(--sab)); right: 24px; width: 60px; height: 132px; }
  .lyrics-vocal-control svg { left: 12px; width: 36px; height: 36px; }
}
@media (min-width: 800px) { .ios-lyrics-sheet .lyrics-head,.ios-lyrics-sheet .sheet-lyrics-body { width: min(100%,620px); margin-inline: auto; } .lyrics-vocal-control { right: max(32px,calc((100% - 620px)/2 + 32px)); } }
@media (prefers-reduced-motion: reduce) { .ios-lyrics-sheet .lyrics-line { transition: none; } }
/* The vocal slider is shown only when both real stems are decoded. */
.lyrics-sing-action { position: absolute; z-index: 3; left: 32px; bottom: calc(314px + var(--sab)); padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.16); color: var(--lyrics-ink); font-size: 14px; font-weight: 600; }
.lyrics-sing-action:disabled { opacity: .6; cursor: wait; }
.lyrics-vocal-control { pointer-events: auto; }
.lyrics-vocal-fill { inset: auto 0 0; height: 0; }
#karaokeVocalLevel { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; margin: 0; background: transparent; writing-mode: vertical-lr; direction: rtl; opacity: 0; cursor: ns-resize; }
.lyrics-vocal-control:focus-within { outline: 2px solid var(--lyrics-ink); outline-offset: 4px; }
.lyrics-vocal-control svg { pointer-events: none; color: var(--lyrics-ink); mix-blend-mode: difference; }
.ios-lyrics-sheet:has(.lyrics-empty-state,.ai-karaoke,.is-plain) .lyrics-vocal-control:not(.hidden) { display: block; }
@media (max-height:740px) { .lyrics-sing-action { left: 24px; bottom: calc(236px + var(--sab)); } }

/* ---- текст есть, таймкодов нет: карточка «Расставить» над обычным текстом ---- */

.ai-sync {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 18px;
  text-align: left;
  color: var(--text-secondary);
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--line) inset;
  animation: ai-appear var(--dur-page) var(--ease) both;
}

.ai-sync-badge {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.14);
}

.ai-sync-badge svg {
  width: 18px;
  height: 18px;
}

.ai-sync-text {
  flex: 1 1 auto;
  min-width: 0;
}

.ai-sync-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.ai-sync-sub {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.35;
}

.ai-sync.is-quiet {
  padding: 10px 14px;
  background: transparent;
}

.ai-sync-btn {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-on);
  background: var(--accent-gradient);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-fast) var(--ease), opacity var(--dur-micro) var(--ease);
}

.ai-sync-btn.is-pressed {
  scale: 0.95;
}

.ai-sync-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.ai-sync-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: ai-sync-pulse var(--dur-pulse) var(--ease-breathe) infinite;
}

@keyframes ai-sync-pulse {
  0%, 100% { transform: scale(0.7); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; }
}

.ios-lyrics-sheet .ai-sync {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.ios-lyrics-sheet .ai-sync-title { color: rgba(255, 255, 255, 0.95); }
.ios-lyrics-sheet .ai-sync-badge { color: rgb(255, 255, 255); background: rgba(255, 255, 255, 0.2); }
.ios-lyrics-sheet .ai-sync-pulse { background: rgb(255, 255, 255); }
.ios-lyrics-sheet .ai-sync-btn { background: rgba(255, 255, 255, 0.9); color: rgb(var(--tint)); }

@media (prefers-reduced-motion: reduce) {
  .ai-sync, .ai-sync-pulse { animation: none; }
}

/* Empty lyrics belong to the current theme and center within the lyrics area. */
.ios-lyrics-sheet #lyricsContent:has(> .ai-karaoke) {
  padding: 16px;
  gap: 0;
  mask-image: none;
  -webkit-mask-image: none;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) {
  width: 100%;
  min-height: 100%;
  margin-block: auto;
  padding: 0;
  gap: 12px;
  color: color-mix(in srgb, var(--lyrics-ink) 72%, transparent);
  animation: none;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-badge {
  width: 36px;
  height: 36px;
  margin: 0 0 4px;
  color: color-mix(in srgb, var(--lyrics-ink) 62%, transparent);
  background: transparent;
  box-shadow: none;
  animation: none;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-badge svg { width: 28px; height: 28px; }
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-title {
  color: var(--lyrics-ink);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 600;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-sub {
  max-width: 292px;
  color: color-mix(in srgb, var(--lyrics-ink) 72%, transparent);
  font-size: 13px;
  line-height: 1.4;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-btn {
  justify-content: center;
  min-height: 44px;
  margin: 4px 0 0;
  padding: 0 20px;
  border-radius: 10px;
  background: var(--accent-fill);
  color: var(--tg-on-accent);
  box-shadow: none;
  font-size: 15px;
  font-weight: 600;
}
.ios-lyrics-sheet .ai-karaoke:not(.ai-running) .ai-fine {
  max-width: 292px;
  margin: 0;
  color: color-mix(in srgb, var(--lyrics-ink) 72%, transparent);
  font-size: 11px;
  line-height: 1.3;
  opacity: 1;
}

/* Активная строка выделяется текстом, без фонового свечения. */
.ios-lyrics-sheet .lyrics-line::before { display: none; }
.ios-lyrics-sheet .lyrics-line.active { text-shadow: none; }

/* ---- Загрузка текста и «текста нет» в стиле Liquid Glass (2026-11-13) ----
   Экран текста всегда на тёмном фоне из цвета обложки, поэтому здесь — белое
   стекло: полупрозрачная заливка, светлый блик по верхней кромке и тонкий
   край, без акцентного свечения. */

/* Загрузка: заготовки строк мерцают волной сверху вниз, как в Apple Music. */
.lyrics-skeleton {
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding-top: 8px;
}
.lyrics-skeleton i {
  display: block;
  width: var(--w, 70%);
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.16);
  opacity: 0.45;
  animation: lyrics-skel var(--dur-pulse) var(--ease-breathe) infinite alternate;
  animation-delay: calc(var(--i, 0) * 140ms);
}
@keyframes lyrics-skel {
  from { opacity: 0.35; }
  to { opacity: 1; }
}
.ios-lyrics-sheet:has(.lyrics-skeleton) .lyrics-vocal-control,
.ios-lyrics-sheet:has(.lyrics-skeleton, .ai-karaoke, .lyrics-empty-state) .lyrics-sing-action { display: none; }

/* «Текста нет», ожидание, ошибка. */
.ios-lyrics-sheet #lyricsContent .ai-karaoke { gap: 12px; padding: 24px 8px; }
.ios-lyrics-sheet #lyricsContent .ai-karaoke .ai-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: #fff; }
.ios-lyrics-sheet #lyricsContent .ai-sub { max-width: 300px; font-size: 15px; color: rgba(255, 255, 255, 0.68); }
.ios-lyrics-sheet #lyricsContent .ai-fine { color: rgba(255, 255, 255, 0.5); opacity: 1; }
.ios-lyrics-sheet #lyricsContent .ai-note { color: #fff; background: rgba(255, 255, 255, 0.12); }

.ios-lyrics-sheet #lyricsContent .ai-badge,
.ios-lyrics-sheet #lyricsContent .ai-badge.is-quiet {
  width: 68px;
  height: 68px;
  margin-bottom: 8px;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), inset 0 0 0 0.5px rgba(255, 255, 255, 0.2), 0 10px 28px rgba(0, 0, 0, 0.22);
}
.ios-lyrics-sheet #lyricsContent .ai-badge.is-quiet { color: rgba(255, 255, 255, 0.7); }
.ios-lyrics-sheet #lyricsContent .ai-badge svg { width: 30px; height: 30px; }

.ios-lyrics-sheet #lyricsContent .ai-btn {
  min-height: 50px;
  margin-top: 18px;
  padding: 0 28px;
  color: #fff;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 0 0 0.5px rgba(255, 255, 255, 0.25), 0 10px 28px rgba(0, 0, 0, 0.24);
}
.ios-lyrics-sheet #lyricsContent .ai-btn:disabled { box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.2); }

/* Пустой текст продолжает ритм строк, а не становится отдельной карточкой. */
.ios-lyrics-sheet #lyricsContent .ai-idle {
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  gap: var(--s3);
  padding: var(--s4) var(--s2);
  animation: ai-appear var(--dur-page) var(--ease) both;
}
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-title {
  max-width: 12em;
  font-size: var(--t-large, 28px);
  line-height: 1.15;
  color: var(--lyrics-ink);
}
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-sub,
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-fine {
  color: color-mix(in srgb, var(--lyrics-ink) 78%, transparent);
  line-height: 1.4;
}
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-btn {
  min-height: 44px;
  margin-top: var(--s2);
  padding: 0 var(--s4);
  border-radius: var(--r-pill);
  color: var(--lyrics-ink);
  background: color-mix(in srgb, var(--lyrics-ink) 16%, transparent);
  box-shadow: none;
}
.ios-lyrics-sheet #lyricsContent .ai-idle .ai-btn:focus-visible {
  outline: 2px solid var(--lyrics-ink);
  outline-offset: 3px;
}
/* Все действия ИИ-караоке используют тот же компактный язык, что и запуск. */
.ios-lyrics-sheet #lyricsContent .ai-karaoke .ai-btn,
.ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn {
  min-height: 44px;
  padding: 0 var(--s4);
  border-radius: var(--r-pill);
  color: var(--lyrics-ink);
  background: color-mix(in srgb, var(--lyrics-ink) 16%, transparent);
  box-shadow: none;
}
.ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn { max-width: 100%; }
.ios-lyrics-sheet #lyricsContent .ai-karaoke .ai-btn:disabled,
.ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn:disabled { box-shadow: none; }
.ios-lyrics-sheet #lyricsContent .ai-karaoke .ai-btn:focus-visible,
.ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn:focus-visible {
  outline: 2px solid var(--lyrics-ink);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn { transition: none; }
}
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-sync .ai-sync-btn { transition: none; }
/* Ожидание занимает то же место, что и заглушка; движется только индикатор статуса. */
.ios-lyrics-sheet #lyricsContent :is(.ai-idle, .ai-running, .ai-failed) {
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  gap: var(--s3);
  padding: var(--s4) var(--s2);
}
.ios-lyrics-sheet #lyricsContent :is(.ai-running, .ai-failed) .ai-title {
  color: var(--lyrics-ink);
  font-size: var(--t-large, 28px);
  line-height: 1.15;
}
.ios-lyrics-sheet #lyricsContent .ai-dots { white-space: nowrap; }
.ios-lyrics-sheet #lyricsContent .ai-dots span {
  display: inline-block;
  animation: ai-dot-wave var(--dur-pulse) var(--ease-breathe) infinite;
}
.ios-lyrics-sheet #lyricsContent .ai-dots span:nth-child(2) { animation-delay: calc(var(--dur-pulse) / 6); }
.ios-lyrics-sheet #lyricsContent .ai-dots span:nth-child(3) { animation-delay: calc(var(--dur-pulse) / 3); }
@keyframes ai-dot-wave {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-0.13em); }
}
.ios-lyrics-sheet #lyricsContent :is(.ai-running, .ai-failed) .ai-sub {
  color: color-mix(in srgb, var(--lyrics-ink) 78%, transparent);
  line-height: 1.4;
}
@media (prefers-reduced-motion: reduce) {
  .ios-lyrics-sheet #lyricsContent :is(.ai-idle, .ai-running),
  .ios-lyrics-sheet #lyricsContent .ai-dots span { animation: none; }
}
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-idle { animation: none; }
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-running,
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-dots span { animation: none; }

/* Ожидание расшифровки: тот же орб, но белым светом, а не акцентным. */
.ios-lyrics-sheet #lyricsContent .ai-orb::before { background: conic-gradient(from 0deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0)); }
.ios-lyrics-sheet #lyricsContent .ai-orb::after { background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.06)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), inset 0 0 0 0.5px rgba(255, 255, 255, 0.2); }
.ios-lyrics-sheet #lyricsContent .ai-ring { border-color: rgba(255, 255, 255, 0.4); }
.ios-lyrics-sheet #lyricsContent .ai-bars i { background: #fff; }

/* Короткие состояния («Инструментальная композиция», «Не удалось получить текст»). */
.ios-lyrics-sheet #lyricsContent .lyrics-empty-state .empty-icon { color: rgba(255, 255, 255, 0.7); opacity: 1; }
.ios-lyrics-sheet #lyricsContent .lyrics-empty-state .empty-title { font-size: 17px; }

@media (prefers-reduced-motion: reduce) { .lyrics-skeleton i { animation: none; opacity: 0.6; } }

/* Recognition states share the player's typography and a quiet, legible error cue. */
.ios-lyrics-sheet #lyricsContent .ai-running .ai-title {
  transition: opacity 420ms cubic-bezier(.22, 1, .36, 1), transform 420ms cubic-bezier(.22, 1, .36, 1);
}
.ios-lyrics-sheet #lyricsContent .ai-running .ai-title.is-swapping {
  opacity: 0;
  transform: translateY(-5px);
  transition-duration: 240ms;
}
.ios-lyrics-sheet #lyricsContent .ai-failed {
  position: relative;
  min-height: max-content;
  flex-shrink: 0;
  animation: none;
}
.ios-lyrics-sheet #lyricsContent .ai-error-morph {
  position: absolute;
  top: var(--s4);
  left: var(--s2);
  height: 32px;
  pointer-events: none;
  z-index: 1;
}
.ai-error-origin {
  position: absolute;
  left: 0;
  top: 0;
  width: min(80vw, 340px);
  color: var(--lyrics-ink);
  font-size: var(--t-large, 28px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  transform-origin: 14px 50%;
  animation: ai-error-gather 500ms cubic-bezier(.55, 0, .2, 1) both;
}
.ai-error-mark {
  display: block;
  width: 30px;
  height: 30px;
  color: #ff817d;
  transform-origin: center;
  animation: ai-error-symbol 1350ms cubic-bezier(.22, 1, .36, 1) both;
}
.ai-error-mark svg { display: block; width: 100%; height: 100%; }
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-title,
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-sub,
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-btn {
  animation: ai-error-unfold 650ms cubic-bezier(.22, 1, .36, 1) both;
}
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-title { animation-delay: 850ms; }
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-sub { animation-delay: 1000ms; }
.ios-lyrics-sheet #lyricsContent .ai-failed .ai-btn { animation-delay: 1120ms; }
@keyframes ai-error-gather {
  0% { opacity: 1; transform: scaleX(1); }
  100% { opacity: 0; transform: scaleX(.08); }
}
@keyframes ai-error-symbol {
  0%, 20% { opacity: 0; transform: scale(.35); }
  40%, 62% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.25); }
}
@keyframes ai-error-unfold {
  from { opacity: 0; transform: translateX(-8px) scaleX(.9); transform-origin: left center; }
  to { opacity: 1; transform: translateX(0) scaleX(1); transform-origin: left center; }
}
@media (prefers-reduced-motion: reduce) {
  .ios-lyrics-sheet #lyricsContent .ai-running .ai-title { transition: none; }
  .ios-lyrics-sheet #lyricsContent .ai-error-morph { display: none; }
  .ios-lyrics-sheet #lyricsContent .ai-failed :is(.ai-title, .ai-sub, .ai-btn) { animation: none; }
}
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-running .ai-title { transition: none; }
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-error-morph { display: none; }
html[data-motion="instant"] .ios-lyrics-sheet #lyricsContent .ai-failed :is(.ai-title, .ai-sub, .ai-btn) { animation: none; }
