/* ============================================
   LineupIQ Games Strip
   Slate-level row of the slate's games, between
   the build tabs and the split workspace (team
   sports only). Collapsible; horizontal scroll
   within the strip when there are many games.
   ============================================ */

.games-strip {
    background: var(--liq-bg-secondary);
    border-bottom: 1px solid var(--liq-border-color);
    flex-shrink: 0;
}

/* ---- Bar (always visible) ---- */

.games-strip-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 1rem;
    min-height: 32px;
}

.games-strip-toggle {
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--liq-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

    .games-strip-toggle:hover {
        border-color: var(--liq-border-color);
        color: var(--liq-text-primary);
        background: var(--liq-bg-hover);
    }

    .games-strip-toggle i {
        font-size: 0.7rem;
        line-height: 1;
    }

.games-strip-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--liq-text-secondary);
}

.games-strip-summary {
    font-size: 0.75rem;
    color: var(--liq-text-muted, var(--liq-text-secondary));
}

/* ---- Cards ---- */

.games-strip-cards {
    display: flex;
    gap: 0.5rem;
    padding: 0 1rem 0.5rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

    .games-strip-cards::-webkit-scrollbar {
        height: 6px;
    }

    .games-strip-cards::-webkit-scrollbar-thumb {
        background: var(--liq-border-color);
        border-radius: 3px;
    }

.games-strip.collapsed .games-strip-cards {
    display: none;
}

.game-card {
    flex: 0 0 auto;
    /* 168px until the Vegas row landed; the extra 14px keeps ML + chip + total
       + chip + ML from touching on a -119/-101 kind of game. */
    min-width: 182px;
    padding: 0.45rem 0.7rem;
    background: var(--liq-bg-primary);
    border: 1px solid var(--liq-border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: border-color 0.15s ease;
}

    .game-card:hover {
        border-color: var(--liq-accent-green);
    }

/* Card body is clickable (toggles the game in the view filter) */
.game-card {
    cursor: pointer;
}

    .game-card.game-filtered {
        border-color: var(--liq-accent-green);
        background: rgba(var(--liq-accent-rgb), 0.06);
    }

/* ============================================
   Individual sports (tennis, MMA)
   Same card SHAPE as a team game — competitor left, "vs", competitor right —
   so each name sits above its own filter / exclude pair, which the shared
   space-between rows already line up. No logo, no weather, no confirmed
   badge. The strip scrolls horizontally, so a wider card is cheap while a
   taller one costs the grid real estate: hence side by side, not stacked.
   Each side is a column so odds can drop in under the name later.
   ============================================ */

.game-card.game-card-individual {
    /* No wider floor than a team card: the card is flex: 0 0 auto, so it
       sizes to its own content. "Bonzi vs Majchrzak" stays tight while
       "Vandecasteele vs Davidovich Fokina" grows to fit. A fixed floor here
       just padded the short ones with dead space. */
    min-width: 176px;
}

/* The meta line on these cards holds at most the confirmed badge (no
   weather), and the renderer omits the line entirely when even that is
   empty — the time lives down between the action pairs now. */
.game-card-individual .game-badges:empty {
    display: none;
}

.game-card-individual .game-card-matchup {
    align-items: flex-start;
}

.game-card-individual .game-competitor {
    /* 0 0 auto, not 1 1 0: the sides must NOT shrink below their names, or a
       long one gets clipped instead of widening the card. space-between on
       the row still pushes them to opposite edges. */
    flex: 0 0 auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05rem;
}

/* Home side mirrors so its name sits above the right-hand button pair */
.game-card-individual .game-team-home {
    align-items: flex-end;
    text-align: right;
}

.game-competitor-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--liq-text-primary);
    /* One line, always. Wrapping a single long name would push EVERY card in
       the row taller (flex stretches them to match), trading the expensive
       dimension for the cheap one. Let the card grow sideways instead — the
       strip scrolls. */
    white-space: nowrap;
}

/* Reserved for tennis prices — renders only when a value is present */
.game-competitor-odds {
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--liq-text-secondary);
    font-variant-numeric: tabular-nums;
}

.game-card-individual .game-team.team-excluded .game-competitor-name {
    text-decoration: line-through;
    opacity: 0.55;
}

.game-vs {
    flex: 0 0 auto;
    align-self: center;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--liq-text-secondary);
    opacity: 0.7;
    line-height: 1;
}

/* Game state accents (competitionState) — in-progress / final dim slightly */
.game-card.game-card-inprogress,
.game-card.game-card-live {
    border-color: rgba(var(--liq-accent-rgb), 0.45);
}

