:root {
  --bg: #0b0c0e;
  --panel: #121317;
  --panel-2: #16181c;
  --line: #23252b;
  --line-soft: #1a1c20;
  --border: #33363d;
  --text: #e4e5e8;
  --muted: #9a9da5;
  --dim: #6b6e76;
  --red: #e0202b;
  --red-hover: #f0303b;
  --red-text: #ff6b73;
  --gold: #d3a54a;
  --green: #3ba55d;
  --orange: #f0832a;

  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --display: "Inter", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

a {
  color: var(--text);
}

a:hover {
  color: var(--red-text);
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--red-text);
  outline-offset: 2px;
}

.loading {
  padding: 40px;
  color: var(--dim);
}

.stripe {
  height: 6px;
  background: repeating-linear-gradient(45deg, var(--red) 0 9px, transparent 9px 18px);
  opacity: 0.9;
}

.logo {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--text);
  text-decoration: none;
}

.logo span {
  color: var(--red);
}

.note {
  color: var(--dim);
  font-size: 12px;
}

/* ---- header / footer ---- */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--muted);
}

.crumbs b {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text);
}

.me {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}

.me img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding: 0 28px 32px;
  font-size: 12px;
  color: var(--dim);
}

/* ---- buttons & inputs ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: transparent;
  color: #c7c9ce;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  border-color: #4a4d55;
  color: var(--text);
}

.btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.btn.red {
  border-color: rgba(224, 32, 43, 0.55);
  color: var(--red-text);
}

.btn.red:hover:not(:disabled) {
  background: rgba(224, 32, 43, 0.12);
  color: #ff8a90;
}

.btn.solid {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn.solid:hover:not(:disabled) {
  background: var(--red-hover);
  color: #fff;
}

.btn.big {
  min-height: 46px;
  padding: 0 22px;
  font-size: 13px;
  letter-spacing: 1.4px;
}

.link {
  padding: 6px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.link:hover {
  color: var(--text);
}

.input {
  flex: 1 1 220px;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
}

.input:focus {
  border-color: #555963;
  outline: none;
}

select.input {
  flex: 0 0 auto;
  height: 36px;
}

.code-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.code-form .input {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.inline-form .btn {
  min-height: 36px;
}

/* ---- layout ---- */

.page {
  padding: 24px 28px 60px;
}

.label-heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--muted);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--muted);
}

.card-body {
  padding: 18px;
}

.empty {
  padding: 28px 18px;
  text-align: center;
  color: var(--dim);
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: start;
}

.two-col > * {
  min-width: 0;
}

.stack {
  display: grid;
  gap: 20px;
}

.card-body.stack {
  gap: 14px;
}

.banner {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 13px;
}

.banner.warn {
  border-color: rgba(211, 165, 74, 0.35);
  background: rgba(211, 165, 74, 0.08);
  color: #e9c983;
}

.banner.off {
  border-color: var(--line);
  background: var(--panel-2);
  color: var(--muted);
}

/* ---- server list ---- */

.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}

.no-servers {
  margin-bottom: 36px;
}

.server-card {
  display: block;
  padding: 18px;
  text-decoration: none;
  transition: border-color 0.15s;
}

.server-card:hover {
  border-color: #3a3d45;
  color: var(--text);
}

.server-card h4 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
}

.server-card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.status.live {
  color: var(--green);
}

.status.live::before {
  box-shadow: 0 0 8px var(--green);
}

.status.idle {
  color: var(--gold);
}

.status.off {
  color: var(--dim);
}

