/* Homepage server cards: equal-height grid, region filters, visitor ping. */

.server-grid {
  display: grid;
  align-items: stretch;
}

.server-block {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  gap: 0;
}

.server-block > .server-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.server-card .sname,
.server-card .mapstrip,
.server-card .server-facts,
.server-card .server-card-badges,
.server-card .server-live-row,
.server-card .server-card-meta-line {
  flex: 0 0 auto;
}

.server-card .progress {
  display: none !important;
}

.server-card .server-id-copy,
.server-card .server-id-copy-label,
.server-card .server-players-badge,
.server-card .server-slot-badge {
  word-spacing: 0.16em;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.server-region-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

.server-region-filters button {
  appearance: none;
  border: 1px solid rgb(255 255 255 / 0.12);
  background: rgb(255 255 255 / 0.04);
  color: var(--mist-200, #e5e7eb);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 2px;
  cursor: pointer;
}

.server-region-filters button.is-active {
  border-color: rgb(242 169 0 / 0.55);
  color: #f2a900;
  background: rgb(242 169 0 / 0.08);
}

.server-card-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
}

.server-region-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mist-300, #d1d5db);
  border: 1px solid rgb(255 255 255 / 0.1);
  padding: 2px 7px;
  border-radius: 2px;
}

.server-ping {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #86efac;
}

.server-ping.is-mid { color: #fbbf24; }
.server-ping.is-high { color: #f87171; }

.server-ping-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgb(34 197 94 / 0.7);
  animation: server-ping-pulse 1.6s ease-out infinite;
}

@keyframes server-ping-pulse {
  0% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0.65); }
  70% { box-shadow: 0 0 0 8px rgb(34 197 94 / 0); }
  100% { box-shadow: 0 0 0 0 rgb(34 197 94 / 0); }
}

.server-facts {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 10px;
}

.server-fact {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: 0.01em;
  word-spacing: 0.12em;
  text-transform: none;
}

