/* ============================================================================
   _game-results.css — Zone 3: the FPS result READOUT (crisp dashboard)
   ============================================================================
   A crisp, flat readout — hairline border, tiny shadow — NOT a big gray box.
   The average FPS is still the signature (mono, tabular-nums, accent-gradient),
   but sized to the shared display scale so it reads sharp, not cartoonish.
   Below it: a smooth performance bar, the 1% low as a secondary tabular stat,
   a two-tone GPU/CPU bottleneck meter and resolution tiles — all on hairline
   dividers within the one surface.

   Uses the shared type + spacing scale from _game-hero.css. Result chips/cards
   reuse _results.css / _bottleneck.css / _badges.css. Tokens only; reuses the
   fadeInUp keyframe declared in _results.css.
   ============================================================================ */

/* ---------- Dashboard integration ------------------------------------- */
/* In the 2-col dashboard the readout sits BESIDE the console — kill the legacy
   stacked top-margin so the result panel top-aligns with the console. */
.fps-dashboard__readout .fps-results-section {
    margin-top: 0;
}

.fps-result {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--fps-pad);
    background:
        radial-gradient(120% 130% at 0% 0%,
            color-mix(in srgb, var(--accent) 7%, transparent),
            transparent 55%),
        var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--fps-pad);
    overflow: hidden;
}

.fps-result.is-animating {
    animation: fadeInUp 0.4s ease-out;
}

/* Hero row: big number + 1% low + confidence/tier */
.fps-result__hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--fps-gap);
    padding-bottom: var(--fps-pad);
    border-bottom: 1px solid var(--border);
}

.fps-result__figure {
    display: flex;
    align-items: baseline;
    gap: clamp(0.5rem, 1.2vw, 0.75rem);
    min-width: 0;
}

/* The signature: the single hero of the view. Site sans, semibold, PROPORTIONAL
   figures (deliberately NOT tabular) — loud in size, calm in styling: a solid
   --text-primary fill, no gradient, no display/mono face. */
.fps-result__value {
    font-family: var(--font-display);
    font-size: clamp(3rem, 5vw + 1rem, 4.5rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: proportional-nums;
    color: var(--text-primary);
}

.fps-result__figure-meta {
    display: flex;
    flex-direction: column;
    gap: 0.0625rem;
}

.fps-result__unit {
    font-size: var(--fps-fs-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.fps-result__caption {
    max-width: 24ch;
    font-size: var(--fps-fs-xs);
    line-height: 1.35;
    color: var(--text-secondary);
}

.fps-result__aside {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

/* Neat muted pill — a secondary stat, not an alarm (no orange). */
.fps-result__low {
    display: inline-flex;
    align-items: baseline;
    gap: 0.375rem;
    padding: 0.3125rem 0.75rem;
    background: color-mix(in srgb, var(--text-secondary) 6%, transparent);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
}

.fps-result__low-value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--fps-fs-lg);
    font-weight: 700;
    line-height: 1;
    color: var(--text-primary);
}

.fps-result__low-label {
    font-size: var(--fps-fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.fps-result__badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4375rem;
    justify-content: flex-end;
}

@media (max-width: 560px) {
    .fps-result__aside {
        align-items: flex-start;
        width: 100%;
    }

    .fps-result__badges {
        justify-content: flex-start;
    }
}

/* ---------- Performance bar (smooth accent-gradient meter) ------------- */

.fps-result__perf {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.fps-result__perf-track {
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--border) 55%, transparent);
}

.fps-result__perf-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--brand-primary), var(--accent));
    box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 40%, transparent);
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.fps-result__perf-caption {
    font-size: var(--fps-fs-xs);
    font-family: var(--font-mono);
    letter-spacing: 0.01em;
    color: var(--text-muted);
}

/* ---------- Bottleneck meter (two-tone GPU/CPU bar) ------------------- */

