/* ===================================================================
   match_mm.css — page-scoped styles for the MM
   match detail page.
   ================================================================ */

.mmd-page {
    --mmd-accent: #2C12D9;
    --mmd-accent-light: #4A35E0;
    --mmd-accent-soft: rgba(44, 18, 217, 0.18);
    --mmd-accent-hairline: rgba(44, 18, 217, 0.42);
    --mmd-blue: #60A5FA;
    --mmd-red: #EF4444;
    --mmd-amber: #F59E0B;
    --mmd-green: #10B981;
    --mmd-row-spine: 4px;
    --mmd-shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 6px 24px rgba(0, 0, 0, 0.35);
    overflow-x: clip;
    font-feature-settings: "tnum";
}

[data-theme="light"] .mmd-page {
    --mmd-shadow-card: 0 1px 0 rgba(0, 0, 0, 0.03) inset, 0 4px 18px rgba(0, 0, 0, 0.08);
}

.mmd-shell { position: relative; }

/* ----- Backlink ----- */
.mmd-backlink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--color-ps-muted);
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: 18px;
    transition: color 0.15s ease;
}
.mmd-backlink:hover { color: var(--mmd-accent); }

/* =================== Match Card hero =================== */
.mmd-hero {
    position: relative;
    --mmd-hero-ink: #F7FBFF;
    --mmd-hero-muted: rgba(222, 233, 249, 0.82);
    --mmd-hero-dimmed: rgba(202, 216, 236, 0.68);
    --mmd-hero-chip-bg: rgba(239, 247, 255, 0.94);
    --mmd-hero-chip-border: rgba(255, 255, 255, 0.38);
    --mmd-hero-chip-ink: #142338;
    background: #111A2B;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: var(--mmd-shadow-card);
    color: var(--mmd-hero-ink);
    overflow: hidden;
    margin-bottom: 28px;
}

.mmd-hero-art {
    position: absolute;
    inset: 0;
    background-image: var(--mmd-hero-art, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.38;
    filter: saturate(0.92) contrast(1.08);
    z-index: 0;
}
.mmd-hero[data-has-art="false"] .mmd-hero-art {
    background-image: linear-gradient(135deg, rgba(44, 18, 217, 0.14), transparent 55%);
    opacity: 1;
}
.mmd-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(8, 13, 24, 0.94) 0%, rgba(13, 22, 38, 0.82) 46%, rgba(7, 12, 22, 0.94) 100%),
        linear-gradient(180deg, rgba(14, 20, 33, 0.3) 0%, rgba(6, 10, 18, 0.74) 100%);
    z-index: 1;
}
[data-theme="light"] .mmd-hero::after {
    background:
        linear-gradient(90deg, rgba(8, 13, 24, 0.94) 0%, rgba(13, 22, 38, 0.82) 46%, rgba(7, 12, 22, 0.94) 100%),
        linear-gradient(180deg, rgba(14, 20, 33, 0.3) 0%, rgba(6, 10, 18, 0.74) 100%);
}

.mmd-hero-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 280px) minmax(0, 1fr) minmax(0, 320px);
    gap: 24px;
    padding: 28px 28px;
}

@media (max-width: 900px) {
    .mmd-hero-grid {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 22px 18px;
    }
}

