/* =================================================================
   ARABIANS RANK — Redesign
   Theme: CS 1.6 HUD / terminal. Amber console glow, tactical dark.
   Shared across: index (server list), top15, user profile, mapend.
   ================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* surfaces */
  --bg:        #0a0c0b;
  --bg-2:      #0f1311;
  --panel:     rgba(18, 22, 20, 0.86);
  --panel-2:   rgba(26, 31, 28, 0.92);
  --line:      rgba(120, 140, 120, 0.14);
  --line-hot:  rgba(211, 175, 55, 0.30);

  /* the signature gold — extracted from brand swatch (#d3af37) */
  --hud:       #d3af37;
  --hud-dim:   #977e27;
  --hud-glow:  rgba(211, 175, 55, 0.55);

  /* team colors from the game */
  --ct:        #5b9bd5;   /* counter-terrorist blue */
  --t:         #d9534f;   /* terrorist red */

  /* text */
  --ink:       #e7eae3;
  --ink-2:     #9aa39a;
  --ink-3:     #5f6961;

  /* status */
  --on:        #6fcf5f;
  --off:       #4a514a;

  /* medals */
  --gold:      #f5c542;
  --silver:    #c8d0d6;
  --bronze:    #cd7f4a;

  --r:         10px;
  --r-sm:      6px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Rajdhani', system-ui, sans-serif;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(211,175,55,0.06), transparent 60%),
    radial-gradient(900px 700px at -10% 110%, rgba(91,155,213,0.05), transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,0.18) 2px 3px),
    var(--bg);
  background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

::selection { background: var(--hud); color: #1a1408; }

/* scrollbars */
::-webkit-scrollbar { height: 9px; width: 9px; }
::-webkit-scrollbar-thumb { background: var(--hud-dim); border-radius: 20px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 60px;
}

/* ---------- top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 22px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-left: 3px solid var(--hud);
  border-radius: var(--r);
}
.topbar .mark {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--bg);
  background: var(--hud);
  padding: 4px 8px;
  border-radius: 4px;
}
.topbar h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.topbar h1 b { color: var(--hud); }
.topbar .spacer { flex: 1; }

.btn {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--hud);
  background: transparent;
  border: 1px solid var(--line-hot);
  border-radius: var(--r-sm);
  padding: 9px 16px;
  cursor: pointer;
  transition: all .15s ease;
}
.btn:hover { background: var(--hud); color: #1a1408; border-color: var(--hud); }
.btn.ghost { color: var(--ink-2); border-color: var(--line); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink-3); background: transparent; }

/* eyebrow label, monospace console style */
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--hud-dim);
}
.eyebrow::before { content: '> '; color: var(--hud); }

/* ---------- generic panel ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

/* ===============================================================
   SERVER LIST  (index)
   =============================================================== */
.servers { display: grid; gap: 14px; }
.server {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color .15s ease, transform .15s ease;
}
.server:hover { border-color: var(--line-hot); transform: translateY(-1px); }
.server .dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--off);
}
.server.live .dot {
  background: var(--on);
  box-shadow: 0 0 0 3px rgba(111,207,95,0.18), 0 0 12px rgba(111,207,95,0.7);
}
.server .meta { min-width: 0; }
.server .name {
  font-size: 18px; font-weight: 700; letter-spacing: .3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.server.live .name:hover { color: var(--hud); }
.server .addr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--ink-3); margin-top: 2px;
}
.server .right { display: flex; align-items: center; gap: 18px; }
.server .players {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 16px;
}
.server .players b { color: var(--hud); }
.server .players span { color: var(--ink-3); font-size: 12px; display: block; text-transform: uppercase; letter-spacing: 1px; }
.server .mapimg {
  width: 96px; height: 56px; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--line);
}
.server .mapname {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--ink-2); text-align: right;
}
.server.offline { opacity: .55; }

/* ===============================================================
   LEADERBOARD  (top15)
   =============================================================== */
.board { width: 100%; }
.board-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 14px;
}
.search {
  display: flex; gap: 8px;
}
.search input {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 12px;
  width: 230px;
  outline: none;
}
.search input:focus { border-color: var(--line-hot); }
.search input::placeholder { color: var(--ink-3); }

