:root {
  --purple: #8b5cf6;
  --pink: #ec4899;
  --black: #050509;
  --blue: #38bdf8;
  --cyan: #42b8b0;
  --green: #4ca154;
  --amber: #d19934;
  --danger: #c75a67;
  --surface: #111114;
  --surface-soft: #18181d;
  --surface-strong: #222229;
  --text: #ececf1;
  --muted: #aaaab5;
  --border: rgba(255, 255, 255, .14);
  --shadow: 0 8px 20px rgba(0, 0, 0, .24);
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(139, 92, 246, .08), transparent 220px),
    linear-gradient(135deg, rgba(56, 189, 248, .08), transparent 360px),
    #08080b;
  color: var(--text);
}

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

.text-link {
  color: #8fc5f0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

button {
  cursor: pointer;
}

img {
  max-width: 100%;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 12, .96);
}

.nav {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #24242b;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(236, 72, 153, .28);
}

.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link,
.drop-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #bebec8;
  background: transparent;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}

.nav-link:hover,
.drop-button:hover,
.nav-link.active {
  color: var(--text);
  border-color: var(--border);
  background: #18181e;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(640px, calc(100vw - 32px));
  max-height: 68vh;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 16, 24, .98);
  box-shadow: var(--shadow);
  display: none;
}

.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu {
  display: block;
}

.dropdown-section-title {
  margin: 2px 4px 10px;
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.tag-link,
.pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 5px;
  border: 1px solid var(--border);
  color: #d9d9e2;
  background: #1b1b21;
  font-size: .86rem;
}

.tag-link:hover {
  border-color: rgba(49, 149, 216, .55);
  background: #202630;
}

.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .06);
}

main {
  flex: 1;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 54px;
}

.hero-band {
  min-height: 260px;
  display: grid;
  align-items: center;
  padding: 34px 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #9ea4b8;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.hero-title {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.15rem, 5vw, 4.25rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-title span {
  color: inherit;
  background: none;
}

.hero-copy {
  max-width: 610px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.hero-actions,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: #1b1b21;
  font-weight: 750;
}

.button:hover {
  background: #24242c;
}

.button.primary {
  border-color: rgba(236, 72, 153, .58);
  background: linear-gradient(135deg, #7c3aed, #db2777);
}

.button.blue {
  border-color: rgba(56, 189, 248, .58);
  background: #2488c7;
  color: #fff;
}

.button.ghost {
  color: var(--muted);
}

.button.danger {
  border-color: rgba(251, 113, 133, .45);
  background: rgba(251, 113, 133, .12);
  color: #ffd0d8;
}

.button.icon {
  width: 40px;
  min-height: 40px;
  padding: 0;
}

.section {
  padding: 24px 0 12px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.section-title {
  margin: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.85rem);
}

.section-copy {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 220px) minmax(150px, 220px);
  gap: 10px;
  margin-bottom: 18px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: #17171c;
  outline: none;
}

.input,
.select {
  padding: 0 12px;
}

.textarea {
  min-height: 150px;
  padding: 12px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(49, 149, 216, .7);
  box-shadow: 0 0 0 2px rgba(49, 149, 216, .16);
}

.server-list {
  display: grid;
  gap: 12px;
}

.server-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px 214px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #121217;
  box-shadow: none;
}

.server-card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.above-link {
  position: relative;
  z-index: 2;
}

.server-card.sponsored {
  border-color: rgba(139, 92, 246, .88);
  box-shadow: inset 3px 0 0 rgba(236, 72, 153, .82);
  background:
    linear-gradient(90deg, rgba(139, 92, 246, .16), transparent 50%),
    #121217;
}

.rank {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: var(--text);
  background: #1c1c22;
  border: 1px solid var(--border);
  font-weight: 800;
}

.rank .star {
  color: var(--pink);
  margin-right: 2px;
}

.banner {
  width: 214px;
  aspect-ratio: 468 / 60;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .18);
  background-color: #15151f;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

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

.server-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-size: 1rem;
}

.server-ip {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .92rem;
  word-break: break-word;
}

.server-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--danger);
}

.dot.online {
  background: var(--green);
  box-shadow: none;
}

.stats {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 150px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
}

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

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #121217;
  padding: 18px;
  box-shadow: none;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #17171d;
}

.client-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.client-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.client-image {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #1b1b21 center / cover no-repeat;
  color: var(--muted);
  font-weight: 800;
}

.client-image.placeholder {
  padding: 18px;
  text-align: center;
}

.description-text.compact {
  max-height: 11rem;
  overflow: auto;
}

.admin-client-panel {
  display: grid;
  gap: 18px;
}

