/* Дриль-спринт (ds-) і сцена після титрів (ac-) — js/blocks2.js. Лише токени теми. */

/* ---------------- дриль-спринт ---------------- */
.ds { position: relative; overflow: visible; }
.ds-start, .ds-sum { text-align: center; padding: 10px 4px 6px; }
.ds-start h3 { margin: 10px 0 4px; font-size: 22px; }
.ds-hint { margin: 0 auto 6px; max-width: 520px; }
.ds-badge { width: 64px; height: 64px; margin: 0 auto; border-radius: 22px; display: grid; place-items: center;
  background: var(--mag-soft); border: 2px solid var(--mag-line); box-shadow: 0 5px 0 var(--depth-mag); }
.ds-badge svg { width: 34px; height: 34px; fill: var(--mag); }
.ds-badge.big { width: 84px; height: 84px; border-radius: 28px; }
.ds-badge.big svg { width: 46px; height: 46px; }
.ds-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 18px; }
.ds-facts span { padding: 8px 14px; border-radius: 999px; background: var(--surface-2); border: 1.5px solid var(--line);
  color: var(--ink-soft); font-size: 14px; }
.ds-facts b { color: var(--ink); font-size: 16px; }
.ds-start .btn, .ds-sum .btn { padding: 15px 30px; font-size: 16.5px; font-weight: 800; border-radius: 16px; box-shadow: 0 5px 0 var(--depth-mag); }
.ds-start .btn:active, .ds-sum .btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--depth-mag); }

/* HUD прилипає під верхньою панеллю */
.ds-hud { position: sticky; top: calc(var(--topbar-h, 62px) + 8px); z-index: 6; display: flex; align-items: stretch; gap: 8px;
  padding: 8px; margin: -4px -4px 8px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line);
  box-shadow: var(--shadow-2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.ds-cell { flex: 1; min-width: 0; padding: 6px 10px; border-radius: 13px; background: var(--surface-2); text-align: center; line-height: 1.1; }
.ds-cell small { display: block; font-size: 11px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-faint); }
.ds-cell b { display: inline-block; font-size: 22px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.ds-cell i { display: block; font-style: normal; font-size: 11px; color: var(--ink-faint); }
.ds-time.low b { color: var(--bad); }
.ds-time.low { background: var(--bad-soft); }
.ds-combo.hot { background: var(--mag-soft); box-shadow: inset 0 0 0 1.5px var(--mag-line); }
.ds-combo.hot b { color: var(--mag); }
.ds-mute { flex: 0 0 46px; border-radius: 13px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink-soft);
  cursor: pointer; display: grid; place-items: center; padding: 0; }
.ds-mute svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ds-mute[aria-pressed="true"] { color: var(--ink-faint); }
.ds-mute:hover { border-color: var(--line-strong); }
.ds-bar { height: 6px; border-radius: 6px; background: var(--ghost); overflow: hidden; margin: 0 2px 10px; }
.ds-bar i { display: block; height: 100%; width: 100%; background: var(--mag); border-radius: 6px; transition: width .25s linear; }
.ds-hud:has(.low) + .ds-bar i { background: var(--bad); }
.ds-step { margin: 2px 4px 8px; font-weight: 700; color: var(--ink-soft); }
.ds-stage > .card { margin: 0; box-shadow: none; }
.ds-nav { display: flex; justify-content: flex-end; margin-top: 12px; }
.ds-nav .btn { min-width: 130px; }

.ds-pop { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); pointer-events: none; opacity: 0; z-index: 7;
  padding: 10px 20px; border-radius: 999px; background: var(--mag); color: var(--on-mag); font-weight: 800; font-size: 20px;
  box-shadow: var(--shadow-mag), var(--glow); white-space: nowrap; }
.ds-pop.go { animation: ds-pop 1.1s cubic-bezier(.2, 1.4, .4, 1) both; }
.ds-bump { animation: ds-bump .35s ease-out; }
.ds-in { animation: ds-in .35s ease-out both; }

.ds-sum .ds-big { font-size: clamp(26px, 6vw, 38px); font-weight: 800; color: var(--ink); margin: 12px 0 2px; }
.ds-flag { display: inline-block; margin-top: 12px; padding: 5px 12px; border-radius: 999px; background: var(--bad-soft);
  color: var(--bad); border: 1.5px solid var(--bad-line); font-weight: 700; font-size: 13px; }
.ds-end .ds-badge { animation: ds-spin .8s cubic-bezier(.2, 1.3, .4, 1) both; }

