/* MTG v2 / ServerList — wierne dopasowanie do oryginalnych zasobów z MTG_v2.xml
 * Działa z istniejącym mtg-serverlist/assets/serverlist.js (klasy .mtg-sl__*).
 * Bez nadpisywania custom.css IPS i bez zmiany odpytywania serwerów.
 */
.mtg-sl {
  --mtg-red:#8e1524; --mtg-bright:#c13147;
  --mtg-muted:#a29598; --mtg-asset:'/mtg-v2-modules/';
  color:#efebeb; width:100%; max-width:1254px;
  margin:0 auto 22px; font:inherit; font-size:12px;
  container:mtgsv / inline-size;
}
.mtg-sl,.mtg-sl *,.mtg-sl *::before,.mtg-sl *::after{box-sizing:border-box}
.mtg-sl__card{
  display:flex; flex-direction:column; width:100%; overflow:visible;
  background:transparent!important; border:0!important;
  border-radius:0!important; box-shadow:none!important;
  backdrop-filter:none!important; -webkit-backdrop-filter:none!important;
  position:relative; isolation:isolate;
}
.mtg-sl__card::before,.mtg-sl__card::after{content:none!important}
/* W oryginalnym MTG serwery nie były zamknięte w ogromnej karcie. */
.mtg-sl__head{
  order:0;min-height:28px;display:flex;align-items:center;justify-content:flex-end;
  padding:0 6px 4px!important;border:0!important; background:transparent!important;
  gap:8px;box-shadow:none!important;
}
.mtg-sl__head::after,.mtg-sl__head::before{content:none!important}
.mtg-sl__headings{display:none!important}
.mtg-sl__head-actions{display:flex;align-items:center;gap:8px;justify-content:flex-end}
.mtg-sl__updated{font-size:10px;color:#77676c;font-weight:400;white-space:nowrap}
.mtg-sl__refresh{
  display:inline-flex;align-items:center;justify-content:center;gap:4px;
  padding:3px 9px!important;min-height:23px;line-height:1;
  font-size:10px!important;font-weight:600;color:#d2c7ca!important;
  background:rgba(27,5,8,.7)!important;
  border:1px solid rgba(110,17,29,.9)!important;border-radius:3px!important;
  box-shadow:none!important;cursor:pointer;transition:background .2s,color .2s;
}
.mtg-sl__refresh:hover{background:#5b111b!important;color:#fff!important}
.mtg-sl__refresh:disabled{opacity:.55;cursor:wait}
.mtg-sl__svg{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:14px;height:14px}
.mtg-sl__svg svg{width:100%;height:100%;display:block}
.mtg-sl__list{
  order:1;list-style:none!important;display:grid;gap:2px;
  padding:0!important;margin:0!important;width:100%;background:none!important;
}
/* Oryginalna cienka, czarno-rubinowa belka serwera */
.mtg-sl__server{
  display:grid!important;
  grid-template-columns:minmax(154px,1.58fr) minmax(155px,1.38fr) minmax(90px,.85fr) minmax(72px,.6fr) minmax(98px,.82fr) minmax(145px,1fr)!important;
  grid-template-areas:'identity address map players owner controls'!important;
  align-items:center!important;gap:5px!important;
  height:40px;min-height:40px!important;max-height:none;
  position:relative; margin:0!important; padding:0 8px 0 0!important;
  background:linear-gradient(180deg,rgba(21,2,4,.38),rgba(2,0,0,.24))!important;
  border:0!important;border-bottom:1px solid rgba(100,7,20,.48)!important;
  border-radius:0!important; box-shadow:none!important; overflow:visible!important;
  transition:filter .16s ease,background .16s ease;
  backdrop-filter:none!important;-webkit-backdrop-filter:none!important;
}
.mtg-sl__server::before{content:none!important}
.mtg-sl__server::after{content:none!important}
.mtg-sl__server:hover{
  transform:none!important;z-index:2;
  background:linear-gradient(90deg,rgba(84,7,18,.33),rgba(4,0,1,.23))!important;
  border-color:#861124!important;box-shadow:none!important;
}
.mtg-sl__identity{
  grid-area:identity;display:flex;align-items:center;gap:4px;min-width:0;
  height:35px;padding:0 7px 0 1px;
  background:url('/mtg-v2-modules/name_server.png') center center / 100% 28px no-repeat;
}
.mtg-sl__game{
  flex:0 0 36px;width:36px;height:35px;display:grid;place-items:center;
  background:url('/mtg-v2-modules/icon_server.png') center/36px auto no-repeat;
  border:0!important;border-radius:0!important;box-shadow:none!important;
}
.mtg-sl__game img{width:17px;height:17px;object-fit:contain;border:0}
.mtg-sl__labels{min-width:0;overflow:hidden;flex:1}
.mtg-sl__name{
  display:block;color:#e9dfe1;font-size:12px;font-weight:650;white-space:nowrap;
  line-height:1.25;overflow:hidden;text-overflow:ellipsis;
}
.mtg-sl__details{display:none!important}
.mtg-sl__address-box{
  grid-area:address;display:flex;align-items:center;justify-content:flex-start;gap:5px;
  height:35px;padding:0 5px;min-width:0;
  background:url('/mtg-v2-modules/ip_server.png') center / 100% 28px no-repeat;
}
.mtg-sl__ip{
  background:transparent!important;color:#e5dcde!important;border:0!important;
  padding:3px 0!important; min-width:0;max-width:100%;
  font:500 11px/1.1 Arial,Helvetica,sans-serif!important;
  letter-spacing:.1px; white-space:nowrap;cursor:pointer;text-align:left;
  border-radius:0!important;box-shadow:none!important;
}
.mtg-sl__ip:hover{color:#fff!important;text-decoration:underline}
.mtg-sl__join{
  display:inline-flex!important;justify-content:center;align-items:center;
  flex:0 0 21px!important;width:21px!important;height:23px!important;
  background:rgba(83,2,13,.36)!important; color:#f6ced4!important;
  border:1px solid rgba(115,12,28,.8)!important;border-radius:50%!important;
  padding:2px!important;box-shadow:none!important;
}
.mtg-sl__join .mtg-sl__svg{width:12px;height:12px}
.mtg-sl__join:hover{background:#821222!important;filter:brightness(1.25)}
.mtg-sl__map{
  grid-area:map;display:flex;align-items:center;min-width:0;gap:5px;
  padding-left:1px;white-space:nowrap;overflow:hidden;
  color:#d2bec2;
}
.mtg-sl__map::before{
  content:'';display:inline-block;flex:0 0 15px;width:15px;height:15px;
  background:url('/mtg-v2-modules/icon_server2.png') 0 0 no-repeat;
}
.mtg-sl__meta-title{display:none!important}
.mtg-sl__map strong{
  display:block;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;
  color:#c7b7bb;font:500 11px/1.3 Arial,Helvetica,sans-serif!important;
}
.mtg-sl__players{grid-area:players;display:flex;align-items:center;gap:4px;min-width:0}
.mtg-sl__players::before{
  content:'';display:inline-block;width:15px;height:15px;flex:0 0 15px;
  background:url('/mtg-v2-modules/icon_server2.png') 0 -15px no-repeat;
}
.mtg-sl__gauge{
  background:none!important;display:inline!important;width:auto!important;height:auto!important;
  flex:none!important;border-radius:0!important;box-shadow:none!important;
}
.mtg-sl__gauge::after{content:none!important}
.mtg-sl__gauge span{font:600 11px/1.25 Arial,sans-serif!important;color:#eee5e7!important;white-space:nowrap}
.mtg-sl__players small{display:none!important}
.mtg-sl__owner{
  grid-area:owner;display:flex;align-items:center;min-width:0;
  color:#a98f95;overflow:hidden;padding:0 3px;
}
.mtg-sl__owner-data{min-width:0;max-width:100%;display:block}
.mtg-sl__owner-name{
  display:block;color:#bc7279!important;font-size:11px;font-weight:650;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-decoration:none!important;
}
.mtg-sl__owner-name[href]:hover{color:#f1b6bf!important}
.mtg-sl__owner-avatar{display:none!important}
.mtg-sl__controls{
  grid-area:controls;display:flex;align-items:center;justify-content:flex-end;
  min-width:0;gap:8px;
}
.mtg-sl__status{font-size:0!important;display:inline-flex!important;align-items:center;gap:0;color:transparent!important}
.mtg-sl__status-dot{
  width:5px;height:5px;border-radius:50%;background:#6f7c6e;box-shadow:0 0 5px #293b29;
  animation:none!important;
}
.mtg-sl__server.is-offline{opacity:.58}
.mtg-sl__server.is-offline .mtg-sl__status-dot{background:#69333b;box-shadow:none}
.mtg-sl__buttons{display:flex;align-items:center;justify-content:flex-end;gap:4px;flex-wrap:nowrap}
.mtg-sl__iconbtn{
  width:23px!important;height:23px!important;flex:0 0 23px!important;
  display:inline-flex;align-items:center;justify-content:center;
  padding:2px!important; background:transparent!important;border:0!important;
  color:#bfb0b2!important;border-radius:0!important;box-shadow:none!important;
  cursor:pointer;text-decoration:none!important;transition:color .16s,transform .16s;
}
.mtg-sl__iconbtn .mtg-sl__svg{width:13px;height:13px}
.mtg-sl__iconbtn:hover:not(:disabled){color:#fff!important;transform:translateY(-1px)!important;background:transparent!important}
.mtg-sl__iconbtn:disabled{color:#655c5d!important;cursor:not-allowed;opacity:.5}
.mtg-sl__iconbtn:focus-visible,.mtg-sl__ip:focus-visible,.mtg-sl__refresh:focus-visible{
  outline:1px solid #c6384c;outline-offset:2px;
}
/* Podsumowanie jak w źródłowej tabeli: na dole, czerwony separator i drobne napisy. */
.mtg-sl__summary{
  order:2; display:flex;align-items:center;justify-content:space-between;
  gap:8px;flex-wrap:wrap;
  margin-top:11px!important;padding:10px 2px 0!important;
  border-top:2px solid rgba(121,14,26,.8)!important;
  border-bottom:0!important;background:transparent!important;
}
.mtg-sl__summary-item{display:inline-flex;align-items:center;gap:6px;margin:0!important}
.mtg-sl__summary-item strong{color:#8f1a27!important;font-weight:800;font-size:12px;order:0}
.mtg-sl__summary-item span{color:#776367!important;font-size:11px;order:1}
.mtg-sl__empty{padding:16px 10px;text-align:center;color:#998184;background:rgba(25,3,7,.4);font-size:12px}
.mtg-sl__foot{display:none!important}
/* Informacje — zachowane, lecz wizualnie spójne ze starym MTG. */
.mtg-sl__overlay{position:fixed;inset:0;z-index:100000;display:grid;place-items:center;padding:15px;background:rgba(0,0,0,.82)}
.mtg-sl__dialog{width:min(520px,100%);max-height:90vh;overflow:auto;background:#0e0306;border:1px solid #65202a;color:#f0e8e8;border-radius:2px;padding:18px;box-shadow:0 18px 70px #000}
.mtg-sl__dialog-top{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:14px;padding:6px 0 10px;border-bottom:1px solid #4c0d1a}
.mtg-sl__dialog-top h3{font-size:18px;color:#fff;margin:0}
.mtg-sl__dialog-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.mtg-sl__dialog-item{padding:11px;display:flex;flex-direction:column;gap:6px;background:#160509;border-left:2px solid #722035}
.mtg-sl__dialog-item span{color:#a78e91;font-size:11px}
.mtg-sl__dialog-item strong{overflow-wrap:anywhere;font-size:13px}
.mtg-sl__dialog-note{font-size:11px;color:#9d8184;line-height:1.5;margin-top:14px}
/* Wąskie kolumny — nadal czytelne bez utraty funkcji. */
@container mtgsv (max-width:900px){
  .mtg-sl__server{height:auto;min-height:49px!important;
    grid-template-columns:minmax(155px,1.5fr) minmax(165px,1fr) minmax(95px,.85fr) 95px!important;
    grid-template-areas:'identity address map players' 'identity owner controls controls'!important;
    gap:3px 8px!important;padding:4px 5px!important}
  .mtg-sl__owner{justify-content:flex-start}.mtg-sl__controls{justify-content:flex-end}
}
@container mtgsv (max-width:540px){
  .mtg-sl__server{height:auto;min-height:78px!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
    grid-template-areas:'identity identity' 'address players' 'map controls'!important;
    gap:3px 6px!important;padding:4px 6px 6px!important}
  .mtg-sl__identity{max-width:100%;padding:0 5px}.mtg-sl__address-box{max-width:100%}
  .mtg-sl__map{min-width:0}.mtg-sl__owner{display:none!important}
  .mtg-sl__buttons{gap:2px}.mtg-sl__status{display:none!important}
  .mtg-sl__updated{font-size:9px}
  .mtg-sl__summary{justify-content:flex-start;gap:7px 15px}
}
@media(prefers-reduced-motion:reduce){.mtg-sl__server,.mtg-sl__iconbtn,.mtg-sl__refresh{transition:none!important}}
