* {
  box-sizing: border-box;
}

:root {
  --bg-1: #101317;
  --bg-2: #1a1f27;
  --card: #1e242d;
  --text: #ecf1f9;
  --muted: #aeb8c7;
  --border: #2f3744;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: "Oxanium", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(140deg, var(--bg-1), var(--bg-2));
  min-height: 100%;
}

.preloader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--bg-1), var(--bg-2));
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  border-radius: 999px;
  border: 1px solid #394250;
  background: #1a2028;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.loader-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #7ea8ff;
  opacity: 0.45;
  animation: dotGrow 0.9s ease-in-out infinite;
  will-change: transform, opacity;
}

.loader-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.loader-dot:nth-child(3) {
  animation-delay: 0.32s;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 12% 20%, rgba(59, 130, 246, 0.16), transparent 26%),
    radial-gradient(circle at 88% 20%, rgba(167, 139, 250, 0.13), transparent 24%),
    radial-gradient(circle at 70% 100%, rgba(34, 197, 94, 0.08), transparent 26%);
  pointer-events: none;
  animation: bgShift 16s ease-in-out infinite alternate;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #171a1f;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.topbar-left {
  display: flex;
  align-items: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-left: auto;
}

.server-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.server-photo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid #3c4658;
}

.server-name {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #e3eaf6;
  font-size: 1rem;
}

.lang-switch {
  display: flex;
  gap: 0.4rem;
}

.lang-btn {
  border: 1px solid var(--border);
  background: #11192a;
  color: #d4e2ff;
  border-radius: 10px;
  padding: 0.35rem 0.6rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.lang-btn:hover {
  transform: scale(1.08);
}

.lang-btn.active {
  background: linear-gradient(135deg, #4062d8, #2f4ba8);
  color: #fff;
  border-color: transparent;
}

.content {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 2rem;
  display: grid;
  gap: 1rem;
  transition: opacity 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

body.lang-changing .content {
  opacity: 0;
  transform: scale(0.86);
  filter: blur(10px);
  pointer-events: none;
}

.card {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card);
  padding: 1.15rem;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.3);
  animation: cardFloat 7s ease-in-out infinite;
}

.center {
  text-align: center;
}

.hero-buttons {
  margin-top: 1rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 700;
  border-radius: 12px;
  padding: 0.7rem 1rem;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 1px solid rgba(120, 154, 255, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 22px rgba(53, 94, 219, 0.36);
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

.status-pill {
  display: inline-block;
  background: rgba(66, 122, 255, 0.2);
  border: 1px solid rgba(123, 170, 255, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  color: #a8d4ff;
}

.server-status {
  color: var(--muted);
  display: none;
}

.online-box {
  display: inline-block;
  min-width: 120px;
  padding: 0.38rem 0.8rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 800;
  margin-top: 0.3rem;
  letter-spacing: 0.05em;
}

.online-box.online {
  background: #15803d;
  color: #ffffff;
  border-color: #22c55e;
}

.online-box.offline {
  background: #b91c1c;
  color: #ffffff;
  border-color: #ef4444;
}

.rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
}

.rank-card {
  color: #edf2ff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  background: rgba(20, 27, 45, 0.85);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.rank-card:hover {
  transform: translateY(-7px) scale(1.01);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.35);
}

.rank-card.active {
  transform: translateX(10px);
  border-color: rgba(136, 167, 255, 0.75);
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.22);
}

.rank-card:hover h3,
.rank-card:hover li,
.rank-card:hover .discord-note {
  color: inherit;
}

.rank-card h3 {
  margin-top: 0;
}

.rank-card ul {
  margin: 0;
  padding-left: 1rem;
  color: #cfd9f7;
}

.rank-card li {
  margin-bottom: 0.45rem;
}

.discord-note {
  font-size: 0.88rem;
  color: #dce4ff;
  margin-top: 0.8rem;
}

.buy-btn {
  margin-top: auto;
  border: 1px solid rgba(147, 172, 255, 0.5);
  background: #2b4cb9;
  color: #ffffff;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.buy-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.buy-btn.disabled,
.buy-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.vip {
  border-left: 5px solid #ffd64f;
}

.vip:hover {
  border-left-color: #ffd64f;
}

.mvp {
  border-left: 5px solid #ff4d56;
}

.mvp:hover {
  border-left-color: #ff4d56;
}

.legend {
  border-left: 5px solid #2ede80;
}

.legend:hover {
  border-left-color: #2ede80;
}

.ultra {
  border-left: 5px solid #af65ff;
}

.ultra:hover {
  border-left-color: #af65ff;
}

.custom {
  border-left: 5px solid #c7d3ef;
}

.custom:hover {
  border-left-color: #c7d3ef;
}

.purchase-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 14, 0.78);
  backdrop-filter: blur(2px);
}