@keyframes ds-pop { 0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); } 25% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -6px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -24px) scale(.95); } }
@keyframes ds-bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
@keyframes ds-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes ds-spin { from { transform: scale(.4) rotate(-40deg); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 560px) {
  .ds-hud { gap: 6px; padding: 6px; }
  .ds-cell { padding: 5px 6px; }
  .ds-cell b { font-size: 19px; }
  .ds-cell small { font-size: 10px; letter-spacing: .6px; }
  .ds-mute { flex-basis: 40px; }
  .ds-nav .btn { width: 100%; }
}

/* ---------------- сцена після титрів ---------------- */
.ac { position: relative; overflow: hidden; }
.ac-locked { display: flex; gap: 16px; align-items: center; border: 2px dashed var(--line-strong); background: var(--surface-2); }
.ac-lock { position: relative; flex: 0 0 74px; height: 74px; display: grid; place-items: center; }
.ac-star { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--ghost); stroke: var(--line-strong); stroke-width: .8; }
.ac-pad { position: relative; width: 34px; height: 34px; fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; }
.ac-pad rect { fill: var(--surface); }
.ac-shackle { transform-origin: 16px 11px; transition: transform .45s cubic-bezier(.3, 1.5, .5, 1); }
.ac-txt { flex: 1; min-width: 0; }
.ac-txt b { display: block; font-size: 16px; color: var(--ink); margin: 2px 0 8px; }
.ac-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--mag); }
.ac-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.ac-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--ghost); border: 1.5px solid var(--line-strong); transition: background .25s, transform .25s; }
.ac-dots i.on { background: var(--mag); border-color: var(--mag); transform: scale(1.12); box-shadow: 0 0 10px -2px var(--mag-line); }
.ac-peek { margin-top: 10px; }

.ac-opening .ac-shackle { transform: translateY(-4px) rotate(-28deg); }
.ac-opening .ac-star { fill: var(--mag-soft); stroke: var(--mag); }
.ac-opening .ac-lock { animation: ac-wiggle .6s ease-in-out; }

.ac-open { border: 2px solid var(--mag-line); box-shadow: var(--shadow-2), var(--glow); }
.ac-anim { animation: ac-rise .55s cubic-bezier(.2, 1.2, .4, 1) both; }
.ac-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--mag); margin-bottom: 12px; }
.ac-head svg { width: 20px; height: 20px; fill: var(--mag); }
.ac-media { margin: 0 0 12px; border-radius: 18px; overflow: hidden; border: 1.5px solid var(--line); background: var(--surface-2); }
.ac-media img, .ac-media video { display: block; width: 100%; max-height: 420px; object-fit: cover; }
.ac-media video { object-fit: contain; background: var(--solid); }
.ac-yt { position: relative; display: block; color: var(--on-mag); text-decoration: none; }
.ac-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; background: var(--mag); color: var(--on-mag); font-weight: 800; box-shadow: var(--shadow-mag); }
.ac-play svg { width: 18px; height: 18px; fill: currentColor; }
.ac-yt:hover .ac-play { box-shadow: var(--shadow-mag), var(--glow); }
.ac-text { font-size: 16px; line-height: 1.55; color: var(--ink); margin: 0 0 12px; }

.ac-chat { display: flex; flex-direction: column; gap: 8px; }
.ac-msg { max-width: 82%; display: flex; flex-direction: column; }
.ac-msg small { font-size: 12px; font-weight: 700; color: var(--ink-faint); margin: 0 10px 2px; }
.ac-bub { padding: 10px 14px; border-radius: 18px; font-size: 15.5px; line-height: 1.45; box-shadow: var(--shadow-1); }
.ac-l { align-self: flex-start; }
.ac-l .ac-bub { background: var(--surface-2); color: var(--ink); border: 1.5px solid var(--line); border-bottom-left-radius: 6px; }
.ac-r { align-self: flex-end; align-items: flex-end; }
.ac-r .ac-bub { background: var(--mag); color: var(--on-mag); border-bottom-right-radius: 6px; }
.ac-anim .ac-msg { animation: ac-msg .4s ease-out both; animation-delay: calc(.45s + var(--i) * .55s); }

.ac-burst { position: absolute; left: 50%; top: 40px; pointer-events: none; }
.ac-burst i { position: absolute; width: 10px; height: 10px; background: var(--mag); border-radius: 2px;
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
  animation: ac-fly 1.1s ease-out both; animation-delay: var(--d); }

@keyframes ac-wiggle { 0%, 100% { transform: none; } 25% { transform: rotate(-8deg) scale(1.05); } 60% { transform: rotate(6deg) scale(1.1); } }
@keyframes ac-rise { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ac-msg { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes ac-fly { 0% { opacity: 1; transform: translate(0, 0) scale(.4); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2) rotate(90deg); } }

@media (max-width: 560px) {
  .ac-locked { flex-direction: column; text-align: center; }
  .ac-dots { justify-content: center; }
  .ac-msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
  .ds-pop.go, .ds-bump, .ds-in, .ds-end .ds-badge, .ac-anim, .ac-anim .ac-msg, .ac-opening .ac-lock, .ac-burst i { animation: none !important; }
  .ds-bar i, .ac-dots i, .ac-shackle { transition: none; }
}

/* темна тема: під «липкою» панеллю прокручуються вправи — фон суцільний */
.ds-hud { background: linear-gradient(var(--surface), var(--surface)), var(--page); }

/* тизер наступного уроку в кінці «після титрів» */
.ac-next { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: var(--mag-soft); color: var(--ink); font-size: 15px; line-height: 1.5; }
.ac-next b { color: var(--mag); }