.mmd-hero-cell { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mmd-hero-meta { align-items: flex-start; }
.mmd-hero-score { align-items: center; justify-content: center; text-align: center; }
.mmd-hero-when { align-items: flex-end; text-align: right; }
@media (max-width: 900px) {
    .mmd-hero-score, .mmd-hero-when { align-items: flex-start; text-align: left; }
}

/* Status pill */
.mmd-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(7, 12, 22, 0.54);
}
.mmd-status-label {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.mmd-status-pill.is-live { border-color: rgba(34, 197, 94, 0.55); background: rgba(34, 197, 94, 0.12); }
.mmd-status-pill.is-live .mmd-status-label { color: #22C55E; }
.mmd-status-dot {
    width: 8px; height: 8px;
    background: #22C55E;
    border-radius: 50%;
    animation: mmd-pulse 1.6s ease-in-out infinite;
}
@keyframes mmd-pulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
.mmd-status-pill.is-finished .mmd-status-label { color: var(--mmd-hero-muted); }
.mmd-status-pill.is-cancelled { border-color: rgba(239, 68, 68, 0.5); }
.mmd-status-pill.is-cancelled .mmd-status-label { color: #EF4444; }
.mmd-status-pill.is-pending { border-color: rgba(245, 158, 11, 0.5); }
.mmd-status-pill.is-pending .mmd-status-label { color: #F59E0B; }

/* Live timer */
.mmd-live-timer {
    margin-top: 4px;
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 28px;
    color: var(--mmd-hero-ink);
    letter-spacing: 0.04em;
    line-height: 1;
}
.mmd-duration {
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 13px;
    color: var(--mmd-hero-muted);
    letter-spacing: 0.08em;
}

/* Meta chips row */
.mmd-meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.mmd-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    background: var(--mmd-hero-chip-bg);
    border: 1px solid var(--mmd-hero-chip-border);
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--mmd-hero-chip-ink);
}
.mmd-chip-muted { color: #4B617A; }

/* Score block */
.mmd-team-pill {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.mmd-team-pill.is-blue { color: var(--mmd-blue); }
.mmd-team-pill.is-red { color: var(--mmd-red); }
.mmd-team-pill.is-winner::after {
    content: "★";
    margin-left: 6px;
    color: var(--mmd-accent);
    font-size: 11px;
}

.mmd-score-block {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 4px 0;
    font-family: var(--font-family-chakra);
    font-weight: 900;
    line-height: 1;
}
.mmd-score-blue, .mmd-score-red {
    font-size: 56px;
    transition: color 0.4s ease;
}
.mmd-score-blue { color: var(--mmd-blue); }
.mmd-score-red { color: var(--mmd-red); }
.mmd-score-blue.is-loser, .mmd-score-red.is-loser { color: rgba(224, 235, 251, 0.78); }
.mmd-score-blue.is-winner, .mmd-score-red.is-winner { text-shadow: 0 0 24px rgba(96, 165, 250, 0.18); }
.mmd-score-red.is-winner { text-shadow: 0 0 24px rgba(239, 68, 68, 0.22); }
.mmd-score-sep {
    color: var(--mmd-hero-dimmed);
    font-size: 32px;
}

@keyframes mmd-score-flash {
    0%, 100% { transform: translateY(0); opacity: 1; }
    35% { transform: translateY(-6px); opacity: 0.85; }
}
.mmd-score-flash { animation: mmd-score-flash 0.45s ease; }

.mmd-round-now {
    margin-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    background: rgba(44, 18, 217, 0.08);
    border: 1px solid var(--mmd-accent-hairline);
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.mmd-round-label { color: var(--mmd-hero-muted); }
.mmd-round-blue { color: var(--mmd-blue); }
.mmd-round-red { color: var(--mmd-red); }
.mmd-round-sep { color: var(--color-ps-dimmed); }

.mmd-cancel-banner, .mmd-pending-banner {
    padding: 18px 22px;
    border: 1px dashed var(--color-ps-border);
}
.mmd-cancel-banner { border-color: rgba(239, 68, 68, 0.45); }
.mmd-pending-banner { border-color: rgba(245, 158, 11, 0.45); }
.mmd-cancel-title, .mmd-pending-title {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mmd-hero-ink);
}
.mmd-cancel-reason, .mmd-pending-sub {
    margin-top: 6px;
    font-size: 13px;
    color: var(--mmd-hero-muted);
}

/* When & where */
.mmd-when-date {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--mmd-hero-ink);
}
.mmd-when-rel {
    font-size: 12px;
    color: var(--mmd-hero-muted);
    margin-top: 2px;
}
.mmd-when-server {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.08em;
    color: var(--mmd-hero-muted);
}
.mmd-flag { font-size: 14px; line-height: 1; }
.mmd-when-map {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
    color: var(--mmd-hero-ink);
}
.mmd-map-thumb {
    width: 36px;
    height: 22px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.36);
}
.mmd-map-thumb-fallback {
    background: linear-gradient(135deg, var(--mmd-accent) 0%, var(--mmd-accent-light) 100%);
}
.mmd-map-name { font-weight: 600; }
.mmd-map-mx {
    color: #8CC7FF;
    font-size: 11px;
    text-decoration: none;
    margin-left: 4px;
}
.mmd-map-mx:hover { color: #D7EBFF; }

/* Quick actions */
.mmd-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-self: flex-end;
    justify-content: flex-end;
    margin-top: auto;
}
.mmd-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--mmd-hero-chip-bg);
    border: 1px solid var(--mmd-hero-chip-border);
    color: var(--mmd-hero-chip-ink);
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.mmd-action:hover {
    background: #152238;
    border-color: rgba(255, 255, 255, 0.48);
    color: #F7FBFF;
}
.mmd-action svg { flex-shrink: 0; }
.mmd-action .mp-col { text-transform: none; }
.mmd-action:hover .mp-col {
    color: var(--mc-d, var(--mp-default, #fff)) !important;
}
.mmd-action[data-mmd-copied="true"] {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.5);
    color: #22C55E;
}

/* =================== Team rosters =================== */
.mmd-rosters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
}
@media (max-width: 760px) { .mmd-rosters { grid-template-columns: 1fr; } }

.mmd-roster {
    position: relative;
    background: var(--color-ps-surface);
    border: 1px solid var(--color-ps-border);
    box-shadow: var(--mmd-shadow-card);
    overflow: hidden;
}
.mmd-roster.is-winner {
    background: linear-gradient(180deg, rgba(44, 18, 217, 0.07) 0%, var(--color-ps-surface) 60%);
}

.mmd-roster-head {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px 12px 18px;
    border-bottom: 1px solid var(--color-ps-border);
    background: var(--color-ps-elevated);
}
.mmd-roster-rail {
    position: absolute;
    top: 0; bottom: 0; left: 0;
    width: 4px;
}
.mmd-roster[data-team="blue"] .mmd-roster-rail { background: var(--mmd-blue); }
.mmd-roster[data-team="red"] .mmd-roster-rail { background: var(--mmd-red); }
.mmd-roster-name {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 14px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.mmd-roster[data-team="blue"] .mmd-roster-name { color: var(--mmd-blue); }
.mmd-roster[data-team="red"] .mmd-roster-name { color: var(--mmd-red); }
.mmd-roster-meta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-ps-muted);
    margin-left: auto;
}
.mmd-roster-elo { color: var(--color-ps-muted); }
.mmd-roster-delta.is-pos { color: #22C55E; }
.mmd-roster-delta.is-neg { color: #EF4444; }
.mmd-winner-pill {
    margin-left: 8px;
    padding: 3px 8px;
    background: var(--mmd-accent-soft);
    border: 1px solid var(--mmd-accent-hairline);
    color: var(--mmd-accent);
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.mmd-player-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto auto auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 4px;
    padding: 10px 16px;
    border-bottom: 1px dashed var(--color-ps-border-subtle);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s ease;
}
.mmd-player-row:hover { background: var(--color-ps-hover); }
.mmd-player-row:last-child { border-bottom: 0; }

.mmd-avatar {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-ps-border);
    object-fit: cover;
    background: var(--color-ps-elevated);
}
.mmd-player-id { min-width: 0; }
.mmd-player-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mmd-player-login {
    font-family: var(--font-family-chakra);
    font-size: 11px;
    color: var(--color-ps-dimmed);
    letter-spacing: 0.04em;
}
.mmd-flag-inline { font-size: 13px; margin-right: 2px; }
.mmd-player-tier-pill {
    padding: 3px 7px;
    font-family: var(--font-family-chakra);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.mmd-player-elo {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 16px;
    color: var(--mmd-accent);
}
.mmd-player-delta {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 13px;
    min-width: 36px;
    text-align: right;
}
.mmd-player-delta.is-pos { color: #22C55E; }
.mmd-player-delta.is-neg { color: #EF4444; }
.mmd-player-delta.is-zero { color: var(--color-ps-dimmed); }
.mmd-player-promo {
    grid-column: 2 / -1;
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--mmd-accent);
}

/* =================== Generic section =================== */
.mmd-section {
    background: var(--color-ps-surface);
    border: 1px solid var(--color-ps-border);
    box-shadow: var(--mmd-shadow-card);
    padding: 22px 24px;
    margin-bottom: 24px;
}
@media (max-width: 760px) { .mmd-section { padding: 18px 16px; } }

.mmd-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.mmd-section-rail {
    width: 4px;
    height: 22px;
    background: var(--mmd-accent);
}
.mmd-section-title h2 {
    margin: 0;
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 18px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.mmd-empty {
    color: var(--color-ps-muted);
    font-size: 13px;
    margin: 0;
}

/* =================== Elite scoreboard =================== */
.mmd-top-of-match {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}
.mmd-top-cell {
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: 3px 10px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--color-ps-border-subtle);
    box-shadow: inset 3px 0 0 var(--mmd-accent-hairline);
}
[data-theme="light"] .mmd-top-cell { background: rgba(0, 0, 0, 0.018); }
.mmd-top-cell.is-rail { box-shadow: inset 3px 0 0 rgba(245, 158, 11, 0.65); }
.mmd-top-cell.is-rocket { box-shadow: inset 3px 0 0 rgba(239, 68, 68, 0.62); }
.mmd-top-cell.is-attacks { box-shadow: inset 3px 0 0 rgba(44, 18, 217, 0.62); }
.mmd-top-label {
    grid-column: 1 / -1;
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-ps-muted);
}
.mmd-top-value {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 26px;
    line-height: 0.95;
    color: var(--mmd-accent);
    font-variant-numeric: tabular-nums;
}
.mmd-top-cell.is-rail .mmd-top-value { color: var(--mmd-amber); }
.mmd-top-cell.is-rocket .mmd-top-value { color: var(--mmd-red); }
.mmd-top-who {
    min-width: 0;
    align-self: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-ps-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mmd-top-detail {
    grid-column: 1 / -1;
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-ps-dimmed);
}

.mmd-elite-board {
    display: grid;
    gap: 10px;
}
.mmd-elite-headers,
.mmd-elite-matchup {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr);
    align-items: stretch;
    gap: 12px;
}
.mmd-elite-headers {
    align-items: center;
    padding: 0 14px 4px;
}
.mmd-elite-head-team {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}
.mmd-elite-head-team.is-blue { color: var(--mmd-blue); text-align: right; }
.mmd-elite-head-team.is-red { color: var(--mmd-red); text-align: left; }
.mmd-elite-head-vs {
    text-align: center;
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--color-ps-muted);
    text-transform: uppercase;
}