.game-card.game-card-final,
.game-card.game-card-completed {
    opacity: 0.6;
}

/* Late Swap build only (LineupIQLateSwap.syncGamesStrip): the game has
   started per our stored start times — players from it are locked. Amber to
   match the locked-row edge and lineup lock icons; the time stays readable. */
.game-card.game-locked {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.05);
}

.game-card.game-locked .game-time {
    color: #f59e0b;
}

.game-card.game-locked .game-time::before {
    content: "\F47A";              /* bi-lock-fill */
    font-family: "bootstrap-icons";
    font-size: 0.75em;
    margin-right: 3px;
}

.game-card-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
}

.game-team {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

/* Row 2: one cell per team, mirroring .game-card-teams above it so each cell
   sits under its own team. space-between (not a grid) because the teams row
   uses it too -- anything else and the cells drift out of alignment the moment
   an abbreviation is a different width.

   Holds the confirmation tick and the probable pitcher today. The moneyline
   and the implied team total go here when they arrive, which is the reason
   this is a per-team row rather than more badges crowded onto the meta line. */
.game-card-teamline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    margin-top: 0.2rem;
    font-size: 0.68rem;
    line-height: 1.1;
    min-height: 1.05rem;
}

.game-teamline-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
    color: var(--fgb-text-muted, #8b98a9);
}

    /* Mirrors .game-team-home: the home side reads right-to-left so its tick
       lands beside its logo rather than out in the middle of the card. */
    .game-teamline-home {
        flex-direction: row-reverse;
    }

.game-teamline-sp {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-teamline-ok {
    color: #26a65b;
    flex-shrink: 0;
}

/* Deliberately a dash, not a hollow tick. An empty circle next to a filled one
   reads as "loading"; a dash reads as "nothing yet", which is the truth. */
.game-teamline-pending {
    color: rgba(139, 152, 169, 0.45);
    flex-shrink: 0;
}

/* Row 3: Vegas — moneyline + implied-total chip per team, game total in the
   middle. Mirrors the teams row's space-between (see .game-card-teamline for
   why), the total sitting where the "@" does two rows up.

   Size hierarchy is deliberate: the implied total is the number a DFS user
   came for (where do the runs land), so the chip is the largest thing on the
   row; the moneyline and game total are context and drop to muted small. */
.game-card-vegas {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    margin-top: 0.1rem;
    font-size: 0.68rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.game-vegas-cell {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-width: 0;
}

    /* Mirrors .game-team-home: chip lands under the logo, price toward the
       middle, same reading direction as the row above. */
    .game-vegas-home {
        flex-direction: row-reverse;
    }

.game-vegas-ml {
    font-size: 0.64rem;
    color: var(--liq-text-muted, var(--liq-text-secondary));
}

.game-vegas-total {
    flex: 0 0 auto;
    font-size: 0.62rem;
    color: var(--liq-text-muted, var(--liq-text-secondary));
    opacity: 0.8;
}

/* Implied team total. The background alpha is set inline, scaled across the
   slate's own range — see impliedChipHtml in lineupiq-games.js. */
.game-vegas-it {
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--liq-text-primary);
}

    .game-team-home {
        flex-direction: row-reverse;
    }

/* 22px -> 26px (2026-09-05): at 22 the mark read as an afterthought beside
   the 0.85rem bold abbreviation and the odds row. 30px was tried and starts
   to dominate the card. */
.game-team-logo {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .game-team-logo .team-logo {
        width: 26px;
        height: 26px;
        display: block;
    }

    /* Sprite not loaded / id missing: render nothing, keep the box so the
       layout doesn't shift when the sprite lands and upgrades it */
    .game-team-logo .team-logo-missing {
        display: block;
        width: 26px;
        height: 26px;
    }

    /* Sports with NO sprite coverage at all (soccer today): reserving the box
       just leaves a permanent gap, so collapse it and let the abbreviation
       carry the card. Self-retiring -- once badges exist the symbol resolves
       and an <svg> renders instead of this span. */
    .game-team-logo .team-logo-missing[data-sport="soccer"] {
        display: none;
    }

.game-team-abbr {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--liq-text-primary);
    letter-spacing: 0.02em;
}

.game-at {
    font-size: 0.7rem;
    color: var(--liq-text-muted, var(--liq-text-secondary));
    flex-shrink: 0;
}

.game-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    font-size: 0.72rem;
    color: var(--liq-text-secondary);
}