.server-fact-k {
  flex: 0 0 6.75em;
  color: var(--mist-400, #9ca3af);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.server-fact-sep {
  flex: 0 0 auto;
  color: var(--mist-500, #6b7280);
}

.server-fact-v {
  min-width: 0;
  color: var(--mist-100, #f3f4f6);
  text-transform: none;
  letter-spacing: 0.01em;
}

.server-fact-v b {
  color: var(--mist-100, #f3f4f6);
  font-weight: 600;
}

.server-fact .restart-est {
  margin-left: 0.35em;
  color: var(--mist-400, #9ca3af);
  font-weight: 400;
  font-size: 12px;
}

.server-card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}

.server-card .mapstrip span {
  display: none;
}

.server-card .mapstrip {
  position: relative;
}

.match-scores {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  pointer-events: none;
}

.match-score {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 2px 7px 2px 3px;
  border-radius: 3px;
  background: rgb(8 8 10 / 0.55);
  border: 1px solid rgb(255 255 255 / 0.1);
}

.match-score-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.7));
}

.match-score-n {
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
  text-shadow: 0 1px 4px rgb(0 0 0 / 0.75);
}

.match-score--lonestar .match-score-n { color: #7cc4f5; }
.match-score--valkyra .match-score-n { color: #ff8a7a; }
.match-score--manticore .match-score-n { color: #5ee98a; }

.server-card-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.server-buy-prio {
  margin: 0;
  padding: 0 8px;
  white-space: nowrap;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-color: rgb(242 169 0 / 0.5);
  background: rgb(242 169 0 / 0.16);
  color: #f2a900;
}

.server-buy-prio:hover,
.server-buy-prio:focus-visible {
  border-color: rgb(242 169 0 / 0.85);
  background: rgb(242 169 0 / 0.26);
  color: #ffd56a;
}

@media (max-width: 420px) {
  .server-card-top {
    align-items: flex-start;
  }
  .server-card-actions {
    width: 100%;
  }
}

.server-reserved-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgb(232 163 60 / 0.16);
  color: #e8a33c;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Public servers section tabs (leaderboard ↔ list) */
.ps-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}
.ps-tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid #2a2a30;
  background: #15151a;
  color: #c8c8ce;
  text-decoration: none;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.ps-tab:hover {
  border-color: rgba(232, 163, 60, 0.45);
  color: #f3f3f5;
}
.ps-tab.is-active {
  border-color: rgba(232, 163, 60, 0.65);
  background: rgba(232, 163, 60, 0.14);
  color: #e8a33c;
}

.shop-bar {
  display: none;
}
.shop-pitch {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.9fr);
  gap: 18px;
  align-items: stretch;
  margin: 0 0 18px;
  padding: 18px 20px;
  border: 1px solid rgba(232, 163, 60, 0.35);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(232,163,60,0.1), transparent 55%),
    #15151a;
}
@media (max-width: 800px) {
  .shop-pitch { grid-template-columns: 1fr; }
}
.shop-pitch-copy h2 {
  font-family: "Barlow Condensed", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 4px 0 8px;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  color: #fff;
}
.shop-pitch-copy .mist {
  margin: 0 0 14px;
  max-width: 38rem;
  line-height: 1.45;
}
.shop-pitch-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.shop-pitch-stat {
  padding: 12px 12px 10px;
  border-radius: 10px;
  border: 1px solid #2a2a30;
  background: rgba(0,0,0,.28);
}
.shop-pitch-stat strong {
  display: block;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  color: #e8a33c;
  line-height: 1.1;
}
.shop-pitch-stat span {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: #9ca3af;
  line-height: 1.25;
}
.shop-bar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.shop-coins strong {
  color: #e8a33c;
  font-variant-numeric: tabular-nums;
}
.shop-bar-note { margin: 0; font-size: 0.85rem; }
.shop-flash {
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #2a2a30;
}
.shop-flash.ok { border-color: rgba(112, 207, 145, 0.4); color: #70cf91; }
.shop-flash.err { border-color: rgba(220, 80, 80, 0.45); color: #f0a0a0; }

.server-card--add {
  width: 100%;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
  border-style: dashed;
  border-color: rgba(232, 163, 60, 0.45);
  background: linear-gradient(165deg, rgba(232, 163, 60, 0.08), #121218 70%);
  color: inherit;
}
.server-card--add:hover {
  border-color: rgba(232, 163, 60, 0.8);
  transform: translateY(-2px);
}
.server-add-plus {
  font-size: 2.4rem;
  line-height: 1;
  color: #e8a33c;
  font-weight: 700;
}
.server-card--add strong {
  font-family: "Barlow Condensed", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.25rem;
}
.server-card--add p {
  margin: 0;
  color: #9ca3af;
  font-size: 0.9rem;
}
.server-card--community {
  border-color: rgba(107, 154, 196, 0.35);
}
.server-card--community.server-card--sponsored {
  position: relative;
  border-color: rgba(242, 169, 0, 0.45);
  background:
    linear-gradient(115deg, rgba(12, 12, 16, 0.92), rgba(12, 12, 16, 0.72)),
    var(--server-banner, transparent);
  background-size: cover;
  background-position: center;
}
.server-title-badge--community {
  background: rgba(107, 154, 196, 0.18);
  color: #8eb6d9;
  border: 1px solid rgba(107, 154, 196, 0.4);
}
.server-title-badge--sponsored {
  background: rgba(242, 169, 0, 0.18);
  color: #f2a900;
  border: 1px solid rgba(242, 169, 0, 0.45);
}
.server-bump-btn {
  white-space: nowrap;
}

.shop-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.65);
}
.shop-modal-panel {
  width: min(520px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  border: 1px solid #2a2a30;
  border-radius: 10px;
  background: #121218;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}
.shop-modal-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #2a2a30;
}
.shop-modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.shop-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
}
.shop-pack-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shop-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shop-legal {
  font-size: 0.8rem;
  line-height: 1.35;
}
