/* Arena recent match feed. Shared by tournament tabs and referee dashboard. */
.recent-matches-block{--rm-ink:#142b3b;--rm-muted:#3d5869;--rm-card:#fff;--rm-soft:#f1f5f8;--rm-edge:#b3c3ce;--rm-win:#126746;--rm-loss:#a44039;--rm-wbg:#edf7f0;--rm-lbg:#fdf5f4;--rm-accent:#006c61;container-type:inline-size;min-width:0}
[data-theme=dark] .recent-matches-block{--rm-ink:#eef8fa;--rm-muted:#a9c0ce;--rm-card:#102334;--rm-soft:#142d3c;--rm-edge:#294452;--rm-win:#7ae0b2;--rm-loss:#e9a19c;--rm-wbg:#16382f;--rm-lbg:#292a36;--rm-accent:#65e6cf}
.recent-matches-block .rm-header{display:grid!important;grid-template-columns:minmax(0,1fr) auto 30px;align-items:center;gap:10px}
.recent-matches-block .rm-header h2{font-size:clamp(20px,2vw,26px);margin:0;line-height:1.2}
.recent-matches-block .rm-head-spacer{display:none}
.recent-matches-block .rm-header .seg-btn{font-size:14px;min-height:40px;padding:7px 11px}
.recent-matches-block .rm-header .pr-connection{grid-column:3;grid-row:1;justify-self:end}
.recent-matches-block .pr-rm-list{min-width:0;width:100%;border:1px solid var(--rm-edge);border-radius:12px;overflow:clip;background:var(--rm-card)}
.recent-matches-block .pr-rm-table{width:100%!important;min-width:0!important;display:table!important;table-layout:fixed;border-collapse:collapse!important;border:0!important;background:transparent!important;box-shadow:none!important}
.recent-matches-block .pr-rm-table thead{display:none!important}
.recent-matches-block .pr-rm-table tbody{display:table-row-group!important;background:transparent!important}
.recent-matches-block .pr-rm-table tr:not([style*="display: none"]){display:table-row!important;background:transparent!important;border:0!important;box-shadow:none!important}
.recent-matches-block .pr-rm-table td{display:table-cell!important;padding:0!important;border:0!important;background:transparent!important;white-space:normal!important;min-width:0!important;max-width:none!important}
.recent-matches-block .pr-rm-table td:before,.recent-matches-block .pr-rm-table td:after{display:none!important;content:none!important}
.recent-matches-block .pr-rm-table tr:not(:last-child) td{border-bottom:1px solid var(--rm-edge)!important}
.recent-matches-block .pr-rm-table tr:not([data-rm-id]) td{padding:24px!important;text-align:center}
.recent-matches-block .pr-rm-item{min-width:0;color:var(--rm-ink);font-variant-numeric:tabular-nums}
.recent-matches-block .pr-rm-tr .pr-rm-item{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.85fr) minmax(0,1.35fr);align-items:center;gap:12px;min-height:76px;padding:10px 14px}
.recent-matches-block .pr-rm-table:has(.pr-rm-action) .pr-rm-tr .pr-rm-item{grid-template-columns:minmax(0,1fr) minmax(0,1.85fr) minmax(0,1.35fr) max-content}
.recent-matches-block .pr-rm-tr .pr-rm-item:hover{background:var(--rm-soft)}
.recent-matches-block .pr-rm-meta{white-space:normal!important;display:flex;min-width:0;align-items:center;gap:6px;flex-wrap:wrap;font-size:12px;color:var(--rm-muted)}
.recent-matches-block .pr-rm-cat{display:inline-flex;align-items:center;gap:6px;font-weight:700;color:var(--rm-ink);min-width:0;overflow-wrap:anywhere}
.recent-matches-block .pr-rm-cat i{width:9px;height:9px;border-radius:3px;flex:none}
.recent-matches-block .pr-rm-state{display:inline-flex;gap:5px;align-items:center;font-weight:700;color:var(--rm-muted);min-width:0;overflow-wrap:anywhere}
.recent-matches-block .pr-rm-state i{width:7px;height:7px;border:1px solid currentColor;background:currentColor;border-radius:50%;flex:none}
.recent-matches-block .pr-rm-state[data-state=done]{color:var(--rm-win)}
.recent-matches-block .pr-rm-state[data-state=live]{color:var(--rm-accent)}
.recent-matches-block .pr-rm-state[data-state=special]{color:var(--rm-loss)}
.recent-matches-block .pr-rm-state[data-state=wait] i{background:transparent}
.recent-matches-block .pr-rm-tourney{overflow-wrap:anywhere;min-width:0}
.recent-matches-block .pr-rm-tr .pr-rm-meta{flex-direction:column;align-items:flex-start;gap:4px}
.recent-matches-block .pr-rm-players{display:grid;gap:3px;min-width:0}
.recent-matches-block .pr-rm-player{display:grid;grid-template-columns:minmax(0,1fr) 28px;align-items:center;gap:6px;min-width:0;line-height:1.3}
.recent-matches-block .pr-rm-avatar{display:none}
.recent-matches-block .pr-rm-name{white-space:normal!important;font-size:15px;font-weight:650;overflow-wrap:anywhere;min-width:0}
.recent-matches-block .pr-rm-score{font-size:22px;line-height:1;text-align:right;font-weight:800;white-space:nowrap}
.recent-matches-block .pr-rm-player[data-outcome=win]{color:var(--rm-win)}
.recent-matches-block .pr-rm-player[data-outcome=loss]{color:var(--rm-loss)}
.recent-matches-block .pr-rm-foot{display:flex;align-items:center;gap:5px 8px;flex-wrap:wrap;min-width:0;font-size:12px;color:var(--rm-muted)}
.recent-matches-block .pr-rm-games{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.recent-matches-block .pr-rm-game{background:var(--rm-soft);color:var(--rm-muted);font-size:12px;white-space:nowrap;border-radius:5px;padding:3px 5px}
.recent-matches-block .pr-rm-game b{color:var(--rm-ink);font-weight:800}
.recent-matches-block .pr-rm-duration{white-space:nowrap}
.recent-matches-block .pr-rm-tr .pr-rm-duration{flex-basis:100%}
.recent-matches-block .pr-rm-action{display:flex;align-items:center;justify-content:center;align-self:stretch;min-width:0}
.recent-matches-block .pr-rm-action .rm-score-action{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:6px!important;min-height:44px;min-width:44px;margin:0!important;padding:7px 10px!important;white-space:nowrap;font-size:13px!important;color:var(--rm-accent)!important;border:1px solid var(--rm-edge)!important;background:transparent!important;border-radius:8px!important}
.recent-matches-block .pr-rm-action .rm-score-action:hover{border-color:var(--rm-accent)!important}
.recent-matches-block .pr-rm-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:10px;min-width:0}
.recent-matches-block .pr-rm-card{display:flex;flex-direction:column;border:1px solid var(--rm-edge);border-radius:12px;background:var(--rm-card);overflow:clip;box-shadow:0 1px 3px #00000008}
.recent-matches-block .pr-rm-card .pr-rm-meta{padding:13px 13px 10px}
.recent-matches-block .pr-rm-card .pr-rm-state{margin-left:auto}
.recent-matches-block .pr-rm-card .pr-rm-players{padding:0 10px 9px;gap:4px}
.recent-matches-block .pr-rm-card .pr-rm-player{grid-template-columns:32px minmax(0,1fr) 36px;background:var(--rm-soft);border-radius:7px;padding:8px;min-height:50px;gap:7px}
.recent-matches-block .pr-rm-card .pr-rm-avatar{display:grid;place-items:center;border:1px solid currentColor;width:32px;height:32px;border-radius:8px;font-size:11px;font-weight:750;opacity:.85}
.recent-matches-block .pr-rm-card .pr-rm-player[data-outcome=win]{background:var(--rm-wbg)}
.recent-matches-block .pr-rm-card .pr-rm-player[data-outcome=loss]{background:var(--rm-lbg)}
.recent-matches-block .pr-rm-card .pr-rm-name{font-size:16px}
.recent-matches-block .pr-rm-card .pr-rm-score{font-size:28px}
.recent-matches-block .pr-rm-card .pr-rm-foot{border-top:1px solid var(--rm-edge);padding:10px 12px;margin-top:auto;justify-content:space-between}
.recent-matches-block .pr-rm-card .pr-rm-action{padding:0 12px 10px;justify-content:flex-end}
.recent-matches-block .pr-rm-new{animation:prRmNew 1.6s ease-out}
.recent-matches-block .pr-rm-score-changed{animation:prRmScore 1.2s ease-out}
.recent-matches-block .pr-rm-view-in{animation:prRmView .18s ease-out}
@keyframes prRmNew{0%{opacity:.3;background:var(--rm-wbg)}20%{opacity:1;background:var(--rm-wbg)}100%{background:transparent}}
@keyframes prRmScore{0%,25%{background:var(--rm-wbg);box-shadow:0 0 0 3px var(--rm-wbg)}100%{box-shadow:none}}
@keyframes prRmView{from{opacity:.65}to{opacity:1}}
@container(max-width:720px){
 .recent-matches-block .rm-header{grid-template-columns:minmax(0,1fr) 30px;gap:8px}
 .recent-matches-block .rm-header .pr-connection{grid-column:2;grid-row:1}
 .recent-matches-block .rm-header .rm-seg{grid-row:2;grid-column:1/-1;justify-self:start}
 .recent-matches-block .rm-header .seg-btn{min-height:44px}
 .recent-matches-block .pr-rm-tr .pr-rm-item{grid-template-columns:minmax(0,1fr);grid-template-areas:"meta" "players" "foot";gap:5px;padding:9px 10px;min-height:0}
 .recent-matches-block .pr-rm-table:has(.pr-rm-action) .pr-rm-tr .pr-rm-item{grid-template-columns:minmax(0,1fr) max-content;grid-template-areas:"meta meta" "players action" "foot foot"}
 .recent-matches-block .pr-rm-tr .pr-rm-meta{grid-area:meta;flex-direction:row;align-items:center}
 .recent-matches-block .pr-rm-tr .pr-rm-state{margin-left:auto}
 .recent-matches-block .pr-rm-tr .pr-rm-tourney{order:3;flex-basis:100%}
 .recent-matches-block .pr-rm-tr .pr-rm-players{grid-area:players}
 .recent-matches-block .pr-rm-tr .pr-rm-player{grid-template-columns:minmax(0,1fr) 24px}
 .recent-matches-block .pr-rm-tr .pr-rm-foot{grid-area:foot;justify-content:space-between}
 .recent-matches-block .pr-rm-tr .pr-rm-duration{flex-basis:auto}
 .recent-matches-block .pr-rm-tr .pr-rm-action{grid-area:action}
 .recent-matches-block .pr-rm-tr .pr-rm-action .rm-score-action span{display:none}
 .recent-matches-block .pr-rm-tr .pr-rm-action .rm-score-action:after{content:"Счёт";font-size:13px}
 .recent-matches-block .pr-rm-tr .pr-rm-game{background:transparent;padding:1px 2px}
}
@container(max-width:360px){
 .recent-matches-block .pr-rm-card .pr-rm-player{grid-template-columns:26px minmax(0,1fr) 30px;gap:5px;padding:7px}
 .recent-matches-block .pr-rm-card .pr-rm-avatar{width:26px;height:26px}
 .recent-matches-block .pr-rm-tr .pr-rm-action .rm-score-action:after{display:none}
 .recent-matches-block .pr-rm-card .pr-rm-score{font-size:26px}
}
@media(prefers-reduced-motion:reduce){.recent-matches-block .pr-rm-new,.recent-matches-block .pr-rm-score-changed,.recent-matches-block .pr-rm-view-in{animation:none!important}}

/* Keep preview results visible while hiding staff-only actions. */
body.is-preview-mode .recent-matches-block .pr-rm-action{display:none!important}
body.is-preview-mode .recent-matches-block .pr-rm-table:has(.pr-rm-action) .pr-rm-tr .pr-rm-item{grid-template-columns:minmax(0,1fr) minmax(0,1.85fr) minmax(0,1.35fr)}
@container(max-width:720px){body.is-preview-mode .recent-matches-block .pr-rm-table:has(.pr-rm-action) .pr-rm-tr .pr-rm-item{grid-template-columns:minmax(0,1fr);grid-template-areas:"meta" "players" "foot"}}
.recent-matches-block .pr-rm-table tr[style*="display: none"]{display:none!important}

/* Supersede the legacy table IDs, including their forced header/min-width/padding. */
.recent-matches-block .rm-tbl :is(#recent-matches-table,#referee-recent-table).pr-rm-table thead{display:none!important}
.recent-matches-block .rm-tbl :is(#recent-matches-table,#referee-recent-table).pr-rm-table tbody td{padding:0!important;white-space:normal!important}
.recent-matches-block .rm-tbl :is(#recent-matches-table,#referee-recent-table).pr-rm-table tbody tr:not([data-rm-id]) td{padding:24px!important}
.recent-matches-block .pr-rm-action .rm-score-action svg{display:block!important;width:16px!important;height:16px!important;flex:0 0 16px}
