/* Match detail: same visual language, wallpaper and summary card as /matches.
   The shared card itself uses matches_redesign.css; only the extra content
   and detail actions are styled here. */
body.page-match-detail .gm-detail-container{
  padding-top:43px;
  padding-bottom:65px;
}
body.page-match-detail .gm-card{width:100%;margin:0 auto!important}
.gm-detail-page .gm-hero__title-row{max-width:calc(100% - 20px)}
.gm-detail-page .gm-hero h1{text-align:center;font-size:clamp(30px,3.5vw,53px)}
.gm-detail-page .gm-hero__rule{flex:0 1 150px}
.gm-detail-actions{
  margin-left:auto;
  display:flex;align-items:center;justify-content:flex-end;flex-wrap:wrap;gap:8px;
}
.gm-detail-action{
  min-height:36px;padding:8px 12px;display:inline-flex;justify-content:center;
  align-items:center;gap:7px;flex:none;border:1px solid #d6b25c;
  border-radius:9px;color:#f5d58d;background:linear-gradient(180deg,#2a261c,#141a20);
  font:800 11px/1.2 Inter,"Segoe UI",sans-serif;letter-spacing:.025em;
  text-decoration:none;white-space:nowrap;cursor:pointer;transition:filter .15s ease,background .15s ease;
}
.gm-detail-action svg{display:block;width:17px;height:17px;flex:none}
.gm-detail-action:hover,.gm-detail-action:focus-visible{
  filter:brightness(1.15);text-decoration:none;outline:1px solid #e4bf70;
}
.gm-detail-action--report{border-color:#b85b62;color:#ffb7ba;background:linear-gradient(180deg,#381c25,#19131b)}
.gm-detail-action--download{border-color:#66788f;color:#d5dee9;background:linear-gradient(180deg,#1b2837,#101b29)}
.gm-detail-section{margin:23px 0 0;min-width:0}
.gm-detail-heading{
  display:flex;justify-content:center;align-items:center;gap:14px;
  margin:0 0 9px;
}
.gm-detail-heading h2{
  margin:0;color:#fbd484;text-align:center;white-space:nowrap;
  font:900 clamp(15px,1.4vw,20px)/1.3 Inter,"Segoe UI",sans-serif;
  letter-spacing:.075em;text-shadow:0 0 12px #d7a04344;
}
.gm-detail-heading__rule{
  height:1px;flex:1;max-width:190px;
  background:linear-gradient(90deg,transparent,#eac16c88);
}
.gm-detail-heading__rule:last-child{transform:scaleX(-1)}
.gm-detail-panel{
  overflow:hidden;min-width:0;
  background:linear-gradient(180deg,#0a131f,#050b13 88%);
  border:1.5px solid #bc913f;border-radius:14px;
  box-shadow:inset 0 0 0 1px #ca9d3a1d,0 9px 22px #0009;
}
.gm-detail-loading{padding:18px;text-align:center;color:#9fb0c6;margin:0;font-size:13px}
.gm-detail-unavailable{
  padding:25px;background:#181b25;color:#f5d6af;border:1px solid #ac8541;border-radius:12px;
  text-align:center;
}
.gm-detail-error{padding:15px;margin:14px 0 0;border:1px solid #c26060;background:#26141b;border-radius:9px;color:#ffe0e0}
.gm-detail-return{margin:25px 0 0;text-align:center}
.gm-detail-return a{color:#d9b76f;font-weight:800;text-decoration:none}
.gm-detail-return a:hover{text-decoration:underline}
.gm-detail-page .toast{
  position:fixed;left:50%;bottom:22px;z-index:999;
  padding:11px 17px;border:1px solid #bd974e;border-radius:10px;
  background:#141d29;color:#fff1d2;font:800 12px Inter,sans-serif;
  box-shadow:0 10px 30px #000b;
  opacity:0;transform:translate(-50%,12px);
  pointer-events:none;transition:opacity .2s,transform .2s;
}
.gm-detail-page .toast.show{opacity:1;transform:translate(-50%,0)}
/* A compact category bar matching the reference screenshot. */
.gm-stats-nav{
  display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:3px;
  padding:5px 6px 4px;border-bottom:1px solid #c29843a6;
}
.gm-stats-tab{
  display:flex;align-items:center;justify-content:center;gap:9px;
  min-width:0;min-height:32px;padding:7px 10px;
  border-radius:9px;border:1px solid #ad873c;
  color:#ebeff7;background:linear-gradient(180deg,#111d2a,#080e17);
  font:800 12px/1.2 Inter,"Segoe UI",sans-serif;
  white-space:nowrap;cursor:pointer;
}
.gm-stats-tab span{color:#ffce5c;font-size:17px;line-height:1}
.gm-stats-tab.is-active{
  background:linear-gradient(180deg,#ffe6a1,#daa73e);border-color:#f4d67e;
  color:#201604;box-shadow:0 0 11px #dca53744;
}
.gm-stats-tab.is-active span{color:#3c2a0a}
.gm-stats-tab:hover:not(.is-active){background:#1f2b39}
.gm-stats-tab:focus-visible{outline:2px solid #fff1ad;outline-offset:1px}
.gm-detail-page .stats-wrap{display:block;padding:9px 10px 13px;min-width:0}
.gm-stats-pane[hidden]{display:none!important}
.gm-detail-page .stats-block{border:0;background:none;border-radius:0;padding:0;min-width:0}
.gm-detail-page .stats-block h3{
  margin:1px 0 6px;color:#edf2f8;
  font:800 12px/1.3 Inter,"Segoe UI",sans-serif;
}
.gm-detail-page .stats-table-wrap{
  width:100%;max-width:100%;overflow:auto;
  border:1px solid #2a3747;border-radius:10px;
  scrollbar-color:#66778b #111924;
}
.gm-detail-page table.stats-table{
  width:100%;min-width:740px;border-collapse:collapse;border-spacing:0;
  background:#09121c;
}
.gm-detail-page table.stats-table thead th{
  padding:9px 10px;color:#dae2ef;background:linear-gradient(#1b2633,#101925);
  text-align:center;white-space:nowrap;
  font:800 11px/1.3 Inter,"Segoe UI",sans-serif;
  border-bottom:1px solid #3f4c5e;
}
.gm-detail-page table.stats-table thead th:first-child,
.gm-detail-page table.stats-table tbody td:first-child{text-align:left}
.gm-detail-page table.stats-table tbody td{
  padding:6px 10px;border-bottom:1px solid #34425438;
  color:#e5edf7;text-align:center;white-space:nowrap;
  font:650 12px/1.25 Inter,"Segoe UI",sans-serif;
}
.gm-detail-page table.stats-table tbody td.player-cell{
  min-width:174px;font-weight:800;
}
.gm-detail-page table.stats-table tbody tr:nth-child(even) td{background:#121c28a3}
.gm-detail-page table.stats-table tbody tr:last-child td{border-bottom:0}
.gm-detail-page table.stats-table tbody td.stat-max{
  color:#ffd05e!important;background:transparent!important;font-weight:950;
}
.gm-detail-page .gm-stats-pane--summary table.stats-table tbody td:last-child{
  color:#ffcd5c;font-weight:900;
}
.gm-detail-page .stats-player-chip{
  display:flex;align-items:center;gap:8px;min-width:0;
}
.gm-detail-page .stats-player-chip .stats-slot-ring{
  width:27px;height:27px;flex:0 0 27px;overflow:hidden;border-radius:5px;
  box-sizing:border-box;border:1px solid var(--slotColor,#718096);
  box-shadow:none;background:transparent;
}
.gm-detail-page .stats-player-chip .stats-slot-ring::after{display:none!important}
.gm-detail-page .stats-player-chip .civ-mini{
  width:100%;height:100%;border:0;border-radius:4px;
  display:block;object-fit:cover;
}
.gm-detail-page .stats-player-chip .pname{white-space:nowrap;font-size:12px}
.gm-detail-page table.stats-table tr.team-sep td{padding:0!important;border:0}
.gm-detail-page .team-sep-line{
  height:2px;margin:5px 0;background:#a4aebb75;
}
/* The four expandable military columns retain per-player breakdowns. */
.gm-detail-page .stat-expand{display:flex;flex-direction:column;align-items:stretch;gap:5px;min-width:82px}
.gm-detail-page .stat-top{display:flex;align-items:center;justify-content:center;gap:8px}
.gm-detail-page .exp-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:22px;height:22px;flex:none;padding:0;cursor:pointer;
  border:1px solid #b4914e;border-radius:6px;
  color:#f4c866;background:#1e2936;
  font:900 14px/1 Inter,sans-serif;
}
.gm-detail-page .exp-btn:hover,
.gm-detail-page .exp-btn[aria-expanded="true"]{
  background:#594324;color:#ffe09b;border-color:#f3c871;
}
.gm-detail-page .exp-btn[aria-expanded="true"] .caret{display:block;transform:rotate(180deg)}
.gm-detail-page .exp-detail{display:none;padding:7px 0 2px;border-top:1px solid #526176}
.gm-detail-page .exp-detail.open{display:block}
.gm-detail-page .exp-row{
  display:flex;align-items:center;justify-content:space-between;
  gap:12px;padding:4px 0;font:700 11px Inter,sans-serif;
}
.gm-detail-page .exp-name{max-width:125px;overflow:hidden;text-overflow:ellipsis}
.gm-detail-page .exp-count{color:#e4eaf5}
.gm-detail-page .stats-note{font:500 11px Inter,sans-serif;color:#aebccf}
.gm-detail-page .gm-chat-panel{padding:12px}
.gm-detail-page .chat-wrap{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
}
.gm-detail-page .chat-block{
  min-width:0;overflow:hidden;padding:12px 13px;
  background:linear-gradient(160deg,#111e2b,#080f18 75%);
  border:1px solid #718194;border-radius:11px;color:#f1f4f8;
}
.gm-detail-page .chat-block > div:first-child{
  padding-bottom:8px;margin-bottom:6px!important;
  border-bottom:1px solid #5362745e;
  color:#f5d083;font-size:13px;
}
.gm-detail-page .chat-line{
  display:grid;grid-template-columns:65px minmax(0,1fr);
  gap:10px;align-items:start;
  padding:9px 3px;border-bottom:1px solid #35465a63;
}
.gm-detail-page .chat-line:last-child{border-bottom:0}
.gm-detail-page .chat-t{font:700 11px/1.5 Inter,sans-serif;color:#e9c068}
.gm-detail-page .chat-m{
  min-width:0;overflow-wrap:anywhere;
  font:500 12px/1.45 Inter,sans-serif;color:#dae2f0;
}
.gm-detail-page .chat-n{font-weight:900;margin-right:6px}
.gm-detail-page .muted{color:#a4b0c0}
@media(max-width:960px){
  .gm-detail-page .chat-wrap{grid-template-columns:minmax(0,1fr)}
  .gm-stats-nav{grid-template-columns:repeat(5,minmax(0,1fr))}
  .gm-stats-tab{gap:5px;padding:8px 5px;font-size:11px}
  .gm-detail-page .gm-detail-actions{margin-left:0}
}
@media(max-width:650px){
  body.page-match-detail .gm-detail-container{padding-top:32px}
  .gm-detail-page .gm-hero h1{font-size:clamp(23px,5.7vw,34px)}
  .gm-detail-page .gm-hero__title-row{gap:7px}
  .gm-detail-page .gm-hero__rule{flex-basis:22px}
  .gm-detail-page .gm-detail-actions{width:100%;gap:6px;justify-content:flex-start}
  .gm-detail-page .gm-detail-action{flex:1 1 auto;padding:8px;min-width:0;font-size:10px}
  .gm-stats-nav{
    display:flex;gap:5px;padding:6px;
    overflow-x:auto;scrollbar-width:thin;scrollbar-color:#8b7042 #09121d;
    scroll-snap-type:x proximity;
  }
  .gm-stats-tab{flex:0 0 auto;min-width:116px;scroll-snap-align:start;font-size:11px}
  .gm-detail-page .stats-wrap{padding:8px 6px 12px}
  .gm-detail-page .chat-block{padding:10px}
  .gm-detail-page .chat-line{grid-template-columns:52px minmax(0,1fr);gap:7px}
}
@media(prefers-reduced-motion:reduce){
  .gm-detail-action{transition:none!important}
}