/* filter bar */
.filters {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.filters .flabel {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--ink-3);
}
.filters .flabel::before { content: '⛂ '; color: var(--hud-dim); }
.fselect {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; color: var(--ink);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 8px 12px; outline: none; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23977e27' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}
.fselect:focus { border-color: var(--line-hot); }
.fselect option { background: var(--bg-2); color: var(--ink); }

/* weapon-jump dropdown: reads as a navigation action */
.fselect.fweapon {
  color: var(--hud);
  border-color: var(--line-hot);
  background-color: rgba(211,175,55,0.06);
}
.fselect.fweapon:hover { background-color: rgba(211,175,55,0.12); }

/* steam-only toggle */
.ftoggle {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: 'Rajdhani', sans-serif; font-weight: 600; font-size: 13px;
  color: var(--ink-2); cursor: pointer; user-select: none;
  padding: 7px 12px 7px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg-2);
}
.ftoggle:hover { border-color: var(--line-hot); color: var(--ink); }
.ftoggle .sw {
  width: 34px; height: 19px; border-radius: 20px; flex: none;
  background: var(--off); position: relative; transition: background .15s ease;
}
.ftoggle .sw::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--ink); transition: transform .15s ease;
}
.ftoggle.on { color: var(--hud); border-color: var(--line-hot); }
.ftoggle.on .sw { background: var(--hud); }
.ftoggle.on .sw::after { transform: translateX(15px); background: #1a1408; }
.ftoggle input { display: none; }

.filters .spacer { flex: 1; }
.filters .reset {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink-3); text-transform: uppercase; letter-spacing: 1px;
}
.filters .reset:hover { color: var(--hud); }

.tablebox { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r); border: 1px solid var(--line); }
table.lb {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  min-width: 880px;
}
table.lb thead th {
  position: sticky; top: 0;
  background: var(--bg-2);
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: center;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line-hot);
  white-space: nowrap;
}
table.lb thead th a { color: inherit; }
table.lb thead th a:hover, table.lb thead th a.active { color: var(--hud); }
table.lb thead th.left { text-align: left; padding-left: 16px; }

table.lb tbody td {
  padding: 9px 8px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13.5px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.lb tbody tr:hover td { background: rgba(211,175,55,0.05); }
table.lb tbody tr.me td { background: rgba(91,155,213,0.10); }
table.lb tbody tr.me td:first-child { box-shadow: inset 3px 0 0 var(--ct); }

/* rank cell */
.rk {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; color: var(--ink-3); width: 48px;
}
.rk.medal { font-size: 18px; }
.rk.g { color: var(--gold); }
.rk.s { color: var(--silver); }
.rk.b { color: var(--bronze); }

/* player cell */
td.player { text-align: left !important; padding-left: 16px !important; }
.pl {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Rajdhani', sans-serif;
}
.pl .av {
  width: 28px; height: 28px; border-radius: 5px;
  object-fit: cover; border: 1px solid var(--line); flex: none;
}
.pl .flag { width: 18px; height: 12px; border-radius: 2px; flex: none; object-fit: cover; }
.pl .nm { font-weight: 700; font-size: 15px; color: var(--ink); }
.pl .nm:hover { color: var(--hud); }
.pl .tag {
  font-size: 9px; font-weight: 700; letter-spacing: .5px;
  padding: 1px 5px; border-radius: 3px; text-transform: uppercase;
}
.pl .tag.steam { background: rgba(91,155,213,.2); color: var(--ct); }
.pl .tag.new   { background: rgba(111,207,95,.2); color: var(--on); }
.dotstatus { width: 7px; height: 7px; border-radius: 50%; background: var(--off); flex: none; }
.dotstatus.on { background: var(--on); box-shadow: 0 0 7px var(--on); }

.hs sub { color: var(--hud-dim); font-size: 11px; }

/* skill pill */
.skill {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700; font-size: 12px;
  color: #1a1408;
  padding: 3px 9px; border-radius: 20px;
  min-width: 58px;
}
.skill small { font-weight: 500; opacity: .8; margin-left: 4px; }

/* rank badge img */
.badge { width: 56px; height: auto; vertical-align: middle; image-rendering: auto; }

/* ===============================================================
   WEAPON LEADERBOARD  (weapons)
   =============================================================== */
.wepbanner {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 20px; margin-bottom: 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-left: 3px solid var(--hud);
  border-radius: var(--r);
}
.wepbanner img {
  height: 44px; width: 120px; object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
}
.wepbanner .wb-name {
  font-size: 22px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--hud);
}
.wepbanner .wb-sub {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--ink-3); margin-top: 2px;
}
td.wkillcell {
  text-align: right !important;
}
td.wkillcell > div.inner {
  display: flex; align-items: center; gap: 12px; justify-content: flex-end;
}
td.wkillcell .wkbar {
  flex: 1; max-width: 240px; height: 7px;
  background: var(--bg-2); border-radius: 20px; overflow: hidden;
}
td.wkillcell .wkbar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--hud-dim), var(--hud));
  box-shadow: 0 0 8px var(--hud-glow);
}
td.wkillcell b {
  font-family: 'JetBrains Mono', monospace; font-size: 15px;
  color: var(--ink); min-width: 60px; text-align: right;
}

/* pagination */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; margin-top: 18px; flex-wrap: wrap;
}
.pager a, .pager strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; font-weight: 500;
  padding: 7px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); color: var(--ink-2);
}
.pager a:hover { border-color: var(--line-hot); color: var(--hud); }
.pager strong { background: var(--hud); color: #1a1408; border-color: var(--hud); }

/* ===============================================================
   USER PROFILE  (user)
   =============================================================== */
.back {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--ink-3); margin-bottom: 16px;
}
.back:hover { color: var(--hud); }

