:root {
  --bg: #07070f;
  --bg-2: #0c0c18;
  --card: #13131f;
  --card-2: #16162a;
  --border: #23233a;
  --text: #ececf5;
  --muted: #9a9ab8;
  --blue: #2f7bff;
  --blue-bright: #4f9bff;
  --cyan: #8fd0ff;
  --purple: #7c3aed;
  --purple-bright: #9a5cff;
  --danger: #ff6b6b;
  --radius: 16px;
  --maxw: 1040px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 50% -10%, #14122b 0%, var(--bg-2) 45%, var(--bg) 100%);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

body.modal-open { overflow: hidden; }

a { color: var(--blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(520px 360px at 50% 6%, rgba(124, 58, 237, 0.22), transparent 70%),
    radial-gradient(420px 320px at 50% 2%, rgba(47, 123, 255, 0.22), transparent 70%);
  z-index: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 20px 40px;
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- brand ---------- */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 44px;
}

.brand__logo {
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 10px 28px rgba(47, 123, 255, 0.35))
          drop-shadow(0 4px 18px rgba(124, 58, 237, 0.3));
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.brand__name {
  font-family: "Silkscreen", "Inter", monospace;
  font-weight: 700;
  font-size: clamp(20px, 4.5vw, 30px);
  letter-spacing: 1px;
  background: #0e0e1c;
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
.brand__tld { color: var(--blue-bright); }

/* ---------- ranks ---------- */
.ranks { width: 100%; display: flex; flex-direction: column; align-items: center; }

.section-title {
  font-family: "Silkscreen", monospace;
  font-weight: 400;
  font-size: clamp(18px, 3vw, 24px);
  letter-spacing: 2px;
  color: var(--muted);
  margin: 0 0 28px;
  text-align: center;
}

.rank-grid {
  display: grid;
  grid-template-columns: minmax(0, 360px);
  gap: 24px;
  width: 100%;
  justify-content: center;
}

.card {
  position: relative;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card--featured {
  border-color: rgba(79, 155, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(124, 58, 237, 0.25),
    0 18px 50px rgba(10, 10, 30, 0.7),
    0 0 60px rgba(47, 123, 255, 0.12);
}

.card__halo {
  position: absolute;
  inset: -2px -2px auto -2px;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--blue));
  opacity: 0.9;
}

.card__title {
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 1px;
  margin: 6px 0 22px;
  background: linear-gradient(90deg, var(--cyan), var(--blue-bright) 45%, var(--purple-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card__features {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.card__features li {
  position: relative;
  padding-left: 26px;
  color: #cfcfe2;
  font-size: 15px;
}
.card__features li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-bright), var(--purple-bright));
  box-shadow: 0 0 8px rgba(79, 155, 255, 0.6);
}

.buy {
  margin-top: auto;
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  padding: 16px;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 17px;
  background: linear-gradient(100deg, var(--blue), var(--purple));
  box-shadow: 0 10px 26px rgba(47, 123, 255, 0.32);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}
.buy:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 14px 32px rgba(124, 58, 237, 0.4); }
.buy:active { transform: translateY(0); }
.buy__per { font-weight: 500; font-size: 13px; }

.ranks__note {
  color: var(--muted);
  font-size: 13px;
  margin-top: 26px;
  text-align: center;
}

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 1;
  margin-top: 48px;
  padding: 22px 20px 36px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  flex-shrink: 0;
}
.foot__meta { margin-top: 6px; }
.foot__dot { margin: 0 8px; }
.foot strong { color: var(--text); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(4, 4, 12, 0.72); backdrop-filter: blur(4px); }

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(124, 58, 237, 0.18);
  animation: pop 0.16s ease-out;
}
@keyframes pop { from { transform: scale(0.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.modal__x {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}
.modal__x:hover { color: var(--text); }

.modal__title { font-family: "Silkscreen", monospace; font-weight: 700; font-size: 22px; margin: 0 0 6px; }
.modal__title .accent {
  background: linear-gradient(90deg, var(--cyan), var(--purple-bright));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.modal__sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; }

.field { display: block; }
.field__label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.field input {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0c0c16;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 123, 255, 0.22); }

.hint { font-size: 12px; color: var(--muted); margin: 9px 2px 0; }
.hint code { background: #0c0c16; border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; color: #cfcfe2; }

.error { color: var(--danger); font-size: 13px; margin: 12px 2px 0; }

.btn-primary {
  margin-top: 18px;
  width: 100%;
  border: 0;
  cursor: pointer;
  border-radius: 11px;
  padding: 14px;
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  background: linear-gradient(100deg, var(--blue), var(--purple));
  box-shadow: 0 10px 26px rgba(47, 123, 255, 0.3);
  transition: transform 0.12s ease, filter 0.12s ease;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.btn-primary:disabled { opacity: 0.7; cursor: progress; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal__total { text-align: center; color: var(--muted); font-size: 12px; margin: 16px 0 0; }
.modal__total strong { color: var(--text); }

@media (max-width: 480px) {
  .wrap { padding-top: 36px; }
  .card { padding: 26px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .brand__logo { animation: none; }
  .modal__panel { animation: none; }
  .spinner { animation-duration: 1.2s; }
}
