:root {
  --bg: #f5f6f7;
  --card: #ffffff;
  --text: #16191d;
  --muted: #5f6873;
  --border: #e2e5e9;
  --border-dark: #c9ced4;
  --orange: #e8590c;
  --bar-empty: #e4e7eb;
  --red: #c92a2a;
  --yellow: #d39e00;
  --green: #2b8a3e;
  --blue: rgba(48, 140, 235, 0.04);
  --blue-border: rgba(48, 140, 235, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121416;
    --card: #181b1e;
    --text: #eceef0;
    --muted: #949ca5;
    --border: #262a2f;
    --border-dark: #353a40;
    --orange: #ff7a2e;
    --bar-empty: #2b3036;
    --red: #ff6b6b;
    --yellow: #f2c94c;
    --green: #51cf66;
    --blue: rgba(60, 150, 245, 0.04);
    --blue-border: rgba(60, 150, 245, 0.08);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Archivo", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  width: 100%;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.1;
  background: url("images/bg.webp") center / cover no-repeat;
}

a {
  color: inherit;
}

.container {
  max-width: 1680px;
  margin: 0 auto;
  padding: 0 40px;
}

.box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.small-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.mono {
  font-family: "JetBrains Mono", Consolas, monospace;
}

.right {
  text-align: right;
}

.top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 40px 0 28px;
}

.top h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -1px;
}

.top p {
  margin: 12px 0 0;
  max-width: 560px;
  color: var(--muted);
}

.last-checked {
  padding: 10px 16px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
}

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

.page {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 48px;
  align-items: start;
  padding-bottom: 56px;
}

.filters {
  position: sticky;
  top: 16px;
}

.filters summary {
  display: none;
}

.filter-groups {
  display: grid;
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 12px 14px;
}

.filter-group legend {
  float: left;
  padding: 0;
  margin-bottom: 6px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 14px;
  cursor: pointer;
}

.checkbox input {
  margin: 0;
  accent-color: var(--text);
}

.checkbox img {
  width: 21px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
}

.checkbox .count {
  margin-left: auto;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
}

.clear-btn {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
}

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

.server-list {
  min-width: 0;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px 24px;
  padding: 10px 16px;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 360px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}

.search img {
  width: 15px;
}

.search input {
  flex: 1;
  padding: 2px 0;
  border: none;
  outline: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}

.sort {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  font-size: 14px;
  color: var(--muted);
}

.sort button {
  padding: 2px 0;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

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

.sort button.active {
  color: var(--text);
  font-weight: 700;
  border-bottom-color: var(--orange);
}

.list-info {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 13px;
  color: var(--muted);
}

.list-header,
.server {
  display: grid;
  grid-template-columns: 40px 1fr 96px 96px 96px 96px 92px 52px 120px;
  gap: 0 20px;
  align-items: center;
}

.list-header {
  margin-bottom: 8px;
  padding: 10px 16px;
  font-size: 11px;
}

#servers {
  display: grid;
  gap: 8px;
}

.server {
  padding: 14px 16px;
  border: 1px solid var(--blue-border);
  border-radius: 10px;
  background: linear-gradient(100deg, var(--blue), transparent 35%), var(--card);
}

.server:hover {
  border-color: var(--border-dark);
}

.rank {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  color: var(--muted);
}

.name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.name > div {
  min-width: 0;
}

.icon {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bar-empty);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
}

.icon::before {
  content: attr(data-letter);
}

.icon img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--card);
}

.name h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 16px;
}

.name h3 a {
  text-decoration: none;
}

.name h3 a:hover {
  text-decoration: underline;
}

.name h3 img {
  width: 21px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
}

.name p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  word-break: break-word;
}

.name .website {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}

.stats {
  display: contents;
}

.stat-label {
  display: none;
}

.players {
  font-size: 14px;
}

.bars {
  display: flex;
  gap: 3px;
  margin-bottom: 4px;
}

.bars span {
  flex: 1;
  height: 5px;
  background: var(--bar-empty);
}

.low .on {
  background: var(--red);
}

.medium .on {
  background: var(--yellow);
}

.high .on {
  background: var(--green);
}

.level small {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.updates {
  font-size: 13px;
  white-space: nowrap;
}

.updates .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--green);
}

.updates.irregular .dot {
  background: var(--red);
}

.rating {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 16px;
  font-weight: 600;
  text-align: right;
}

.buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.star {
  padding: 4px 6px;
  border: none;
  background: none;
  color: var(--border-dark);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

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

.star.saved {
  color: var(--orange);
}

.play {
  padding: 7px 14px;
  border: 1.5px solid var(--text);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.play:hover {
  background: var(--text);
  color: var(--bg);
}

.no-results {
  padding: 40px 0;
  color: var(--muted);
}

.no-results b {
  display: block;
  color: var(--text);
}

.guide {
  padding: 8px 0 48px;
}

.guide h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
}

.guide > p {
  margin: 4px 0 18px;
  color: var(--muted);
}

.guide-boxes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  font-size: 14px;
  color: var(--muted);
}

.guide-boxes .box {
  padding: 20px 22px;
}

.guide h3 {
  margin: 0 0 12px;
}

.guide dl,
.guide ol,
.guide ul {
  margin: 0;
  padding: 0;
}

.guide dt {
  margin-top: 12px;
  font-weight: 700;
  color: var(--text);
}

.guide dt:first-child {
  margin-top: 0;
}

