/* Yoga (js/yoga.js). Pagina urmează tema site-ului (tokenuri pe :root, redefinite
   sub body.dark-theme); scena instructorului e mereu închisă la culoare, ca personajul să se
   vadă bine. Culoarea exercițiului ales vine din --g1/--g2, puse din JS. */
:root {
    --yg-accent: #0f766e;
    --yg-page-bg: #f3f7f6;
    --yg-card-bg: #ffffff;
    --yg-card-border: #d5e6e2;
    --yg-ink: #0f172a;
    --yg-muted: #4b5b63;
    --yg-shadow: 0 10px 28px rgba(15, 60, 55, .12);
    --yg-chip: #e6f4f1;
    --yg-warn-bg: #fff7e6;
    --yg-warn-line: #f59e0b;
    --yg-stage-1: #142036;
    --yg-stage-2: #0b1220;
    --yg-stage-ink: #f8fafc;
    --yg-stage-muted: #a7b4c6;
    --yg-track: #dfe9e6;
}

body.dark-theme {
    --yg-accent: #2dd4bf;
    --yg-page-bg: #0b1116;
    --yg-card-bg: #131c24;
    --yg-card-border: #24343d;
    --yg-ink: #e8eef2;
    --yg-muted: #a3b2bb;
    --yg-shadow: 0 10px 28px rgba(0, 0, 0, .45);
    --yg-chip: #17312d;
    --yg-warn-bg: #2a2212;
    --yg-warn-line: #f59e0b;
    --yg-track: #22303a;
}

/* clip, nu hidden: `body { overflow-x: hidden }` de pe tot site-ul strică position: sticky */
.yg-body, body.yg-body#page-top {
    background: var(--yg-page-bg);
    color: var(--yg-ink);
    overflow-x: clip;
    min-height: 100vh;
    --g1: #f59e0b;
    --g2: #ea580c;
}

.yg-home { padding-top: 84px; padding-bottom: 40px; }
.yg-wrap { max-width: 1180px; }
.yg-hero { text-align: center; padding: 4px 0 14px; }
.yg-hero .container { max-width: 760px; }
.yg-hero h1 { font-weight: 800; font-size: clamp(1.7rem, 6vw, 2.5rem); margin: 0 0 6px; display: inline-flex; align-items: center; gap: 12px; color: var(--yg-ink); }
.yg-hero-icon { width: 48px; height: 48px; border-radius: 14px; display: inline-grid; place-items: center; font-size: 22px; color: #fff; background: linear-gradient(135deg, #a855f7, #db2777); box-shadow: var(--yg-shadow); }
.yg-lead { max-width: 640px; margin: 0 auto; color: var(--yg-muted); font-size: 1.05rem; line-height: 1.55; }
.yg-h2 { font-size: 1.3rem; font-weight: 800; margin: 18px 0 10px; color: var(--yg-ink); }

/* ───────────── Cele 5 exerciții ───────────── */
.yg-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0 14px; }
.yg-pill {
    position: relative; display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 10px 12px 14px;
    border-radius: 16px; border: 2px solid var(--yg-card-border); background: var(--yg-card-bg); color: var(--yg-ink);
    text-align: left; cursor: pointer; box-shadow: var(--yg-shadow); touch-action: manipulation; overflow: hidden;
    transition: border-color .15s, transform .15s;
}
.yg-pill:hover { border-color: var(--g1); }
.yg-pill:active { transform: translateY(1px); }
.yg-pill:focus-visible, .yg-ctl:focus-visible, .yg-btn:focus-visible { outline: 3px solid #fde68a; outline-offset: 3px; }
.yg-pill-nr {
    flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2));
}
.yg-pill-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.yg-pill-txt b { font-size: .95rem; font-weight: 800; }
.yg-pill-txt small { font-size: .8rem; color: var(--yg-muted); font-weight: 600; }
.yg-pill.is-on { border-color: var(--g1); background: linear-gradient(135deg, var(--g1), var(--g2)); color: #fff; }
.yg-pill.is-on .yg-pill-txt small { color: rgba(255, 255, 255, .9); }
.yg-pill.is-on .yg-pill-nr { background: rgba(255, 255, 255, .22); }
.yg-pill-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: transparent; }
.yg-pill-bar i { display: block; height: 100%; width: 0; background: var(--g1); transition: width .25s linear; }
.yg-pill.is-on .yg-pill-bar i { background: rgba(255, 255, 255, .85); }
.yg-pill-nr { position: relative; }
.yg-pill.is-done .yg-pill-nr::after { content: '✓'; position: absolute; top: -6px; right: -6px; font-size: .7rem; background: #22c55e; color: #fff; border-radius: 50%; width: 16px; height: 16px; display: grid; place-items: center; }

/* ───────────── Panoul: scena + rutina | textele ───────────── */
.yg-dash { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.yg-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.yg-stage-card {
    border-radius: 20px; overflow: hidden; color: var(--yg-stage-ink);
    background: radial-gradient(120% 90% at 50% 15%, var(--yg-stage-1), var(--yg-stage-2));
    box-shadow: var(--yg-shadow); border-top: 6px solid var(--g1);
}
.yg-stage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px 0; }
.yg-chip { font-size: .8rem; font-weight: 800; letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); }
.yg-stage-name { font-weight: 800; font-size: 1.15rem; }
.yg-stage-wrap { position: relative; height: clamp(320px, 58vh, 560px); }
.yg-stage { position: absolute; inset: 0; }
.yg-stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.yg-step { margin: 0; padding: 10px 14px 14px; min-height: 2.9em; font-weight: 700; font-size: 1.05rem; color: var(--yg-stage-ink); text-align: center; }

