/* Dynasty Points — Game register: cumulative race chart + Data-register points
   ledger and running-standings snapshot. Mirrors the Matchup Rewind stage.
   Tokens from phl-tokens.css. */

.dy-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;
}

/* Spotlight franchise head */
.dy-scorehead {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
}
.dy-team { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.dy-team .dy-key {
    width: 10px; height: 10px; border-radius: 2px;
    align-self: center; flex: 0 0 auto; background: var(--phl-orange);
}
.dy-nm {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-size: 1.6rem; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dy-scwrap { display: inline-flex; flex-direction: column; align-items: flex-start; }
.dy-sc {
    font-family: 'Rajdhani', 'Bahnschrift', 'Segoe UI', sans-serif;
    font-weight: 700; font-size: 2.5rem; font-variant-numeric: tabular-nums; line-height: 1;
    color: var(--phl-orange-deep);
}
.dy-sub { font-size: .6875rem; color: var(--phl-faint); line-height: 1.2; }

.dy-asof { text-align: center; }
.dy-lbl {
    font-size: .6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--phl-muted);
}
.dy-cume {
    font-family: 'Rajdhani', 'Bahnschrift', 'Segoe UI', sans-serif;
    font-weight: 700; font-size: 1.5rem; font-variant-numeric: tabular-nums;
}
.dy-league { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.dy-leadnm {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-size: 1.15rem; font-weight: 700; color: var(--phl-steel-deep);
    white-space: nowrap;
}

.dy-chartwrap { position: relative; }
.dy-chartwrap svg { display: block; width: 100%; height: auto; }
/* Both views are toggled with [hidden]; nothing here may out-specify that. */
.dy-chartwrap[hidden], .dy-racewrap[hidden] { display: none; }

/* Chart head: view switch + transport */
.dy-charthead {
    display: flex; align-items: center; gap: 10px;
    margin: 4px 0 10px;
}
.dy-play {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--phl-card); color: var(--phl-text);
    border: 1px solid var(--phl-line); border-radius: 4px;
    padding: 4px 12px; font-size: .75rem; font-weight: 600;
    letter-spacing: .04em; cursor: pointer;
}
.dy-play:hover { border-color: var(--phl-orange); color: var(--phl-orange-deep); }
.dy-play.on { background: var(--phl-orange); border-color: var(--phl-orange); color: #fff; }
.dy-play:focus-visible { outline: 2px solid var(--phl-orange); outline-offset: 2px; }

/* Race view — one row per franchise, ranked by transform so overtakes animate */
.dy-racewrap { --dy-race-h: 30px; position: relative; }
.dy-racetrack { position: relative; overflow: hidden; }
.dy-racerow {
    position: absolute; top: 0; left: 0; right: 0;
    height: calc(var(--dy-race-h) - 6px);
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    transition: transform .75s cubic-bezier(.4, 0, .2, 1), opacity .5s ease;
    will-change: transform;
}
.dy-racerow.off { opacity: 0; pointer-events: none; }
.dy-racenm {
    flex: 0 0 128px; text-align: right;
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-size: .9375rem; font-weight: 600; color: var(--phl-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dy-racebarwrap { flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.dy-racebar {
    height: 100%; min-height: 16px; border-radius: 0 3px 3px 0;
    background: var(--phl-steel); flex: 0 0 auto;
    transition: width .75s cubic-bezier(.4, 0, .2, 1), background-color .3s ease;
}
.dy-raceval {
    font-family: 'Rajdhani', 'Bahnschrift', 'Segoe UI', sans-serif;
    font-weight: 700; font-size: .9375rem; font-variant-numeric: tabular-nums;
    color: var(--phl-muted); flex: 0 0 auto;
}
.dy-racerow.hot .dy-racenm { color: var(--phl-orange-deep); font-weight: 700; }
.dy-racerow.hot .dy-racebar { background: var(--phl-orange); }
.dy-racerow.hot .dy-raceval { color: var(--phl-orange-deep); }
.dy-racerow:hover .dy-racebar { filter: brightness(1.08); }

/* Season stamp, watermark-style so it never competes with the bars */
.dy-racestamp {
    position: absolute; right: 8px; bottom: 4px; text-align: right;
    pointer-events: none; line-height: 1;
}
.dy-racey {
    display: block;
    font-family: 'Rajdhani', 'Bahnschrift', 'Segoe UI', sans-serif;
    font-weight: 700; font-size: 3.25rem; color: var(--phl-line);
    font-variant-numeric: tabular-nums;
}
.dy-racesn {
    display: block; font-size: .6875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .06em; color: var(--phl-faint);
}

@media (prefers-reduced-motion: reduce) {
    .dy-racerow, .dy-racebar { transition-duration: .01ms; }
}
.dy-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;
}
.dy-endlabel {
    font-size: 11px; font-weight: 600;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}
.dy-line { fill: none; stroke-linejoin: round; stroke-linecap: round; cursor: pointer; }
.dy-line.rest { stroke: var(--phl-line); stroke-width: 1.5; }
.dy-line.near { stroke: var(--phl-steel-bright); stroke-width: 2; }
.dy-line.hot { stroke: var(--phl-orange); stroke-width: 2.75; }
.dy-hit { fill: none; stroke: transparent; stroke-width: 10; cursor: pointer; }

/* Cursor readout — a strip below the plot, never on top of it. Light ground so
   it reads as a caption rather than a second surface competing with the chart. */
.dy-readout {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px;
    margin-top: 8px; padding: 7px 12px;
    background: var(--phl-surface);
    border: 1px solid var(--phl-line); border-radius: 8px;
    font-size: .75rem; line-height: 1.4;
}
.dy-ro-season {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-size: 1.05rem; font-weight: 700; color: var(--phl-ink);
    white-space: nowrap;
}
.dy-ro-item { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.dy-ro-lbl {
    font-size: .625rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--phl-faint); white-space: nowrap;
}
.dy-ro-gain {
    font-family: 'Rajdhani', 'Bahnschrift', sans-serif; font-weight: 700;
    font-variant-numeric: tabular-nums; color: var(--phl-orange-deep);
    white-space: nowrap;
}
.dy-ro-gain.zero { color: var(--phl-faint); font-weight: 400; }
.dy-ro-tot {
    font-family: 'Rajdhani', 'Bahnschrift', sans-serif; font-weight: 700;
    font-variant-numeric: tabular-nums; color: var(--phl-ink);
}
.dy-ro-who {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-size: .9375rem; font-weight: 700; color: var(--phl-orange-deep);
    white-space: nowrap;
}
.dy-ro-desc { color: var(--phl-muted); white-space: nowrap; }
.dy-ro-champ { color: var(--phl-text); white-space: nowrap; }

/* Milestone captions under the chart */
.dy-caps {
    display: grid; gap: 4px 12px; margin-top: 8px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.dy-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;
}
.dy-cap:hover { border-color: var(--phl-line); background: var(--phl-surface); }
.dy-capnum {
    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; flex: 0 0 auto;
}
.dy-capwho { font-weight: 600; white-space: nowrap; }
.dy-cappts { font-variant-numeric: tabular-nums; color: var(--phl-win); font-weight: 600; }
.dy-capdesc {
    color: var(--phl-muted); flex: 1 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Segmented controls (buttons in the stage, links in the page head) */
.dy-seg { display: flex; border: 1px solid var(--phl-line); border-radius: 4px; overflow: hidden; }
.dy-seg button, .dy-seg a {
    background: var(--phl-card); color: var(--phl-muted); border: 0;
    padding: 4px 12px; font-size: .75rem; font-weight: 600; cursor: pointer;
    letter-spacing: .04em; text-decoration: none; white-space: nowrap;
}
.dy-seg button.on, .dy-seg a.on { background: var(--phl-orange); color: #fff; }
.dy-seg button:focus-visible, .dy-seg a:focus-visible {
    outline: 2px solid var(--phl-orange); outline-offset: -2px;
}
.dy-segsm button { padding: 2px 8px; font-size: .6875rem; }
.dy-segmetric a { padding: 6px 14px; font-size: .8125rem; }

/* Ledger + snapshot side by side */
.dy-tickerhead {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin: 16px 0 8px; flex-wrap: wrap;
}
.dy-tickertitle {
    font-size: .6875rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .06em; color: var(--phl-muted); margin: 0;
}
.dy-main { display: flex; gap: 16px; align-items: flex-start; }
.dy-main .dy-tickerbox { flex: 1 1 auto; min-width: 0; }
.dy-snap { flex: 0 0 360px; }
.dy-snaptime { color: var(--phl-faint); text-transform: none; letter-spacing: 0; }
.dy-snaphead {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.dy-tickerbox {
    max-height: 430px; overflow: auto;
    border: 1px solid var(--phl-line); border-radius: 6px;
    contain: content;
}

table.dy-ticker { border-collapse: collapse; width: 100%; font-size: .78125rem; }
table.dy-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.dy-ticker th.num, table.dy-ticker td.num {
    text-align: right; font-variant-numeric: tabular-nums;
}
table.dy-ticker td { padding: 4px 10px; border-bottom: 1px solid var(--phl-line-soft); }
table.dy-ticker tr.ev { cursor: pointer; }
table.dy-ticker tr.ev:hover { background: var(--phl-line-soft); }
table.dy-ticker tr.hl { background: var(--phl-line-soft); }
table.dy-ticker tr.spot td { box-shadow: inset 3px 0 0 var(--phl-orange); }
table.dy-ticker td.who { white-space: nowrap; font-weight: 600; }
table.dy-ticker td.yr { white-space: nowrap; color: var(--phl-muted); }
table.dy-ticker td.pts { color: var(--phl-win); font-weight: 600; }
table.dy-ticker td.pts.zero { color: var(--phl-faint); font-weight: 400; }
table.dy-ticker tr.bound td {
    color: var(--phl-faint); font-size: .6875rem;
    padding: 3px 10px; background: var(--phl-surface);
    text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
}

table.dy-snaptable { border-collapse: collapse; width: 100%; font-size: .78125rem; }
table.dy-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);
}
table.dy-snaptable th.num, table.dy-snaptable td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dy-snaptable td { padding: 3px 8px; border-bottom: 1px solid var(--phl-line-soft); white-space: nowrap; }
table.dy-snaptable tr { cursor: pointer; }
table.dy-snaptable tr:hover td { background: var(--phl-line-soft); }
table.dy-snaptable tr.spot td { background: var(--phl-row-keeper); font-weight: 600; }
table.dy-snaptable td.gain { color: var(--phl-win); font-weight: 600; }
table.dy-snaptable td.gain.zero { color: var(--phl-faint); font-weight: 400; }
table.dy-snaptable td.out { color: var(--phl-faint); }
.dy-rk {
    display: inline-block; min-width: 20px; text-align: right;
    font-variant-numeric: tabular-nums; color: var(--phl-muted);
}
.dy-move { font-size: .625rem; font-weight: 700; }
.dy-move.up { color: var(--phl-win); }
.dy-move.down { color: var(--phl-loss); }

.dy-note { font-size: .75rem; color: var(--phl-faint); margin-top: 10px; }

@media (max-width: 980px) {
    .dy-main { flex-direction: column; }
    .dy-snap { flex: 1 1 auto; width: 100%; }
    .dy-league { display: none; }
}

@media (max-width: 760px) {
    .dy-nm { font-size: 1.15rem; }
    .dy-sc { font-size: 1.7rem; }
    .dy-stage { padding: 16px 12px; }
    /* Twenty seasons of lines can't shrink to phone width and stay legible —
       hold a readable chart and let it scroll sideways, same as a wide table. */
    .dy-chartwrap { overflow-x: auto; }
    .dy-chartwrap svg { width: 820px; max-width: none; }
    table.dy-ticker { min-width: 560px; }
    /* The race does fit a phone — give the bars back the room the name column
       and the row pitch were spending. */
    .dy-racewrap { --dy-race-h: 26px; }
    .dy-racenm { flex-basis: 84px; font-size: .8125rem; }
    .dy-racey { font-size: 2.25rem; }
}
