/* Stats, mode switching, tables and the match page. Uses the tokens from style.css. */

/* ------------------------------------------------ match rows */
.matches { display: grid; gap: 6px; }
.match {
  display: grid; align-items: center; gap: 14px; padding: 10px 14px 10px 0; text-decoration: none;
  grid-template-columns: 4px 44px minmax(120px, 1.4fr) 64px minmax(90px, .9fr) 48px 48px 48px 48px 64px;
  border: 1px solid var(--line); background: var(--plate-2);
}
.match:hover { background: #1d1719; border-color: #3a2c31; }
.match .stripe { align-self: stretch; background: var(--draw); }
.match.win .stripe { background: var(--win); } .match.loss .stripe { background: var(--loss); } .match.none .stripe { background: var(--line); }
.match .ag { width: 44px; height: 44px; background: var(--void); }
.match .m-map { font: 600 15px/1.2 var(--f-display); }
.match .m-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .score { font: 700 17px/1 var(--f-display); font-variant-numeric: tabular-nums; }
.match.win .score { color: var(--win); } .match.loss .score { color: var(--loss); }
.match .cell .k { font-size: 11px; color: var(--dim); }
.match .cell .v { font: 600 14px/1.2 var(--f-display); font-variant-numeric: tabular-nums; }
.match .rrc { text-align: right; font: 700 14px var(--f-display); font-variant-numeric: tabular-nums; }
.up { color: var(--win); } .down { color: var(--loss); }
@media (max-width: 760px) {
  .match { grid-template-columns: 4px 40px minmax(0, 1fr) auto auto; gap: 10px; }
  .match .ag { width: 40px; height: 40px; }
  .match .hide-sm, .match .rrc:empty { display: none; }
}
.more { justify-self: center; margin: 12px auto 0; }
.ph { display: inline-block; background: var(--plate-2); }
.chip { text-decoration: none; }

/* ------------------------------------------------ mode bar */
.modebar {
  position: sticky; top: 65px; z-index: 10; display: flex; align-items: center; gap: 12px;
  background: rgba(5, 5, 5, .9); backdrop-filter: blur(10px); padding: 8px 0; border-bottom: 1px solid var(--line);
}
.modes { display: flex; gap: 4px; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: none; }
.modes::-webkit-scrollbar { display: none; }
.modes button {
  flex: none; display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; cursor: pointer;
  background: var(--plate); border: 1px solid var(--line); color: var(--muted); font: 600 14px var(--f-display);
}
.modes button small { font: 500 11px var(--f-body); color: var(--dim); }
.modes button:hover { color: var(--bone); }
.modes button[aria-selected="true"] { color: var(--void); background: var(--red); border-color: var(--red); }
.modes button[aria-selected="true"] small { color: rgba(5, 5, 5, .7); }
.actsel select {
  height: 36px; padding: 0 12px; background: var(--plate-2); border: 1px solid var(--line); color: var(--bone);
  font: 600 13px var(--f-display); text-transform: lowercase; cursor: pointer;
}
@media (max-width: 560px) { .modebar { top: 112px; flex-wrap: wrap; } .actsel, .actsel select { width: 100%; } }

/* ------------------------------------------------ stat grids */
.statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.statgrid > div, .deep-grid > div { background: var(--plate); border: 1px solid var(--line); padding: 14px 16px; min-width: 0; }
.statgrid .k, .deep-grid .k, .deep-row .k { font-size: 12px; color: var(--muted); }
.statgrid .v { font: 700 24px/1.2 var(--f-display); font-variant-numeric: tabular-nums; }
.statgrid .s, .deep-grid .s { font-size: 12px; color: var(--dim); }
.deep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.deep-grid > div { background: var(--plate-2); }
.deep-grid .v { font: 700 20px/1.2 var(--f-display); font-variant-numeric: tabular-nums; }
.deep-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 16px; }
.mk { display: flex; gap: 6px; margin-top: 6px; }
.mk span { flex: 1; text-align: center; padding: 8px 4px; background: var(--plate-2); border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.mk b { display: block; font: 700 20px/1.1 var(--f-display); color: var(--bone); }
.mk .ace { border-color: var(--red); } .mk .ace b { color: var(--red); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pill { padding: 5px 10px; border: 1px solid var(--line); background: var(--plate-2); font: 600 13px var(--f-display); }
.dim { color: var(--dim); }
h3.sub { margin: 20px 0 10px; font: 600 13px var(--f-display); color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.weapons { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.wpn { background: var(--plate-2); border: 1px solid var(--line); padding: 12px; display: grid; gap: 6px; min-width: 0; }
.wimg { height: 36px; display: flex; align-items: center; }
.wimg img { max-height: 36px; width: auto; max-width: 100%; }
.wname { font: 600 14px var(--f-display); }
.wbar { display: inline-block; position: relative; height: 4px; background: var(--void); }
.wpn .wbar { display: block; }
.wbar i { position: absolute; inset: 0 auto 0 0; background: var(--red); }
.wnum { font-size: 12px; color: var(--muted); } .wnum b { color: var(--bone); font-family: var(--f-display); }

/* ------------------------------------------------ tables */
.tblwrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font: 500 11px var(--f-body); color: var(--dim); padding: 4px 8px; white-space: nowrap; }
.tbl td { padding: 7px 8px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.n { font-family: var(--f-display); }
.tbl .pl { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.tbl .pl img, .tbl .pl .ph { width: 26px; height: 26px; }
.tbl .pl.map img { width: 52px; height: 26px; object-fit: cover; }
.tbl .pl > span { text-transform: none; }
.tbl td .wbar { width: 46px; margin-right: 8px; vertical-align: middle; }
.tbl tr.me td { background: var(--red-glow); }
.tbl tr.me td:first-child { box-shadow: inset 2px 0 0 var(--red); }

/* acts */
.acts { display: grid; gap: 6px; }
.act { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; background: var(--plate-2); border: 1px solid var(--line); }
.act.cur { border-color: var(--red); }
.act img, .act .ph { width: 34px; height: 34px; }
.act b { display: block; font: 600 14px var(--f-display); }
.act span { font-size: 12px; color: var(--muted); }
.act .wr { text-align: right; font: 700 15px var(--f-display); }
.act .wr small { display: block; font: 500 11px var(--f-body); color: var(--dim); }

/* ------------------------------------------------ match page */
.back { justify-self: start; }
.matchhead {
  position: relative; overflow: hidden; display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap;
  min-height: 180px; padding: 24px; border: 1px solid var(--line); background: var(--plate);
}
.matchhead .art { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .35; }
.matchhead::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--void) 15%, rgba(5, 5, 5, .5) 65%, rgba(5, 5, 5, .75)); }
.matchhead > *:not(.art) { position: relative; z-index: 1; }
.matchhead.win { box-shadow: inset 0 -3px 0 var(--win); } .matchhead.loss { box-shadow: inset 0 -3px 0 var(--loss); }
.mh-mode { font: 600 13px var(--f-display); color: var(--red); }
.matchhead h1 { margin: 2px 0 0; font: 700 clamp(30px, 5vw, 48px)/1 var(--f-display); }
.mh-score { margin-left: auto; text-align: right; display: grid; gap: 4px; justify-items: end; }
.mh-score .big { font: 700 clamp(36px, 6vw, 56px)/1 var(--f-display); font-variant-numeric: tabular-nums; display: flex; gap: 10px; color: var(--muted); }
.mh-score .big .w { color: var(--bone); }
.mh-score .big i { font-style: normal; color: var(--dim); }
.res { font: 700 16px var(--f-display); }
.matchhead.win .res { color: var(--win); } .matchhead.loss .res { color: var(--loss); }
.mine-line { display: flex; align-items: center; gap: 8px; font: 600 14px var(--f-display); color: var(--muted); }
.mine-line img { width: 26px; height: 26px; }
.teamboard.mine { box-shadow: inset 3px 0 0 var(--win); } .teamboard.enemy { box-shadow: inset 3px 0 0 var(--loss); }
.board .party { width: 4px; height: 26px; flex: none; }
.party.p0 { background: #ffb547; } .party.p1 { background: #7cc4ff; } .party.p2 { background: #d48cff; } .party.p3 { background: #9be36b; }
.mvp { font: 700 10px var(--f-display); font-style: normal; padding: 2px 5px; background: var(--red); color: var(--void); }
.mvp.team { background: var(--plate-2); color: var(--muted); border: 1px solid var(--line); }

.rounds { display: flex; flex-wrap: wrap; gap: 4px; align-items: stretch; }
.rd {
  width: 38px; padding: 6px 0 4px; display: grid; justify-items: center; gap: 3px; cursor: pointer;
  background: var(--plate-2); border: 1px solid var(--line); border-bottom: 2px solid var(--loss); color: var(--loss);
}
.rd.w { border-bottom-color: var(--win); color: var(--win); }
.rd .ri svg { width: 14px; height: 14px; display: block; }
.rd .rn { font: 600 11px var(--f-display); color: var(--muted); }
.rd[aria-pressed="true"] { background: var(--bone); }
.rd[aria-pressed="true"] .rn { color: var(--void); }
.half { width: 1px; align-self: stretch; background: var(--muted); margin: 0 4px; }
#rdetail { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.rhead { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 14px; }
.rhead b { font: 700 16px var(--f-display); }
.rgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 24px; }
@media (max-width: 900px) { .rgrid { grid-template-columns: minmax(0, 1fr); } }
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.feed li { display: grid; grid-template-columns: 40px minmax(0, 1fr) 70px minmax(0, 1fr); gap: 8px; align-items: center; padding: 5px 8px; background: var(--plate-2); border-left: 2px solid var(--loss); font-size: 13px; }
.feed li.ours { border-left-color: var(--win); }
.feed .t { color: var(--dim); font-family: var(--f-display); font-variant-numeric: tabular-nums; }
.feed .who { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-transform: none; }
.feed .who.v { justify-content: flex-end; color: var(--muted); }
.feed .who img, .feed .who .ph { width: 22px; height: 22px; flex: none; }
.feed .gun { display: flex; justify-content: center; color: var(--dim); font-size: 11px; }
.feed .gun img { height: 16px; width: auto; max-width: 70px; }
.econ .wcell img { height: 16px; width: auto; max-width: 80px; }
.econ tr.gap td { border: 0; padding: 4px; }
