/* sparky_ai.css — Коммуникатор ИИ-Спарки по лекциям + чёткая панель понятности + живой эквалайзер звука */

/* Анимация живого звука на кнопке 🔊 */
body.music-playing #btn-sound:not(.off) {
  border-color: var(--cyan);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.35), 0 4px 0 var(--ink), 0 0 16px rgba(29,180,255,0.65);
  animation: eqBeat 0.52s ease-in-out infinite alternate;
}
@keyframes eqBeat { from { transform: scale(1); } to { transform: scale(1.07); } }

/* Понятная 1-строчная подсказка «ЧТО ДЕЛАТЬ» прямо внутри экрана задания */
.task-guide-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 13px;
  background: rgba(29, 180, 255, 0.14);
  border: 2px solid rgba(29, 180, 255, 0.42);
  font-size: 12.5px; font-weight: 800; color: #C9F0FF; line-height: 1.25;
}
.task-guide-bar b {
  padding: 2px 7px; border-radius: 7px; background: var(--cyan); color: var(--ink);
  font-size: 10.5px; font-weight: 900; text-transform: uppercase; flex-shrink: 0;
}

/* Кнопка «ИИ-Спарки» в боковом рельсе Лобби */
.rail-btn.ai-orb {
  background: linear-gradient(180deg, #34F5B8 0%, #0DA884 100%);
  box-shadow: 0 5px 0 #075945, 0 0 20px rgba(52, 245, 184, 0.48);
}

/* Полноценный Коммуникатор Спарки (Чат + Конспект лекций зоны) */
#ai-drawer {
  position: absolute; inset: 0; z-index: 175;
  background: rgba(3, 6, 18, 0.84);
  display: flex; align-items: flex-end; padding: 10px;
}
#ai-drawer[hidden] { display: none; }

.ai-sheet {
  width: 100%; height: 84%; display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #1B2C66 0%, #0B1330 100%);
  border: 3.5px solid var(--ink); border-radius: 26px; padding: 14px;
  box-shadow: inset 0 2px 0 rgba(120,230,255,0.35), 0 12px 40px rgba(0,0,0,0.8);
  animation: aiUp 0.25s cubic-bezier(.2,1.2,.4,1);
}
@keyframes aiUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.ai-head { display: flex; align-items: center; gap: 10px; }
.ai-head img { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); }
.ai-head-txt { flex: 1; min-width: 0; }
.ai-head-txt b { display: block; font-size: 15.5px; font-weight: 900; color: #FFE866; }
.ai-head-txt span { font-size: 11.5px; font-weight: 700; color: #8AEBFF; }

.ai-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ai-tab {
  height: 36px; border-radius: 12px; border: 2.5px solid var(--ink); cursor: pointer;
  background: rgba(255,255,255,0.08); color: #CBE0FF; font-family: inherit;
  font-size: 12.5px; font-weight: 900; text-transform: uppercase;
}
.ai-tab.on {
  background: linear-gradient(180deg, #3AD6FF, #0F84DC); color: #fff;
  box-shadow: 0 3px 0 #074378;
}

.ai-zones-strip {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; flex-shrink: 0;
}
.ai-zones-strip::-webkit-scrollbar { display: none; }
.ai-zchip {
  padding: 6px 11px; border-radius: 99px; border: 2px solid var(--ink);
  background: rgba(255,255,255,0.08); color: #DCEBFF; font-family: inherit;
  font-size: 11.5px; font-weight: 800; white-space: nowrap; cursor: pointer;
}
.ai-zchip.on { background: var(--gold); color: var(--ink); }

.ai-body {
  flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 9px;
  padding-right: 2px;
}

/* Конспект лекций */
.kb-card {
  padding: 12px 13px; border-radius: 16px; border: 2.5px solid var(--ink);
  background: rgba(8, 14, 36, 0.88); font-size: 13.5px; line-height: 1.45;
}
.kb-card b { display: block; font-size: 14px; color: #FFE866; margin-bottom: 6px; }
.kb-point {
  display: flex; gap: 8px; padding: 8px 10px; border-radius: 12px; margin-top: 6px;
  background: rgba(29, 180, 255, 0.12); border-left: 4px solid var(--cyan);
  font-weight: 700; color: #EDF5FF;
}

/* Чат со Спарки */
.msg {
  max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 13.5px; font-weight: 700; line-height: 1.42;
}
.msg.bot {
  align-self: flex-start; border: 2.5px solid var(--ink);
  background: linear-gradient(180deg, #243C82, #142252); color: #fff;
  border-bottom-left-radius: 5px;
}
.msg.user {
  align-self: flex-end; border: 2.5px solid var(--ink);
  background: linear-gradient(180deg, #FFB82E, #EE6B00); color: #fff;
  border-bottom-right-radius: 5px; text-shadow: 0 1px 0 rgba(0,0,0,0.4);
}

.ai-quick { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }
.ai-qbtn {
  padding: 6px 10px; border-radius: 11px; border: 2px solid rgba(120,210,255,0.4);
  background: rgba(29,180,255,0.14); color: #C9F0FF; font-family: inherit;
  font-size: 11.5px; font-weight: 800; cursor: pointer;
}
.ai-form { display: flex; gap: 7px; flex-shrink: 0; }
.ai-form input {
  flex: 1; height: 44px; padding: 0 13px; border-radius: 14px;
  border: 2.5px solid rgba(120,195,255,0.4); background: #060B1E;
  color: #fff; font-size: 15px; font-weight: 700; font-family: inherit; outline: none;
}
.ai-form input:focus { border-color: var(--cyan); }