/* ==========================================================================
   Hellcase-style Case Battle site — Shared Design System
   Base tokens, resets, layout primitives shared by every page.
   ========================================================================== */

:root {
  /* Base surfaces — deep charcoal */
  --bg-0: #0c0a09;
  --bg-1: #131110;
  --bg-2: #191614;
  --bg-3: #201c19;
  --bg-elevated: #24201d;
  --border-subtle: #2f2a25;
  --border-soft: #3a332c;

  /* Gold / amber / fire accents */
  --gold-100: #fbe8c6;
  --gold-300: #f0c877;
  --gold-400: #e5b358;
  --gold-500: #d4a039;
  --gold-600: #b9822a;
  --amber-500: #e08a3c;
  --fire-500: #d9622f;
  --fire-600: #b84a24;

  --gold-gradient: linear-gradient(135deg, #f7d98c 0%, #d4a039 45%, #b8791f 100%);
  --fire-gradient: linear-gradient(135deg, #f0c877 0%, #e08a3c 55%, #d9622f 100%);

  /* Text */
  --text-primary: #f2ead9;
  --text-secondary: #b9ada0;
  --text-muted: #7d7269;
  --text-inverse: #14110d;

  /* Rarity colors */
  --rarity-consumer: #8b96a3;
  --rarity-industrial: #5e97d6;
  --rarity-milspec: #4b6ee0;
  --rarity-restricted: #8847e8;
  --rarity-classified: #d24bd0;
  --rarity-covert: #e0435c;
  --rarity-gold: #e5b358;

  /* Semantic */
  --success: #4bbf7b;
  --danger: #e0435c;
  --info: #4b8ee0;

  /* Shadows */
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-gold-glow: 0 0 0 1px rgba(229, 179, 88, 0.25), 0 8px 30px rgba(212, 160, 57, 0.25);
  --shadow-gold-glow-strong: 0 0 0 1px rgba(240, 200, 119, 0.4), 0 12px 40px rgba(212, 160, 57, 0.4);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --container-max: 1360px;
  --header-h: 68px;
  --feed-h: 92px;

  --font-body: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-display: "Rajdhani", "Manrope", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(212, 160, 57, 0.08), transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, rgba(217, 98, 47, 0.06), transparent 55%),
    var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, p {
  margin: 0;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--gold-500);
  color: var(--text-inverse);
  padding: 10px 16px;
  z-index: 999;
  border-radius: 0 0 8px 0;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
  white-space: nowrap;
}
.btn:active {
  transform: translateY(1px);
}

.btn-gold {
  background: var(--gold-gradient);
  color: var(--text-inverse);
  box-shadow: 0 4px 18px rgba(212, 160, 57, 0.35);
}
.btn-gold:hover {
  box-shadow: 0 6px 26px rgba(229, 179, 88, 0.55);
  transform: translateY(-1px);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  border-color: var(--border-soft);
}
.btn-outline:hover {
  border-color: var(--gold-400);
  color: var(--gold-300);
  box-shadow: 0 0 0 1px rgba(229, 179, 88, 0.2);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover {
  color: var(--gold-300);
}

.btn-block {
  width: 100%;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 15px;
}

.btn-sm {
  padding: 7px 14px;
  font-size: 12.5px;
}

/* ---------- Section heading ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: "";
  width: 4px;
  height: 20px;
  border-radius: 3px;
  background: var(--gold-gradient);
  display: inline-block;
}

.section-link {
  font-size: 13px;
  color: var(--gold-400);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.section-link:hover {
  color: var(--gold-300);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 5px;
  text-transform: uppercase;
}
.badge-top {
  background: linear-gradient(135deg, #f7d98c, #d4a039);
  color: #241c0f;
}
.badge-sale {
  background: linear-gradient(135deg, #f0664a, #b8391f);
  color: #fff3ea;
}
.badge-new {
  background: linear-gradient(135deg, #4b8ee0, #2f5fb0);
  color: #eaf2ff;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(12, 10, 9, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo img {
  height: 42px;
  width: auto;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background 0.15s ease;
}
.main-nav a:hover {
  color: var(--gold-300);
  background: rgba(229, 179, 88, 0.07);
}
.main-nav a.active {
  color: var(--gold-300);
}
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold-gradient);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.balance-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13.5px;
  color: var(--gold-300);
}

.lang-switch {
  position: relative;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.lang-btn:hover {
  border-color: var(--gold-500);
  color: var(--gold-300);
}
.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  min-width: 140px;
  padding: 6px;
  display: none;
  z-index: 80;
}
.lang-menu.open {
  display: block;
}
.lang-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lang-menu button:hover {
  background: rgba(229, 179, 88, 0.1);
  color: var(--gold-300);
}
.lang-menu button[data-active="true"] {
  color: var(--gold-400);
  font-weight: 700;
}

.btn-steam {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold-gradient);
  color: var(--text-inverse);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 13.5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(240, 200, 119, 0.35), 0 4px 20px rgba(212, 160, 57, 0.45);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.btn-steam:hover {
  box-shadow: 0 0 0 1px rgba(247, 217, 140, 0.6), 0 6px 28px rgba(229, 179, 88, 0.65);
  transform: translateY(-1px);
}
.btn-steam svg {
  width: 16px;
  height: 16px;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
}

/* ---------- Live feed ---------- */
.live-feed {
  height: var(--feed-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
}
.live-feed::before,
.live-feed::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 5;
  pointer-events: none;
}
.live-feed::before {
  left: 0;
  background: linear-gradient(90deg, var(--bg-1), transparent);
}
.live-feed::after {
  right: 0;
  background: linear-gradient(270deg, var(--bg-1), transparent);
}
.live-feed-label {
  position: absolute;
  left: 24px;
  top: 8px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 6;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fire-500);
  box-shadow: 0 0 0 3px rgba(217, 98, 47, 0.25);
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.feed-track {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  width: max-content;
  animation: feed-scroll 42s linear infinite;
  padding-top: 10px;
}
.live-feed:hover .feed-track {
  animation-play-state: paused;
}
@keyframes feed-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 12px 6px 6px;
  flex-shrink: 0;
}
.feed-item-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.feed-item-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.feed-item-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  border: 2px solid var(--rarity-color, var(--rarity-covert));
  opacity: 0.9;
}
.feed-item-user {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-soft);
}
.feed-item-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.feed-item-name {
  font-size: 11.5px;
  color: var(--text-secondary);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-item-price {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--gold-300);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 64px;
  background: var(--bg-1);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
}
.footer-brand p {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 12px;
  line-height: 1.6;
  max-width: 320px;
}
.footer-col h4 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-300);
  margin-bottom: 14px;
  font-weight: 800;
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 13.5px;
  color: var(--text-secondary);
}
.footer-col a:hover {
  color: var(--gold-300);
}
.footer-link-btn {
  font-size: 13.5px;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.footer-link-btn:hover {
  color: var(--gold-300);
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.payment-icons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.payment-icons img {
  height: 20px;
  width: auto;
  opacity: 0.85;
}
.footer-age {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-age img {
  height: 22px;
}

/* ---------- Modal (Steam login CTA) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 5, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.open {
  display: flex;
  animation: fade-in 0.18s ease;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-card {
  position: relative;
  width: 100%;
  max-width: 720px;
  background: linear-gradient(160deg, #171310, #0e0c0a);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-gold-glow-strong);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  overflow: hidden;
  animation: modal-pop 0.22s ease;
}
@keyframes modal-pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.modal-close:hover {
  color: var(--gold-300);
  border-color: var(--gold-400);
}
.modal-body {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.modal-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-logo img {
  height: 30px;
}
.modal-logo span {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal-body h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
}
.modal-social {
  display: flex;
  gap: 10px;
}
.modal-social button {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.modal-social button:hover {
  border-color: var(--gold-400);
  color: var(--gold-300);
}
.modal-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.modal-checks label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.modal-checks input {
  accent-color: var(--gold-500);
  margin-top: 2px;
}
.modal-checks a {
  color: var(--gold-400);
}
.modal-checks a:hover {
  text-decoration: underline;
}
.modal-visual {
  position: relative;
  background:
    linear-gradient(180deg, rgba(212, 160, 57, 0.18), rgba(12, 10, 9, 0.4)),
    var(--bg-2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-visual img {
  width: 100%;
  max-width: 260px;
  object-fit: contain;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.5));
}

@media (max-width: 720px) {
  .modal-card {
    grid-template-columns: 1fr;
  }
  .modal-visual {
    display: none;
  }
}

/* ---------- Mobile nav drawer ---------- */

@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border-subtle);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    gap: 2px;
    display: none;
    z-index: 55;
  }
  .main-nav.open {
    display: flex;
  }
  .main-nav a {
    padding: 12px 14px;
  }
  .nav-toggle {
    display: flex;
  }
  .balance-pill span.balance-label {
    display: none;
  }
}

@media (max-width: 640px) {
  .header-inner {
    gap: 12px;
  }
  .logo-text {
    display: none;
  }
  .header-actions {
    gap: 6px;
  }
  .lang-btn span.lang-label {
    display: none;
  }
}