.mmd-elite-matchup {
    padding: 14px;
    border: 1px solid var(--color-ps-border-subtle);
    background: rgba(255, 255, 255, 0.018);
}
[data-theme="light"] .mmd-elite-matchup {
    background: rgba(0, 0, 0, 0.012);
}
.mmd-elite-player {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}
.mmd-elite-player.is-blue {
    text-align: right;
    align-items: flex-end;
}
.mmd-elite-player.is-red {
    text-align: left;
    align-items: flex-start;
}
.mmd-elite-player-head {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}
.mmd-elite-player.is-blue .mmd-elite-player-head {
    justify-content: flex-end;
}
.mmd-elite-player.is-red .mmd-elite-player-head {
    justify-content: flex-start;
}
.mmd-elite-name {
    min-width: 0;
    max-width: 100%;
    display: inline-block;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mmd-elite-att {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: baseline;
    gap: 5px;
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 13px;
    color: var(--color-ps-dark);
    padding: 4px 7px;
    background: var(--color-ps-elevated);
    border: 1px solid var(--color-ps-border-subtle);
    white-space: nowrap;
}
.mmd-elite-att-main {
    font-variant-numeric: tabular-nums;
}
.mmd-elite-att-l {
    font-weight: 700;
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--color-ps-muted);
    text-transform: uppercase;
}
.mmd-elite-empty { color: var(--color-ps-dimmed); font-size: 12px; font-style: italic; }
.mmd-mvp {
    flex: 0 0 auto;
    color: #EAB308;
    font-size: 15px;
    filter: drop-shadow(0 0 8px rgba(234, 179, 8, 0.25));
}

