/*
 * One game, broken down: `/upcoming/<key>`.
 *
 * Loaded after home.css, whose ground, type, banner and record card it
 * reuses. What is here is the mirrored comparison table, the rating chart and
 * the two game logs. Theme tokens only, as everywhere.
 */

.gd {
    gap: 40px;
}

.gd-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(34px, 4.6vw, 60px);
    line-height: 0.95;
    letter-spacing: -0.02em;
    color: var(--brand-navy);
}

.gd-title span {
    color: var(--home-eyebrow);
}

.home .gd-back {
    font-size: 15px;
    font-weight: 600;
}

.gd-lines {
    gap: 6px;
}

.gd-line {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    font-size: 15px;
    color: var(--home-ink-soft);
}

.gd-line b {
    color: var(--brand-navy);
}

.gd-line-ours b {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 18px;
}

.home .gd-team-link {
    color: var(--text-strong);
    text-decoration: none;
}

.home .gd-team-link:hover {
    color: var(--text-strong);
    text-decoration: underline;
}

/* -- Sections ---------------------------------------------------------- */

.gd-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.gd-section-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 26px;
    color: var(--brand-navy);
}

.gd-note {
    margin: 0;
    max-width: 760px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--home-ink-soft);
}

/* -- The mirrored table ----------------------------------------------- */

/* One stat a row, as a box score app draws it: the two numbers at the outer
   edges, the label between them, and under them a bar in the two teams'
   colours (each half's inline --team-color) split so the longer half is the
   better side. */
.gd-table {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 20px 24px 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(10, 36, 99, 0.08);
}

.gd-row-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--home-eyebrow);
}

.gd-row-head span:last-child {
    text-align: right;
}

.gd-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gd-row-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: baseline;
    gap: 12px;
}

.gd-label {
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--home-ink-muted);
}

.gd-cell {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

.gd-left {
    justify-content: flex-start;
}

/* The rank sits inside the value, toward the label, on both sides. */
.gd-right {
    justify-content: flex-end;
}

.gd-right .gd-rank {
    order: -1;
}

.gd-value {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 24px;
    line-height: 1;
    color: var(--brand-ink);
}

.gd-rank {
    font-size: 13px;
    font-weight: 600;
    color: var(--home-ink-muted);
}

.gd-bar {
    display: flex;
    gap: 6px;
    height: 8px;
}

.gd-bar span {
    min-width: 6px;
    flex-basis: 0;
    border-radius: 4px;
    background: var(--team-color, var(--team-fallback));
}

/* -- The rating chart -------------------------------------------------- */

.gd-trend {
    margin: 0;
    padding: 18px 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(10, 36, 99, 0.08);
}

.gd-trend svg {
    display: block;
    width: 100%;
    height: auto;
}

.gd-axis {
    stroke: rgba(10, 36, 99, 0.12);
    stroke-width: 1;
}

.gd-series {
    fill: none;
    stroke: var(--team-color, var(--brand-navy));
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gd-trend figcaption {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    padding-top: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--home-ink-soft);
}

.gd-key::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 4px;
    margin-right: 8px;
    vertical-align: middle;
    border-radius: 2px;
    background: var(--team-color, var(--brand-navy));
}

.gd-range {
    margin-left: auto;
    font-weight: 500;
    color: var(--home-ink-muted);
}

/* -- The line's movement, WEB-19 ------------------------------------------ */

.gd-move-line {
    fill: none;
    stroke: var(--team-color);
    stroke-width: 3;
    stroke-linejoin: round;
}

/* Ours on top and heaviest; the markets beneath it. */
.gd-move-line.gd-move-ours {
    stroke-width: 5;
}

.gd-move-zero {
    stroke: rgba(10, 36, 99, 0.35);
    stroke-width: 1.5;
    stroke-dasharray: 6 6;
}

.gd-move-tick {
    font-size: 15px;
    font-weight: 600;
    fill: var(--home-ink-muted);
}

.gd-move-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gd-move-toggle {
    display: inline-flex;
    border: 1px solid rgba(10, 36, 99, 0.2);
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.65);
}

.gd-move-toggle button {
    padding: 7px 16px;
    border: 0;
    background: transparent;
    font: 600 14px var(--font-home);
    color: var(--home-ink-soft);
    cursor: pointer;
}

.gd-move-toggle button + button {
    border-left: 1px solid rgba(10, 36, 99, 0.2);
}

.gd-move-toggle button[aria-pressed="true"] {
    background: var(--brand-navy);
    color: var(--brand-paper);
}

.gd-move-axis {
    display: block;
    padding-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--home-ink-muted);
}

/* The chart scales to the screen, so on a phone its text and lines are drawn
   larger to land at a readable size. */
@media (max-width: 640px) {
    .gd-move-tick {
        font-size: 34px;
    }

    .gd-move-line {
        stroke-width: 6;
    }

    .gd-move-line.gd-move-ours {
        stroke-width: 9;
    }
}

.gd-move figcaption b {
    margin-left: 4px;
    color: var(--brand-ink);
}

/* -- The two game logs -------------------------------------------------- */

.gd-logs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.gd-log {
    padding: 18px 22px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(10, 36, 99, 0.08);
}

.gd-log-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-navy);
}

.gd-log-title span {
    font-weight: 500;
    color: var(--home-ink-muted);
}

.gd-log ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gd-log li {
    display: grid;
    grid-template-columns: 22px 26px minmax(0, 1fr) auto 52px;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-top: 1px solid rgba(10, 36, 99, 0.08);
    font-size: 15px;
}

.gd-log li:first-child {
    border-top: 0;
}

.gd-log-week {
    font-size: 13px;
    color: var(--home-ink-muted);
}

.gd-log-logo img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.gd-log-opp {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.gd-log-score {
    font-weight: 700;
}

.gd-log-l {
    color: var(--home-ink-muted);
}

.gd-log-empty {
    color: var(--home-ink-muted);
}

.gd-log-past {
    text-align: right;
    font-weight: 700;
}

.gd-beat {
    color: var(--positive-deep);
}

.gd-missed {
    color: var(--negative-deep);
}

.gd-source {
    margin: 0;
    font-size: 14px;
    color: var(--home-ink-muted);
}

@media (max-width: 760px) {
    .gd-logs {
        grid-template-columns: minmax(0, 1fr);
    }

    .gd-table {
        padding: 16px 16px 20px;
        gap: 16px;
    }

    /* The numbers keep their width and the label wraps between them,
       rather than the three overlapping on a long label. */
    .gd-row-top {
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
    }

    .gd-label {
        font-size: 13px;
        line-height: 1.25;
    }

    .gd-value {
        font-size: 20px;
    }

    .gd-rank {
        font-size: 11px;
    }
}
