/* ==========================================================================
   progress.css — My Progress (/progress), the WM-composite dashboard.
   Extracted from the template's <style> (cascade position unchanged: loads
   in <head>, bars.html's reset + base.css ship later and win ties).
   Deliberate deletions vs the old inline block (all already inert):
   - legacy alias :root vars (--accent, --bg-body, --text-primary, --success,
     …): owned by base.css :7-20 with identical resolved values
   - the `*` margin/padding/box-sizing reset: bars.html :238 ships the same
   - .empty-state shell rule: 100% shadowed by base.css .empty-state
   Load-bearing traps kept (with the merge noted):
   - .card: base.css .card wins background/border/radius/padding/shadow/
     backdrop-filter; this file's margin-bottom + fadeUp animation apply
   - .composite-info .badge outranks base.css .badge (two classes)
   - .cal-grid: grid skeleton comes from stats.css .nc-hm-rows; --hm-gap is
     this page's spacing (its data mapping)
   ========================================================================== */

:root {
    /* page-local (NOT a base.css alias) */
    --font: var(--global-font-main, 'Outfit', sans-serif);
}

body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-primary);
    padding-bottom: 120px;
}

.page-container {
    max-width: 860px;
    margin: 0 auto;
    padding: 24px 16px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* merges with base.css .card (base wins surface/border/radius/padding/
   shadow/backdrop-filter ties); margin-bottom + animation are this page's */
.card {
    margin-bottom: 20px;
    animation: fadeUp 0.5s ease both;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ─── HERO COMPOSITE ─── */
.composite-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 28px;
    align-items: center;
}

@media (max-width: 500px) {
    .composite-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }
}

.composite-ring {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.composite-ring svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--bg-surface-2);
    stroke-width: 14;
}

.ring-fill {
    fill: none;
    stroke: var(--accent);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 440;
    stroke-dashoffset: 440;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.composite-inner {
    position: relative;
    text-align: center;
}

.composite-num {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -0.06em;
    line-height: 1;
}

.composite-unit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}

.composite-info h2 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.composite-info .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: oklch(from var(--accent) l c h / 0.1);
    border: 1px solid oklch(from var(--accent) l c h / 0.25);
    border-radius: 99px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
}

.composite-info p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 380px;
}

.trend-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 99px;
    margin-top: 10px;
}

.trend-chip.up {
    background: oklch(65% 0.2 145 / 0.12);
    color: var(--success);
}

.trend-chip.flat {
    background: var(--bg-surface-2);
    color: var(--text-secondary);
}

.trend-chip.down {
    background: oklch(58% 0.22 25 / 0.12);
    color: var(--error);
}

/* ─── KPI ROW ─── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 14px;
}

.kpi-item {
    background: var(--bg-surface-2);
    border-radius: 18px;
    padding: 18px 14px;
    text-align: center;
}

.kpi-val {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1;
}

.kpi-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 700;
    margin-top: 6px;
}

/* ─── RADAR CHART CONTAINER ─── */
.radar-wrap {
    max-width: 320px;
    margin: 0 auto;
    aspect-ratio: 1;
}

/* ─── GAME BREAKDOWN TABLE ─── */
.breakdown-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.breakdown-row {
    display: grid;
    grid-template-columns: 2rem 1fr auto 80px;
    align-items: center;
    gap: 12px;
}

.br-icon {
    font-size: 1.4rem;
}

.br-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.br-sessions {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.br-pct-label {
    font-weight: 800;
    font-size: 1rem;
    text-align: right;
}

.br-bar-track {
    height: 6px;
    background: var(--bg-surface-2);
    border-radius: 99px;
    overflow: hidden;
    grid-column: 2 / -1;
    margin-top: -6px;
}

.br-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    transition: width 1s ease;
}

/* ─── HISTORY CHART ─── */
.chart-wrap {
    height: 220px;
    position: relative;
}

/* ─── STREAK CALENDAR (skeleton: stats.css .nc-hm-rows; --hm-gap is this
   page's cell spacing) ─── */
.cal-grid {
    --hm-gap: 5px;
}

.cal-day {
    aspect-ratio: 1;
    border-radius: 6px;
    background: var(--bg-surface-2);
    transition: background 0.3s;
}

.cal-day.trained {
    background: var(--accent);
}

.cal-day.trained-light {
    background: oklch(from var(--accent) l c h / 0.35);
}

.cal-day.future {
    opacity: 0.2;
}

.cal-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 4px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

/* ─── DAILY PROTOCOL ─── */
.protocol-card {
    border: 2px solid var(--accent);
    background: oklch(from var(--accent) l c h / 0.05);
    border-radius: 28px;
}

.protocol-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.protocol-row:last-child {
    border-bottom: none;
}

.pr-order {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.pr-name {
    font-weight: 700;
    font-size: 0.95rem;
    flex: 1;
}

.pr-dur {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.pr-done {
    font-size: 1.1rem;
}

.btn-start {
    display: block;
    margin-top: 20px;
    padding: 16px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 18px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 6px 20px var(--accent-glow);
}

.btn-start:hover {
    transform: translateY(-2px);
}

/* ─── SHARE CARD ─── */
.share-box {
    background: linear-gradient(135deg, oklch(from var(--accent) l c h / 0.12), var(--bg-surface-2));
    border: 1px solid oklch(from var(--accent) l c h / 0.25);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.share-text {
    font-size: 0.9rem;
    font-weight: 700;
}

.share-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 3px;
}

.btn-share {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: all 0.2s;
}

.btn-share:hover {
    transform: scale(1.04);
}

/* ─── EMPTY STATE (shell rule: base.css .empty-state) ─── */
.empty-state .icon {
    font-size: 3.5rem;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto 20px;
}

/* ─── PAGE HEADER ─── */
.page-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    animation: fadeUp 0.3s ease;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.page-header .sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
