:root {
  --bg:     #0d0f14;
  --bg2:    #161a24;
  --bg3:    #1e2330;
  --acc:    #e8a020;
  --acc2:   #c07010;
  --text:   #d4d8e2;
  --muted:  #6b7585;
  --green:  #3dba6e;
  --red:    #e05050;
  --border: #2a3040;
  --r:      6px;
  --font:   'Segoe UI', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; min-height: 100vh; }

header {
  background: linear-gradient(135deg, #0a0c10 0%, #1a1000 50%, #0a0c10 100%);
  border-bottom: 2px solid var(--acc);
  padding: 18px 24px 14px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.logo { font-size: 26px; font-weight: 800; letter-spacing: 3px; color: var(--acc); text-shadow: 0 0 20px rgba(232,160,32,.5); text-transform: uppercase; }
.hstats { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.hstat { text-align: center; padding: 6px 14px; background: rgba(232,160,32,.07); border: 1px solid rgba(232,160,32,.18); border-radius: var(--r); }
.hstat-val { display: block; font-size: 18px; font-weight: 700; color: var(--acc); line-height: 1.1; }
.hstat-lbl { display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin-top: 2px; }

.game-select-wrap {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-select-wrap label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.game-select {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  padding: 0 32px 0 12px; height: 36px; border-radius: var(--r); font-size: 14px;
  font-weight: 600; font-family: var(--font); outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23e8a020'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 13px;
  transition: border-color .2s;
  min-width: 160px;
}
.game-select:focus { border-color: var(--acc); }

.toolbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toolbar-row1 { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar input[type=text],
.toolbar input[type=number],
.toolbar select {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  padding: 0 10px; height: 32px; border-radius: var(--r); font-size: 13px; outline: none;
  font-family: var(--font); transition: border-color .2s;
}
.toolbar input[type=text]:focus,
.toolbar input[type=number]:focus,
.toolbar select:focus { border-color: var(--acc); }
.toolbar input[type=text]   { width: 230px; }
.toolbar input[type=number] { width: 90px; -moz-appearance: textfield; }
.toolbar input[type=number]::-webkit-outer-spin-button,
.toolbar input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.toolbar select {
  cursor: pointer;
  appearance: none; -webkit-appearance: none;
  padding: 0 28px 0 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%236b7585'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}
.btn, .btn-r {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 16px; border-radius: var(--r); font-family: var(--font);
  font-size: 13px; cursor: pointer; white-space: nowrap; text-decoration: none;
  border: 1px solid transparent; transition: background .2s, color .2s, border-color .2s;
}
.btn { background: var(--acc); color: #000; font-weight: 700; border-color: var(--acc); }
.btn:hover { background: var(--acc2); border-color: var(--acc2); color: #000; }
.btn-r { background: var(--bg3); color: var(--muted); border-color: var(--border); font-weight: 400; }
.btn-r:hover { color: var(--text); background: var(--bg); }
.btn-r.active { color: var(--acc); border-color: var(--acc); background: rgba(232,160,32,.08); }

.rbar { padding: 7px 24px; font-size: 12px; color: var(--muted); background: var(--bg2); border-bottom: 1px solid var(--border); text-align: center; }

.tw { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; table-layout: auto; }
th.rk, td.rk     { width: 44px; white-space: nowrap; }
th.nm, td.nm     { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 0; }
th.col-ip, td.col-ip   { width: 150px; white-space: nowrap; }
th.col-map, td.col-map { white-space: nowrap; }
th.col-ver, td.col-ver { white-space: nowrap; }
th.col-gt, td.col-gt   { white-space: nowrap; }
th.of, td.of     { width: 44px; white-space: nowrap; }
th.pw, td.pw     { width: 40px; white-space: nowrap; }
th.pl, td.pl     { width: 96px; white-space: nowrap; }
th.cc, td.cc     { white-space: nowrap; }

thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--bg3); color: var(--muted);
  font-weight: 600; text-transform: uppercase; font-size: 11px; letter-spacing: .5px;
  padding: 9px 10px; border-bottom: 2px solid var(--border); white-space: nowrap;
  text-align: left;
}
thead th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
thead th a:hover { color: var(--acc); }
.sa { font-size: 11px; opacity: .4; }
.sa.asc, .sa.desc { color: var(--acc); opacity: 1; }

tbody tr { border-bottom: 1px solid var(--border); transition: background .12s; }
tbody tr:hover { background: var(--bg3); }
tbody tr.is-official { background: rgba(232,160,32,.05); }
tbody tr.is-official:hover { background: rgba(232,160,32,.1); }
tbody td { padding: 8px 10px; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
td.col-ip { overflow: visible; }
.rk { text-align: center; font-size: 12px; color: var(--muted); }
.nm { font-weight: 600; }
.pl { text-align: center; }
.cc { text-align: left; }
.pw { text-align: center; }
.of { text-align: center; }
.fi-none { color: var(--muted); font-size: 13px; }
.flag-img { width: 20px; height: 15px; object-fit: cover; border-radius: 2px; display: inline-block; vertical-align: middle; flex-shrink: 0; }
.cc-cell { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.official-badge { display: inline-flex; align-items: center; justify-content: center; color: var(--acc); font-size: 13px; font-weight: 900; line-height: 1; flex-shrink: 0; }

.bw { display: flex; flex-direction: column; align-items: center; gap: 3px; justify-content: center; }
.bg { flex: none; width: 80px; height: 5px; background: var(--bg3); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.bf { height: 100%; border-radius: 3px; background: var(--green); }
.bf.w { background: #d4a020; }
.bf.f { background: var(--red); }
.bl { font-size: 12px; min-width: 48px; text-align: center; }

.pag {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 24px; background: var(--bg2); border-top: 1px solid var(--border);
}
.pag-pages { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; align-items: center; }
.pag-pages a, .pag-pages span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 7px; border-radius: var(--r);
  font-size: 13px; text-decoration: none; background: var(--bg3); color: var(--text);
  border: 1px solid var(--border); transition: background .2s, color .2s;
}
.pag-pages a:hover { background: var(--acc); color: #000; border-color: var(--acc); }
.pag-pages .cur { background: var(--acc); color: #000; border-color: var(--acc); font-weight: 700; }
.pag-jump {
  width: 52px; height: 32px; padding: 0 4px; border-radius: var(--r);
  font-size: 13px; background: var(--bg3); color: var(--muted);
  border: 1px dashed var(--border); text-align: center; -moz-appearance: textfield;
}
.pag-jump::-webkit-outer-spin-button,
.pag-jump::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pag-jump:focus { border-color: var(--acc); color: var(--text); outline: none; }

footer { text-align: center; padding: 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--border); background: var(--bg2); }

.filter-toggle { display: none; }
.filter-body { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.filter-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
tbody tr.srv-row { cursor: pointer; }

.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.72); backdrop-filter: blur(3px);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg2); border: 1px solid var(--border); border-radius: 10px;
  width: 100%; max-width: 620px; box-shadow: 0 24px 64px rgba(0,0,0,.65);
  animation: modIn .15s ease;
}
@keyframes modIn { from { opacity:0; transform:translateY(12px) scale(.97); } to { opacity:1; transform:none; } }
.modal-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 12px; border-bottom: 1px solid var(--border);
}
.modal-title { font-weight: 700; font-size: 14px; color: var(--text); flex: 1; min-width: 0; white-space: normal; word-break: break-word; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 8px; border-radius: var(--r); transition: color .15s, background .15s; }
.modal-close:hover { color: var(--text); background: var(--bg3); }
.modal-tabs { display: flex; border-bottom: 1px solid var(--border); }
.modal-tab { padding: 10px 16px; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; display: flex; align-items: center; gap: 6px; }
.modal-tab:hover { color: var(--text); }
.modal-tab.active { color: var(--acc); border-bottom-color: var(--acc); }
.modal-panel { display: none; }
.modal-panel.active { display: block; }
#pl-count-badge { font-size: 11px; background: var(--bg3); border: 1px solid var(--border); border-radius: 10px; padding: 1px 7px; color: var(--muted); }
.modal-body { padding: 8px 16px 16px; display: flex; flex-direction: column; }
.md-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.md-row:last-child { border-bottom: none; }
.md-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); width: 88px; flex-shrink: 0; }
.md-val { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-val.mono { font-family: monospace; font-size: 12px; color: var(--muted); }
.md-ip-code {
  font-family: monospace; font-size: 12px; color: var(--acc);
  background: rgba(232,160,32,.08); border: 1px solid rgba(232,160,32,.2);
  border-radius: 4px; padding: 2px 8px; letter-spacing: .3px;
}
.md-copy {
  background: none; border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; font-size: 11px; padding: 0 8px; height: 24px;
  border-radius: var(--r); transition: color .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0;
}
.md-copy:hover { color: var(--acc); border-color: var(--acc); }
.pl-status { text-align: center; padding: 32px; color: var(--muted); font-size: 13px; }
.pl-table { width: 100%; border-collapse: collapse; margin-top: 4px; }
.pl-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.pl-table td { padding: 7px 8px; font-size: 13px; border-bottom: 1px solid var(--border); }
.pl-table tr:last-child td { border-bottom: none; }

@media (min-width: 861px) {
  .filter-body { flex-wrap: nowrap; }
  .filter-body > select { flex: 1 1 0; min-width: 0; }
  .filter-body > input[type=number] { flex: 1 1 0; min-width: 0; }
  .filter-actions { flex: 0 0 auto; }
}
@media (max-width: 1100px) {
  th.col-ver, td.col-ver,
  th.col-gt,  td.col-gt,
  th.col-map, td.col-map { display: none; }
  th.col-ip, td.col-ip { width: 130px; }
  th.cc, td.cc { width: 130px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 900px) {
  th.rk, td.rk { display: none; }
}
@media (max-width: 860px) {
  header { flex-direction: column; align-items: center; gap: 10px; padding-top: 14px; padding-bottom: 14px; }
  .logo { width: auto; text-align: center; margin-bottom: 0; }
  .hstats { margin-left: 0; flex-wrap: nowrap; width: 100%; }
  .hstat { flex: 1 1 0; min-width: 0; }
  .game-select-wrap { padding: 8px 12px; }
  .filter-toggle { display: inline-flex; }
  .filter-body { display: none; width: 100%; }
  .filter-body.open { display: flex; flex-wrap: wrap; }
  .filter-body > select,
  .filter-body > input[type=number] { flex: 1 1 140px; width: auto !important; max-width: none; }
  .filter-actions { width: 100%; margin-left: 0; }
  .filter-actions .btn,
  .filter-actions .btn-r { flex: 1; }
  td.col-ip,  th.col-ip,
  td.of,      th.of,
  td.pw,      th.pw      { display: none; }
  th.pl, td.pl { width: 78px; }
  th.cc, td.cc { padding: 4px 8px 4px 0; text-align: center; }
  .cc-cell .cc-name { display: none; }
  .cc-cell { justify-content: center; }
  .bw .bg { width: 60px; }
  .bl { min-width: 0; text-align: center; }
  .rbar { padding: 6px 12px; }
  .toolbar { padding: 8px 12px; }
}
@media (max-width: 480px) {
  header { padding: 12px 12px 10px; }
  .logo { font-size: 18px; letter-spacing: 2px; }
  .hstat { padding: 5px 6px; }
  .hstat-val { font-size: 14px; }
  .hstat-lbl { font-size: 9px; }
  .pag { padding: 10px 12px; }
}