.link-server {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.link-server ol {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.link-server li {
  margin-bottom: 8px;
}

.link-server li b {
  font-weight: 600;
  color: var(--text);
}

.link-server .label {
  display: block;
  margin-bottom: 8px;
}

/* ---- server page ---- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 26px;
  padding: 0 28px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0 14px;
  border: 0;
  background: none;
  color: var(--dim);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  cursor: pointer;
}

.tab:hover {
  color: var(--muted);
}

.tab.on {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--red);
}

.count {
  padding: 1px 7px;
  border-radius: 9px;
  background: #262830;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.tab.on .count {
  background: rgba(224, 32, 43, 0.18);
  color: var(--red-text);
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
}

.status-bar b {
  font-weight: 600;
  color: var(--text);
}

.status-bar .punishment {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-align: left;
  white-space: nowrap;
}

td {
  height: 52px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover td {
  background: #15171b;
}

tr.selected td {
  background: #17191e;
}

tr.selected td:first-child {
  box-shadow: inset 3px 0 0 var(--red);
}

td.actions {
  text-align: right;
  white-space: nowrap;
}

td.actions .btn {
  margin-left: 6px;
}

.player {
  font-weight: 600;
  white-space: nowrap;
}

.steamid {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dim);
}

.num {
  font-variant-numeric: tabular-nums;
}

.hot {
  font-weight: 600;
  color: var(--red-text);
}

.chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
}

.chip.host { color: var(--green); background: rgba(59, 165, 93, 0.12); }
.chip.checked { color: var(--muted); background: #1f2126; }
.chip.exempt,
.chip.role { color: var(--gold); background: rgba(211, 165, 74, 0.12); }
.chip.guest { color: #8fb3e8; background: rgba(110, 150, 220, 0.12); }
.chip.dev { margin-left: 8px; color: #fff; background: var(--red); }

.outcome {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
}

.outcome.LOGGED { color: var(--dim); }
.outcome.BLOCKED { color: var(--gold); }
.outcome.KICKED { color: var(--orange); }
.outcome.BANNED { color: var(--red-text); }

.player-detail h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.player-detail .sub {
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
}

.entry {
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
}

.entry:first-child {
  border-top: 0;
}

.when {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}

.feed-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: baseline;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.feed-row.activity {
  grid-template-columns: 120px minmax(0, 1fr) auto;
}

.feed-row .who {
  font-weight: 600;
}

.feed-row .what {
  font-size: 13px;
  color: var(--muted);
}

details.warned {
  border-bottom: 1px solid var(--line-soft);
}

details.warned summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 110px 100px auto;
  gap: 12px;
  align-items: center;
  padding: 12px 18px;
  list-style: none;
  cursor: pointer;
}

details.warned summary::-webkit-details-marker {
  display: none;
}

details.warned[open] summary {
  background: #15171b;
}

details.warned .history {
  padding: 4px 18px 14px 32px;
}

/* ---- settings tab ---- */

.settings {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.settings > * {
  min-width: 0;
}

.settings-nav {
  padding: 10px 0;
  border-right: 1px solid var(--line);
}

.settings-nav .group {
  padding: 12px 18px 5px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.cat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 18px;
  border: 0;
  background: none;
  color: #a8aab0;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.cat:hover {
  color: var(--text);
}

.cat.on {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: inset 3px 0 0 var(--red);
  color: var(--text);
}

.tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
}

.tag.CUSTOM { color: #e07b73; }
.tag.DEFAULTS { color: var(--dim); }
.tag.DISABLED { color: #4a4d55; }

.settings-main {
  padding: 20px 24px;
}

.settings-main h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 1px;
}

.settings-main .desc {
  margin: 6px 0 10px;
  font-size: 13px;
  color: var(--dim);
}

.settings-main .banner {
  margin-top: 10px;
}

.subhead {
  margin: 22px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.setting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.setting .label {
  flex: 1 1 260px;
  min-width: 0;
}

.setting .name {
  font-weight: 500;
}

.setting .help {
  margin-top: 2px;
  font-size: 12px;
  color: var(--dim);
}

.setting .lock {
  margin-top: 3px;
  font-size: 12px;
  color: var(--gold);
}

.setting.locked .name {
  color: var(--dim);
}

.setting .control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.opt {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.02);
  color: #a8aab0;
  font-size: 12px;
  cursor: pointer;
}

.opt:hover:not(:disabled) {
  border-color: #4a4d55;
  color: var(--text);
}

.opt.on {
  border-color: rgba(224, 32, 43, 0.75);
  background: rgba(224, 32, 43, 0.22);
  color: #ffd2d4;
}

.opt:disabled {
  opacity: 0.45;
  cursor: default;
}

.range {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range input {
  width: min(240px, 55vw);
  accent-color: var(--red);
}

.range .value {
  width: 54px;
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.text-setting {
  width: min(300px, 100%);
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
}

/* ---- staff tab ---- */

.staff-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.staff-row img,
.staff-row .avatar {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  background: #22242a;
}

.staff-row .who {
  flex: 1 1 200px;
  min-width: 0;
}

.add-staff {
  border-top: 1px solid var(--line);
}

.levels {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted);
}

.levels li {
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
}

.levels b {
  display: inline-block;
  width: 92px;
  color: var(--text);
}

.levels-note {
  margin: 12px 0 0;
}

/* ---- toast & dialogs ---- */

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #1d1f24;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.2s;
}

#toast.show {
  opacity: 1;
}

#toast.error {
  border-color: rgba(224, 32, 43, 0.6);
  color: #ffc9cc;
}

dialog {
  width: calc(100vw - 32px);
  max-width: 440px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

dialog h3 {
  margin: 0 0 8px;
}

dialog p {
  margin: 0 0 18px;
  color: var(--muted);
}

dialog .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

/* ---- sign in ---- */

/* sizes are tied to the window height so the whole thing fits on a laptop screen without scrolling */
.signin {
  display: flex;
  align-items: center;
  min-height: calc(100vh - 6px);
  min-height: calc(100dvh - 6px);
  background:
    linear-gradient(90deg, var(--bg) 0%, rgba(10, 10, 11, 0.88) 42%, rgba(10, 10, 11, 0.3)),
    url("/img/login-art.jpg") 70% 30% / cover no-repeat;
  background-color: var(--bg);
}

.signin-wrap {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(16px, 3.6vh, 60px) 40px;
}

.signin-col {
  max-width: 520px;
}

.signin .logo {
  display: block;
  width: max-content;
  margin-bottom: clamp(12px, 3.4vh, 44px);
  font-size: clamp(26px, 3.6vh, 34px);
}

.secure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(10px, 2.2vh, 22px);
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--muted);
}