.purchase-modal.hidden {
  display: none;
}

.purchase-dialog {
  width: min(560px, calc(100% - 2rem));
  border: 1px solid #3a4352;
  border-radius: 16px;
  padding: 1rem;
  background: #171d26;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45);
  position: relative;
}

.purchase-dialog .hidden {
  display: none;
}

.purchase-step {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.purchase-step.leaving {
  opacity: 0;
  transform: translateY(10px) scale(0.98);
}

.purchase-step.entering {
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
}

.close-modal-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  border: 1px solid #41506a;
  background: #20293a;
  color: #eff5ff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.2rem;
}

.name-input-wrap {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin: 0.8rem 0;
}

.player-head-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 1px solid #51607b;
  background: #0f1420;
  display: grid;
  place-items: center;
  color: #dbe5ff;
  font-weight: 800;
  overflow: hidden;
  flex-shrink: 0;
}

.player-head-box img {
  width: 100%;
  height: 100%;
  display: block;
}

.player-name-input {
  width: 100%;
  border: 1px solid #4c5a73;
  border-radius: 10px;
  background: #0f1420;
  color: #eef2ff;
  padding: 0.72rem 0.8rem;
  font-family: inherit;
  font-size: 1rem;
}

.player-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.player-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  border: 1px solid #3d4b63;
  background: #131a27;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.player-check:hover {
  transform: translateY(-2px);
  border-color: #6f89d9;
  box-shadow: 0 8px 18px rgba(47, 75, 168, 0.25);
}

.player-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid #6a7b9e;
  background: #0d1320;
  cursor: pointer;
  position: relative;
}

.player-check input[type="checkbox"]:checked {
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  border-color: transparent;
}

.player-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.player-check-text {
  min-height: 1.2rem;
  font-weight: 700;
  margin: 0.2rem 0 0.7rem;
}

.player-check-text.ok {
  color: #86efac;
}

.player-check-text.error {
  color: #fca5a5;
}

.continue-btn {
  width: 100%;
}

.selected-rank-card {
  border: 1px solid #4a5870;
  border-left: 5px solid #7ea8ff;
  border-radius: 10px;
  background: #1e2633;
  color: #eef4ff;
  font-weight: 800;
  padding: 0.7rem 0.8rem;
  margin-bottom: 0.8rem;
}

.selected-rank-card.vip {
  border-left-color: #ffd64f;
}

.selected-rank-card.mvp {
  border-left-color: #ff4d56;
}

.selected-rank-card.legend {
  border-left-color: #2ede80;
}

.selected-rank-card.ultra {
  border-left-color: #af65ff;
}

.purchase-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.purchase-status {
  min-height: 1.25rem;
  font-weight: 700;
}

.purchase-status.success {
  color: #86efac;
}

.purchase-status.error {
  color: #fca5a5;
}

.purchase-status-note {
  min-height: 1.2rem;
  margin-top: -0.1rem;
  margin-bottom: 0.6rem;
  color: #b8ccff;
  font-weight: 700;
}

.footer {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 1rem;
  color: #9eabd2;
}

@keyframes cardFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes dotGrow {
  0% {
    transform: scale(0.7);
    opacity: 0.35;
  }
  50% {
    transform: scale(1.55);
    opacity: 1;
  }
  100% {
    transform: scale(0.7);
    opacity: 0.35;
  }
}

@keyframes bgShift {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-1.5%);
  }
}

@media (max-width: 740px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-right {
    justify-content: center;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .topbar-left {
    justify-content: center;
  }

  .lang-switch {
    width: 100%;
    justify-content: center;
  }
}
