:root {
  --bg: #0a0808;
  --bg-elevated: #141010;
  --surface: #181313;
  --surface-hover: #201919;
  --border: #302222;
  --text: #f3eeee;
  --text-muted: #9c8d8d;
  --accent-a: #e0262e;
  --accent-b: #7a0d13;
  --accent-gradient: linear-gradient(120deg, var(--accent-a), var(--accent-b));
  --danger: #ff4d4d;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 20px 50px -25px rgba(0, 0, 0, 0.6);
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% -10%, rgba(122, 13, 19, 0.28), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(224, 38, 46, 0.1), transparent 40%);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

img {
  max-width: 100%;
  display: block;
}

.shell {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Navbar */

.navbar {
  border-bottom: 1px solid var(--border);
  background: rgba(10, 8, 8, 0.75);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.nav-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text-muted);
}

.nav-links a {
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.admin-link {
  color: var(--accent-a);
}

.nav-links a.admin-link.hidden {
  display: none;
}

.nav-links a.admin-link:hover,
.nav-links a.admin-link.active {
  color: var(--danger);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, opacity 0.12s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #0a0808;
}

.btn-primary:hover {
  opacity: 0.92;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-hover);
}

.btn-steam {
  background: #171a21;
  color: #fff;
  border: 1px solid #2a3f5f;
}

.btn-steam:hover {
  background: #1b2838;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-block {
  width: 100%;
}

/* User pill */

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.88rem;
}

.user-pill img {
  width: 26px;
  height: 26px;
  border-radius: 999px;
}

.user-pill .logout-link {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 4px;
}

.user-pill .logout-link:hover {
  color: var(--danger);
}

/* Hero */

.hero {
  padding: 96px 0 72px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-a);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.08;
  margin: 0 0 18px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.hero h1 .gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 560px;
  margin: 0 auto 34px;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Feature grid */

.section {
  padding: 64px 0;
}

.section-heading {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 44px;
}

.section-heading .eyebrow {
  color: var(--accent-a);
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  display: block;
}

.section-heading h2 {
  font-size: clamp(1.7rem, 3vw, 2.2rem);
  margin: 0 0 10px;
  font-weight: 800;
}

.section-heading p {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: rgba(224, 38, 46, 0.14);
  color: var(--accent-a);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 700;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Shop */

.shop-header {
  text-align: center;
  padding: 64px 0 8px;
}

.shop-header h1 {
  font-size: clamp(2rem, 4vw, 2.6rem);
  margin: 0 0 12px;
  font-weight: 900;
}

.shop-header p {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.signin-banner {
  max-width: 640px;
  margin: 28px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.signin-banner p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.signin-banner.hidden {
  display: none;
}

/* Billing toggle */

.billing-toggle {
  position: relative;
  display: inline-flex;
  margin: 26px auto 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.billing-toggle-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  background: var(--accent-gradient);
  border-radius: 999px;
  transition: transform 0.25s ease;
}

.billing-toggle.mode-recurring .billing-toggle-slider {
  transform: translateX(100%);
}

.billing-toggle-option {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  padding: 9px 26px;
  min-width: 120px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.billing-toggle-option.active {
  color: #0a0808;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  padding: 48px 0 24px;
}

.rank-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.rank-card:hover {
  transform: translateY(-4px);
  border-color: rgba(224, 38, 46, 0.45);
}

.rank-card.popular {
  border-color: var(--accent-a);
  background: linear-gradient(180deg, rgba(122, 13, 19, 0.16), var(--surface) 40%);
}

.popular-pill {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gradient);
  color: #0a0808;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 14px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rank-swatch {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.rank-card h2 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 800;
}

.rank-tagline {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.rank-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 22px;
}

.rank-price strong {
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.rank-price span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.rank-perks {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}

.rank-perks li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
}

.rank-perks li svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--accent-a);
}

/* Footer */

.footer {
  border-top: 1px solid var(--border);
  margin-top: auto;
  padding: 32px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer a {
  color: var(--text-muted);
}

.footer a:hover {
  color: var(--text);
}

.footer-links {
  display: flex;
  gap: 20px;
}

/* Login page */

.login-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.login-card .brand-mark {
  margin: 0 auto 20px;
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.login-card h1 {
  font-size: 1.4rem;
  margin: 0 0 8px;
  font-weight: 800;
}

.login-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0 0 28px;
}

.login-error {
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.35);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

.login-error.hidden {
  display: none;
}

/* Toast */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 50;
  max-width: 90vw;
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.toast.error {
  border-color: rgba(255, 77, 77, 0.5);
  color: var(--danger);
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }
}
