/**
 * ============================================================================
 * ROAD2RADIANT v29.2
 * Module: compareProfileStyles.css
 * ----------------------------------------------------------------------------
 * Compare Profile — tactical comparison briefing overlay.
 *
 * Design language:
 * - Premium dark tactical HUD matching Road2Radiant.
 * - CSS custom properties (--v-green, --v-midnight, --v-gold, --v-red).
 * - Geist font exclusively for all typography.
 * - Glassmorphic cards, subtle borders, generous spacing.
 * - Green accent (#2ff472) for viewer (YOU), cyan (#00f2ff) for target (FRIEND).
 * - Gold (#ffb800) for peak rank highlights.
 * - Restrained motion only: one brief periodic winner flash per winning
 *   card; no scan sweeps, neon bloom, or continuous animation.
 *
 * Information architecture:
 *   Section 1 — Player Identity (YOU vs FRIEND)
 *   Section 2 — Core Performance (K/D, WR, HS%, KAST, ADR)
 *   Section 3 — Tactical Impact (UDC, EBR, TTV, TCR, TCV)
 *   Section 4 — Combat & Clutch (FB Conversion, Opening Kill Rate,
 *               Opening Duel WR, Clutch WR)
 *   Section 5 — Sample & Confidence
 * ============================================================================
 */

/* =====================================================================
   OVERLAY CONTAINER
   ===================================================================== */

#cp-overlay {
    position: fixed;
    inset: 0;
    z-index: 250;
    background: radial-gradient(ellipse at 50% 0%, rgba(12, 24, 32, 1) 0%, var(--v-midnight) 60%);
    overflow-y: auto;
    overflow-x: hidden;
}

/* =====================================================================
   INNER WRAPPER — professional content width
   ===================================================================== */

.cp-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px 36px 80px;
}

/* =====================================================================
   WORKSPACE HEADER — Navigation + Title + Divider
   ===================================================================== */

/* Top bar: return control + status indicator */
.cp-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

/* Return-to-dashboard command control */
.cp-return-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(47, 244, 114, 0.04);
    border: 1px solid rgba(47, 244, 114, 0.15);
    border-left: 3px solid var(--v-green);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 20px;
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.cp-return-btn:hover {
    color: #ffffff;
    background: rgba(47, 244, 114, 0.08);
    border-color: rgba(47, 244, 114, 0.3);
    border-left-color: var(--v-green);
    box-shadow: 0 0 16px rgba(47, 244, 114, 0.08);
}

/* Left-side button cluster (return + home) */
.cp-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Home button — matches dashboard header home button styling */
.cp-home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s ease;
}

.cp-home-btn:hover {
    color: var(--v-green);
    border-color: rgba(47, 244, 114, 0.3);
    background: rgba(47, 244, 114, 0.04);
    box-shadow: 0 0 12px rgba(47, 244, 114, 0.08);
}

/* Right-side status indicator */
.cp-topbar-status {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(47, 244, 114, 0.04);
    border: 1px solid rgba(47, 244, 114, 0.12);
    border-radius: 4px;
}

.cp-topbar-status::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--v-green);
    box-shadow: 0 0 6px var(--v-green);
    flex-shrink: 0;
}

/* Title block: feature name + analytical descriptor */
/* Centre the title independently of topbar left/right controls.
   Absolute positioning removes it from the normal flow so the
   widths of the return button and status badge cannot shift it. */
.cp-title-block {
    text-align: center;
    position: relative;
    width: 100%;
    margin-bottom: 8px;
    pointer-events: none;
}

.cp-title-block > * {
    pointer-events: auto;
}

.cp-title {
    font-family: 'Geist', sans-serif;
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: var(--v-green);
    text-transform: uppercase;
    margin: 0 0 6px;
    line-height: 1;
}

.cp-subtitle {
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
    line-height: 1.4;
}

/* Gradient divider separating header from comparison content */
.cp-header-divider {
    height: 1px;
    background: linear-gradient(90deg, var(--v-green), transparent 70%);
    opacity: 0.2;
    margin-bottom: 32px;
}

/* =====================================================================
   SECTION 1 — PLAYER IDENTITY HEADER
   ===================================================================== */

.cp-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 48px;
}

/* --- Player Identity Card --- */

