/* Guided workout (workout.php): block cards, progress card and the full-screen player. */

/* ---------- progress card ---------- */
#gwProgress { margin: 0 0 .75rem; }
.gwp {
  background: #0E3D1D; border: 1px solid rgba(119,255,160,.16); border-radius: 22px;
  padding: 16px; color: #fff; display: grid; gap: 12px;
}
.gwp-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.gwp-lbl { font-family: 'Sora', sans-serif; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.55); margin-bottom: 4px; }
.gwp-val { font-family: 'TT Firs Neue', sans-serif; font-size: 16px; font-weight: 500; color: rgba(255,255,255,.85); }
.gwp-val b { font-size: 22px; font-weight: 600; color: #77FFA0; margin-right: 2px; }
.gwp-pct { font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 30px; line-height: 1; color: #fff; }
.gwp-pct small { font-size: 15px; color: rgba(255,255,255,.6); margin-left: 1px; }
.gwp-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); overflow: hidden; }
.gwp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #3FD978, #77FFA0); transition: width .5s cubic-bezier(.2,.8,.2,1); min-width: 0; }
.gwp-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px;
  border: 0; border-radius: 100px; background: #77FFA0; color: #041309; cursor: pointer;
  font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 15px; padding: 0 18px;
  transition: transform .12s, filter .2s;
}
.gwp-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gwp-btn svg { width: 20px; height: 20px; flex: none; }
.gwp-btn:active { transform: scale(.98); }
.gwp-btn:disabled { background: rgba(255,255,255,.1); color: rgba(255,255,255,.6); cursor: default; }
.gwp-btn--ghost { background: transparent; color: #77FFA0; box-shadow: inset 0 0 0 1.5px rgba(119,255,160,.5); }
.gwp-sub { font-family: 'Sora', sans-serif; font-size: 12px; color: rgba(255,255,255,.5); text-align: center; margin-top: -4px; }
.gwp.is-complete .gwp-lbl { color: #77FFA0; }

/* ---------- block cards ---------- */
.gwc .workout-item { gap: 12px; padding: 14px 14px 14px 12px; }
.gwc-ring {
  --p: 0; position: relative; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%;
  background: conic-gradient(#1F9E4B calc(var(--p) * 1turn), rgba(0,0,0,.1) 0);
  transition: --p .4s;
}
.gwc { --p: 0; }
.gwc-ring { --p: inherit; }
.gwc-ring img { width: 42px !important; height: 42px; max-width: none !important; border-radius: 50%; background: #1B1A1F; object-fit: contain; }
.gwc-badge {
  position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%;
  background: #1F9E4B; color: #fff; display: grid; place-items: center; border: 2px solid rgba(217,242,225,1);
  transform: scale(0); transition: transform .25s cubic-bezier(.3,1.6,.5,1);
}
.gwc-badge svg { width: 12px; height: 12px; }
.gwc.is-done .gwc-badge { transform: scale(1); }
.gwc .text-col { gap: 2px; min-width: 0; }
.gwc .item-type { margin-bottom: 0; }
.gwc .item-title { font-size: 16px; line-height: 1.25; }
.gwc-meta { font-family: 'Sora', sans-serif; font-size: 12px; color: rgba(0,0,0,.55); margin-top: 2px; }
.gwc-meta-done { color: #1F7A3E; font-weight: 600; }
.gwc-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,.07); color: #1B1A1F; transition: transform .3s, background .2s;
}
.gwc-toggle svg { width: 20px; height: 20px; }
.gwc.expanded .gwc-toggle { transform: rotate(180deg); background: #1B1A1F; color: #fff; }
.gwc .dropdown-content { padding: 0 12px; }
.gwc .category-description { margin: 0 2px 12px; font-size: 13px; line-height: 1.4; color: rgba(27,26,31,.75); white-space: pre-wrap; }
.gwc-hint {
  display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 12px; border-radius: 12px;
  background: rgba(31,158,75,.12); color: #1F6B39; font-family: 'Sora', sans-serif; font-size: 12px; line-height: 1.3;
}
.gwc-hint svg { width: 16px; height: 16px; flex: none; }

.gwc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gwc-ex {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  background: rgba(255,255,255,.6); border-radius: 18px; padding: 8px 10px 8px 8px;
  transition: background .2s, opacity .2s;
}
.gwc-thumb {
  position: relative; width: 104px; aspect-ratio: 4 / 3; border: 0; padding: 0; border-radius: 13px;
  overflow: hidden; background: #0D2D17; cursor: pointer; flex: none; display: block;
}
.gwc-thumb img, .gwc-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.gwc-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.45)); }
.gwc-num {
  position: absolute; left: 6px; top: 6px; z-index: 1; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
  background: rgba(0,0,0,.55); color: #fff; font: 600 11px/20px 'Sora', sans-serif; text-align: center;
}
.gwc-play {
  position: absolute; right: 6px; bottom: 6px; z-index: 1; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,.9); color: #041309; display: grid; place-items: center;
}
.gwc-play svg { width: 13px; height: 13px; margin-left: 2px; }
.gwc-info { min-width: 0; display: grid; gap: 6px; }
.gwc-name { font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 15px; line-height: 1.25; color: #1B1A1F; overflow-wrap: anywhere; }
.gwc-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.gwc-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 99px;
  background: #1B1A1F; color: #fff; font: 600 11.5px/1.2 'Sora', sans-serif; white-space: nowrap;
}
.gwc-chip--rest { background: rgba(0,0,0,.07); color: rgba(27,26,31,.8); font-weight: 500; }
.gwc-chip svg { width: 13px; height: 13px; }
.gwc-check {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(27,26,31,.25); background: transparent;
  color: transparent; display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: background .2s, border-color .2s, color .2s;
}
.gwc-check svg { width: 18px; height: 18px; }
.gwc-check:hover { border-color: #1F9E4B; color: rgba(31,158,75,.5); }
.gwc-ex.is-done { background: rgba(255,255,255,.35); }
.gwc-ex.is-done .gwc-check { background: #1F9E4B; border-color: #1F9E4B; color: #fff; }
.gwc-ex.is-done .gwc-name { color: rgba(27,26,31,.55); }
.gwc-ex.is-done .gwc-thumb { opacity: .6; }
.gwc-check.pop { animation: gwPop .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes gwPop { 0% { transform: scale(.7); } 100% { transform: scale(1); } }
.gwc-start {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin: 10px 0 14px;
  border: 0; border-radius: 99px; background: #1B1A1F; color: #fff; cursor: pointer;
  font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 14px;
}
.gwc-start svg { width: 16px; height: 16px; color: #77FFA0; }
.gwc .dropdown-content > :last-child:not(.gwc-start) { margin-bottom: 14px; }

/* ---------- player ---------- */
html.gw-lock, html.gw-lock body { overflow: hidden; }
.gw {
  position: fixed; inset: 0; z-index: 10050; display: flex; flex-direction: column;
  background: #041309; color: #fff; font-family: 'Sora', sans-serif;
  opacity: 0; transform: translateY(16px); transition: opacity .25s, transform .3s cubic-bezier(.2,.8,.2,1);
  padding-bottom: env(safe-area-inset-bottom);
}
.gw.is-in { opacity: 1; transform: none; }
.gw[hidden], .gw [hidden] { display: none !important; }
.gw button { font-family: inherit; }
.gw svg { display: block; }

.gw-top { padding: calc(10px + env(safe-area-inset-top)) 14px 6px; display: grid; gap: 10px; }
.gw-segs { display: flex; gap: 3px; }
.gw-segs i { flex: 1; height: 4px; border-radius: 99px; background: rgba(255,255,255,.16); overflow: hidden; }
.gw-segs i b { display: block; height: 100%; background: #77FFA0; border-radius: inherit; transition: width .4s; }
.gw-segs i.cur { background: rgba(255,255,255,.3); }
.gw-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gw-count { display: grid; text-align: center; gap: 1px; }
.gw-step { font-size: 12px; color: rgba(255,255,255,.65); }
.gw-clock { font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.gw-ic {
  width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(255,255,255,.08); color: #fff; padding: 0; flex: none;
}
.gw-ic svg { width: 22px; height: 22px; }
.gw-ic--soft { width: 52px; height: 52px; background: rgba(255,255,255,.08); }
.gw-ic:active { transform: scale(.94); }

.gw-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; margin: 4px 14px 10px; cursor: pointer; }
.gw-video {
  display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: cover;
  border-radius: 22px; background: #0D2D17; transition: filter .45s, transform .45s, opacity .16s ease;
}
.gw-video.is-swap { opacity: 0; }
.gw.is-rest .gw-video { filter: blur(14px) brightness(.45) saturate(.8); transform: scale(.96); }
.gw.is-lead .gw-video { filter: brightness(.5); }
.gw.is-paused .gw-video { filter: brightness(.55); }

.gw-lead, .gw-pausebadge, .gw-rest { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .25s; }
.gw.is-lead .gw-lead { opacity: 1; }
.gw.is-paused .gw-lead { opacity: 0; }
.gw-lead span { font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 110px; color: #77FFA0; animation: gwLead .9s ease-out both; text-shadow: 0 6px 30px rgba(0,0,0,.5); }
@keyframes gwLead { 0% { transform: scale(1.5); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.85); opacity: .9; } }
.gw-pausebadge { grid-auto-flow: column; gap: 8px; place-content: center; font-weight: 600; font-size: 15px; }
.gw-pausebadge svg { width: 26px; height: 26px; }
.gw.is-paused .gw-pausebadge { opacity: 1; }

.gw.is-rest .gw-rest { opacity: 1; pointer-events: auto; cursor: default; }
.gw-rest { align-content: center; gap: 14px; }
.gw-rest-lbl { font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 15px; letter-spacing: .14em; text-transform: uppercase; color: #77FFA0; }
.gw-rest-sub { margin-top: -8px; font-size: 13px; color: rgba(255,255,255,.75); min-height: 1em; }
.gw-rest-sub:empty { display: none; }
.gw-ring { position: relative; width: min(56vw, 34vh, 240px); aspect-ratio: 1; }
.gw-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gw-ring circle { fill: none; stroke-width: 10; }
.gw-ring-bg { stroke: rgba(255,255,255,.14); }
.gw-ring-fg { stroke: #77FFA0; stroke-linecap: round; transition: stroke-dashoffset .15s linear; }
.gw-ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: clamp(40px, 9vh, 64px); font-variant-numeric: tabular-nums; }
.gw-rest-btns { display: flex; gap: 8px; }
.gw-pill {
  border: 0; border-radius: 99px; padding: 10px 16px; background: rgba(255,255,255,.12); color: #fff;
  font-weight: 600; font-size: 13px; cursor: pointer;
}
.gw-pill:active { transform: scale(.96); }

.gw-panel {
  background: #0E3D1D; border-radius: 28px 28px 0 0; padding: 16px 18px calc(16px + env(safe-area-inset-bottom));
  margin-bottom: calc(-1 * env(safe-area-inset-bottom)); display: grid; gap: 6px; text-align: center;
}
.gw-up { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #77FFA0; }
.gw-up[hidden] { display: none; }
.gw-cat { font-size: 12px; color: rgba(255,255,255,.6); }
.gw-name { font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.gw-setrow { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 13px; color: rgba(255,255,255,.75); }
.gw-dots { display: inline-flex; gap: 5px; }
.gw-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.2); }
.gw-dots i.on { background: #77FFA0; }
.gw-dots i.cur { background: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.18); }
.gw-target { display: grid; justify-items: center; gap: 8px; min-height: 48px; align-content: center; margin: 2px 0 6px; }
.gw-big { font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 40px; line-height: 1; color: #77FFA0; font-variant-numeric: tabular-nums; }
.gw-big--reps { font-size: 26px; line-height: 1.15; }
.gw.is-rest .gw-big { color: #fff; font-size: 20px; }
.gw-tbar { width: min(260px, 70%); height: 5px; border-radius: 99px; background: rgba(255,255,255,.14); overflow: hidden; }
.gw-tbar i { display: block; height: 100%; background: #77FFA0; }
.gw-ctrl { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.gw-main {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 56px; border: 0; border-radius: 99px;
  background: #77FFA0; color: #041309; font-weight: 600; font-size: 17px; cursor: pointer; padding: 0 18px;
}
.gw-main svg { width: 22px; height: 22px; flex: none; }
.gw-main span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gw-main:active { transform: scale(.98); }
.gw-main[data-kind="skiprest"], .gw-main[data-kind="pause"] { background: #fff; }

.gw-finish { position: absolute; inset: 0; z-index: 2; background: radial-gradient(120% 70% at 50% 0%, #145a2b 0%, #041309 60%); display: grid; place-items: center; padding: 24px; overflow: auto; }
.gw-finish[hidden] { display: none; }
.gw-finish-in { width: min(380px, 100%); display: grid; justify-items: center; gap: 12px; text-align: center; }
.gw-trophy { width: 96px; height: 96px; border-radius: 50%; background: #77FFA0; color: #041309; display: grid; place-items: center; animation: gwPop .5s cubic-bezier(.3,1.6,.5,1) both; box-shadow: 0 0 0 12px rgba(119,255,160,.14), 0 0 0 26px rgba(119,255,160,.06); margin-bottom: 14px; }
.gw-trophy svg { width: 52px; height: 52px; }
.gw-finish-h { font-family: 'TT Firs Neue', sans-serif; font-weight: 600; font-size: 28px; margin: 0; }
.gw-finish-p { margin: 0; color: rgba(255,255,255,.7); font-size: 14px; line-height: 1.4; }
.gw-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin: 8px 0; }
.gw-stats div { background: rgba(255,255,255,.07); border-radius: 16px; padding: 12px 6px; display: grid; gap: 2px; }
.gw-stats b { font-family: 'TT Firs Neue', sans-serif; font-size: 20px; font-variant-numeric: tabular-nums; }
.gw-stats span { font-size: 11px; color: rgba(255,255,255,.55); }
.gw-finish .gw-main { width: 100%; }
.gw-finish-cta { text-decoration: none; }
.gw-finish .gw-main:disabled { background: rgba(119,255,160,.16); color: #77FFA0; cursor: default; }
.gw-finish-msg { margin: 0; min-height: 1.2em; color: #77FFA0; font-size: 14px; font-weight: 600; }

/* desktop: video left, controls right */
@media (min-width: 900px) {
  .gw { display: grid; grid-template-columns: 1fr 400px; grid-template-rows: auto 1fr; }
  .gw-top { grid-column: 1 / -1; padding: 16px 24px 8px; }
  .gw-stage { margin: 8px 12px 24px 24px; }
  .gw-panel { border-radius: 28px; margin: 8px 24px 24px 0; align-content: center; padding: 28px 24px; gap: 10px; }
  .gw-name { font-size: 28px; }
  .gw-big { font-size: 52px; }
  .gw-big--reps { font-size: 30px; }
}
/* phones: the video is full-bleed - behind the top bar, edge to edge, tucked under the panel */
@media (max-width: 899px) {
  .gw-top { position: relative; z-index: 3; background: linear-gradient(180deg, rgba(4,19,9,.75) 0%, rgba(4,19,9,.35) 65%, rgba(4,19,9,0) 100%); padding-bottom: 18px; }
  .gw-ic { background: rgba(0,0,0,.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
  .gw-step, .gw-clock { text-shadow: 0 1px 6px rgba(0,0,0,.5); }
  .gw-stage { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--gw-panel-h, 220px) - 30px); margin: 0; z-index: 1; }
  .gw-stage .gw-video { width: 100% !important; height: 100% !important; border-radius: 0; object-fit: cover; }
  .gw-stage.is-contain .gw-video { object-fit: contain; }
  .gw-panel { position: relative; z-index: 2; margin-top: auto; box-shadow: 0 -10px 30px rgba(0,0,0,.25); }
  .gw.is-rest .gw-video { transform: scale(1.06); }
  .gw-rest { padding-top: 40px; }
}
@media (max-height: 640px) and (max-width: 899px) {
  .gw-name { font-size: 19px; }
  .gw-big { font-size: 32px; }
  .gw-big--reps { font-size: 22px; }
  .gw-main { min-height: 50px; }
  .gw-ic--soft { width: 48px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .gw, .gw-video, .gwp-bar i, .gw-segs i b { transition: none; }
  .gw-lead span, .gw-trophy, .gwc-check.pop { animation: none; }
}
