:root {
  color-scheme: dark;
  --bg: #10150f;
  --panel: #172016;
  --text: #f4f0e6;
  --muted: #c8c0ae;
  --green: #55b86b;
  --gold: #d8a846;
  --red: #c95b4d;
  --blue: #5ca8d6;
  --line: rgba(244, 240, 230, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.page {
  min-height: 100vh;
}

.hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: flex-end;
  padding: clamp(28px, 5vw, 72px);
  background:
    linear-gradient(135deg, rgba(16, 21, 15, 0.98), rgba(23, 32, 22, 0.92) 52%, rgba(10, 15, 10, 0.98)),
    radial-gradient(circle at 78% 20%, rgba(216, 168, 70, 0.18), transparent 32%),
    radial-gradient(circle at 88% 70%, rgba(85, 184, 107, 0.16), transparent 34%);
  overflow: hidden;
}

.hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 9, 7, 0.42), rgba(7, 9, 7, 0.18) 52%, rgba(7, 9, 7, 0.04)),
    linear-gradient(0deg, rgba(16, 21, 15, 0.78), rgba(16, 21, 15, 0.08) 46%);
}

.hero__content {
  position: relative;
  width: min(760px, 100%);
  padding-bottom: 4vh;
}

.server-logo {
  display: block;
  width: 104px;
  max-width: 28vw;
  height: 104px;
  aspect-ratio: 1;
  margin-bottom: 18px;
  border: 1px solid rgba(244, 240, 230, 0.28);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.36);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 20px;
  font-size: clamp(42px, 8vw, 88px);
  line-height: 0.96;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.08;
}

.lead {
  max-width: 680px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.48;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
}

.button:hover {
  border-color: rgba(244, 240, 230, 0.38);
  background: rgba(255, 255, 255, 0.13);
}

.button--primary {
  border-color: rgba(85, 184, 107, 0.88);
  background: var(--green);
  color: #071006;
}

.button--primary:hover {
  background: #68ce80;
}

.facts {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-width: 860px;
  margin: 0;
}

.facts div,
.section article,
.donate,
.online-card,
.leaderboard {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 32, 22, 0.86);
}

.facts div {
  padding: 14px 16px;
}

.facts dt {
  color: var(--muted);
  font-size: 13px;
}

.facts dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.section {
  padding: clamp(32px, 6vw, 72px) clamp(20px, 5vw, 72px);
}

.section__inner {
  width: min(1120px, 100%);
  margin: 0 auto;
}

.section--features .section__inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.section article {
  padding: 24px;
}

.section article p,
.donate p {
  color: var(--muted);
  line-height: 1.58;
}

.section--stats {
  padding-bottom: 0;
}

.stats {
  display: grid;
  gap: 18px;
}

.stats__summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(2, minmax(220px, 320px));
  gap: 16px;
  align-items: stretch;
}

.online-card {
  display: grid;
  gap: 6px;
  padding: 20px;
}

.online-card__label,
.online-card span:last-child {
  color: var(--muted);
  font-size: 14px;
}

.online-card strong {
  color: var(--green);
  font-size: 42px;
  line-height: 1;
}

.chart {
  min-height: 154px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 13, 9, 0.46);
}

.chart__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 14px;
}

.chart__head span:first-child {
  color: var(--text);
  font-weight: 900;
}

.chart__bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(4px, 1fr));
  align-items: end;
  gap: 5px;
  height: 96px;
}

.chart__bar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--gold), var(--green));
}

.chart__bar-value {
  position: absolute;
  top: 6px;
  color: rgba(7, 16, 6, 0.9);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(244, 240, 230, 0.25);
}

.leaderboards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.leaderboard {
  padding: 20px;
}

.leaderboard h3 {
  margin: 0 0 14px;
  font-size: 19px;
}

.leaderboard__rows {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.leaderboard__row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) minmax(72px, auto);
  gap: 12px;
  align-items: center;
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
}

.leaderboard__player {
  display: grid;
  gap: 2px;
  overflow: hidden;
  color: var(--text);
  min-width: 0;
}

.leaderboard__name {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard__group {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}

.leaderboard__group--owner,
.leaderboard__group--admin {
  background: rgba(231, 187, 98, 0.18);
  color: #f0cd7e;
}

.leaderboard__group--king,
.leaderboard__group--duke,
.leaderboard__group--paladin,
.leaderboard__group--lord,
.leaderboard__group--knight {
  background: rgba(85, 184, 107, 0.18);
  color: #8be59e;
}

.leaderboard__rank {
  color: var(--gold);
  font-weight: 900;
}

.leaderboard__value {
  color: var(--green);
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.icon {
  display: inline-flex;
  margin-bottom: 28px;
  color: var(--gold);
  font-weight: 900;
}

.section--donate {
  padding-top: 0;
}

.donate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(24px, 4vw, 40px);
}

.donate p {
  max-width: 720px;
  margin-bottom: 0;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(360px, calc(100vw - 40px));
  padding: 14px 18px;
  border: 1px solid rgba(85, 184, 107, 0.5);
  border-radius: 8px;
  background: rgba(10, 15, 10, 0.96);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast[hidden] {
  display: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  padding: 28px clamp(20px, 5vw, 72px);
  border-top: 1px solid var(--line);
  background: #0b100a;
}

.site-footer__inner {
  display: flex;
  width: min(1120px, 100%);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin: 0 auto;
  padding: 0;
}

.site-footer__brand {
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
}

.site-footer__links a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.site-footer__links a:hover {
  color: var(--text);
}

.site-footer__note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.legal-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 28px;
}

.legal-links a {
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.legal-links a span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.legal-page {
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(16, 21, 15, 0.98), rgba(23, 32, 22, 0.94) 48%, rgba(10, 15, 10, 0.98)),
    radial-gradient(circle at 82% 12%, rgba(216, 168, 70, 0.14), transparent 30%),
    radial-gradient(circle at 10% 76%, rgba(85, 184, 107, 0.12), transparent 34%);
}

.legal-hero {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 5vw, 72px) 24px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 34px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

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

.legal-hero h1 {
  max-width: 900px;
  margin-bottom: 14px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
}

.legal-hero__meta {
  color: var(--muted);
  font-size: 16px;
}

.legal-document {
  width: min(980px, calc(100% - 40px));
  margin: 0 auto clamp(36px, 6vw, 72px);
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 32, 22, 0.84);
}

.legal-document h2,
.legal-document h3 {
  margin: 34px 0 12px;
  line-height: 1.16;
}

.legal-document h2:first-child,
.legal-document h3:first-child {
  margin-top: 0;
}

.legal-document p,
.legal-document li {
  color: var(--muted);
  line-height: 1.7;
}

.legal-document p {
  margin: 0 0 14px;
}

.legal-document ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

.legal-document hr {
  height: 1px;
  margin: 28px 0;
  border: 0;
  background: var(--line);
}

@media (max-width: 760px) {
  .hero {
    min-height: 84vh;
    padding: 24px 18px;
  }

  .actions,
  .donate {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .facts,
  .section--features .section__inner,
  .stats__summary,
  .leaderboards {
    grid-template-columns: 1fr;
  }

  .server-logo {
    width: 82px;
    height: 82px;
  }

  .chart__bars {
    grid-template-columns: repeat(12, minmax(5px, 1fr));
  }

  .chart__bar:nth-child(-n+12) {
    display: none;
  }

  .site-footer__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .legal-links {
    grid-template-columns: 1fr;
  }
}
