:root {
  --bg:        #141519;
  --surface:   #1c1e24;
  --panel:     #17191d;
  --border:    #32343c;
  --accent:    #7896e6;
  --text:      #e4e6eb;
  --text-dim:  #878a94;

  --enemy:     #e06a6a;
  --ally:      #5fd0a8;
  --local:     var(--accent);
  --hp:        #78c83c;
  --bomb:      #d8a657;

  --unit:   15px;
  --pad:    11px;
  --header: 34px;
  --row:    30px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: #0d0e11;
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  font-size: var(--unit);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

body {
  display: grid;
  place-items: center;
  padding: 28px;
}

.board {
  width: min(1080px, 100%);
  height: min(720px, calc(100vh - 56px));
  display: flex;
  gap: var(--pad);
  min-height: 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel-head {
  height: calc(var(--header) - 4px);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--pad);
  background: var(--surface);
  border-bottom: 1px solid var(--accent);
}
.panel-title { color: var(--text); font-weight: 600; }
.panel-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--pad);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.panel-body::-webkit-scrollbar { width: 6px; height: 6px; }
.panel-body::-webkit-scrollbar-track { background: transparent; }
.panel-body::-webkit-scrollbar-thumb { background: var(--border); }
.panel-body::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.radar-panel { flex: 1 1 auto; }
.radar-body { display: grid; place-items: center; padding: var(--pad); }

.radar {
  --dot-size: 11px;
  position: relative;
  aspect-ratio: 1 / 1;
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  background: #0f1014;
  border: 1px solid var(--border);
  overflow: hidden;
}

.radar-view {
  position: absolute; inset: 0;
  --zoom: 1;
  --view-rot: 0deg;
  transform: scale(var(--zoom));
  transition: transform 0.18s var(--ease);
}
.radar-view.rotated { transform: scale(var(--zoom)) rotate(var(--view-rot)); }
.map {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  user-select: none; -webkit-user-drag: none;
}
.markers { position: absolute; inset: 0; }

.radar-status {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  background: rgba(15, 16, 20, 0.82);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  letter-spacing: 0.4px;
  white-space: nowrap;
  pointer-events: none;
}

.dot {
  position: absolute;
  width: var(--dot-size); height: var(--dot-size);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1.5px rgba(13, 14, 17, 0.9), 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: left 0.14s linear, top 0.14s linear;
}
.dot.enemy { background: var(--enemy); }
.dot.ally  { background: var(--ally);  }
.dot.local {
  background: var(--local); z-index: 3;
  box-shadow: 0 0 0 1.5px rgba(13, 14, 17, 0.9),
              0 0 0 3px rgba(120, 150, 230, 0.5),
              0 1px 4px rgba(0, 0, 0, 0.5);
}

.dot-label {
  position: absolute;
  left: 50%; top: calc(50% + var(--dot-size));
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  text-shadow: 0 0 3px #000, 0 0 3px #000;
  white-space: nowrap;
  pointer-events: none;
}
.radar.hide-names .dot-label { display: none; }

.bomb {
  position: absolute;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.9));
  transition: left 0.14s linear, top 0.14s linear;
}
.bomb .bombicon { width: 14px; height: 16px; filter: none; }
.radar.hide-bomb .bomb { display: none; }

.sidebar {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  gap: var(--pad);
  min-height: 0;
}
.subtab-panel { flex: 1 1 auto; min-height: 0; }

.subtabs {
  position: relative;
  display: flex;
  height: calc(var(--header) - 4px);
  flex: 0 0 auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.subtab {
  flex: 1 1 0;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  transition: color 0.15s linear;
}
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--text); }
.subtab-underline {
  position: absolute;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transition: transform 0.22s var(--ease), width 0.22s var(--ease);
}

.player-list { padding: 5px; }
.prow {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 7px;
  border-bottom: 1px solid rgba(50, 52, 60, 0.4);
  transition: background 0.15s linear;
}
.prow:last-child { border-bottom: none; }
.prow:hover { background: rgba(120, 150, 230, 0.06); }
.prow.dead { opacity: 0.42; }

.ptop { display: flex; align-items: center; gap: 8px; }
.pdot {
  flex: 0 0 auto;
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.85);
}
.pdot.enemy { background: var(--enemy); }
.pdot.ally  { background: var(--ally); }
.pdot.local { background: var(--local); }

.pname { flex: 1 1 auto; color: var(--text); font-weight: 500; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.prow.dead .pname { text-decoration: line-through; }
.pcash { color: var(--text-dim); font-size: 12px; font-variant-numeric: tabular-nums; }

.hpbar { height: 4px; background: var(--surface); position: relative; }
.hpbar > span { display: block; height: 100%; background: var(--hp);
  transition: width 0.3s var(--ease); }
.player-list.hide-hp .hpbar { display: none; }

.loadout { display: flex; align-items: center; gap: 9px; min-height: 16px; }
.player-list.hide-nades .loadout .nade { display: none; }

.wicon {
  display: inline-block;
  object-fit: contain;
  filter: brightness(0.6);
  transition: filter 0.15s linear;
  -webkit-user-drag: none;
}
.loadout .wicon { width: 30px; height: 15px; }
.loadout .wicon.secondary { width: 22px; }
.loadout .wicon.nade { width: 13px; height: 16px; }
.loadout .wicon.active { filter: brightness(0.95); }

.settings-panel { flex: 0 0 auto; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--row);
  gap: 10px;
}
.row-label { color: var(--text-dim); }
.row:hover .row-label { color: var(--text); }

.slider {
  position: relative;
  width: 120px; height: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  touch-action: none;
}
.slider-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent);
  pointer-events: none; }

.checkbox {
  position: relative;
  width: 16px; height: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s linear;
}
.checkbox:hover { border-color: var(--accent); }
.checkbox::after {
  content: "";
  position: absolute;
  left: 5px; top: 1px;
  width: 4px; height: 8px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  opacity: 0;
  transition: opacity 0.12s linear;
}
.checkbox.checked { background: var(--accent); border-color: var(--accent); }
.checkbox.checked::after { opacity: 1; }

.combo {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 130px;
  height: 22px;
  padding: 0 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s linear;
}
.combo:hover { border-color: var(--accent); }
.combo-value { color: var(--text); font-size: 13px; white-space: nowrap; }
.combo-caret {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-dim);
}
.combo:hover .combo-caret { border-top-color: var(--accent); }

.combo-pop {
  position: fixed;
  z-index: 50;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 4px;
  max-height: 260px;
  overflow: auto;
}
.combo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 9px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s linear, color 0.12s linear;
}
.combo-item:hover { background: rgba(120, 150, 230, 0.08); color: var(--text); }
.combo-item.sel { color: var(--accent); }
.combo-side { font-size: 10px; font-weight: 600; color: var(--text-dim); }

@media (max-width: 760px) {
  .board { flex-direction: column; height: auto; }
  .sidebar { flex: 0 0 auto; }
}
