/* Solid surfaces make contrast independent of the arena artwork behind a card. */
html body .match-team-surface[data-team-color-source],
html body .match-team-surface[data-team-color-source].is-disabled {
    background: var(--match-team-fill);
    color: var(--match-team-text);
    border: 3px var(--match-team-border-style) var(--match-team-border);
    text-shadow: none;
    box-shadow: 0 0 0 2px #080816;
    opacity: 1;
}

html body .match-team-surface[data-team-color-source] :is(strong, small, span) {
    color: var(--match-team-text);
    text-shadow: none;
}

html body .match-team-surface[data-team-color-source="neutral"] {
    border-width: 4px;
    background-clip: padding-box;
}

.match-market-card__team.match-team-surface,
.match-market-card__selected-team.match-team-surface {
    padding: 0 4px;
    border-radius: var(--radius-surface, 8px);
}

.featured-market-card__team {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: var(--radius-surface, 8px);
    font: 700 .75rem/1.2 var(--font-body);
}

.featured-market-card__team img {
    object-fit: contain;
}

html body .option-pick__candidate.match-team-surface:has(:checked) {
    /* Explicit native checked radio plus a two-tone ring; never color alone. */
    box-shadow: 0 0 0 3px #080816, 0 0 0 6px #fff;
}

html body .match-team-surface:is(:focus-visible, :has(:focus-visible)) {
    outline: 3px solid #fff;
    outline-offset: 4px;
    box-shadow: 0 0 0 4px #080816;
}

html body .match-team-surface input[type="radio"] {
    accent-color: #080816;
    background: #fff;
    outline: 2px solid #fff;
    border-radius: 50%;
}

html body .match-team-surface[data-team-color-source]::after {
    color: var(--match-team-text);
}

html body .match-team-surface[data-team-color-source] .status-pill {
    background: #080816;
    color: #fff;
    border-color: #fff;
}

/* Keep the filtered arena inside the inner edge, including Safari compositing. */
html body .match-market-card .match-market-card__background {
    clip-path: inset(4px round 16px);
}

/* Arena treatment stays on the background layer, keeping content sharp. */
html body .match-market-card .match-market-card__background,
html body .featured-market-card--matches .featured-market-card__background {
    inset: -4px;
    background:
        linear-gradient(rgb(5 6 18 / 30%), rgb(5 6 18 / 45%)),
        url('/images/cards/backgrounds/background-dark-1.webp') center / cover no-repeat;
    filter: blur(2px);
}

html body .match-market-card:has([data-team-color-source]) .match-market-card__status-pick {
    color: #fff;
}

/* Owner rapid iteration: card team colors belong to choice buttons only. */
html body .match-market-card__pick.match-team-surface[data-team-color-source] {
    border: 0;
    --match-team-glow: color-mix(in srgb, var(--match-team-fill) 65%, white);
    box-shadow: inset 0 0 0 2px var(--match-team-glow),
        inset 0 3px 8px color-mix(in srgb, var(--match-team-glow) 28%, transparent),
        0 0 9px color-mix(in srgb, var(--match-team-glow) 35%, transparent);
    background-clip: border-box;
}

html body .match-market-card__pick.match-team-surface:focus-visible {
    outline-color: var(--color-primary, #f5c451);
}

/* Enlarge logos within the existing matchup row; keep label and score together. */
.match-market-card__team,
.match-market-card__selected-team {
    grid-template-columns: auto auto;
    justify-content: center;
    column-gap: 4px;
    align-items: baseline;
}

.match-market-card__team img,
.match-market-card__selected-team img {
    grid-column: 1 / -1;
    width: 90px;
    height: 90px;
}

.match-market-card__team:not(:has(small)) strong,
.match-market-card__selected-team:not(:has(small)) strong {
    grid-column: 1 / -1;
}

.featured-market-card__team img {
    width: 41px;
    height: 41px;
}

/* Home already has larger logos and its own taller matchup layout. */
.dashboard-home #dashboard-game :is(.match-market-card__team, .match-market-card__selected-team) {
    grid-template-columns: auto;
}

.dashboard-home #dashboard-game :is(.match-market-card__team, .match-market-card__selected-team)> :is(strong, small) {
    grid-column: 1;
}


