/* ============================================================
   FANTASY FIELD NOTES — cards.css
   Shared matchup card styles.
   Source of truth: fantasyfieldnotes.com/assets/cards.css
   Load this in any project that renders matchup cards.
   Override individual rules in your local stylesheet as needed.
   ============================================================ */

/* ── Depends on these CSS variables being defined by the host app:
   --bg-card, --bg-card-alt, --bg-no-game, --bg-hover
   --border, --border-light
   --text-primary, --text-secondary, --text-muted, --text-dim
   --accent, --accent-glow
   --green, --green-glow, --green-glow-strong
   --red, --red-glow, --red-glow-strong
   --amber, --amber-haze, --amber-haze-strong
   --haze
   --radius, --radius-sm
   --font-primary
   --font-size-xs, --font-size-sm, --font-size-md, --font-size-lg, --font-size-xl
   --font-weight-bold, --font-weight-medium, --font-weight-light
   ============================================================ */

/* ── Cards container ──────────────────────────────────────── */

.cards-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ── Card base ────────────────────────────────────────────── */

.matchup-card {
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

.matchup-card.no-game {
    background: var(--bg-no-game);
    opacity: 0.5;
}

.matchup-inner {
    position: relative;
    z-index: 2;
    will-change: transform;
}

/* ── Header ───────────────────────────────────────────────── */

.matchup-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 11px 14px 9px;
    border-bottom: 1px solid var(--border);
    gap: 3px;
}

.header-player-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.header-meta-block {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.player-side,
.opp-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.opp-side {
    align-items: flex-end;
}
.player-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    flex-wrap: wrap;
}
.player-name-row-left {
    flex-shrink: 0;
}
.player-name-row-right {
    flex: 1;
    min-width: 80px;
    justify-content: flex-end;
}


/* ── Flag icons ───────────────────────────────────────────── */

.star-icon {
    font-size: var(--font-size-lg);
    line-height: 1;
    flex-shrink: 0;
}

.star-always   { color: var(--amber); }
.star-streamer { color: var(--accent); font-size: 13px; }
.star-warning  { color: var(--red);   font-size: 13px; }
.star-watchlist  { color: var(--accent);   font-size: 13px; }
.star-none      { color: var(--text-muted); font-size: 13px; }

/* ── Player name ──────────────────────────────────────────── */

.player-name {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.01em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Meta rows ────────────────────────────────────────────── */

.meta-row {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-md);
    color: var(--text-secondary);
}

.team-abbr {
    font-weight: var(--font-weight-bold);
    letter-spacing: 0.05em;
}

.meta-sep {
    font-size: var(--font-size-lg);
}

.start-time {
    font-weight: 500;
    color: var(--amber);
    letter-spacing: 0.02em;
}

.next-start-date {
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

/* ── VS divider ───────────────────────────────────────────── */

.vs-divider {
    display: flex;
    align-items: center;
    align-self: center;
    justify-content: center;
    padding: 0 10px;
    font-weight: var(--font-weight-bold);
    color: var(--amber-fade);
}

/* ── Opponent side ────────────────────────────────────────── */

.opp-name {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-secondary);
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /*max-width: 130px;*/
}

.opp-meta {
    justify-content: flex-end;
}

.opp-record {
    font-size: var(--font-size-md);
}

/* ── Note ─────────────────────────────────────────────────── */

.player-note {
    padding: 7px 14px 6px;
    font-size: var(--font-size-sm);
    line-height: 1.35;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-style: italic;
}

/* ── Stats section ────────────────────────────────────────── */

.stats-section {
    padding: 0 0 9px;
}

.stats-row {
    padding: 5px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-label {
    font-size: var(--font-size-sm);
    font-weight: 700;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    text-transform: uppercase;
    width: 24px;
    flex-shrink: 0;
    margin-bottom: var(--font-size-xs);
    margin-right: 10px;
}

.stats-grid-6 {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
}

.stats-grid-5 {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
}

.stat-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    min-width: 0;
}

.stat-val {
    font-size: var(--font-size-md);
    font-weight: var(--font-weight-medium);
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.stat-val.avg {
    font-size: var(--font-size-sm);
}

.stat-lbl {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-light);
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stats-divider {
    height: 1px;
    background: var(--border);
}

.opp-divider {
    background: var(--amber-haze-strong)
}

.side-divider {
    background: var(--amber-fade);
    color: var(--amber);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    padding: 0 6px;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Opponent pitcher row ─────────────────────────────────── */

.stats-row-right {
    background: var(--amber-haze);
    border-top: 1px solid var(--border);
}

.stats-label-right {
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* ── Stat color helpers ───────────────────────────────────── */

.stat-hi, .stat-pos { color: var(--green); }
.stat-lo, .stat-neg { color: var(--red); }
.stat-mid, .stat-warning { color: var(--amber); }
.stat-neutral { color: var(--text-muted); }

/* ── No-game state ────────────────────────────────────────── */

.no-game-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
}

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 360px) {
    .player-name  { font-size: 15px; }
    .opp-name     { font-size: 13px; }
    .opp-side     { flex: 0 0 110px; }
    .stat-val     { font-size: 12px; }
    .stat-val.avg { font-size: 11px; }
}