.fps-result__bottleneck {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fps-result__bn-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.fps-result__bn-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: var(--fps-fs-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.fps-result__bn-chip strong {
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

.fps-result__bn-chip--gpu svg {
    color: var(--accent);
}

.fps-result__bn-chip--cpu svg {
    color: var(--brand-secondary);
}

.fps-result__bn-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: var(--fps-fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.fps-result__bn-bar {
    display: flex;
    height: clamp(6px, 1.4vw, 8px);
    overflow: hidden;
    /* Track = a lighter step of the fill hue, never flat gray. The two-tone
       GPU/CPU fills sum to 100%, so this only reads at the seam. */
    background: rgba(var(--accent-rgb), 0.15);
    border-radius: var(--radius-full);
    box-shadow: inset 0 1px 2px color-mix(in srgb, var(--border) 45%, transparent);
}

.fps-result__bn-fill {
    height: 100%;
    transition: width 0.5s ease;
}

.fps-result__bn-fill--gpu {
    background: linear-gradient(90deg,
        color-mix(in srgb, var(--accent) 82%, var(--brand-primary)),
        var(--accent));
}

.fps-result__bn-fill--cpu {
    background: linear-gradient(90deg,
        var(--brand-secondary),
        color-mix(in srgb, var(--brand-secondary) 78%, var(--brand-secondary-light)));
}

.fps-result__bn-desc {
    margin: 0;
    font-size: var(--fps-fs-sm);
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ---------- Resolution card group ------------------------------------- */

.fps-result__res {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.fps-result__res-title {
    font-size: var(--fps-fs-eyebrow);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Frame rates are data — tabular mono in the resolution tiles too. */
.fps-result__res .res-fps {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* Fill the readout column with dense mini-cards instead of a 560px centred
   cluster (overrides the base --compact cap for the dashboard readout). */
.fps-result__res .fps-resolution-grid--compact {
    max-width: none;
    margin: 0;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
}

/* ---------- Resolution cards — calm, consistent, status-tinted --------
   Scoped overrides of the shared _results.css card set for the game readout:
   the selected card gets a soft accent ring + lift, the others recede, and the
   loud severity borders give way to quiet status-token pills. */

.fps-result__res .res-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: none;
}

.fps-result__res .res-label {
    color: var(--text-secondary);
}

/* FPS values stay consistent --text-primary even on the selected tile — the
   ring signals selection, not a colour swap. */
.fps-result__res .res-fps,
.fps-result__res .res-card.is-selected .res-fps {
    color: var(--text-primary);
}

/* Primary (selected) resolution — soft accent ring + gentle lift. */
.fps-result__res .res-card.is-selected {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--border));
    background: rgba(var(--accent-rgb), 0.06);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.5);
}

/* Quiet the loud severity blocks — the small corner badge carries the signal. */
.fps-result__res .res-card--severe,
.fps-result__res .res-card--mild {
    border-color: var(--border);
    box-shadow: none;
}

/* Verdict badges — one tinted-pill treatment (status token + leading dot),
   never colour-alone (keeps the existing Dutch text label). */
.fps-result__res .res-status {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
}

.fps-result__res .res-status::before {
    content: "";
    width: 0.375rem;
    height: 0.375rem;
    border-radius: var(--radius-full);
    background: currentColor;
    flex-shrink: 0;
}

.fps-result__res .status-excellent,
.fps-result__res .status-good {
    background: rgba(var(--success-rgb), 0.12);
    color: var(--success);
    border-color: rgba(var(--success-rgb), 0.25);
}

.fps-result__res .status-medium {
    background: rgba(var(--warning-rgb), 0.12);
    color: var(--warning);
    border-color: rgba(var(--warning-rgb), 0.25);
}

.fps-result__res .status-poor {
    background: rgba(var(--error-rgb), 0.12);
    color: var(--error);
    border-color: rgba(var(--error-rgb), 0.25);
}

/* Incompatible tile stays a quiet muted pill, not a red alarm. */
.fps-result__res .status-disabled {
    background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* ---------- Empty state — a touch more premium, kept quiet -------------
   A subtle radial accent wash behind the prompt icon + tighter copy spacing. */
.fps-dashboard__readout .fps-empty-state__inner {
    gap: clamp(0.625rem, 1.4vw, 0.875rem);
}

.fps-dashboard__readout .fps-empty-state__icon--prompt {
    background:
        radial-gradient(circle at center,
            rgba(var(--accent-rgb), 0.16),
            rgba(var(--accent-rgb), 0.06) 70%);
    border-color: color-mix(in srgb, var(--accent) 32%, transparent);
    box-shadow: 0 0 28px rgba(var(--accent-rgb), 0.14);
}

/* ---------- Offset / variance row ------------------------------------- */

.fps-result__offset {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: var(--fps-pad-sm);
    border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
    .fps-result.is-animating {
        animation: none;
    }

    .fps-result__perf-fill,
    .fps-result__bn-fill {
        transition: none;
    }
}
