/* =============================================
   SHARPFOOTY — TRACK RECORD PAGE
   ============================================= */

/* === SEASON HERO === */
.results-hero {
    padding: var(--space-10) 0 var(--space-8);
    border-bottom: 1px solid var(--border);
}

.results-hero-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-2);
}

.results-hero-title {
    font-size: var(--text-3xl);
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    margin-bottom: var(--space-2);
}

.results-hero-sub {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-8);
}

/* Stats grid */
.results-stats {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: var(--space-3);
}

.results-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
}

.results-stat-card.highlight {
    border-color: rgba(59,130,246,0.3);
    background: rgba(59,130,246,0.04);
}

.rs-value {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.rs-value.positive { color: var(--green); }
.rs-value.negative { color: var(--red); }

.rs-label {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: var(--space-1);
    font-weight: 600;
}

.rs-sub {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: var(--space-1);
    font-family: var(--font-mono);
}

/* === EQUITY CURVE === */
.equity-section {
    padding: var(--space-10) 0;
    border-bottom: 1px solid var(--border);
}

.equity-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.equity-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}

.equity-chart-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.equity-chart-area {
    padding: var(--space-4);
    height: 280px;
    position: relative;
}

.equity-chart-area svg {
    width: 100%;
    height: 100%;
}

.equity-legend {
    display: flex;
    gap: var(--space-6);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.equity-legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.equity-legend-line {
    width: 16px;
    height: 2px;
    border-radius: 1px;
}

.equity-legend-line.solid { background: var(--green); }
.equity-legend-line.dashed { background: var(--text-muted); border-top: 2px dashed var(--text-muted); height: 0; }
.equity-legend-line.flat { background: var(--accent); opacity: 0.4; }

/* === ROUND-BY-ROUND === */
.rounds-section {
    padding: var(--space-10) 0;
    border-bottom: 1px solid var(--border);
}

.rounds-section-title {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-5);
}

/* Round card (collapsed) */
.round-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-3);
    overflow: hidden;
    transition: border-color 0.15s;
}

.round-card:hover {
    border-color: rgba(255,255,255,0.1);
}

.round-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    cursor: pointer;
    user-select: none;
    transition: background 0.1s;
}

.round-card-header:hover {
    background: rgba(255,255,255,0.02);
}

.round-card-left {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.round-card-name {
    font-size: var(--text-base);
    font-weight: 700;
    color: var(--text-primary);
    min-width: 80px;
}

.round-card-stats {
    display: flex;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.round-card-stat {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    white-space: nowrap;
}

.round-card-stat strong {
    font-weight: 700;
}

.round-card-pnl {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-sm);
}

.round-card-pnl.positive {
    color: var(--green);
    background: var(--green-dim);
}

.round-card-pnl.negative {
    color: var(--red);
    background: var(--red-dim);
}

.round-card-toggle {
    font-size: var(--text-xs);
    color: var(--text-muted);
    transition: transform 0.2s;
    flex-shrink: 0;
}

.round-card.open .round-card-toggle {
    transform: rotate(90deg);
}

/* Round detail (expanded) */
.round-card-detail {
    display: none;
    border-top: 1px solid var(--border);
}

.round-card.open .round-card-detail {
    display: block;
}

/* Individual SGM row */
.sgm-row {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid rgba(45,58,74,0.3);
}

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

.sgm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.sgm-game {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: 600;
}

.sgm-meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.sgm-meta-item {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.sgm-meta-item strong {
    color: var(--text-secondary);
}

/* SGM legs */
.sgm-legs {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.sgm-leg {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    background: var(--bg-elevated);
    border-radius: var(--radius);
    font-size: var(--text-sm);
}

.sgm-leg-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.sgm-leg-icon.hit {
    background: var(--green-dim);
    color: var(--green);
}

.sgm-leg-icon.miss {
    background: var(--red-dim);
    color: var(--red);
}

.sgm-leg-text {
    flex: 1;
    color: var(--text-secondary);
}

.sgm-leg-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.sgm-leg-result {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
    flex-shrink: 0;
}

/* SGM bottom row */
.sgm-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid rgba(45,58,74,0.3);
    flex-wrap: wrap;
    gap: var(--space-2);
}

.sgm-pnl {
    font-family: var(--font-mono);
    font-size: var(--text-base);
    font-weight: 700;
}

.sgm-pnl.positive { color: var(--green); }
.sgm-pnl.negative { color: var(--red); }

/* === CALIBRATION === */
.calibration-section {
    padding: var(--space-10) 0;
    border-bottom: 1px solid var(--border);
}

.calibration-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    margin-top: var(--space-6);
    margin-bottom: var(--space-6);
}

.cal-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.cal-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
}

.cal-card-title {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-secondary);
}

.cal-chart {
    padding: var(--space-4);
    height: 240px;
}

.cal-chart svg {
    width: 100%;
    height: 100%;
}

.cal-explanation {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 700px;
}

.cal-explanation strong {
    color: var(--text-primary);
}

/* === CTA === */
.results-cta {
    padding: var(--space-10) 0;
    text-align: center;
}

.results-cta-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-10) var(--space-8);
    max-width: 600px;
    margin: 0 auto;
}

.results-cta-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.results-cta-body {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-6);
}

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    margin: var(--space-8) 0;
}

.empty-state-title {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.empty-state-body {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-6);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-divider {
    width: 60px;
    height: 1px;
    background: var(--border);
    margin: var(--space-6) auto;
}

.empty-state-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-4);
}

/* === BACKTEST PREVIEW === */
.backtest-section {
    padding: var(--space-10) 0;
    border-bottom: 1px solid var(--border);
}

.backtest-label {
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--amber);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: var(--space-2);
}

.backtest-note {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-xs);
    color: var(--amber);
    background: var(--amber-dim);
    padding: 4px 12px;
    border-radius: 9999px;
    margin-bottom: var(--space-4);
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .results-stats { grid-template-columns: repeat(3, 1fr); }
    .calibration-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .results-hero { padding: var(--space-6) 0; }
    .results-hero-title { font-size: var(--text-2xl); }
    .results-stats { grid-template-columns: repeat(2, 1fr); }
    .rs-value { font-size: var(--text-xl); }

    .equity-chart-area { height: 200px; }

    .round-card-header { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
    .round-card-stats { gap: var(--space-3); }
    .round-card-stat { font-size: var(--text-xs); }

    .sgm-row { padding: var(--space-3) var(--space-4); }
    .sgm-header { flex-direction: column; align-items: flex-start; }

    .results-cta-card { padding: var(--space-6) var(--space-4); }
}
