/* ==============================================
   SCORE HERO — KPI scorecard
   Overall score block + sub-score tiles (no rings).
   Desktop: overall | tiles side by side. Mobile: stacked.
   ============================================== */

.overall-score-hero {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 24px;
    padding: 20px 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    visibility: hidden;
}

@keyframes scoreHeroReveal {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.overall-score-hero.revealed {
    visibility: visible;
    animation: scoreHeroReveal 0.5s ease forwards;
}

@media (prefers-reduced-motion: reduce) {
    .overall-score-hero.revealed { animation: none; }
    .segment-bar-fill { transition: none; }
}

/* ---------- Overall block ---------- */

.score-hero-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    text-align: center;
}

.score-hero-headline {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.score-hero-number {
    font-size: 3.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: hsl(var(--hero-hue, 199), 55%, 58%);
    transition: color 0.6s ease;
    font-variant-numeric: tabular-nums;
}

.score-hero-denom {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
}

.score-hero-label {
    font-size: 0.66rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
}

.score-hero-verdict {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color, #e2e8f0);
    line-height: 1.4;
    max-width: 320px;
}

.score-percentile {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color, #e2e8f0);
    margin: 0.35rem 0 0;
}

.score-hero-scoring-note {
    display: inline-block;
    font-size: 0.72rem;
    margin-top: 0.4rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
    text-decoration: underline;
    text-underline-offset: 2px;
}

.score-hero-scoring-note:hover {
    color: var(--text-color, #e2e8f0);
}

/* ---------- Meta chips (BPM / Key) ---------- */

.score-hero-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.score-hero-meta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 5px 10px;
    border: 1px solid var(--chip-border, rgba(255, 255, 255, 0.12));
    border-radius: var(--chip-radius-sm, 8px);
    background: var(--chip-bg, rgba(255, 255, 255, 0.05));
    color: var(--chip-text, var(--text-color, #cbd5e1));
    font-size: 0.74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.score-hero-meta-chip[hidden] { display: none !important; }

/* ---------- Weak-spot "needs work" links ---------- */

.score-hero-weakspots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.weakspot-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    min-height: 26px;
    padding: 5px 10px;
    border-radius: var(--chip-radius-sm, 8px);
    background: hsla(0, 60%, 55%, 0.12);
    color: hsl(0, 60%, 68%);
    border: 1px solid hsla(0, 60%, 55%, 0.2);
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.weakspot-tag:hover {
    background: hsla(0, 60%, 55%, 0.2);
    border-color: hsla(0, 60%, 55%, 0.45);
    transform: translateY(-1px);
}

.weakspot-tag:focus-visible {
    outline: 2px solid hsl(0, 60%, 55%);
    outline-offset: 2px;
}

.weakspot-arrow {
    font-weight: 700;
    transition: transform 0.15s ease;
}

.weakspot-tag:hover .weakspot-arrow { transform: translateX(2px); }

/* ---------- Sub-score tiles ---------- */

.score-hero-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 10px;
}

.score-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 84px;
    padding: 12px 6px;
    background: var(--card-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s, border-color 0.2s, background 0.2s;
}

.score-segment:hover {
    transform: translateY(-2px);
    border-color: hsla(var(--seg-hue, 199), 55%, 55%, 0.45);
    background: var(--surface-elevated, rgba(255, 255, 255, 0.05));
}

.score-segment:focus-visible {
    outline: 2px solid hsl(var(--hero-hue, 199), 60%, 50%);
    outline-offset: 2px;
}

.score-segment.weak {
    border-color: hsla(0, 70%, 55%, 0.3);
}

.score-segment.unavailable {
    opacity: 0.72;
}

.score-segment-ai {
    position: relative;
}

.segment-val {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--text-color, #fff);
    font-variant-numeric: tabular-nums;
}

.segment-label-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    flex-wrap: wrap;
    min-width: 0;
    width: 100%;
    text-align: center;
}

.segment-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
}

.segment-beta {
    flex: 0 0 auto;
    padding: 2px 4px;
    border: 1px solid hsla(var(--seg-hue, 199), 55%, 55%, 0.35);
    border-radius: var(--radius-sm);
    color: hsl(var(--seg-hue, 199), 60%, 62%);
    font-size: 0.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.segment-bar {
    width: 70%;
    height: 4px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
    margin-top: 2px;
}

.segment-bar-fill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--radius-pill);
    background: hsl(var(--seg-hue, 199), 60%, 50%);
    transition: width 1s cubic-bezier(0.4, 0, 0.15, 1) 0.3s;
}

/* ---------- Desktop: overall | tiles side by side ---------- */

@media (min-width: 769px) {
    .overall-score-hero {
        flex-direction: row;
        align-items: stretch;
        gap: 22px;
        padding: 18px 22px;
    }

    .score-hero-main {
        flex: 0 0 230px;
        align-items: flex-start;
        text-align: left;
        justify-content: center;
        padding-right: 22px;
        border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    }

    .score-hero-verdict { max-width: none; }
    .score-hero-meta,
    .score-hero-weakspots { justify-content: flex-start; }

    .score-hero-breakdown { flex: 1 1 auto; }
}

/* ---------- Light mode ---------- */

[data-theme="light"] .overall-score-hero {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .score-segment {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .segment-beta {
    background: rgba(15, 23, 42, 0.03);
}

[data-theme="light"] .score-hero-number {
    color: hsl(var(--hero-hue, 199), 55%, 42%);
}

[data-theme="light"] .score-hero-main {
    border-right-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .weakspot-tag {
    background: hsla(0, 60%, 55%, 0.08);
    color: hsl(0, 55%, 45%);
    border-color: hsla(0, 60%, 55%, 0.18);
}

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
    .score-hero-number { font-size: 2.8rem; }
    .score-hero-breakdown { grid-template-columns: repeat(3, 1fr); }
    .segment-val { font-size: 1.3rem; }
    .segment-beta { font-size: 0.46rem; }
}

@media (max-width: 380px) {
    .score-hero-breakdown { grid-template-columns: repeat(2, 1fr); }
}
