/* Интерактивная тренировка с тренером (workout-player.js). */
html.ngp-lock, html.ngp-lock body { overflow: hidden !important; }

.ngp { position: fixed; inset: 0; z-index: 98; display: flex; align-items: stretch; justify-content: center; color: #eef6f7; }
.ngp-sheet {
  position: relative; display: flex; flex-direction: column; width: 100%; max-width: 560px; min-height: 100%;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px calc(env(safe-area-inset-bottom, 0px) + 14px);
  background: radial-gradient(120% 70% at 50% 0%, #15232d 0%, #0a1118 55%, #070c11 100%);
  overflow: hidden; animation: ngpSheetIn .32s cubic-bezier(.2, .8, .2, 1) both;
}
.ngp-sheet::before { content: ''; position: absolute; inset: -40% -20% auto; height: 70%; background: radial-gradient(closest-side, rgba(183, 255, 0, .14), transparent 70%); pointer-events: none; animation: ngpGlow 9s ease-in-out infinite alternate; }
.ngp-sheet[data-kind="rest"]::before { background: radial-gradient(closest-side, rgba(96, 196, 255, .16), transparent 70%); }
.ngp-sheet[data-kind="finish"]::before { background: radial-gradient(closest-side, rgba(255, 196, 64, .18), transparent 70%); }
.ngp-sheet.is-paused .ngp-ring-wrap { filter: saturate(.4); }

.ngp-top { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ngp-top-mid { display: flex; flex-direction: column; align-items: center; min-width: 0; flex: 1; }
.ngp-kicker { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #9fb2b6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ngp-elapsed { font-size: 13px; font-weight: 900; color: #b7ff00; font-variant-numeric: tabular-nums; }
.ngp-top-right { display: flex; gap: 6px; }
.ngp-icon { width: 42px; height: 42px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); color: #cfe3e8; font-size: 15px; cursor: pointer; transition: background .2s, transform .15s; }
.ngp-icon:active { transform: scale(.94); }
.ngp-icon.is-on { color: #b7ff00; border-color: rgba(183, 255, 0, .35); }

.ngp-progress { display: flex; gap: 3px; margin: 10px 0 4px; height: 4px; }
.ngp-seg { flex: 1 1 0; min-width: 2px; border-radius: 99px; background: rgba(255, 255, 255, .12); transition: background .3s, transform .3s; }
.ngp-seg.is-rest { flex-grow: .5; }
.ngp-seg.is-warmup, .ngp-seg.is-cooldown { background: rgba(96, 196, 255, .18); }
.ngp-seg.is-done { background: #b7ff00; }
.ngp-seg.is-now { background: #eaffb0; transform: scaleY(1.8); box-shadow: 0 0 10px rgba(183, 255, 0, .6); }

.ngp-body { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 0; padding-top: 10px; overflow: hidden; }
.ngp-enter { animation: ngpStepIn .34s cubic-bezier(.2, .8, .2, 1) both; }
.ngp-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ngp-set { margin: 0; font-size: 13px; font-weight: 800; color: #b7ff00; letter-spacing: .02em; }
.ngp-muscle { color: #9fb2b6; font-weight: 700; }
.ngp-title { margin: 0; font-size: clamp(20px, 5.6vw, 26px); font-weight: 900; line-height: 1.2; color: #fff; text-wrap: balance; }
.ngp-meta { margin: 0; font-size: 14px; color: #c7d6da; }
.ngp-paused-label { margin: 0; font-size: 12px; font-weight: 900; letter-spacing: .2em; text-transform: uppercase; color: #ffd166; animation: ngpBlink 1.4s ease-in-out infinite; }

/* Кольцо таймера */
.ngp-ring-wrap { position: relative; width: min(62vw, 250px); aspect-ratio: 1; margin: 6px auto 2px; display: grid; place-items: center; }
.ngp-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ngp-ring-bg { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 8; }
.ngp-ring-fg { fill: none; stroke: #b7ff00; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .12s linear, stroke .3s; filter: drop-shadow(0 0 8px rgba(183, 255, 0, .55)); }
.ngp-ring-wrap.is-rest .ngp-ring-fg { stroke: #60c4ff; filter: drop-shadow(0 0 8px rgba(96, 196, 255, .55)); }
.ngp-ring-wrap.is-prep .ngp-ring-fg { stroke: #ffd166; filter: drop-shadow(0 0 8px rgba(255, 209, 102, .55)); }
.ngp-ring-wrap.is-reps .ngp-ring-fg { stroke: #7ef0c0; }
.ngp-ring-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ngp-ring-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #ffd166; }
.ngp-clock { font-size: clamp(44px, 14vw, 68px); font-weight: 900; line-height: 1; letter-spacing: -.02em; color: #fff; font-variant-numeric: tabular-nums; }
.ngp-ring-wrap.is-prep .ngp-clock { font-size: clamp(60px, 20vw, 88px); animation: ngpPrepPulse 1s ease-in-out infinite; }
.ngp-rep-row { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; }
.ngp-rep-count { font-size: 30px; font-weight: 900; color: #7ef0c0; line-height: 1; display: inline-block; }
.ngp-rep-target { font-size: 14px; font-weight: 800; color: #9fb2b6; }
.ngp-breathe-bg { position: absolute; inset: 12%; border-radius: 50%; background: radial-gradient(circle, rgba(96, 196, 255, .22), rgba(96, 196, 255, 0) 70%); animation: ngpBreathe 4s ease-in-out infinite; }

/* Тренер */
.ngp-coach { display: flex; align-items: flex-start; gap: 10px; width: 100%; max-width: 440px; margin-top: 6px; padding: 10px 12px; border-radius: 18px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); text-align: left; }
.ngp-avatar { position: relative; flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #b7ff00, #4fd1a5); color: #071014; font-size: 13px; font-weight: 900; box-shadow: 0 6px 18px rgba(183, 255, 0, .25); }
.ngp-avatar-bars { position: absolute; right: -4px; bottom: -4px; display: flex; align-items: flex-end; gap: 2px; height: 14px; padding: 2px 4px; border-radius: 8px; background: #0b1017; opacity: 0; transition: opacity .25s; }
.ngp-avatar-bars i { width: 2px; height: 4px; border-radius: 2px; background: #b7ff00; }
.ngp-avatar.is-talking .ngp-avatar-bars { opacity: 1; }
.ngp-avatar.is-talking .ngp-avatar-bars i { animation: ngpTalk .7s ease-in-out infinite; }
.ngp-avatar.is-talking .ngp-avatar-bars i:nth-child(2) { animation-delay: .12s; }
.ngp-avatar.is-talking .ngp-avatar-bars i:nth-child(3) { animation-delay: .24s; }
.ngp-avatar.is-talking .ngp-avatar-bars i:nth-child(4) { animation-delay: .36s; }
.ngp-coach-text { margin: 0; font-size: 14px; line-height: 1.45; color: #dbe8ec; min-height: 40px; }
.ngp-coach-swap { animation: ngpTextIn .35s ease both; }

/* Вступление и финал */
.ngp-hero { display: grid; place-items: center; margin-top: 8px; }
.ngp-hero-ring { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; color: #b7ff00; background: rgba(183, 255, 0, .08); border: 2px solid rgba(183, 255, 0, .35); box-shadow: 0 0 0 10px rgba(183, 255, 0, .05), 0 0 40px rgba(183, 255, 0, .25); }
.ngp-hero-ring.is-done { color: #071014; background: #b7ff00; border-color: #b7ff00; }
.ngp-plan { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; max-width: 440px; display: grid; gap: 6px; }
.ngp-plan li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 12px; background: rgba(255, 255, 255, .04); font-size: 14px; animation: ngpStepIn .4s ease both; animation-delay: calc(var(--i, 0) * 40ms); }
.ngp-plan li span { text-align: left; }
.ngp-plan li small { color: #9fb2b6; font-weight: 800; white-space: nowrap; }
.ngp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 440px; margin-top: 6px; }
.ngp-stats div { padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .08); display: grid; gap: 2px; }
.ngp-stats b { font-size: 18px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.ngp-stats span { font-size: 11px; color: #9fb2b6; font-weight: 700; }
.ngp-effort { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.ngp-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 14px; border-radius: 99px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .05); color: #eef6f7; font-size: 14px; font-weight: 800; cursor: pointer; transition: transform .15s, background .2s, border-color .2s; }
.ngp-chip:active { transform: scale(.96); }
.ngp-chip.is-on { background: rgba(183, 255, 0, .16); border-color: #b7ff00; color: #e7ffb0; }

.ngp-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ngp-confetti i { position: absolute; top: -12px; left: var(--x); width: 8px; height: 14px; border-radius: 2px; background: hsl(var(--h), 90%, 60%); opacity: 0; animation: ngpConfetti 2.6s ease-in both; animation-delay: var(--d); }
.ngp-confetti i:nth-child(odd) { width: 6px; height: 6px; border-radius: 50%; }

/* Кнопки */
.ngp-actions { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 6px; }
.ngp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 16px; border-radius: 16px; border: 1px solid rgba(255, 255, 255, .14); background: rgba(255, 255, 255, .06); color: #eef6f7; font-size: 15px; font-weight: 850; cursor: pointer; transition: transform .15s ease, background .2s, box-shadow .2s; }
.ngp-btn:active { transform: scale(.96); }
.ngp-btn-ghost { min-width: 48px; color: #cfe3e8; }
.ngp-btn-primary { flex: 1 1 auto; max-width: 320px; background: #b7ff00; border-color: #b7ff00; color: #071014; box-shadow: 0 10px 28px rgba(183, 255, 0, .25); }
.ngp-btn-primary:hover { box-shadow: 0 12px 34px rgba(183, 255, 0, .38); }
.ngp-btn-big { min-height: 56px; font-size: 17px; }
.ngp-btn-rep { flex: 1 1 auto; min-height: 56px; background: rgba(126, 240, 192, .14); border-color: rgba(126, 240, 192, .5); color: #c9fff0; font-size: 16px; }
.ngp-btn-rep:active { background: rgba(126, 240, 192, .3); }
.ngp button:focus-visible { outline: 3px solid #7ef0c0; outline-offset: 2px; }

/* Выход */
.ngp-exit { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 20px; background: rgba(5, 9, 13, .78); backdrop-filter: blur(6px); animation: ngpFade .2s ease both; }
.ngp-exit[hidden] { display: none; }
.ngp-exit-card { width: 100%; max-width: 380px; padding: 18px 16px 14px; border-radius: 22px; background: linear-gradient(160deg, #172430, #0d151d); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); animation: ngpStepIn .25s ease both; }
.ngp-exit-card h3 { margin: 0 0 6px; font-size: 18px; font-weight: 900; color: #fff; }
.ngp-exit-card p { margin: 0 0 14px; font-size: 14px; color: #c7d6da; line-height: 1.45; }
.ngp-exit-actions { display: grid; gap: 8px; }

/* Кнопка запуска на экране тренировки */
.ngp-launch { display: flex; align-items: center; gap: 12px; padding: 14px; margin-bottom: 20px; border: 1px solid rgba(183, 255, 0, .3) !important; background: linear-gradient(135deg, rgba(183, 255, 0, .12), rgba(96, 196, 255, .06)) !important; }
.ngp-launch-avatar { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #b7ff00, #4fd1a5); color: #071014; font-weight: 900; font-size: 14px; box-shadow: 0 0 0 6px rgba(183, 255, 0, .12); animation: ngpHalo 2.8s ease-in-out infinite; }
.ngp-launch-copy { flex: 1; min-width: 0; }
.ngp-launch-title { margin: 0; font-size: 15px; font-weight: 900; color: #fff; }
.ngp-launch-hint { margin: 2px 0 0; font-size: 12px; line-height: 1.4; color: #9fb2b6; }
.ngp-launch-btn { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 16px; border: 0; background: #b7ff00; color: #071014; font-size: 16px; cursor: pointer; box-shadow: 0 10px 24px rgba(183, 255, 0, .3); transition: transform .15s; }
.ngp-launch-btn:active { transform: scale(.94); }

/* Компактная кнопка «С тренером» в карточках */
.ngp-go { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px; border-radius: 12px; border: 1px solid rgba(183, 255, 0, .45); background: rgba(183, 255, 0, .12); color: #e7ffb0; font-size: 13px; font-weight: 850; cursor: pointer; white-space: nowrap; transition: transform .15s, background .2s; }
.ngp-go:hover { background: rgba(183, 255, 0, .2); }
.ngp-go:active { transform: scale(.96); }
.ngp-go.is-icon { width: 40px; min-width: 40px; padding: 0; flex: 0 0 auto; }
.ngp-go i { font-size: 12px; }
.ngp-go.is-primary { background: #b7ff00; border-color: #b7ff00; color: #071014; box-shadow: 0 8px 20px rgba(183, 255, 0, .25); }
.ngp-row { display: flex; align-items: center; gap: 8px; }
.ngp-row > :first-child { flex: 1 1 auto; min-width: 0; }

/* Анимации */
@keyframes ngpSheetIn { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes ngpStepIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ngpFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ngpTextIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ngpGlow { from { transform: translateX(-6%) scale(1); } to { transform: translateX(6%) scale(1.08); } }
@keyframes ngpBreathe { 0%, 100% { transform: scale(.82); opacity: .55; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes ngpPrepPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes ngpBlink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ngpTalk { 0%, 100% { height: 3px; } 50% { height: 10px; } }
@keyframes ngpHalo { 0%, 100% { box-shadow: 0 0 0 6px rgba(183, 255, 0, .12); } 50% { box-shadow: 0 0 0 11px rgba(183, 255, 0, .05); } }
@keyframes ngpConfetti { 0% { opacity: 0; transform: translateY(0) rotate(0); } 10% { opacity: 1; } 100% { opacity: 0; transform: translateY(110vh) rotate(540deg); } }
.ngp-pop { animation: ngpPop .32s cubic-bezier(.2, 1.6, .3, 1) both; }
@keyframes ngpPop { 0% { transform: scale(1); } 40% { transform: scale(1.45); color: #fff; } 100% { transform: scale(1); } }
.ngp-zoom { animation: ngpZoom .35s cubic-bezier(.2, 1.4, .3, 1) both; }
@keyframes ngpZoom { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ngp-breathe { animation: ngpBreathe 4s ease-in-out infinite; }

@media (min-width: 640px) { .ngp { align-items: center; padding: 16px; background: rgba(4, 8, 12, .74); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); } .ngp-sheet { min-height: 0; max-height: 92vh; border-radius: 28px; border: 1px solid rgba(255, 255, 255, .1); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); } }
@media (max-width: 400px) { .ngp-actions .ngp-btn { font-size: 14px; padding: 10px 12px; } .ngp-btn-big { font-size: 16px; } .ngp-btn-rep { font-size: 15px; white-space: nowrap; } }
@media (max-height: 640px) { .ngp-ring-wrap { width: min(44vw, 170px); } .ngp-coach-text { min-height: 0; } .ngp-plan { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .ngp *, .ngp *::before, .ngp *::after { animation: none !important; transition: none !important; }
}