.game-time {
    white-space: nowrap;
}

    .game-time .game-tz {
        margin-left: 0.2rem;
        font-size: 0.6rem;
        opacity: 0.6;
        letter-spacing: 0.04em;
    }

.game-weather {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    color: var(--liq-text-muted, var(--liq-text-secondary));
}

.game-weather-icon {
    display: inline-flex;
    font-size: 0.8rem;
    line-height: 1;
    color: var(--liq-text-secondary);
}

.game-badges {
    display: inline-flex;
    gap: 0.25rem;
    margin-left: auto;
}

.game-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.75rem;
    line-height: 1;
}

.game-badge-confirmed {
    color: var(--liq-accent-green);
}

.game-badge-dome {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.05rem 0.3rem;
    border-radius: 3px;
    background: var(--liq-bg-tertiary);
    color: var(--liq-text-muted, var(--liq-text-secondary));
}

/* ---- Team actions (filter / exclude) ---- */

.game-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.375rem;
    /* auto, not a fixed margin: cards in a row stretch to the tallest, and a
       card missing the weather line would otherwise leave its footer floating
       mid-card while its neighbours' sit lower. Pinning the footer keeps the
       time / filter row on one line across the whole strip. */
    margin-top: auto;
    padding-top: 0.25rem;
    border-top: 1px solid var(--liq-border-color);
}

    /* The start time lives here, centred between the two action pairs — its
       own slot instead of sharing the meta line with the weather. Keeps the
       .game-time class so the late-swap lock accent still lands on it. */
    .game-card-actions .game-time {
        font-size: 0.72rem;
        color: var(--liq-text-secondary);
    }

.game-team-actions {
    display: inline-flex;
    gap: 0.125rem;
}

.game-team-btn {
    width: 22px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--liq-text-muted, var(--liq-text-secondary));
    cursor: pointer;
    font-size: 0.72rem;
    line-height: 1;
    transition: all 0.12s ease;
}

    .game-team-btn:hover {
        border-color: var(--liq-border-color);
        color: var(--liq-text-primary);
        background: var(--liq-bg-hover);
    }

    .game-team-filter.active {
        color: var(--liq-accent-green);
        border-color: rgba(var(--liq-accent-rgb), 0.4);
        background: rgba(var(--liq-accent-rgb), 0.1);
    }

    .game-team-exclude.active {
        color: var(--liq-accent-red, #ef4444);
        border-color: rgba(239, 68, 68, 0.4);
        background: rgba(239, 68, 68, 0.1);
    }

/* Excluded team: dim its abbreviation on the card */
.game-team.team-excluded .game-team-abbr {
    text-decoration: line-through;
    opacity: 0.45;
}

.game-team.team-excluded .game-team-logo {
    opacity: 0.35;
}

/* Bar-level "Clear filter" (visible only while a team filter is on) */
.games-strip-clear {
    margin-left: auto;
    padding: 0.15rem 0.5rem;
    background: rgba(var(--liq-accent-rgb), 0.1);
    border: 1px solid rgba(var(--liq-accent-rgb), 0.4);
    border-radius: 5px;
    color: var(--liq-accent-green);
    font-size: 0.7rem;
    cursor: pointer;
    white-space: nowrap;
}

    .games-strip-clear:hover {
        background: rgba(var(--liq-accent-rgb), 0.18);
    }

/* ---- Team logo in the player grid's Team column ---- */

.team-cell {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    height: 100%;
}

    .team-cell .team-cell-logo {
        width: 18px;
        height: 18px;
        display: block;
        flex-shrink: 0;
    }

    /* Sprite not loaded / id missing: no box, just the abbreviation */
    .team-cell .team-logo-missing {
        display: none;
    }

/* Player grid rows on an excluded team — visible, muted */
.ag-theme-quartz .ag-row.liq-row-team-excluded,
.ag-theme-quartz-dark .ag-row.liq-row-team-excluded {
    opacity: 0.4;
}

    .ag-theme-quartz .ag-row.liq-row-team-excluded .ag-cell,
    .ag-theme-quartz-dark .ag-row.liq-row-team-excluded .ag-cell {
        text-decoration: line-through;
        text-decoration-color: var(--liq-text-muted, currentColor);
    }

/* ---- Mobile ---- */

@media (max-width: 768px) {
    .games-strip-bar {
        padding: 0.25rem 0.75rem;
    }

    .games-strip-cards {
        padding: 0 0.75rem 0.5rem;
    }

    .game-card {
        min-width: 162px;
        padding: 0.375rem 0.55rem;
    }
}