.guide dt span {
  margin-left: 6px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.guide dd {
  margin: 2px 0 0;
}

.guide .box p {
  margin: 14px 0 0;
}

.guide .criteria {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.guide .fine {
  font-size: 12px;
}

.weights {
  list-style: none;
}

.weights li {
  display: grid;
  grid-template-columns: 96px 1fr 36px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  color: var(--text);
}

.weights i {
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--text);
}

.weights b {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  text-align: right;
}

.tips {
  list-style: none;
  counter-reset: tip;
}

.tips li {
  position: relative;
  margin-bottom: 12px;
  padding-left: 22px;
  counter-increment: tip;
}

.tips li::before {
  content: counter(tip);
  position: absolute;
  left: 0;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
}

.tips b {
  display: block;
  color: var(--text);
}

footer {
  background: var(--card);
  border-top: 1px solid var(--border);
}

footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px 40px;
  padding-top: 26px;
  padding-bottom: 34px;
  font-size: 13px;
  color: var(--muted);
}

footer strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
  color: var(--text);
}

footer p {
  max-width: 560px;
  margin: 0;
}

footer p + p {
  margin-top: 8px;
}

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

.footer-links {
  display: flex;
  gap: 20px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}

.footer-links a {
  color: var(--text);
}

.crumbs {
  padding-top: 28px;
  font-size: 13px;
  color: var(--muted);
}

.crumbs a {
  color: var(--text);
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.server-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 0 28px;
}

.server-top h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1px;
}

.server-top h1 img {
  width: 30px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
}

.server-top p {
  margin: 4px 0 0;
  color: var(--muted);
}

.server-top .name {
  gap: 18px;
}

.icon.big {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  font-size: 26px;
}

.discord {
  padding: 7px 14px;
  border: 1.5px solid var(--border-dark);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

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

.server-page {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
  padding-bottom: 56px;
}

.server-main,
.server-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.server-stats {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  padding: 20px 22px;
  background: linear-gradient(100deg, var(--blue), transparent 35%), var(--card);
}

.server-stats .small-title {
  display: block;
  margin-bottom: 6px;
}

.server-stats .rating {
  font-size: 26px;
  line-height: 1.1;
  text-align: left;
}

.server-stats .rating .small-title {
  font-family: "Archivo", Arial, sans-serif;
  line-height: 1.5;
}

.server-stats .rating small {
  font-size: 13px;
  color: var(--muted);
}

.text-box {
  padding: 22px 26px;
}

.text-box h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 800;
}

.text-box p {
  max-width: 720px;
  margin: 0 0 10px;
  color: var(--muted);
}

.text-box p:last-child {
  margin-bottom: 0;
}

.features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
}

.text-box .warning {
  padding: 12px 14px;
  border-left: 3px solid var(--red);
  border-radius: 4px;
  background: color-mix(in srgb, var(--red) 7%, transparent);
  color: var(--text);
}

.text-box .lead {
  font-size: 16px;
  color: var(--text);
}

.text-box h3 {
  margin: 18px 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.feature-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.feature-list b {
  display: block;
  margin-bottom: 2px;
}

.feature-list p {
  margin: 0;
  font-size: 14px;
}

.timeline {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.timeline li:first-child {
  border-top: none;
}

.timeline span {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  line-height: 22px;
  color: var(--muted);
}

.timeline p {
  margin: 0;
  max-width: none;
}

.src,
.timeline a {
  font-size: 12px;
  color: var(--muted);
}

.facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 14px 0 0;
  font-size: 14px;
}

.facts dt {
  font-weight: 700;
}

.facts dd {
  margin: 0;
  color: var(--muted);
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.links a {
  display: block;
  padding: 4px 12px;
  border: 1px solid var(--border-dark);
  border-radius: 20px;
  font-size: 13px;
  text-decoration: none;
}

.links a:hover {
  border-color: var(--text);
}

.sources {
  padding: 0 4px;
  font-size: 13px;
  color: var(--muted);
}

.sources summary {
  cursor: pointer;
}

.sources ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.sources li {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.server-side .box {
  padding: 18px 20px;
}

.server-side h2 {
  margin: 0 0 12px;
}

.details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 14px;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.similar {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.similar a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.similar a:hover b {
  text-decoration: underline;
}

.similar .icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 13px;
}

.similar span:last-child {
  margin-left: auto;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  color: var(--muted);
}

.back {
  font-size: 14px;
  text-decoration: none;
  color: var(--muted);
}

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

@media (max-width: 1440px) {
  .list-header {
    display: none;
  }

  .server {
    grid-template-columns: 32px 1fr auto;
    grid-template-areas:
      "rank name buttons"
      ". stats stats";
    row-gap: 12px;
  }

  .rank {
    grid-area: rank;
    align-self: start;
    padding-top: 2px;
  }

  .name {
    grid-area: name;
  }

  .buttons {
    grid-area: buttons;
    align-self: start;
  }

  .stats {
    grid-area: stats;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
  }

  .stat-label {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
  }

  .rating {
    text-align: left;
  }

  .guide-boxes {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

  .server-stats {
    grid-template-columns: repeat(3, 1fr);
  }

  .feature-list {
    grid-template-columns: 1fr;
  }

  .timeline li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .server-top h1 {
    font-size: 30px;
  }

  .container {
    padding: 0 16px;
  }

  .top h1 {
    font-size: 32px;
  }

  .page {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .filters {
    position: static;
  }

  .filters summary {
    display: block;
    padding: 4px 0 12px;
    font-weight: 700;
    cursor: pointer;
  }

  .filter-groups {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .search {
    width: 100%;
  }

  .guide-boxes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
}