.secure svg,
.secure b {
  color: var(--green);
}

.secure b,
.secure strong {
  font-weight: 600;
}

.secure strong {
  color: var(--text);
}

.secure .sep {
  color: #55534f;
}

.signin h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(36px, 6.4vh, 64px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -1px;
  text-transform: uppercase;
  text-wrap: balance;
  color: #f6f5f2;
}

.signin-lead {
  max-width: 460px;
  margin: clamp(8px, 1.7vh, 16px) 0 clamp(14px, 3.1vh, 30px);
  font-size: clamp(15px, 1.8vh, 17px);
  line-height: 1.55;
  color: #b9b7b0;
}

.signin .banner,
.signin .code-form {
  max-width: 460px;
}

.signin .banner {
  margin-bottom: 16px;
}

.steam-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: clamp(46px, 6vh, 58px);
  padding: 0 26px;
  background: var(--red);
  box-shadow: 0 10px 30px rgba(224, 32, 43, 0.25);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-decoration: none;
  transition: background 0.15s;
}

.steam-btn:hover {
  background: var(--red-hover);
  color: #fff;
}

.signin-points {
  max-width: 460px;
  margin: clamp(14px, 3vh, 30px) 0 0;
  padding: 0;
  list-style: none;
}

.signin-points li {
  display: flex;
  gap: 16px;
  padding: clamp(7px, 1.5vh, 16px) 0;
  border-top: 1px solid var(--line);
  color: var(--red);
}

.signin-points svg {
  flex: 0 0 22px;
  margin-top: 1px;
}

.signin-points b {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  color: #f3f3f5;
}

.signin-points span {
  font-size: clamp(13px, 1.5vh, 14px);
  line-height: 1.5;
  color: var(--muted);
}

.signin-legal {
  margin: clamp(10px, 2.4vh, 24px) 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--dim);
}

.signin-legal a {
  color: var(--muted);
}

/* ---- privacy page ---- */

.privacy {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 28px 80px;
}

.privacy h1 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
}

.privacy h2 {
  margin: 36px 0 10px;
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red-text);
}

.privacy p,
.privacy li {
  font-size: 15px;
  line-height: 1.7;
  color: #c9c7c1;
}

.privacy .lead {
  margin: 0 0 36px;
  font-size: 17px;
  color: var(--muted);
}

.privacy ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.privacy li {
  margin-bottom: 6px;
}

.privacy b {
  color: var(--text);
}

.privacy code {
  padding: 1px 6px;
  border-radius: 3px;
  background: #1a1b1f;
  font-family: var(--mono);
  font-size: 13px;
}

.privacy .small {
  margin-top: 40px;
  font-size: 13px;
  color: var(--dim);
}

/* ---- smaller screens ---- */

@media (max-width: 1100px) {
  .two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .settings {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-nav {
    display: flex;
    flex-wrap: wrap;
    padding: 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .settings-nav .group {
    display: none;
  }

  .cat {
    width: auto;
  }
}

@media (max-width: 760px) {
  .link-server {
    grid-template-columns: minmax(0, 1fr);
  }

  .signin {
    align-items: flex-start;
    background:
      linear-gradient(180deg, rgba(10, 10, 11, 0.55), var(--bg) 340px),
      url("/img/login-art.jpg") 62% top / auto 420px no-repeat;
    background-color: var(--bg);
  }

  .signin-wrap {
    padding: 36px 20px 48px;
  }

  .signin .logo {
    margin-bottom: 28px;
    font-size: 28px;
  }

  .signin h1 {
    font-size: 46px;
  }

  .steam-btn {
    display: flex;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 18px 16px 48px;
  }

  .top,
  .tabs,
  .status-bar {
    padding-left: 16px;
    padding-right: 16px;
  }

  details.warned summary {
    grid-template-columns: 1fr auto;
  }
}

/* short laptop windows: keep the headings, drop the small print */
@media (min-width: 761px) and (max-height: 600px) {
  .signin-points span {
    display: none;
  }

  .signin-points li {
    padding: 7px 0;
  }
}
