:root {
  color-scheme: dark;
  --bg: #131313;
  --panel: #1f1f1f;
  --panel-soft: #272727;
  --line: #343434;
  --text: #f7f7f7;
  --muted: #9ba0a8;
  --orange: #f05a1a;
  --orange-strong: #ff6a22;
  --green: #4ade80;
  --red: #f87171;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

button,
input {
  font: inherit;
}

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

.primary-action,
.paypal-action,
.donate-button,
.vote-button {
  border: 0;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
}

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

h2 {
  margin-bottom: 0;
  font-size: clamp(25px, 3vw, 34px);
}

.server-voting-widget {
  background: var(--bg);
  padding: 1px 0 0;
}

.dashboard,
.history {
  width: min(1450px, calc(100% - 44px));
  margin: 0 auto;
  padding: 44px 0 0;
}

.toolbar,
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 32px;
}

.month-pill {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 18px;
  color: var(--muted);
}

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

.server-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 190px 260px;
  gap: 22px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #202020, #171717);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.rank {
  display: grid;
  place-items: center;
  background: #111;
  color: var(--orange-strong);
  font-size: 28px;
  font-weight: 800;
}

.server-main,
.server-side,
.donor-box {
  padding: 24px;
}

.server-main h3 {
  margin-bottom: 8px;
  font-size: 26px;
}

.server-description {
  min-height: 48px;
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.meta-row,
.money-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.meta-row {
  flex-wrap: wrap;
}

.status {
  border-radius: 999px;
  padding: 8px 12px;
  color: #151515;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.status.online {
  background: var(--green);
}

.status.offline {
  background: var(--red);
}

.votes {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.vote-button {
  padding: 12px 18px;
}

.server-side {
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.progress {
  height: 12px;
  margin: 16px 0 14px;
  border-radius: 999px;
  background: #0f0f0f;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffb16b);
}

.money-row {
  color: var(--muted);
  font-size: 14px;
}

.donate-button,
.primary-action,
.paypal-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  padding: 13px 16px;
}

.donate-button {
  margin-top: 18px;
}

.donor-box {
  min-width: 0;
}

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

.donor-list li,
.empty-donor {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #dfe1e4;
  font-size: 14px;
}

.donor-list span:last-child {
  color: var(--orange-strong);
  font-weight: 800;
}

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

.history {
  padding-bottom: 72px;
}

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

.history-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 24px;
}

.history-card h3 {
  margin-bottom: 18px;
}

.history-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.history-row strong {
  color: #fff;
}

.donation-dialog {
  width: min(440px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

.donation-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.donation-form {
  position: relative;
  display: grid;
  gap: 16px;
  padding: 28px;
}

.donation-form label {
  display: grid;
  gap: 8px;
  color: #d9dce0;
  font-weight: 700;
}

.donation-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #141414;
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

.donation-form input:focus {
  border-color: var(--orange);
}

.paypal-action {
  background: #ffc439;
  color: #111;
}

.icon-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #151515;
  color: #fff;
  cursor: pointer;
  font-size: 22px;
}

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

  .server-side,
  .donor-box {
    border-top: 1px solid var(--line);
    border-right: 0;
    border-left: 0;
  }

  .server-side {
    grid-column: 2;
  }

  .donor-box {
    grid-column: 2;
  }

  .history-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .toolbar,
  .section-heading,
  .meta-row {
    align-items: stretch;
    flex-direction: column;
  }

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

  .rank,
  .server-side,
  .donor-box {
    grid-column: auto;
  }

  .rank {
    min-height: 58px;
  }
}
