.match-page {
    --room-home: var(--home-color, var(--at-team-home-fallback));
    --room-away: var(--away-color, var(--at-team-away-fallback));
    --room-gold: var(--lu-gold, #f5c518);
}

.room-name {
    font-weight: 800;
}

.room-head-note {
    color: var(--fx-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.room-crest {
    --crest-size: 16px;
    width: 16px;
    height: 16px;
}

.game-card.is-motm .game-card-head {
    margin-bottom: 10px;
}

.game-card.is-motm .game-card-head h2 {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.game-card.is-motm .game-card-head h2 .ico {
    width: 18px;
    height: 18px;
    color: var(--room-gold);
    fill: currentColor;
}

.room-chip-state {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    max-width: 58%;
    height: 26px;
    overflow: hidden;
    padding: 0 10px;
    border: 1px solid var(--fx-line-strong);
    border-radius: 999px;
    color: var(--fx-text-2);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.room-chip-state.is-live {
    border-color: color-mix(in srgb, var(--fx-live) 40%, transparent);
    background: var(--fx-live-soft);
    color: var(--fx-live);
}

.room-chip-state.is-closed {
    border-color: color-mix(in srgb, var(--room-gold) 45%, transparent);
    color: var(--fx-text);
}

.room-vote-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 230px;
    min-width: 0;
}

.room-vote-intro,
.room-vote-note,
.room-vote-foot {
    margin: 0;
    overflow: hidden;
    color: var(--fx-muted);
    font-size: 13px;
    line-height: 20px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.room-vote-note {
    color: var(--fx-text-2);
}

.room-vote-note .room-name {
    color: var(--fx-text);
}

.room-vote-note.is-inline {
    align-self: center;
}

.room-vote-foot {
    margin-top: auto;
    font-size: 12px;
}

.room-seg {
    display: inline-flex;
    align-self: flex-start;
    max-width: 100%;
    padding: 3px;
    border: 1px solid var(--fx-line);
    border-radius: 999px;
    background: var(--fx-surface-2);
}

.room-seg-button {
    max-width: 128px;
    height: 26px;
    overflow: hidden;
    padding: 0 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--fx-text-2);
    font: 700 12px/26px Cairo, sans-serif;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}

.room-seg-button[aria-pressed="true"] {
    background: var(--fx-text);
    color: var(--fx-surface);
}

.room-track {
    display: flex;
    gap: 8px;
    min-width: 0;
    height: 112px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 6px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
    scrollbar-color: var(--fx-line-strong) transparent;
    overscroll-behavior-x: contain;
}

.room-track[data-team="home"] .room-pick.is-away,
.room-track[data-team="away"] .room-pick.is-home {
    display: none;
}

.room-pick {
    position: relative;
    display: grid;
    flex: none;
    justify-items: center;
    align-content: start;
    gap: 4px;
    width: 78px;
    height: 102px;
    padding: 8px 4px 6px;
    border: 1px solid var(--fx-line);
    border-radius: 12px;
    background: var(--fx-surface-2);
    color: var(--fx-text);
    font: inherit;
    scroll-snap-align: start;
    cursor: pointer;
    transition: border-color var(--at-dur-2) var(--at-ease), background var(--at-dur-2) var(--at-ease), transform var(--at-dur-1) var(--at-ease);
}

.room-pick:hover {
    border-color: var(--fx-line-strong);
}

.room-pick:active {
    transform: scale(.97);
}

.room-pick.is-picked {
    border-color: var(--fx-accent);
    background: color-mix(in srgb, var(--fx-accent) 10%, var(--fx-surface-2));
    box-shadow: inset 0 0 0 1px var(--fx-accent);
}

.room-pick.is-picked::after {
    content: "";
    position: absolute;
    top: 6px;
    inset-inline-start: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--fx-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.room-pick-photo,
.room-bar-photo,
.room-top-photo,
.room-winner-photo {
    position: relative;
    display: grid;
    flex: none;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--fx-score-bg);
}

.room-pick-photo {
    width: 44px;
    height: 44px;
    box-shadow: 0 0 0 2px var(--fx-surface-2), 0 0 0 4px var(--room-home);
}

.room-pick.is-away .room-pick-photo {
    box-shadow: 0 0 0 2px var(--fx-surface-2), 0 0 0 4px var(--room-away);
}

:is(.room-pick-photo, .room-bar-photo, .room-top-photo, .room-winner-photo) img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

:is(.room-pick-photo, .room-bar-photo, .room-top-photo, .room-winner-photo)::before {
    content: attr(data-no);
    color: var(--fx-text-2);
    font-size: 13px;
    font-weight: 800;
}

.room-winner-photo::before {
    font-size: 22px;
}

:is(.room-pick-photo, .room-bar-photo, .room-top-photo, .room-winner-photo).is-broken img {
    display: none;
}

.room-pick-name {
    display: block;
    width: 100%;
    overflow: hidden;
    margin-top: 4px;
    font-size: 12px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.room-pick-team {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 16px;
    color: var(--fx-muted);
    font-size: 10px;
    font-weight: 700;
}

.room-pick-team .room-crest {
    --crest-size: 14px;
    width: 14px;
    height: 14px;
}

.room-vote-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 40px;
    margin-top: auto;
}

.room-submit {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    max-width: 360px;
    height: 40px;
    overflow: hidden;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--at-accent-fill);
    color: #ffffff;
    font: 800 14px/1 Cairo, sans-serif;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    transition: background var(--at-dur-2) var(--at-ease), opacity var(--at-dur-2) var(--at-ease);
}

.room-submit:hover:not(:disabled) {
    background: var(--at-accent-fill-hover);
}

.room-submit:disabled {
    background: var(--fx-score-bg);
    box-shadow: inset 0 0 0 1px var(--fx-line);
    color: var(--fx-muted);
    cursor: default;
}

.room-submit.is-ghost {
    border: 1px solid var(--fx-line-strong);
    background: transparent;
    color: var(--fx-text);
}

.room-submit.is-ghost:hover {
    background: var(--fx-surface-2);
}

.room-link {
    flex: none;
    padding: 0;
    border: 0;
    background: none;
    color: var(--fx-text-2);
    font: 700 12px/1.4 Cairo, sans-serif;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.room-bars {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.room-bar {
    display: grid;
    grid-template-columns: 16px 32px minmax(0, 1fr) minmax(56px, 34%) 40px;
    align-items: center;
    gap: 8px;
    height: 40px;
}

.room-bar-rank {
    color: var(--fx-muted);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.room-bar-photo {
    width: 32px;
    height: 32px;
    box-shadow: 0 0 0 2px var(--room-home);
}

.room-bar.is-away .room-bar-photo {
    box-shadow: 0 0 0 2px var(--room-away);
}

.room-bar.is-empty {
    visibility: hidden;
}

.room-bar-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.room-bar-name bdi {
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-bar.is-mine .room-bar-name {
    font-weight: 800;
}

.room-bar.is-mine .room-bar-name::after {
    content: "صوتك";
    flex: none;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--fx-score-bg);
    color: var(--fx-text-2);
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
}

.room-bar-meter {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--fx-score-bg);
}

.room-bar-meter i {
    position: absolute;
    inset-block: 0;
    inset-inline-start: 0;
    width: var(--share, 0%);
    border-radius: inherit;
    background: var(--room-home);
    transition: width 700ms var(--at-ease-out);
}

.room-bar.is-away .room-bar-meter i {
    background: var(--room-away);
}

.room-bar-share {
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-align: end;
}

.room-winner {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-height: 92px;
    padding: 6px 4px 0;
}

.room-winner-photo {
    width: 76px;
    height: 76px;
    box-shadow: 0 0 0 3px var(--fx-surface), 0 0 0 5px var(--room-gold);
}

.room-winner-text {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.room-winner-tag {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 4px;
    padding: 0 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--room-gold) 18%, transparent);
    color: var(--fx-text);
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
}

.room-winner-tag .ico {
    width: 12px;
    height: 12px;
    color: var(--room-gold);
    fill: currentColor;
}

.match-page .room-winner-name {
    overflow: hidden;
    color: var(--fx-text);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-decoration: none;
}

.match-page a.room-winner-name:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.room-winner-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 6px;
    color: var(--fx-muted);
    font-size: 12px;
    font-weight: 600;
}

.room-runners {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    min-height: 20px;
    margin: 0;
    color: var(--fx-text-2);
    font-size: 12px;
    line-height: 20px;
}

.room-runners b {
    color: var(--fx-muted);
}

.room-top {
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.room-top-row {
    display: grid;
    grid-template-columns: 18px 44px minmax(0, 1fr) auto 42px;
    align-items: center;
    gap: 10px;
    padding: 8px 6px;
    border-radius: 10px;
    color: var(--fx-text);
    text-decoration: none;
}

a.room-top-row:hover {
    background: var(--fx-surface-2);
}

.room-top-rank {
    color: var(--fx-muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.room-top li:first-child .room-top-rank {
    color: var(--fx-star);
}

.room-top-photo {
    width: 44px;
    height: 44px;
    box-shadow: 0 0 0 2px var(--room-home);
}

.room-top-row.is-away .room-top-photo {
    box-shadow: 0 0 0 2px var(--room-away);
}

.room-top-main {
    display: grid;
    min-width: 0;
}

.room-top-name {
    overflow: hidden;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.room-top-team {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    color: var(--fx-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.room-top-team .room-crest {
    --crest-size: 14px;
    width: 14px;
    height: 14px;
}

.room-top-stats {
    display: inline-flex;
    gap: 6px;
}

.room-top-stat {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--fx-text-2);
    font-size: 12px;
    font-weight: 800;
}

.match-page .room-top-stat .ico {
    width: 14px;
    height: 14px;
}

.room-rating {
    display: inline-grid;
    place-items: center;
    height: 28px;
    border-radius: 8px;
    background: var(--lu-band-low);
    color: #ffffff;
    font-size: 13px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.room-rating.is-mid { background: var(--lu-band-mid); }
.room-rating.is-good { background: var(--lu-band-good); }
.room-rating.is-top { background: var(--lu-band-top); }

.room-feed-card {
    max-width: 880px;
    margin-inline: auto;
}

.room-feed {
    margin: 0;
    padding: 0;
    list-style: none;
}

.room-entry {
    display: grid;
    grid-template-columns: 56px 28px minmax(0, 1fr) auto auto;
    align-items: start;
    gap: 10px;
    padding: 12px 0;
    border-top: 1px solid var(--fx-line);
}

.room-entry:first-child {
    border-top: 0;
    padding-top: 2px;
}

.room-entry .game-minute {
    min-width: 0;
    margin-top: 2px;
}

.room-entry .game-minute.is-word {
    padding: 0 4px;
    font-size: 11px;
}

.room-entry-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--fx-score-bg);
    color: var(--fx-text-2);
}

.match-page .room-entry-icon .ico {
    width: 16px;
    height: 16px;
}

.room-entry:is(.is-goal, .is-penaltyGoal) .room-entry-icon {
    background: var(--fx-text);
    color: var(--fx-surface);
}

.room-entry:is(.is-kickoff, .is-half, .is-second, .is-full) .room-entry-icon {
    color: var(--fx-text);
}

.room-entry-body {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding-top: 3px;
}

.room-entry-text {
    margin: 0;
    color: var(--fx-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.75;
    overflow-wrap: anywhere;
}

.room-entry:is(.is-goal, .is-penaltyGoal, .is-ownGoal, .is-full) .room-entry-text {
    font-weight: 800;
}

.room-entry:is(.is-kickoff, .is-half, .is-second, .is-extra, .is-shootout) .room-entry-text {
    color: var(--fx-text-2);
}

.room-entry .game-event-score {
    margin-top: 3px;
}

.room-entry .room-crest {
    --crest-size: 20px;
    width: 20px;
    height: 20px;
    margin-top: 4px;
}

.room-entry-tag {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: 4px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--fx-score-bg);
    color: var(--fx-text-2);
    font-size: 11px;
    font-weight: 800;
    line-height: 20px;
}

.match-page .room-entry-tag .ico {
    width: 12px;
    height: 12px;
    color: var(--room-gold);
    fill: currentColor;
}

.room-entry.is-note .room-entry-icon {
    background: color-mix(in srgb, var(--fx-accent) 12%, var(--fx-score-bg));
    color: var(--fx-accent);
}

.room-entry.is-note.is-important {
    margin: 4px 0;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--room-gold) 45%, transparent);
    border-radius: 12px;
    background: color-mix(in srgb, var(--room-gold) 9%, var(--fx-surface));
}

.room-entry.is-note.is-important + .room-entry {
    border-top: 0;
}

.room-entry.is-note.is-important .room-entry-tag {
    background: color-mix(in srgb, var(--room-gold) 22%, transparent);
    color: var(--fx-text);
}

.room-entry.is-note.is-important .room-entry-text {
    font-weight: 800;
}

.room-entry.is-important:not(.is-note) .game-minute {
    background: var(--fx-text);
    box-shadow: none;
    color: var(--fx-surface);
}

.game-tab[data-tab="live"] {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.game:has(.game-hero .game-live-label:not(.is-break)) .game-tab[data-tab="live"]::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fx-live);
    animation: room-pulse 1.6s ease-in-out infinite;
}

@keyframes room-pulse {
    50% { opacity: .35; }
}

@media (hover: none) {
    .room-track {
        scrollbar-width: none;
    }

    .room-track::-webkit-scrollbar {
        display: none;
    }
}

@media (max-width: 1019px) {
    .game-card.is-motm { order: 1; }
    .game-card.is-top-players { order: 2; }
}

@media (max-width: 767px) {
    .room-vote-body {
        height: 232px;
    }

    .room-chip-state {
        max-width: 52%;
        padding: 0 8px;
        font-size: 11px;
    }

    .room-submit {
        max-width: none;
    }

    .room-bar {
        grid-template-columns: 14px 32px minmax(0, 1fr) minmax(48px, 28%) 38px;
        gap: 6px;
    }

    .room-winner {
        grid-template-columns: 68px minmax(0, 1fr);
        gap: 12px;
    }

    .room-winner-photo {
        width: 68px;
        height: 68px;
    }

    .match-page .room-winner-name {
        font-size: 16px;
    }

    .room-top-row {
        grid-template-columns: 14px 40px minmax(0, 1fr) auto 40px;
        gap: 8px;
        padding: 8px 2px;
    }

    .room-top-photo {
        width: 40px;
        height: 40px;
    }

    .room-entry {
        grid-template-columns: 50px 26px minmax(0, 1fr) auto;
        gap: 8px;
    }

    .room-entry .room-crest {
        display: none;
    }

    .room-entry-icon {
        width: 26px;
        height: 26px;
    }

    .room-entry-text {
        font-size: 13.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .room-bar-meter i,
    .room-pick,
    .room-submit {
        transition: none;
    }

    .game:has(.game-hero .game-live-label:not(.is-break)) .game-tab[data-tab="live"]::before {
        animation: none;
    }
}