.yg-clock {
    position: absolute; top: 10px; right: 10px; z-index: 2; min-width: 110px; padding: 8px 12px; border-radius: 14px;
    display: flex; flex-direction: column; align-items: flex-end; background: rgba(11, 18, 32, .72); backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, .12); pointer-events: none;
}
.yg-clock-part { font-size: clamp(1.9rem, 6vw, 2.6rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; }
.yg-clock-label { font-size: .8rem; font-weight: 700; color: var(--yg-stage-muted); text-align: right; max-width: 170px; }
.yg-clock[data-tip="pauza"] .yg-clock-part, .yg-clock[data-tip="pregatire"] .yg-clock-part { color: #fde68a; }

.yg-pause, .yg-final {
    position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 16px; text-align: center; background: rgba(11, 18, 32, .78); backdrop-filter: blur(3px);
}
.yg-pause[hidden], .yg-final[hidden], .yg-clock[hidden] { display: none; }
.yg-pause-big { margin: 0; font-size: 2.4rem; font-weight: 800; color: #fff; }
.yg-final-icon { margin: 0; font-size: 2.6rem; color: #fbbf24; }
.yg-final-title { margin: 0; font-size: 1.8rem; font-weight: 800; color: #fff; }
.yg-final-sub { margin: 0; max-width: 420px; color: var(--yg-stage-muted); }
.yg-final-stats { display: flex; gap: 22px; }
.yg-final-stats div { display: flex; flex-direction: column; align-items: center; }
.yg-final-stats b { font-size: 1.8rem; color: #fff; }
.yg-final-stats span { font-size: .85rem; color: var(--yg-stage-muted); }
.yg-final-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.yg-btn {
    min-height: 52px; padding: 0 20px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, .5);
    background: transparent; color: #fff; font-weight: 800; font-size: 1.05rem; cursor: pointer; touch-action: manipulation;
}
.yg-btn-main { border: 0; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 6px 16px rgba(0, 0, 0, .25); }

/* rutina */
.yg-routine { background: var(--yg-card-bg); border: 1px solid var(--yg-card-border); border-radius: 18px; padding: 14px 16px; box-shadow: var(--yg-shadow); }
.yg-routine-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.yg-routine-h { margin: 0 0 4px; font-size: 1.2rem; font-weight: 800; color: var(--yg-ink); }
.yg-routine-sub { margin: 0; color: var(--yg-muted); font-weight: 600; min-height: 1.5em; }
.yg-total { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.yg-total-time { font-size: 2.1rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; color: var(--yg-ink); }
.yg-total-label { font-size: .8rem; color: var(--yg-muted); font-weight: 700; }
.yg-progress { display: flex; gap: 4px; height: 12px; margin: 12px 0; }
.yg-progress span { flex: 1 1 0; border-radius: 6px; background: var(--yg-track); overflow: hidden; position: relative; }
.yg-progress span i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--g1), var(--g2)); transition: width .25s linear; }
.yg-progress span.is-now { outline: 2px solid var(--g1); outline-offset: 1px; }
.yg-controls { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.yg-ctl {
    min-width: 52px; height: 52px; padding: 0 12px; border-radius: 14px; border: 1px solid var(--yg-card-border);
    background: var(--yg-chip); color: var(--yg-ink); font-size: 1.1rem; cursor: pointer; touch-action: manipulation;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.yg-ctl:disabled { opacity: .45; cursor: default; }
.yg-ctl-main { min-width: 150px; height: 60px; border: 0; color: #fff; font-weight: 800; font-size: 1.2rem; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
.yg-play-label, .yg-sound-label { font-size: .95rem; font-weight: 800; }
.yg-ctl-main .yg-play-label { font-size: 1.1rem; }
.yg-w-pause { display: none; }
.yg-ctl-main.is-playing .yg-w-play { display: none; }
.yg-ctl-main.is-playing .yg-w-pause { display: inline; }
.yg-ctl-sound .yg-w-s1, .yg-ctl-sound .yg-w-s2 { display: none; }
.yg-ctl-sound[data-mode="1"] .yg-w-s0, .yg-ctl-sound[data-mode="2"] .yg-w-s0 { display: none; }
.yg-ctl-sound[data-mode="1"] .yg-w-s1, .yg-ctl-sound[data-mode="2"] .yg-w-s2 { display: inline; }
.yg-serie { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--yg-chip); font-weight: 700; color: var(--yg-ink); }
.yg-serie b { color: var(--yg-accent); }
.yg-note { color: var(--yg-muted); font-size: .92rem; margin: 8px 0 0; }

/* textele exercițiului */
.yg-info {
    background: var(--yg-card-bg); border: 1px solid var(--yg-card-border); border-top: 6px solid var(--g1);
    border-radius: 18px; padding: 16px; box-shadow: var(--yg-shadow); position: sticky; top: 84px;
}
.yg-info-head { display: flex; gap: 12px; align-items: flex-start; }
.yg-info-badge { flex: none; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); }
.yg-info-pilon { margin: 0; font-size: .85rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--g2); }
body.dark-theme .yg-info-pilon { color: var(--g1); }
.yg-info-name { margin: 2px 0; font-size: 1.5rem; font-weight: 800; color: var(--yg-ink); }
.yg-info-name small { font-size: .85rem; font-weight: 600; color: var(--yg-muted); }
.yg-info-titlu { margin: 0; font-weight: 700; color: var(--yg-muted); }
.yg-switch { display: flex; align-items: center; gap: 12px; margin: 14px 0 4px; padding: 10px 12px; min-height: 50px; border-radius: 12px; border: 1px solid var(--yg-card-border); cursor: pointer; font-weight: 600; color: var(--yg-ink); }
.yg-switch input { width: 22px; height: 22px; accent-color: var(--g2); flex: none; }
.yg-block { margin-top: 12px; }
.yg-block h3 { font-size: 1rem; font-weight: 800; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; color: var(--yg-ink); }
.yg-block h3 svg, .yg-block h3 i { color: var(--g2); width: 1.1em; }
body.dark-theme .yg-block h3 svg, body.dark-theme .yg-block h3 i { color: var(--g1); }
.yg-block p, .yg-block li { line-height: 1.55; color: var(--yg-ink); }
.yg-block p { margin: 0; }
.yg-block ol { margin: 0; padding-left: 1.3rem; }
.yg-block li + li { margin-top: 4px; }
.yg-block-secret p { padding: 10px 12px; border-radius: 12px; background: var(--yg-chip); }
.yg-block-warn p { padding: 10px 12px; border-radius: 12px; background: var(--yg-warn-bg); border-left: 4px solid var(--yg-warn-line); }
.yg-block-vol p { font-weight: 700; }

/* siguranță, surse */
.yg-box { margin-top: 18px; background: var(--yg-card-bg); border: 1px solid var(--yg-card-border); border-radius: 18px; padding: 4px 16px 14px; box-shadow: var(--yg-shadow); }
.yg-box p, .yg-box li { line-height: 1.55; }
.yg-safety-short { font-weight: 600; padding: 10px 12px; border-radius: 12px; background: var(--yg-chip); }
.yg-safety-list { padding-left: 1.2rem; margin-bottom: 0; }
.yg-sources a, .yg-links a { color: var(--yg-accent); }
.yg-sources ul { padding-left: 1.2rem; }

/* ───────────── Telefon și tabletă ───────────── */
@media (max-width: 991.98px) {
    .yg-dash { grid-template-columns: 1fr; }
    .yg-info { position: static; }
}
@media (max-width: 767.98px) {
    .yg-home { padding-top: 76px; }
    .yg-pills {
        display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; padding: 2px 2px 8px;
        margin-left: -4px; margin-right: -4px; scrollbar-width: thin;
    }
    .yg-pill { flex: 0 0 auto; min-width: 158px; scroll-snap-align: start; }
    .yg-stage-wrap { height: clamp(300px, 52vh, 460px); }
    .yg-routine { padding: 12px; }
    .yg-total-time { font-size: 1.8rem; }
    .yg-ctl-main { min-width: 120px; flex: 1 1 auto; }
    .yg-ctl { min-width: 48px; }
    .yg-sound-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .yg-pill, .yg-pill-bar i, .yg-progress span i { transition: none; }
}

/* planificatorul săptămânal comun + butoanele „pune în plan" */
.yg-plan { margin: 4px 0 28px; }
.yg-plan-btn { display: flex; align-items: center; justify-content: center; width: 100%; margin: 10px 0 0; padding: 10px 12px; min-height: 46px; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--g2, #0f766e) 65%, transparent); background: transparent; color: var(--yg-ink); font-weight: 700; cursor: pointer; }
.yg-plan-btn:hover { background: color-mix(in srgb, var(--g2, #0f766e) 10%, transparent); }
.yg-plan-btn:focus-visible { outline: 2px solid var(--g2, #0f766e); outline-offset: 2px; }
.yg-plan-btn-ex { margin: 8px 0 4px; }

/* ───────────── Yoga: rutinele, pozițiile rutinei, cercul respirației ───────────── */
.yg-pill { min-height: 72px; }
.yg-pill-nr svg, .yg-pill-nr i { font-size: .95rem; }
.yg-pill-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yg-poses { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 14px; }
.yg-pose { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 14px 6px 6px; border-radius: 999px; border: 2px solid var(--yg-card-border); background: var(--yg-card-bg); color: var(--yg-ink); font-weight: 700; cursor: pointer; touch-action: manipulation; }
.yg-pose:hover { border-color: var(--g1); }
.yg-pose:focus-visible { outline: 3px solid #fde68a; outline-offset: 2px; }
.yg-pose-ico { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--g1), var(--g2)); font-size: .85rem; flex: none; }
.yg-pose small { font-weight: 600; color: var(--yg-muted); font-style: italic; }
.yg-pose.is-on { border-color: var(--g1); background: color-mix(in srgb, var(--g1) 14%, var(--yg-card-bg)); }
.yg-pose.is-now { box-shadow: 0 0 0 3px color-mix(in srgb, var(--g1) 45%, transparent); }

.yg-breath { position: absolute; left: 14px; bottom: 14px; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: 999px; background: rgba(8, 12, 22, .62); color: #f8fafc; backdrop-filter: blur(4px); pointer-events: none; }
.yg-breath-ring { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); display: grid; place-items: center; flex: none; }
.yg-breath-ring i { display: block; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--g1) 85%, #fff) 0%, var(--g2) 100%); transform: scale(var(--s, .45)); opacity: .9; }
.yg-breath-txt { display: flex; flex-direction: column; line-height: 1.15; }
.yg-breath-txt b { font-size: 1.25rem; font-weight: 800; }
.yg-breath-txt small { font-size: .85rem; color: #cbd5e1; font-weight: 600; }
@media (max-width: 767.98px) {
    .yg-pill { min-width: 200px; }
    .yg-breath { left: 8px; bottom: 8px; padding: 6px 12px 6px 6px; }
    .yg-breath-ring { width: 44px; height: 44px; }
    .yg-breath-txt b { font-size: 1.05rem; }
}
.yg-progress span.is-prep { opacity: .5; }
