/* Matchup Rewind — Game register: card rail + annotated win-prob chart +
   Data-register play ticker. Tokens from phl-tokens.css. */

.rw-rail {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 16px;
}

.rw-mcard {
    flex: 0 0 200px;
    background: var(--phl-card);
    border: 1px solid var(--phl-line);
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(23, 34, 46, .08);
}

.rw-mcard:hover { box-shadow: 0 4px 12px rgba(23, 34, 46, .12); }
.rw-mcard.on { border-color: var(--phl-orange); box-shadow: 0 0 0 1px var(--phl-orange); }
.rw-mcard:focus-visible { outline: 2px solid var(--phl-orange); outline-offset: 2px; }

.rw-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rw-cnm {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-size: 1rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rw-csc {
    font-family: 'Rajdhani', 'Bahnschrift', 'Segoe UI', sans-serif;
    font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums;
}
.rw-mcard .w { color: var(--phl-text); }
.rw-mcard .l { color: var(--phl-faint); }
.rw-dot {
    display: inline-block; width: 6px; height: 6px; border-radius: 999px;
    background: var(--phl-win); margin-right: 4px; vertical-align: 2px;
}
.rw-mcard svg { display: block; margin-top: 6px; }
.rw-meta { display: flex; gap: 6px; margin-top: 6px; }

.rw-badge {
    font-size: .625rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; padding: 1px 6px; border-radius: 4px;
}
.rw-badge.cb { background: var(--phl-orange); color: #fff; }
.rw-badge.lc { background: var(--phl-line-soft); color: var(--phl-muted); }

.rw-stage {
    background: var(--phl-card);
    border: 1px solid var(--phl-line);
    border-radius: 10px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(23, 34, 46, .08);
    margin-bottom: 24px;
}

.rw-scorehead {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
}
.rw-team { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.rw-team .rw-nm {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-size: 1.6rem; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rw-team .rw-sc {
    font-family: 'Rajdhani', 'Bahnschrift', 'Segoe UI', sans-serif;
    font-weight: 700; font-size: 2.5rem; font-variant-numeric: tabular-nums; line-height: 1;
}
.rw-team .rw-key { width: 10px; height: 10px; border-radius: 2px; align-self: center; flex: 0 0 auto; }
.rw-team.o1 .rw-key { background: var(--phl-steel); }
.rw-team.o2 .rw-key { background: var(--phl-orange); }

.rw-asof { text-align: center; }
.rw-lbl {
    font-size: .6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--phl-muted);
}
.rw-wp {
    font-family: 'Rajdhani', 'Bahnschrift', 'Segoe UI', sans-serif;
    font-weight: 700; font-size: 1.5rem; font-variant-numeric: tabular-nums;
}

.rw-chartwrap { position: relative; }
.rw-chartwrap svg { display: block; width: 100%; height: auto; }

/* Floating readout that follows the scrub cursor */
.rw-tip {
    position: absolute; z-index: 6; pointer-events: none;
    transform: translate(12px, -50%);
    min-width: 190px; max-width: 300px;
    background: var(--phl-ink); color: #fff;
    border-radius: 8px; padding: 8px 10px;
    box-shadow: 0 4px 14px rgba(23, 34, 46, .28);
    font-size: .75rem; line-height: 1.35;
}
.rw-tip.flip { transform: translate(calc(-100% - 12px), -50%); }
.rw-tip[hidden] { display: none; }
.rw-tiptime {
    font-size: .625rem; text-transform: uppercase; letter-spacing: .06em;
    color: #93A1AF; margin-bottom: 2px;
}
.rw-tiphead { display: flex; align-items: baseline; gap: 6px; }
.rw-tipwho {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-size: 1.05rem; font-weight: 700;
}
.rw-tippts {
    font-family: 'Rajdhani', 'Bahnschrift', sans-serif; font-weight: 700;
    font-variant-numeric: tabular-nums; color: var(--phl-orange);
}
.rw-tipdesc { color: #C7D2DD; }
.rw-tipfoot {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    margin-top: 5px; padding-top: 5px; border-top: 1px solid #2C3947;
    font-variant-numeric: tabular-nums; color: #93A1AF; font-size: .6875rem;
}
.rw-tipdw { font-weight: 700; white-space: nowrap; }
.rw-tipdw.up { color: var(--phl-steel-bright); }
.rw-tipdw.down { color: var(--phl-orange-bright); }
.rw-chart-label {
    font-size: 11px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; fill: var(--phl-muted);
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

.rw-tickertitle {
    font-size: .6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--phl-muted); margin: 16px 0 8px;
}
.rw-tickerbox {
    max-height: 430px; overflow: auto;
    border: 1px solid var(--phl-line); border-radius: 6px;
    /* Isolate the scroller: sticky-header recalc over a few hundred rows was
       the desktop wheel-scroll jank (touch scrolling never hit it). */
    contain: content;
}

table.rw-ticker { border-collapse: collapse; width: 100%; font-size: .78125rem; }
table.rw-ticker th {
    position: sticky; top: 0; z-index: 5;
    background: var(--phl-ink); color: #fff;
    font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em;
    text-align: left; padding: 6px 10px;
    border-bottom: 2px solid var(--phl-orange);
}
table.rw-ticker th.num, table.rw-ticker td.num {
    text-align: right; font-variant-numeric: tabular-nums;
}
table.rw-ticker td { padding: 4px 10px; border-bottom: 1px solid var(--phl-line-soft); vertical-align: top; }
table.rw-ticker tr.ev { cursor: pointer; }
table.rw-ticker tr.ev:hover { background: var(--phl-line-soft); }
table.rw-ticker tr.hl { background: var(--phl-line-soft); box-shadow: inset 3px 0 0 var(--phl-orange); }
table.rw-ticker tr.bound td {
    color: var(--phl-faint); font-size: .6875rem;
    padding: 3px 10px; background: var(--phl-surface);
}
table.rw-ticker tr.bound td.rw-boundlbl {
    text-transform: uppercase; letter-spacing: .06em; white-space: nowrap;
    font-weight: 600;
}
.rw-gamenm { font-weight: 700; color: var(--phl-muted); letter-spacing: .04em; }
.rw-gamest { color: var(--phl-faint); }
.rw-gamest .side1 { color: var(--phl-steel-deep); font-weight: 600; }
.rw-gamest .side2 { color: var(--phl-orange-deep); font-weight: 600; }
table.rw-ticker td.pname { white-space: nowrap; font-weight: 600; }
table.rw-ticker td.pname .side1 { color: var(--phl-steel-deep); }
table.rw-ticker td.pname .side2 { color: var(--phl-orange-deep); }
table.rw-ticker td.playdesc { color: var(--phl-muted); max-width: 520px; }
table.rw-ticker td.pts.pos { color: var(--phl-win); font-weight: 600; }
table.rw-ticker td.pts.neg { color: var(--phl-loss); font-weight: 600; }

.rw-note { font-size: .75rem; color: var(--phl-faint); margin-top: 10px; }

/* Stacked sub-values (projected score, win% delta) */
.rw-sub { font-size: .6875rem; color: var(--phl-faint); font-weight: 400; line-height: 1.2; }
.rw-proj { color: var(--phl-steel-deep); font-variant-numeric: tabular-nums; }
.rw-snaptimec { color: var(--phl-muted); font-size: .6875rem; }
.rw-scwrap { display: inline-flex; flex-direction: column; align-items: flex-end; }
.rw-dw.up { color: var(--phl-steel-deep); font-weight: 600; }
.rw-dw.down { color: var(--phl-orange-deep); font-weight: 600; }
.rw-wp.s1 { color: var(--phl-steel-deep); }
.rw-wp.s2 { color: var(--phl-orange-deep); }

/* Ticker head row: title + All/Key segmented control */
.rw-tickerhead {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: 16px 0 8px; flex-wrap: wrap;
}
.rw-tickerhead .rw-tickertitle { margin: 0; }
.rw-seg { display: flex; border: 1px solid var(--phl-line); border-radius: 4px; overflow: hidden; }
.rw-seg button {
    background: var(--phl-card); color: var(--phl-muted); border: 0;
    padding: 4px 12px; font-size: .75rem; font-weight: 600; cursor: pointer;
    letter-spacing: .04em;
}
.rw-seg button.on { background: var(--phl-orange); color: #fff; }
.rw-seg button:focus-visible { outline: 2px solid var(--phl-orange); outline-offset: -2px; }

/* Key-play chart captions + ticker chips */
/* Key plays: up to ten, so a wrapping grid reads better than a pill row */
.rw-caps {
    display: grid; gap: 4px 12px; margin-top: 8px;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.rw-cap {
    display: flex; align-items: baseline; gap: 6px; width: 100%;
    background: transparent; border: 1px solid transparent;
    border-radius: 6px; padding: 2px 6px 2px 3px;
    font-size: .75rem; color: var(--phl-text); cursor: pointer; text-align: left;
}
.rw-cap:hover { border-color: var(--phl-line); background: var(--phl-surface); }
.rw-capwho { font-weight: 600; white-space: nowrap; }
.rw-cappts {
    font-variant-numeric: tabular-nums; color: var(--phl-win); font-weight: 600;
}
.rw-capdesc {
    color: var(--phl-muted); flex: 1 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rw-capnum, .rw-keychip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; border-radius: 999px;
    background: var(--phl-ink); color: #fff;
    font-size: .625rem; font-weight: 700;
}
.rw-keychip { margin-right: 4px; vertical-align: 1px; }
.rw-capdw { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rw-capdw.up { color: var(--phl-steel-deep); font-weight: 600; }
.rw-capdw.down { color: var(--phl-orange-deep); font-weight: 600; }

/* Win% heat, as classes rather than per-row inline styles */
table.rw-ticker td.h-lo2 { background: var(--phl-heat-lo-2); }
table.rw-ticker td.h-lo1 { background: var(--phl-heat-lo-1); }
table.rw-ticker td.h-hi1 { background: var(--phl-heat-hi-1); }
table.rw-ticker td.h-hi2 { background: var(--phl-heat-hi-2); }
table.rw-ticker td.tcol { white-space: nowrap; }

/* Ticker + snapshot side by side */
.rw-main { display: flex; gap: 16px; align-items: flex-start; }
.rw-main .rw-tickerbox { flex: 1 1 auto; min-width: 0; }
.rw-snap { flex: 0 0 360px; }
.rw-snaptime { color: var(--phl-faint); text-transform: none; letter-spacing: 0; }
.rw-snaphead {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.rw-segsm button { padding: 2px 8px; font-size: .6875rem; }
/* Net carries the verdict, so green/red belongs to it alone. Decay is just
   the clock doing what it always does — neutral. */
.rw-wpos { color: var(--phl-win); font-weight: 600; }
.rw-wneg { color: var(--phl-loss); font-weight: 600; }
.rw-wdecay { color: var(--phl-muted); }
.rw-snaptable { border-collapse: collapse; width: 100%; font-size: .78125rem; margin-bottom: 12px; }
.rw-snaptable th {
    background: var(--phl-ink); color: #fff; text-align: left;
    font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em;
    padding: 4px 8px; border-bottom: 2px solid var(--phl-orange);
}
.rw-snaptable th.num, .rw-snaptable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.rw-snaptable td { padding: 3px 8px; border-bottom: 1px solid var(--phl-line-soft); white-space: nowrap; }
.rw-snapfinal { color: var(--phl-faint); }
.rw-pos {
    display: inline-block; min-width: 26px; text-align: center;
    font-size: .625rem; font-weight: 700; color: #fff;
    border-radius: 4px; padding: 0 3px; letter-spacing: .04em;
}
.rw-pos-1 { background: #A83240; } .rw-pos-2 { background: #2E7D4F; }
.rw-pos-3 { background: #4682B4; } .rw-pos-4 { background: #7A4FA0; }
.rw-pos-5 { background: #5B6673; } .rw-pos-6 { background: #6B4F3A; }

@media (max-width: 980px) {
    .rw-main { flex-direction: column; }
    .rw-snap { flex: 1 1 auto; width: 100%; }
}

@media (max-width: 760px) {
    .rw-team .rw-nm { font-size: 1.15rem; }
    .rw-team .rw-sc { font-size: 1.7rem; }
    table.rw-ticker td.playdesc { max-width: 200px; }
}