.admin-client-list {
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.client-form {
  padding-top: 2px;
}

.client-admin-row {
  grid-template-columns: 44px minmax(0, 1fr) auto;
}

.client-logo {
  width: 92px;
  height: 92px;
  border-radius: 5px;
  background-size: cover;
  background-repeat: no-repeat;
  box-shadow: none;
}

.form {
  display: grid;
  gap: 14px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field label,
.check-row {
  color: #d9dbeb;
  font-size: .92rem;
  font-weight: 750;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-choice {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  background: #17171d;
  padding: 0 11px;
}

.tag-choice.selected {
  color: #fff;
  border-color: rgba(49, 149, 216, .7);
  background: #1e3244;
}

.dashboard-list {
  display: grid;
  gap: 12px;
}

.dash-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.notice {
  border: 1px solid rgba(49, 149, 216, .35);
  border-radius: 5px;
  background: #111923;
  color: #d9f5ff;
  padding: 13px 14px;
}

.empty-state {
  width: 100%;
  padding: 22px;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 5px;
  background: #101014;
  text-align: left;
}

.empty-state h2 {
  margin: 0;
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
}

.empty-state p {
  margin: 8px 0 16px;
  max-width: 520px;
  color: var(--muted);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 360px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.info-panel,
.detail-card {
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #121217;
  color: var(--text);
  box-shadow: none;
  overflow: hidden;
}

.info-panel h1 {
  margin: 0;
  padding: 16px 14px;
  background:
    linear-gradient(90deg, rgba(139, 92, 246, .2), transparent),
    #1c1c22;
  color: #fff;
  font-size: 1.05rem;
}

.info-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  min-height: 42px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.info-row strong,
.info-row span {
  min-width: 0;
  padding: 10px;
}

.info-row > span {
  overflow-wrap: anywhere;
}

.info-row strong {
  border-right: 1px solid rgba(255, 255, 255, .08);
  color: #d9d9e2;
}

.info-row a {
  color: #8fc5f0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.status.inline {
  color: #75d17c;
  font-weight: 800;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  background: #1c1c22;
  border-bottom: 1px solid var(--border);
}

.tab {
  min-height: 48px;
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, .08);
  padding: 0 16px;
  color: #d9d9e2;
  background: transparent;
  font-weight: 750;
}

.tab.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, .95), rgba(56, 189, 248, .75));
  color: #fff;
}

.detail-body {
  padding: clamp(20px, 4vw, 34px);
  line-height: 1.65;
}

.detail-tab-panel {
  display: none;
}

.detail-tab-panel.active {
  display: block;
}

.detail-heading {
  margin: 0 0 18px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.detail-banner {
  width: min(468px, 100%);
  aspect-ratio: 468 / 60;
  margin: 0;
  border: 1px solid var(--border);
  background: #1b1b21 center / cover no-repeat;
}

.server-showcase {
  display: grid;
  grid-template-columns: minmax(240px, 468px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid rgba(139, 92, 246, .28);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(139, 92, 246, .16), rgba(56, 189, 248, .06)),
    #0f0f14;
}

.server-showcase h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.server-showcase p {
  margin: 0 0 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.quick-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.mini-stat {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #17171d;
}

.mini-stat strong {
  display: block;
  font-size: 1.7rem;
}

.mini-stat span {
  color: var(--muted);
}

.vote-wide {
  width: 100%;
  margin: 24px auto 0;
  background: linear-gradient(135deg, #24923a, #38bdf8);
  border-color: rgba(56, 189, 248, .5);
  font-size: 1.05rem;
}

.description-text {
  margin: 0;
  color: #e0e0e8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.description-card {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #101016;
  padding: 18px;
}

.description-card h3 {
  margin: 0 0 12px;
}

.copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  width: 100%;
}

.copy-row > span {
  min-width: 0;
  flex: 1 1 100%;
  padding: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.mini-button {
  min-height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  background: rgba(139, 92, 246, .16);
  padding: 0 8px;
}

.chart-box {
  margin: 14px 0 18px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #0f0f13;
  padding: 12px;
}

.chart-box svg {
  display: block;
  width: 100%;
  color: #8fc5f0;
}

.chart-grid line {
  stroke: rgba(255, 255, 255, .13);
  stroke-width: 1;
}

.chart-bars rect {
  fill: #6f82ad;
}

.chart-labels {
  fill: var(--muted);
  font-size: 12px;
}

.metric-select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #17171d;
  color: var(--text);
  padding: 9px 12px;
}

.generated-banner {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #1b1b21 center / cover no-repeat;
}

.generated-banner strong,
.generated-banner span {
  display: block;
  text-shadow: 0 1px 2px #000;
}

.generated-banner strong {
  font-size: 1.25rem;
}

.generated-banner-stats {
  text-align: right;
}

.banner-field {
  margin-top: 12px;
}

.code-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.trailer-frame {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 5px;
  overflow: hidden;
  background: #0f0f13;
}

.trailer-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.detail-note {
  color: var(--muted);
}

.vote-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 18px;
  align-items: start;
}

.leaderboard {
  display: grid;
  gap: 8px;
}

.leader-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #17171d;
}

.danger-zone {
  border-color: rgba(251, 113, 133, .34);
  background: rgba(251, 113, 133, .08);
}

.hidden {
  display: none !important;
}

.footer {
  border-top: 1px solid var(--border);
  background: #08080a;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
  line-height: 1.5;
}

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

.footer-links {
  display: flex;
  gap: 14px;
  white-space: nowrap;
}

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

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #151520;
  color: var(--text);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .mobile-toggle {
    display: inline-grid;
    place-items: center;
    margin-left: auto;
  }

  .nav {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .nav-links {
    width: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    margin-left: 0;
  }

  .nav.open .nav-links {
    display: flex;
  }

  .dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 8px;
  }

  .toolbar,
  .detail-layout,
  .vote-layout,
  .form-grid,
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }

  .server-showcase,
  .quick-stats {
    grid-template-columns: 1fr;
  }

  .server-card {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .banner,
  .stats {
    grid-column: 2;
  }

  .stats {
    justify-items: start;
    grid-template-columns: repeat(3, auto);
    align-items: center;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 520px) {
  .page {
    width: min(100% - 22px, 1180px);
    padding-top: 20px;
  }

  .hero-band {
    min-height: 250px;
    padding-top: 28px;
  }

  .server-card {
    grid-template-columns: 1fr;
  }

  .rank,
  .banner,
  .stats {
    grid-column: auto;
  }

  .banner {
    width: 100%;
  }

  .dash-item {
    grid-template-columns: 1fr;
  }
}
