/* Обучение по кнопке «Обучение» (static/tutorial.js): окно с главами, подсветка цели, окошко-подсказка, плашка паузы.
   Выше окна ноты (45), ниже обычных окон Spoy (50) и всплывающих сообщений (60) */

.tut-dim { position: fixed; inset: 0; z-index: 46; width: 100%; height: 100%; pointer-events: none; }
.tut-dim path { fill: rgba(0, 0, 0, .6); }
.tut-hole { position: fixed; z-index: 46; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 2px var(--accent); }
.tut-hole.tut-none { display: none; }
/* шаг ждёт действия: рамка мягко пульсирует, чтобы было видно, куда нажать */
.tut-hole.act::after {
  content: ""; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--accent);
  animation: tut-ring 1.4s ease-out infinite;
}
.tut-shade { position: fixed; inset: 0; z-index: 46; background: rgba(0, 0, 0, .6); }

.tut-tip {
  position: fixed; z-index: 47; width: min(340px, calc(100vw - 24px)); padding: 14px 18px 14px;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 16px; box-shadow: var(--shadow);
  animation: tut-in .2s ease-out;
}
.tut-tip.tut-center { left: 50%; top: 50%; transform: translate(-50%, -50%); animation: none; }
.tut-tip::after {
  content: ""; position: absolute; width: 12px; height: 12px; background: var(--surface-2);
  border: 1px solid var(--border-2); transform: translate(-50%, -50%) rotate(45deg);
}
.tut-tip[data-side="below"]::after { left: var(--ax, 50%); top: 0; border-right-color: transparent; border-bottom-color: transparent; }
.tut-tip[data-side="above"]::after { left: var(--ax, 50%); top: 100%; border-left-color: transparent; border-top-color: transparent; }
.tut-tip[data-side="right"]::after { left: 0; top: var(--ay, 50%); border-right-color: transparent; border-top-color: transparent; }
.tut-tip[data-side="left"]::after { left: 100%; top: var(--ay, 50%); border-left-color: transparent; border-bottom-color: transparent; }
.tut-tip[data-side="over"]::after, .tut-tip[data-side="center"]::after, .tut-tip.tut-center::after { display: none; }

.tut-top { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tut-label { font-size: 12px; font-weight: 500; color: var(--accent-text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tut-count { margin-left: auto; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tut-bar { height: 3px; border-radius: 2px; background: var(--glass-2); margin-bottom: 12px; overflow: hidden; }
.tut-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .3s ease; }
.tut-tip h3 { margin: 0 0 6px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.tut-text { font-size: 14px; line-height: 1.5; color: var(--muted); }
.tut-tip > p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.tut-text p { margin: 0; }
.tut-text p + p, .tut-text ul + p, .tut-text p + ul { margin-top: 8px; }
.tut-text ul { margin: 0; padding-left: 18px; }
.tut-text li + li { margin-top: 3px; }
.tut-text b { color: var(--text); font-weight: 600; }
.tut-text kbd {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 6px; text-align: center;
  background: var(--surface); border: 1px solid var(--border-2); border-bottom-width: 2px;
  font: 600 12px/1.5 var(--mono); color: var(--text);
}
.tut-text .tut-demos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.tut-demo { pointer-events: none; }
.tut-tip:not([data-side="center"]) .tut-only-center { display: none; } /* пример нужен, только когда настоящей ноты на экране нет */
.tut-demo .tx { font-size: 15px; }

/* что сделать руками: точка пульсирует, после действия — галочка */
.tut-act {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 8px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--text); font-size: 13px; font-weight: 500;
}
.tut-act i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: tut-dot 1.2s ease-in-out infinite; }
.tut-tip.did .tut-act { background: rgba(74, 222, 128, .14); }
.tut-tip.did .tut-act i { animation: none; width: 14px; height: 14px; background: none; position: relative; }
.tut-tip.did .tut-act i::before { content: "✓"; position: absolute; inset: -3px 0 0; color: var(--hit, #4ade80); font-size: 14px; font-weight: 700; font-style: normal; }

/* окно на полке: сначала достать его */
.tut-shelf { margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--glass); font-size: 13px; line-height: 1.45; color: var(--muted); }
.tut-shelf b { color: var(--text); font-weight: 600; }
.tut-tip.on-shelf .tut-text, .tut-tip.on-shelf .tut-act { opacity: .45; }

.tut-btns { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.tut-btns .grow { flex: 1; }
.tut-link {
  padding: 0; border: 0; background: none; color: var(--faint); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none;
}
.tut-link:hover { color: var(--text); }
.tut-x {
  flex: none; display: grid; place-items: center; width: 26px; height: 26px; margin: -4px -6px -4px 0; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--faint); font-size: 13px; cursor: pointer;
}
.tut-x:hover { background: var(--glass); color: var(--text); }
.tut-tip.tut-center .tut-btns .tut-x { margin-left: auto; }

/* ---------- окно с главами ---------- */
.tut-menu {
  position: fixed; inset: 0; z-index: 48; display: grid; place-items: center; padding: 16px;
  background: rgba(0, 0, 0, .62); animation: tut-fade .15s ease-out;
}
.tut-card {
  position: relative; width: min(620px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px 24px 20px;
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 20px; box-shadow: var(--shadow);
}
.tut-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.tut-card > .sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.tut-card > .tut-x { position: absolute; top: 18px; right: 18px; margin: 0; width: 32px; height: 32px; }
.tut-card:focus { outline: none; }
.tut-chapters { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px 8px; }
@media (min-width: 900px) {
  .tut-card { width: min(820px, 100%); }
  .tut-chapters { grid-template-columns: 1fr 1fr; }
}
.tut-ch {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border: 0; border-radius: 12px;
  background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.tut-ch:hover { background: var(--glass); }
.tut-ch.here { background: var(--glass); box-shadow: inset 0 0 0 1px var(--border-2); }
.tut-n {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--glass-2); color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.tut-ch.done .tut-n { background: rgba(74, 222, 128, .16); color: var(--hit, #4ade80); }
.tut-ch-t { display: grid; gap: 1px; min-width: 0; }
.tut-ch-t b { font-size: 14px; font-weight: 600; }
.tut-ch-t small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.tut-menu-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 18px; }
.tut-menu-btns .grow { flex: 1; }

/* ---------- плашка «обучение на паузе» ---------- */
.tut-pill {
  position: fixed; z-index: 44; left: calc(var(--side, 0px) + 24px); bottom: 20px;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-2); box-shadow: var(--shadow); font-size: 13px; color: var(--muted);
  animation: tut-in .2s ease-out;
}
body.has-dock .tut-pill { bottom: calc(var(--dock-h, 80px) + 24px); }
.tut-pill svg { width: 16px; height: 16px; color: var(--accent-text); flex: none; }
.tut-pill .tut-x { margin: 0; }

@keyframes tut-fade { from { opacity: 0; } }
@keyframes tut-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes tut-ring { from { opacity: .9; transform: scale(1); } to { opacity: 0; transform: scale(1.12); } }
@keyframes tut-dot { 50% { transform: scale(1.5); opacity: .6; } }
@media (prefers-reduced-motion: reduce) {
  .tut-hole, .tut-tip, .tut-menu, .tut-pill, .tut-bar i { animation: none; transition: none; }
  .tut-hole.act::after, .tut-act i { animation: none; }
}
@media (max-width: 700px) {
  .tut-pill { left: 12px; right: 12px; }
  .tut-card { padding: 20px 16px 16px; }
}