/* Stable compact slots; content can grow with translated/enlarged text. */
html body .match-market-card .match-market-card__content {
    position: relative;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(18px, auto) minmax(108px, auto) minmax(32px, auto) minmax(18px, auto);
    min-height: 176px;
    gap: 0;
}
.match-market-card__meta {
    grid-area: 1 / 1 / 2 / -1;
    min-height: 18px;
}
.match-market-card__matchup-zone { grid-area: 2 / 1 / 3 / -1; }
.match-market-card__status-zone {
    grid-area: 2 / 1 / 3 / -1;
    align-self: end;
    justify-self: center;
    width: 110px;
    padding-bottom: 3px;
}
.match-market-card__actions { grid-area: 3 / 1 / 4 / -1; }
.match-market-card__secondary-actions { grid-area: 4 / 1 / 5 / -1; }
.match-market-card__team,
.match-market-card__selected-team {
    position: relative;
    top: 0;
}
html body .match-market-card :is(.match-market-card__pick, .match-market-card__primary) {
    height: auto;
    min-height: 32px;
    padding-block: 3px;
    white-space: normal;
}
html body .match-market-card .match-market-card__primary span {
    white-space: normal;
    overflow: visible;
}
.match-market-card__versus {
    font-weight: 900;
    -webkit-text-stroke: 0.35px currentColor;
}
html body .match-market-card--personal-state .match-market-card__content {
    grid-template-columns: minmax(0, 40fr) minmax(0, 58fr);
    column-gap: 2%;
}
.match-market-card--personal-state .match-market-card__meta {
    grid-template-columns: auto;
    justify-items: start;
}
.match-market-card--personal-state .match-market-card__league-slot { display: none; }
.match-market-card--personal-state .match-market-card__time { justify-self: start; }
.match-market-card--personal-state .match-market-card__matchup-zone {
    grid-column: 1;
}
.match-market-card--personal-state .match-market-card__status-zone {
    grid-column: 2;
    align-self: center;
    justify-self: stretch;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding-block: 6px;
}
.match-market-card--personal-state .match-market-card__status {
    order: 0;
    justify-content: flex-start;
    flex-wrap: wrap;
    font-size: 0.65rem;
    gap: 5px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgb(168 95 247 / 30%);
    white-space: normal;
}
:is(.match-market-card--personal-state .match-market-card__status):where(p) { font-size: calc(0.65rem + 3px); }
.match-market-card__pick-summary {
    order: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgb(168 95 247 / 30%);
    font: 700 0.6rem/1.3 Inter, sans-serif;
}
:is(.match-market-card__pick-summary):where(p) { font-size: calc(0.6rem + 3px); }
.match-market-card__pick-summary--published { color: #65ef80; }
.match-market-card__status-icon { flex-shrink: 0; }
.match-market-card--personal-state .market-card-reward {
    order: 2;
    justify-content: flex-start;
    font-size: 0.6rem;
}
:is(.match-market-card--personal-state .market-card-reward):where(p) { font-size: calc(0.6rem + 3px); }
.match-market-card:not(.match-market-card--personal-state) .market-card-reward {
    font-size: 0.55rem;
    gap: 2px 3px;
}
:is(.match-market-card:not(.match-market-card--personal-state) .market-card-reward):where(p) { font-size: calc(0.55rem + 3px); }
.match-market-card:not(.match-market-card--personal-state) .market-card-reward > span:not(.mvp-coin-icon) {
    flex-basis: 100%;
    text-align: center;
}
.match-market-card--state-published .match-market-card__secondary-actions { visibility: hidden; }
.match-market-card__error {
    grid-column: 1 / -1;
    margin-top: 6px;
    overflow-wrap: anywhere;
}
.match-market-card {
    transition: border-color 220ms cubic-bezier(0.2, 0, 0, 1), box-shadow 220ms cubic-bezier(0.2, 0, 0, 1);
    overflow-anchor: none;
}
.match-market-card__background {
    transition: opacity 180ms cubic-bezier(0.2, 0, 0, 1);
}
@media (prefers-reduced-motion: reduce) {
    .match-market-card, .match-market-card__background { transition: none; }
}

.match-market-card .match-market-card__secondary-actions {
    flex-wrap: wrap;
    gap: 4px 12px;
}
.match-market-card .match-market-card__secondary {
    white-space: normal;
    max-width: 100%;
    overflow-wrap: anywhere;
}
