:root {
  --bg: #070707;
  --panel: #111111;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f5f5f5;
  --muted: #9a9a9a;
  --red: #c8102e;
  --red-hot: #e61f3d;
  --discord: #5865f2;
  --discord-hot: #4752c4;
  --ok: #6fcf97;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Barlow Condensed", Impact, sans-serif;
  --max: 1100px;
  --top: 68px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--top) + 12px); }
body {
  min-height: 100vh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; background: none; border: 0; }

.top {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 clamp(1rem, 4vw, 2rem);
  background: rgba(7, 7, 7, 0.72);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(10px);
}
.is-authed .top { border-bottom-color: var(--line); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
}
.brand img { width: 34px; height: 34px; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-nav > a { color: var(--muted); font-size: 0.92rem; font-weight: 600; }
.top-nav > a:hover { color: var(--text); }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.88rem;
  font-weight: 600;
}
.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.user-chip .logout {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
  margin-left: 0.2rem;
}
.user-chip .logout:hover { color: var(--red-hot); }

.cart-btn {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem 0.85rem;
  background: var(--red);
}
.cart-btn span {
  margin-left: 0.3rem;
  opacity: 0.9;
}
.cart-btn:hover { background: var(--red-hot); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 46px;
  padding: 0.7rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-lg { min-height: 52px; padding: 0.85rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-hot); }
.btn-discord { background: var(--discord); color: #fff; }
.btn-discord:hover { background: var(--discord-hot); }
.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.28); }

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-items: end;
  overflow: hidden;
}
.is-authed .hero {
  min-height: 58vh;
  align-items: end;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  transform: scale(1.03);
  animation: settle 1.5s ease forwards;
}
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, #070707 0%, rgba(7,7,7,0.55) 42%, rgba(7,7,7,0.35) 100%),
    linear-gradient(90deg, rgba(7,7,7,0.75), transparent 55%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 0 0 clamp(2.5rem, 7vh, 4.5rem);
  animation: rise 0.8s ease both;
}

.kicker {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red-hot);
  margin-bottom: 0.45rem;
  font-weight: 700;
}
.gate h1,
.welcome h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3rem, 9vw, 5.6rem);
  letter-spacing: 0.02em;
  line-height: 0.92;
  margin-bottom: 0.7rem;
  text-wrap: balance;
}
.lead {
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}
.fine {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.shop {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 2.5rem 0 4.5rem;
}
.shop-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.shop-head h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: 0.03em;
  font-weight: 800;
}
.fivem-status {
  font-size: 0.85rem;
  color: var(--muted);
}
.fivem-status.ok { color: var(--ok); }
.muted { color: var(--muted); }

.category + .category { margin-top: 2.25rem; }
.category-title {
  font-family: var(--display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  font-weight: 700;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.package {
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: rise 0.55s ease both;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.package:hover {
  border-color: rgba(200, 16, 46, 0.55);
  transform: translateY(-2px);
}
.package-media {
  aspect-ratio: 16 / 10;
  background: #0c0c0c;
  overflow: hidden;
  position: relative;
}
.package-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.package-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 1;
  background: var(--red-hot);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
}
.cart-sub-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--red-hot);
  border: 1px solid rgba(200, 16, 46, 0.4);
  padding: 0.1rem 0.35rem;
  vertical-align: middle;
  margin-left: 0.25rem;
}
.package-body {
  padding: 1rem 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.package-body h3 {
  font-family: var(--display);
  font-size: 1.45rem;
  letter-spacing: 0.02em;
  font-weight: 700;
  line-height: 1.1;
}
.package-body p {
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
}
.package-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.35rem;
}
.price {
  font-weight: 800;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  z-index: 50;
}
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(400px, 100%);
  height: 100%;
  transform: translateX(104%);
  transition: transform 0.28s ease;
}
.cart-drawer.open { transform: translateX(0); }
.cart-panel {
  height: 100%;
  background: #0d0d0d;
  border-left: 1px solid var(--line);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cart-head h2 {
  font-family: var(--display);
  font-size: 1.7rem;
  letter-spacing: 0.04em;
}
.cart-head button {
  cursor: pointer;
  color: var(--muted);
}
.cart-head button:hover { color: var(--text); }
.cart-items { flex: 1; overflow: auto; }
.cart-empty { color: var(--muted); padding: 1rem 0; }
.cart-item {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}
.cart-item img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  background: #1a1a1a;
}
.cart-item h4 { font-size: 0.95rem; }
.cart-item p { color: var(--muted); font-size: 0.8rem; }
.cart-item button { cursor: pointer; color: var(--muted); font-size: 0.8rem; }
.cart-item button:hover { color: var(--red-hot); }
.cart-coupon {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
}
.cart-coupon input {
  border: 1px solid var(--line);
  padding: 0.7rem 0.8rem;
  background: #0a0a0a;
}
.cart-totals {
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cart-totals > div {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.9rem;
}
.cart-totals .grand {
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
}
.cart-terms {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0.35rem 0 0.85rem;
}
.cart-vip-note {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  background: rgba(200, 16, 46, 0.08);
  border: 1px solid rgba(200, 16, 46, 0.28);
  padding: 0.65rem 0.75rem;
}
.cart-vip-note strong { color: var(--text); }
.cart-terms-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
}
.cart-terms-check input {
  margin-top: 0.15rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--red-hot);
}
.cart-terms-check strong { color: var(--text); }
#btn-checkout:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%) translateY(10px);
  z-index: 70;
  background: #141414;
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s ease;
  max-width: min(90vw, 26rem);
  text-align: center;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.error { border-color: rgba(200, 16, 46, 0.6); }
.toast.ok { border-color: rgba(111, 207, 151, 0.45); }

.redeem {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto 1.5rem;
}
.redeem-inner {
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.28);
  border-radius: 16px;
  padding: 1.25rem 1.35rem 1.4rem;
  display: grid;
  gap: 1rem;
}
.redeem-inner h2 {
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(1.6rem, 3vw, 2rem);
  letter-spacing: 0.02em;
  margin: 0.15rem 0 0.35rem;
}
.redeem-inner code {
  font-size: 0.85em;
  color: #ffb4bf;
}
.redeem-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.redeem-form input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,0.35);
}
.redeem-result {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  font-size: 0.92rem;
}
.redeem-result ul {
  margin: 0.5rem 0 0 1.1rem;
  color: var(--muted);
}
.redeem-result .ok-text { color: #6fcf97; margin-bottom: 0.4rem; }
.redeem-result .err-text { color: #ff8a9a; }

.foot {
  width: min(var(--max), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.2rem 0 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
}
.page-thanks .hero { min-height: 100vh; }

@keyframes settle { to { transform: scale(1); } }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .top-nav > a:first-child { display: none; }
  .user-chip span { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .is-authed .hero { min-height: 48vh; }
}