.mmd-elite-scoreline {
    display: grid;
    grid-template-columns: 1fr 16px 1fr;
    align-items: center;
    justify-items: center;
    align-self: stretch;
    min-height: 90px;
    padding: 0 8px;
    background: rgba(44, 18, 217, 0.045);
    border: 1px solid var(--color-ps-border-subtle);
}
.mmd-elite-pts {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 32px;
    line-height: 1;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.mmd-elite-pts.is-blue { color: var(--mmd-blue); }
.mmd-elite-pts.is-red { color: var(--mmd-red); }
.mmd-elite-pts-sep {
    color: var(--color-ps-dimmed);
    text-align: center;
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 15px;
}

.mmd-elite-stats-inline {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.mmd-elite-player.is-blue .mmd-elite-stats-inline {
    justify-content: flex-start;
    flex-direction: row-reverse;
}
.mmd-elite-player.is-red .mmd-elite-stats-inline {
    justify-content: flex-start;
}
.mmd-stat {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 78px;
    text-align: center;
}
.mmd-stat-label {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-ps-muted);
}
.mmd-stat-value {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 16px;
}
.mmd-stat.is-rail .mmd-stat-value { color: var(--mmd-amber); }
.mmd-stat.is-rocket .mmd-stat-value { color: var(--mmd-red); }
.mmd-stat-detail {
    font-family: var(--font-family-chakra);
    font-size: 11px;
    color: var(--color-ps-dimmed);
}

@media (max-width: 900px) {
    .mmd-top-of-match { grid-template-columns: 1fr; }
    .mmd-elite-headers { display: none; }
    .mmd-elite-matchup {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .mmd-elite-scoreline {
        order: -1;
        min-height: 64px;
    }
    .mmd-elite-player.is-blue,
    .mmd-elite-player.is-red {
        text-align: left;
        align-items: flex-start;
    }
    .mmd-elite-player.is-blue .mmd-elite-player-head,
    .mmd-elite-player.is-blue .mmd-elite-stats-inline {
        justify-content: flex-start;
    }
    .mmd-elite-player.is-blue .mmd-elite-stats-inline {
        flex-direction: row;
    }
}

@media (max-width: 760px) {
    .mmd-top-value { font-size: 22px; }
    .mmd-top-who { font-size: 13px; }
    .mmd-elite-matchup { padding: 12px; }
    .mmd-elite-pts { font-size: 26px; }
    .mmd-elite-name { font-size: 13px; }
    .mmd-stat { min-width: 70px; }
}

/* =================== Joust duel =================== */
.mmd-duel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
@media (max-width: 760px) { .mmd-duel { grid-template-columns: 1fr; gap: 16px; } }

.mmd-duel-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
}
.mmd-duel-avatar {
    width: 80px;
    height: 80px;
    border: 2px solid var(--color-ps-border);
    object-fit: cover;
    background: var(--color-ps-elevated);
    margin-bottom: 4px;
}
.mmd-duel-side.is-blue .mmd-duel-avatar { border-color: var(--mmd-blue); }
.mmd-duel-side.is-red .mmd-duel-avatar { border-color: var(--mmd-red); }
.mmd-duel-name {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 16px;
    letter-spacing: 0.04em;
}
.mmd-duel-login {
    font-family: var(--font-family-chakra);
    font-size: 11px;
    color: var(--color-ps-dimmed);
    letter-spacing: 0.06em;
}
.mmd-duel-tier {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.mmd-duel-elo {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 16px;
    color: var(--mmd-accent);
}
.mmd-duel-delta {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 14px;
    margin-top: 2px;
}
.mmd-duel-delta.is-pos { color: #22C55E; }
.mmd-duel-delta.is-neg { color: #EF4444; }

.mmd-duel-mid {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.mmd-duel-score {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 64px;
    line-height: 1;
}
.mmd-duel-score-blue { color: var(--mmd-blue); }
.mmd-duel-score-red { color: var(--mmd-red); }
.mmd-duel-score-sep { color: var(--color-ps-dimmed); font-size: 36px; }
.mmd-duel-round {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: rgba(44, 18, 217, 0.08);
    border: 1px solid var(--mmd-accent-hairline);
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}
.mmd-duel-round-label { color: var(--color-ps-muted); }
.mmd-duel-round-blue { color: var(--mmd-blue); }
.mmd-duel-round-red { color: var(--mmd-red); }
.mmd-duel-rule {
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-ps-muted);
}

/* Round breakdown (Joust per-round history) */
.mmd-round-breakdown {
    margin-top: 8px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.mmd-round-breakdown-label {
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-ps-muted);
}
.mmd-round-breakdown-cells {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.mmd-round-cell {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--color-ps-elevated);
    border: 1px solid var(--color-ps-border);
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 12px;
    letter-spacing: 0.04em;
}
.mmd-round-cell.is-blue { border-left: 3px solid var(--mmd-blue); }
.mmd-round-cell.is-red { border-left: 3px solid var(--mmd-red); }
.mmd-round-cell.is-draw { border-left: 3px solid var(--color-ps-dimmed); }
.mmd-round-cell .mmd-round-num {
    color: var(--color-ps-dimmed);
    font-size: 10px;
    letter-spacing: 0.14em;
    margin-right: 4px;
}
.mmd-round-cell .mmd-round-blue { color: var(--mmd-blue); }
.mmd-round-cell .mmd-round-red { color: var(--mmd-red); }

.mmd-round-breakdown-hint {
    font-size: 11px;
    color: var(--color-ps-dimmed);
    margin-top: 6px;
    text-align: center;
    max-width: 320px;
}

/* =================== Match Insights =================== */
.mmd-insights-rows { display: flex; flex-direction: column; gap: 12px; }
.mmd-insight-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-bottom: 1px dashed var(--color-ps-border-subtle);
}
.mmd-insight-row:last-child { border-bottom: 0; }
.mmd-insight-label {
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-ps-muted);
    min-width: 220px;
}
.mmd-insight-value {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 14px;
}
.mmd-insight-value .is-blue { color: var(--mmd-blue); }
.mmd-insight-value .is-red { color: var(--mmd-red); }
.mmd-insight-meta { color: var(--color-ps-muted); font-weight: 700; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.mmd-insight-sep { color: var(--color-ps-dimmed); }

.mmd-h2h-strip { display: inline-flex; gap: 3px; }
.mmd-h2h-pip {
    width: 12px;
    height: 12px;
    border: 1px solid transparent;
}
.mmd-h2h-pip.is-blue { background: rgba(96, 165, 250, 0.7); border-color: rgba(96, 165, 250, 0.9); }
.mmd-h2h-pip.is-red { background: rgba(239, 68, 68, 0.7); border-color: rgba(239, 68, 68, 0.9); }

.mmd-promo-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--color-ps-elevated);
    border: 1px solid var(--color-ps-border);
    font-size: 12px;
}
.mmd-promo-who { font-weight: 600; font-size: 12px; }

/* =================== Information chip strip =================== */
.mmd-info-strip { padding: 16px 20px; }
.mmd-info-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 18px 22px;
    align-items: baseline;
}
.mmd-info-chip {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    color: inherit;
}
.mmd-info-link:hover .mmd-info-value { color: var(--mmd-accent); }
.mmd-info-label {
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-ps-dimmed);
}
.mmd-info-value {
    font-family: var(--font-family-body);
    font-weight: 600;
    font-size: 13px;
    color: var(--color-ps-dark);
    transition: color 0.15s ease;
}