.profile {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}
.card .ct-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--hud-dim); margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.card .ct-head::before { content: '// '; color: var(--hud); }

/* identity block */
.ident { display: flex; gap: 14px; align-items: center; }
.ident .av {
  width: 72px; height: 72px; border-radius: 8px;
  object-fit: cover; border: 1px solid var(--line-hot);
  display: block;
}
.ident .av-link {
  position: relative; display: block; flex: none;
  border-radius: 8px; transition: transform .15s ease, box-shadow .15s ease;
}
.ident .av-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px var(--hud), 0 6px 16px rgba(0,0,0,.45);
}
.ident .av-link::after {
  content: 'STEAM ↗';
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: 'JetBrains Mono', monospace; font-size: 8px; font-weight: 700;
  letter-spacing: 1px; text-align: center; color: #1a1408;
  background: var(--hud); padding: 2px 0;
  border-radius: 0 0 8px 8px;
  opacity: 0; transition: opacity .15s ease;
}
.ident .av-link:hover::after { opacity: 1; }
.ident .who { min-width: 0; }
.ident .nick { font-size: 22px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ident .loc {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  color: var(--ink-3); margin-top: 2px;
  display: flex; align-items: center; gap: 6px;
}
.ident .loc img { width: 18px; height: 12px; border-radius: 2px; }
.ident .placing {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  color: var(--ink-2); margin-top: 6px;
}
.ident .placing b { color: var(--hud); }

/* rank progress */
.rankrow { display: flex; align-items: center; gap: 14px; margin: 18px 0 6px; }
.rankrow .badge { width: 84px; }
.rankrow .rinfo { flex: 1; }
.rankrow .rname { font-size: 18px; font-weight: 700; }
.bar {
  height: 9px; border-radius: 20px; background: var(--bg-2);
  border: 1px solid var(--line); margin: 8px 0 5px; overflow: hidden;
}
.bar > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--hud-dim), var(--hud));
  box-shadow: 0 0 10px var(--hud-glow);
}
.xp { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-3); }
.xp b { color: var(--hud); }

/* mini stat rows */
.kv { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.kv span img { width: 16px; height: 16px; opacity: .8; }
.kv b { font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--ink); }

/* big stat grid */
.statgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-radius: var(--r-sm); overflow: hidden; }
.stat { background: var(--panel-2); padding: 14px; text-align: center; }
.stat .n { font-family: 'JetBrains Mono', monospace; font-size: 22px; font-weight: 700; color: var(--ink); }
.stat .n.good { color: var(--hud); }
.stat .l { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

/* weapons */
.weps { display: grid; gap: 10px; }
.wep { display: flex; align-items: center; gap: 12px; }
.wep .wimg {
  width: 64px; height: 28px; object-fit: contain;
  background: var(--bg-2); border-radius: var(--r-sm);
  border: 1px solid var(--line); padding: 4px; flex: none;
}
.wep .wbar { flex: 1; }
.wep .wname { font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; }
.wep .wname b { font-family: 'JetBrains Mono', monospace; color: var(--hud); }
.wep .wtrack { height: 6px; background: var(--bg-2); border-radius: 20px; margin-top: 4px; overflow: hidden; }
.wep .wtrack > i { display: block; height: 100%; background: linear-gradient(90deg, var(--hud-dim), var(--hud)); }

/* ===============================================================
   MATCH END  (mapend)
   =============================================================== */
.mapend { max-width: 720px; margin: 0 auto; }
.mapend .hero {
  text-align: center; padding: 26px 20px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r);
  border-top: 3px solid var(--hud);
  margin-bottom: 14px;
}
.mapend .hero .lab { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 3px; color: var(--hud-dim); text-transform: uppercase; }
.mapend .hero .mapn { font-size: 30px; font-weight: 700; letter-spacing: 1px; margin: 6px 0; }
.outcome {
  text-align: center; font-size: 18px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  padding: 12px; border-radius: var(--r); margin-bottom: 14px;
}
.outcome.ct { color: var(--ct); background: rgba(91,155,213,.12); border: 1px solid rgba(91,155,213,.3); }
.outcome.t  { color: var(--t);  background: rgba(217,83,79,.12);  border: 1px solid rgba(217,83,79,.3); }
.outcome.draw { color: var(--ink-2); background: var(--panel-2); border: 1px solid var(--line); }

.yourmatch { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; background: var(--line); border-radius: var(--r); overflow: hidden; margin-top: 14px; }
.yourmatch .stat { background: var(--panel-2); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .profile { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 18px; }
  .search input { width: 150px; }
}
@media (max-width: 560px) {
  .server { grid-template-columns: auto 1fr; }
  .server .right { grid-column: 1 / -1; justify-content: space-between; }
  .statgrid { grid-template-columns: repeat(2,1fr); }
}