.cp-player {
    position: relative;
    background: rgba(10, 20, 27, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* Top accent gradient per player */
.cp-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.cp-player--viewer::before {
    background: linear-gradient(90deg, transparent, var(--v-green), transparent);
    opacity: 0.7;
}

.cp-player--target::before {
    background: linear-gradient(90deg, transparent, #00f2ff, transparent);
    opacity: 0.7;
}

/* Role label (YOU / FRIEND) */
.cp-role {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 12px;
}

.cp-role--viewer { color: var(--v-green); }
.cp-role--target { color: #00f2ff; }

/* Player card artwork frame */
.cp-card-art-frame {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
}

.cp-card-art-frame--viewer {
    border: 2px solid rgba(47, 244, 114, 0.35);
    box-shadow: 0 0 20px rgba(47, 244, 114, 0.12);
}

.cp-card-art-frame--target {
    border: 2px solid rgba(0, 242, 255, 0.35);
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.12);
}

.cp-card-art {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Riot ID */
.cp-riot-id {
    font-family: 'Geist', sans-serif;
    font-size: 18px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

/* Rank row — icon + name */
.cp-rank-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-rank-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.cp-rank-name {
    font-family: 'Geist', sans-serif;
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.1;
}

.cp-player--viewer .cp-rank-name { color: var(--v-green); }
.cp-player--target .cp-rank-name { color: #00f2ff; }

/* Stat detail lines (RR, Peak, Matches) */
.cp-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

.cp-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cp-stat-label {
    font-family: 'Geist', sans-serif;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
}

.cp-stat-value {
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.cp-stat-value--peak {
    color: var(--v-gold);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cp-stat-value--sample { color: rgba(255, 255, 255, 0.65); font-size: 11px; }

/* Peak-rank icon — 36×36 with balanced text alignment */
.cp-peak-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    opacity: 0.85;
}

/* --- VS Divider --- */

.cp-vs {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 8px;
}

.cp-vs-line {
    flex: 1;
    width: 1px;
    background: rgba(255, 255, 255, 0.08);
    min-height: 20px;
}

.cp-vs-badge {
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    background: rgba(10, 20, 27, 0.6);
}

/* =====================================================================
   SECTION BLOCK — shared by all comparison sections
   ===================================================================== */

.cp-section {
    margin-bottom: 40px;
}

.cp-section-head {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.cp-section-title {
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--v-green);
    margin: 0;
}

.cp-section-sub {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* =====================================================================
   METRIC COMPARISON ROWS
   ===================================================================== */

.cp-metrics {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.cp-metric {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Metric header: label + edge indicator */
.cp-metric-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* Metric label */
.cp-metric-label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.65);
}

/* Lower-is-better direction hint (EBR, TTV) */
.cp-metric-dir {
    display: inline-block;
    padding: 1px 5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
}

/* Metric description (tactical, combat) */
.cp-metric-desc {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.4;
    margin: -2px 0 0;
}

/* Metric comparison row: viewer | delta | target */
.cp-metric-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

/* Player side within metric row */
.cp-m-side {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cp-m-side--target {
    flex-direction: row-reverse;
}

/* Bar track */
.cp-m-bar-track {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

/* Bar fill */
.cp-m-bar {
    height: 100%;
    border-radius: 4px;
    /* Neutral fill keeps losing and tied values visible. Winning bars
       override this with the identity accent below. */
    background: rgba(255, 255, 255, 0.28);
    transition: width 0.4s ease;
    min-width: 0;
}

/* Numeric value */
.cp-m-val {
    font-family: 'Geist', sans-serif;
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
    min-width: 64px;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
}

/* Advantage coloring */
.cp-m-val--win {
    color: var(--v-green);
}

.cp-m-bar--win {
    background: var(--v-green);
}

.cp-m-side--target .cp-m-val--win {
    color: #00f2ff;
}

.cp-m-side--target .cp-m-bar--win {
    background: #00f2ff;
}

/* Null value */
.cp-m-val--null {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* Center delta badge */
.cp-m-delta {
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.65);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 5px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    white-space: nowrap;
    text-align: center;
    min-width: 64px;
}

/* Edge indicator */
.cp-m-edge {
    font-family: 'Geist', sans-serif;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cp-m-edge--viewer { color: var(--v-green); }
.cp-m-edge--target { color: #00f2ff; }
.cp-m-edge--tie { color: rgba(255, 255, 255, 0.5); }

/* =====================================================================
   CORE SHARED-SCALE COMPARISON TRACK
   Core Performance rows plot both players as markers on one fixed
   per-metric domain. Tactical rows below keep their own bar layout.
   ===================================================================== */

/* Compact badge cluster in the metric header (delta + edge) */
.cp-m-badges {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* The inline delta is a compact label inside the header badge cluster */
.cp-m-badges .cp-m-delta {
    padding: 4px 10px;
    min-width: 0;
    border-radius: 3px;
}

/* Shared track row: value YOU | track | FRIEND value. Scoped modifier so
   the tactical grid (base .cp-metric-row) is untouched. The top margin
   reserves headroom for the crown floating above the winning card. */
.cp-metric-row--track {
    grid-template-columns: auto auto 1fr auto auto;
    gap: 10px;
    margin-top: 30px;
}

/* Identity captions beside each exact value */
.cp-m-role {
    font-family: 'Geist', sans-serif;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* The caption dot doubles as a colour key for its marker */
.cp-m-role::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    margin-right: 5px;
    vertical-align: middle;
}

.cp-m-role--viewer { color: var(--v-green); }
.cp-m-role--target { color: #00f2ff; }

/* The shared horizontal track. Quarter-scale ticks (25/50/75) give the
   eye a stable reference without numeric axis labels. */
.cp-m-track {
    position: relative;
    height: 6px;
    background: rgba(255, 255, 255, 0.10);
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.cp-m-track::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.10)),
        linear-gradient(rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.10)),
        linear-gradient(rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.10));
    background-size: 1px 100%;
    background-position: 25% 0, 50% 0, 75% 0;
    background-repeat: no-repeat;
}

/* Player cards. Each marker is the player's circular Valorant Player
   Card (36 x 36) centred on its exact shared-scale coordinate. The
   carrier is a plain div — a bare <img> would never paint the crown
   (::after does not render on replaced elements) — and the artwork is
   the inner .cp-m-card-art. The thin identity outline plus the dark
   outer ring keep the cards legible over the track and ticks; viewer
   paints above friend (z 2 vs 1) and the winning card paints above both
   (z 3) so its crown is never covered. An exact tie raises the friend
   card vertically (see cp-m-tie) instead of shifting the shared
   coordinate. Positions are set inline from the shared scale. */
.cp-m-marker {
    position: absolute;
    top: 50%;
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px rgba(6, 14, 20, 0.9);
    transition: left 0.4s ease;
}

/* The circular artwork fills the carrier. The inner <img> keeps its own
   50% radius so the square source is cropped to the circle without
   overflow clipping (which would cut the crown floating above). */
.cp-m-card-art {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.cp-m-marker--viewer {
    /* currentColor drives the winner flash glow */
    border-color: var(--v-green);
    color: var(--v-green);
    z-index: 2;
}

.cp-m-marker--target {
    border-color: #00f2ff;
    color: #00f2ff;
    z-index: 1;
}

/* Neutral fallback when a Player Card URL is unavailable: same geometry
   and ring, quiet fill, no fabricated artwork and no image request. */
.cp-m-marker--nocard {
    background: radial-gradient(circle at 50% 32%, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04));
}

/* A value beyond the metric's domain pins to the track end; the card is
   dimmed so the truncation is never mistaken for an exact position
   (the tooltip also calls it out). */
.cp-m-marker--clip {
    filter: grayscale(0.85) brightness(0.75);
}

/* =====================================================================
   WINNER CROWN
   The gold crown floats over the winning card. It inherits the card's
   shared-scale position, so it can never collide with the values or
   the delta badge, and it keeps its own upright orientation
   (independent of any card transform).
   ===================================================================== */

/* The SVG reproduces the approved crown art: three rounded spikes plus
   a detached rounded base bar, gold fill, subtle glow. */
.cp-m-marker--winner::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    width: 16px;
    height: 13px;
    transform: translateX(-50%);
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 52'%3E%3Cpath d='M7 13L21 25L32 8L43 25L57 13L52.5 35L11.5 35Z' fill='%23ffb800' stroke='%23ffb800' stroke-width='7' stroke-linejoin='round'/%3E%3Crect x='11' y='41' width='42' height='8' rx='4' fill='%23ffb800'/%3E%3C/svg%3E") center / contain no-repeat;
    filter: drop-shadow(0 0 2px rgba(255, 184, 0, 0.45));
    pointer-events: none;
}

/* Exact tie: raise the friend card so both cards stay visible at the
   SAME horizontal coordinate (the renderer emits cp-m-tie only when
   both positions are identical). */
.cp-m-marker--target.cp-m-tie {
    top: calc(50% - 14px);
}

/* =====================================================================
   WINNER FLASH
   The winning card emits a brief, stationary glow approximately every
   3.5 seconds — a lighthouse pulse, not a moving light. One shared CSS
   animation and one shared clock (no per-row delays, no JavaScript);
   rise + fade fits inside ~440ms and the card keeps its exact size and
   position throughout. The glow uses the card's identity colour via
   currentColor: green for YOU, cyan for FRIEND.
   ===================================================================== */

.cp-m-marker--winner {
    z-index: 3;
    animation: cpWinnerFlash 3.5s linear infinite;
}

@keyframes cpWinnerFlash {
    0% {
        box-shadow: 0 0 0 2px rgba(6, 14, 20, 0.9);
    }
    3.5% {
        box-shadow:
            0 0 0 2px rgba(6, 14, 20, 0.9),
            0 0 12px 4px currentColor;
    }
    12.5% {
        box-shadow: 0 0 0 2px rgba(6, 14, 20, 0.9);
    }
    100% {
        box-shadow: 0 0 0 2px rgba(6, 14, 20, 0.9);
    }
}

/* Low-sample indicator — replaces an edge when the sample is too small
   for a directional comparison. Values remain visible. */
.cp-low-sample {
    display: inline-block;
    padding: 2px 7px;
    border: 1px solid rgba(255, 184, 0, 0.25);
    border-radius: 3px;
    background: rgba(255, 184, 0, 0.08);
    font-family: 'Geist', sans-serif;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--v-gold);
    white-space: nowrap;
}

/* Unavailable metric explanation */
.cp-metric-note {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
    margin-top: 2px;
}

/* Supporting metric context (TCV cumulative total) */
.cp-metric-context {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 2px;
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.4;
}

.cp-metric-context-label {
    font-weight: 800;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.65);
}

.cp-metric-context-item {
    white-space: normal;
}

/* =====================================================================
   TACTICAL IMPACT — GROUPED METRICS
   ===================================================================== */

.cp-tac-group {
    margin-bottom: 28px;
}

.cp-tac-group:last-child {
    margin-bottom: 0;
}

.cp-tac-group-label {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
    padding-left: 12px;
    border-left: 2px solid var(--v-green);
}

.cp-tac-group-metrics {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding-left: 12px;
}

/* =====================================================================
   COMBAT & CLUTCH SECTION
   ===================================================================== */

.cp-combat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cp-combat-card {
    background: rgba(10, 20, 27, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.cp-combat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cp-combat-card-title {
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
}

.cp-combat-values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cp-combat-val {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.cp-combat-val-label {
    font-family: 'Geist', sans-serif;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
}

.cp-combat-val-num {
    font-family: 'Geist', sans-serif;
    font-size: 28px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
}

.cp-combat-val-num--win {
    color: var(--v-green);
}

.cp-combat-val-num--win-target {
    color: #00f2ff;
}

.cp-combat-delta {
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.65);
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    white-space: nowrap;
    text-align: center;
    flex-shrink: 0;
}

/* =====================================================================
   SAMPLE & CONFIDENCE SECTION
   ===================================================================== */

.cp-confidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cp-conf-card {
    background: rgba(10, 20, 27, 0.55);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.cp-conf-card--viewer {
    border-top: 2px solid rgba(47, 244, 114, 0.4);
}

.cp-conf-card--target {
    border-top: 2px solid rgba(0, 242, 255, 0.4);
}

.cp-conf-card-label {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.cp-conf-card--viewer .cp-conf-card-label { color: var(--v-green); }
.cp-conf-card--target .cp-conf-card-label { color: #00f2ff; }

.cp-conf-matches {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
}

.cp-conf-matches-num {
    font-size: 22px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
}

/* Confidence level badge */
.cp-conf-level {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 4px;
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    width: fit-content;
}

.cp-conf-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cp-conf-level--high {
    color: var(--v-green);
    background: rgba(47, 244, 114, 0.1);
}
.cp-conf-level--high .cp-conf-dot {
    background: var(--v-green);
    box-shadow: 0 0 6px var(--v-green);
}

.cp-conf-level--moderate {
    color: var(--v-gold);
    background: rgba(255, 184, 0, 0.1);
}
.cp-conf-level--moderate .cp-conf-dot {
    background: var(--v-gold);
}

.cp-conf-level--low {
    color: rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.06);
}
.cp-conf-level--low .cp-conf-dot {
    background: rgba(255, 255, 255, 0.5);
}

.cp-conf-level--insufficient {
    color: var(--v-red);
    background: rgba(255, 70, 85, 0.1);
}
.cp-conf-level--insufficient .cp-conf-dot {
    background: var(--v-red);
}

/* Filtered-input transparency */
.cp-conf-filtered {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.4;
}

/* Round-data coverage */
.cp-conf-coverage {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.4;
}

.cp-conf-coverage--partial {
    color: var(--v-gold);
}

/* Confidence description */
.cp-conf-desc {
    font-family: 'Geist', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    margin: 0;
}

/* Sample-basis footnote */
.cp-conf-footnote {
    font-family: 'Geist', sans-serif;
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    margin: 14px 0 0;
}

/* =====================================================================
   ERROR / EMPTY STATE
   ===================================================================== */

.cp-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    text-align: center;
    gap: 20px;
}

.cp-error-icon {
    font-size: 32px;
    opacity: 0.3;
}

.cp-error h2 {
    font-family: 'Geist', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

.cp-error p {
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    max-width: 360px;
    margin: 0;
    line-height: 1.6;
}

/* =====================================================================
   INSUFFICIENT DATA STATE
   ===================================================================== */

.cp-insufficient {
    text-align: center;
    padding: 48px 24px;
}

.cp-insufficient-badge {
    display: inline-block;
    font-family: 'Geist', sans-serif;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--v-gold);
    background: rgba(255, 184, 0, 0.08);
    border: 1px solid rgba(255, 184, 0, 0.2);
    padding: 6px 14px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.cp-insufficient p {
    font-family: 'Geist', sans-serif;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
    margin: 0;
}

.cp-insufficient-stats {
    margin-top: 12px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.55);
}

/* =====================================================================
   RESPONSIVE — TABLET (max 900px)
   ===================================================================== */

@media (max-width: 900px) {
    .cp-inner {
        padding: 24px 24px 60px;
    }

    .cp-header {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .cp-vs {
        flex-direction: row;
        padding: 0 4px;
    }

    .cp-vs-line {
        flex: 1;
        height: 1px;
        width: auto;
        min-height: 0;
        min-width: 20px;
    }

    .cp-combat-grid {
        grid-template-columns: 1fr;
    }

    .cp-confidence-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================================
   RESPONSIVE — MOBILE (max 480px)
   ===================================================================== */

@media (max-width: 480px) {
    .cp-card-breathing,
    .cp-card-art-frame--target.cp-card-breathing {
        animation-duration: 6s;
    }
    .cp-inner {
        padding: 16px 14px 48px;
    }

    .cp-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .cp-title {
        font-size: 16px;
        letter-spacing: 0.1em;
    }

    .cp-subtitle {
        font-size: 10px;
    }

    /* Keep title centred on mobile regardless of topbar stacking */
    .cp-title-block {
        position: relative;
        width: 100%;
        text-align: center;
    }

    .cp-header-divider {
        margin-bottom: 24px;
    }

    .cp-card-art-frame {
        width: 100px;
        height: 100px;
    }

    .cp-riot-id {
        font-size: 15px;
    }

    .cp-rank-icon {
        width: 30px;
        height: 30px;
    }

    .cp-rank-name {
        font-size: 13px;
    }

    .cp-metric-row {
        gap: 8px;
    }

    .cp-m-val {
        font-size: 15px;
        min-width: 50px;
    }

    .cp-m-delta {
        font-size: 10px;
        padding: 4px 10px;
        min-width: 52px;
    }

    /* Shared track: captions hide on narrow screens — left value = YOU,
       right value = FRIEND, matching the profile cards above. */
    .cp-metric-row--track {
        gap: 8px;
    }

    .cp-m-role {
        display: none;
    }

    /* Player cards keep their 36px size on narrow screens. */

    .cp-combat-val-num {
        font-size: 22px;
    }
}

/* =====================================================================
   BREATHING ANIMATION — reuses Dashboard breathingCard keyframes
   ===================================================================== */

/* YOU card: green glow (reuses the Dashboard's exact keyframes) */
.cp-card-breathing {
    animation: breathingCard 4s ease-in-out infinite;
}

/* FRIEND card: cyan glow variant (same scale pattern, different colour) */
.cp-card-art-frame--target.cp-card-breathing {
    animation: breathingCardCyan 4s ease-in-out infinite;
}

@keyframes breathingCardCyan {
    0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(0, 242, 255, 0.25); border-color: rgba(0, 242, 255, 0.35); }
    50% { transform: scale(1.08); box-shadow: 0 0 35px rgba(0, 242, 255, 0.5); border-color: rgba(0, 242, 255, 0.7); }
}

/* =====================================================================
   REDUCED MOTION — accessibility
   ===================================================================== */

@media (prefers-reduced-motion: reduce) {
    .cp-card-breathing,
    .cp-card-art-frame--target.cp-card-breathing {
        animation: none;
    }

    .cp-m-bar {
        transition: none;
    }

    .cp-m-marker {
        transition: none;
    }

    /* Disable the winner flash; the crown, values, delta/tie badges, and
       both player cards remain fully readable without animation. */
    .cp-m-marker--winner {
        animation: none;
    }
}