/* =================== Round replays =================== */
.mmd-replays .mmd-section-title { justify-content: space-between; }
.mmd-replays .mmd-section-title h2 { margin-right: auto; }
.mmd-replays-bulk {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-family: var(--font-family-chakra);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    color: #fff;
    background: var(--mmd-accent);
    border: 1px solid var(--mmd-accent);
    transition: background 0.15s ease, color 0.15s ease;
}
.mmd-replays-bulk:hover { background: var(--mmd-accent-light); border-color: var(--mmd-accent-light); }

.mmd-replay-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.mmd-replay-row {
    display: grid;
    grid-template-columns: 48px minmax(110px, 1fr) minmax(0, 2fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--color-ps-border-subtle);
    min-width: 0;
}
.mmd-replay-row:last-child { border-bottom: 0; }
.mmd-replay-num {
    font-family: var(--font-family-chakra);
    font-weight: 900;
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--color-ps-dimmed);
}
.mmd-replay-kind {
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-ps-dark);
}
.mmd-replay-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    min-width: 0;
    font-family: var(--font-family-body);
    font-size: 12px;
    color: var(--color-ps-muted);
}
.mmd-replay-meta .mmd-replay-when { white-space: nowrap; }
.mmd-replay-meta .mmd-replay-size { white-space: nowrap; color: var(--color-ps-dimmed); }
.mmd-replay-status {
    font-family: var(--font-family-chakra);
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-ps-dimmed);
    white-space: nowrap;
}
.mmd-replay-row.is-available .mmd-replay-status { color: var(--mmd-accent); }
.mmd-replay-row.is-syncing .mmd-replay-status { color: #B7791F; }
.mmd-replay-row.is-failed .mmd-replay-status,
.mmd-replay-row.is-missing-file .mmd-replay-status,
.mmd-replay-row.is-unsafe-path .mmd-replay-status,
.mmd-replay-row.is-missing-folder .mmd-replay-status { color: var(--mmd-red); }

.mmd-replay-action { display: inline-flex; }
.mmd-replay-download {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-family: var(--font-family-chakra);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--mmd-accent);
    background: transparent;
    border: 1px solid var(--mmd-accent-hairline);
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.mmd-replay-download:hover { background: var(--mmd-accent); color: #fff; border-color: var(--mmd-accent); }
.mmd-replay-download.is-disabled {
    color: var(--color-ps-dimmed);
    border-color: var(--color-ps-border);
    background: transparent;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 760px) {
    .mmd-replays .mmd-section-title { flex-wrap: wrap; gap: 10px; }
    .mmd-replay-row {
        grid-template-columns: 36px 1fr auto;
        grid-template-areas:
            "num kind action"
            "meta meta meta"
            "status status status";
        gap: 6px 10px;
    }
    .mmd-replay-num { grid-area: num; }
    .mmd-replay-kind { grid-area: kind; }
    .mmd-replay-meta { grid-area: meta; }
    .mmd-replay-status { grid-area: status; }
    .mmd-replay-action { grid-area: action; justify-self: end; }
}

/* =================== Light theme adjustments =================== */
[data-theme="light"] .mmd-page {
    --mmd-blue: #2563EB;
    --mmd-red: #DC2626;
}
[data-theme="light"] .mmd-hero .mmd-status-pill { background: rgba(7, 12, 22, 0.54); }
[data-theme="light"] .mmd-hero .mmd-status-pill.is-finished .mmd-status-label { color: var(--mmd-hero-muted); }
[data-theme="light"] .mmd-hero .mmd-when-rel { color: var(--mmd-hero-muted); }
[data-theme="light"] .mmd-roster.is-winner {
    background: linear-gradient(180deg, rgba(44, 18, 217, 0.04) 0%, var(--color-ps-surface) 70%);
}
