/* ==========================================================================
   Hellscape Studios — shared site design system
   Palette matches admin/index.html (the existing internal dashboard) so the
   whole product family (Launcher, Nexus, admin, this site) reads as
   one brand: crimson accent (#ca003d), success green (#4cc382), dark ground.
   No build step — plain CSS, loaded by every page in this static site.
   ========================================================================== */

:root {
  --bg: #141414;
  --bg-raised: #1c1c1c;
  --bg-card: #242424;
  --bg-card-hover: #262626;
  --border: #2f2f2f;
  --border-soft: #262626;
  --text: #f2f2f2;
  --text-dim: #a6a6ac;
  --text-faint: #74757c;
  --accent: #ca003d;
  --accent-bright: #ff2d5f;
  --accent-soft: rgba(202, 0, 61, 0.14);
  --ok: #4cc382;
  --ok-soft: rgba(76, 195, 130, 0.14);
  --warn: #e8a33d;
  --warn-soft: rgba(232, 163, 61, 0.14);
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --maxw: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ---- Design-mockup tokens (Hellscape_Website_dc.html), added for
     the site overhaul. Same "additive, never renaming the tokens
     above" approach used for the Launcher's reskin - every existing
     rule in this file keeps working unchanged. New markup can use
     either set; --red-1/--torch-lit/etc. are just aliases pointing at
     the same values as --accent/--warn so copy-pasted mockup styles
     using the mockup's own variable names work without translation. ---- */
  --red-1: var(--accent);
  --red-2: #9b0431;
  --torch-lit: var(--warn);
  --green: var(--ok);
  --color-bg: var(--bg);
  --panel: var(--bg-raised);
  --panel-alt: #202020;
  --panel-card: var(--bg-card);
  --color-divider: var(--border);
  --color-text: var(--text);
  --color-neutral-400: var(--text-dim);
  --color-neutral-500: #8a8a92;
  --color-neutral-600: var(--text-faint);
  --color-neutral-700: #4b4b52;
  --color-accent-100: #ffe3ea;
  --color-accent-300: #fb7a94;
  --color-accent-800: #431019;
  --rarity-rare: #4a9eff;
  --font-heading: 'Poppins', var(--font);
  --font-body: 'Poppins', var(--font);
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, Menlo, monospace;
  --shadow-sm: 0 0 0 1px var(--border);
  --shadow-md: 0 6px 18px rgba(0,0,0,0.45);
  --shadow-lg: 0 16px 40px rgba(0,0,0,0.6);
}

@keyframes hsGlow { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
.elev-sm { box-shadow: var(--shadow-sm); }
.elev-md { box-shadow: var(--shadow-md); }
.elev-lg { box-shadow: var(--shadow-lg); }
.tag { display: inline-flex; align-items: center; font-size: 11px; padding: 3px 10px; border-radius: 8px; }
.tag-accent { background: var(--color-accent-800); color: var(--color-accent-100); }

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 8px; font-family: var(--font-heading); font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0 0 12px; color: var(--text-dim); }
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(20, 20, 20, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.site-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  font-size: 16.5px;
  color: #fff;
  white-space: nowrap;
}
.site-brand .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.site-nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
}
.site-nav a {
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}
.site-nav a:hover { color: #fff; background: var(--bg-card); }
.site-nav a.is-active { color: #fff; background: var(--accent-soft); }
.site-header-actions { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.site-header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  user-select: none;
}
.site-header-user .avatar-dot {
  width: 22px; height: 22px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), var(--warn));
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.site-header-user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 190px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 6px;
  flex-direction: column;
  gap: 1px;
  z-index: 50;
}
.site-header-user.open .site-header-user-menu { display: flex; }
.site-header-user-menu a, .site-header-user-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.site-header-user-menu a:hover, .site-header-user-menu button:hover {
  background: var(--bg-card-hover);
  color: #fff;
}
.site-mobile-toggle { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.06s ease, opacity 0.15s ease, background 0.15s ease;
  text-align: center;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-bright); }
.btn-secondary { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-card-hover); }
.btn-ghost { background: transparent; color: var(--text-dim); border-color: var(--border); }
.btn-ghost:hover { color: #fff; border-color: var(--text-faint); }
.btn-ok { background: var(--ok); color: #0d1f16; }
.btn-ok:hover { opacity: 0.9; }
.btn-danger { background: transparent; color: var(--accent-bright); border-color: rgba(202,0,61,0.4); }
.btn-danger:hover { background: rgba(202,0,61,0.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; border-radius: 7px; }

/* ---------- forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin: 14px 0 6px; }
label:first-child { margin-top: 0; }
input, select, textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 90px; }
.field-hint { font-size: 11.5px; color: var(--text-faint); margin-top: 5px; }
.field-error { font-size: 12px; color: var(--accent-bright); margin-top: 5px; min-height: 14px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 14px 0; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; font-weight: 500; color: var(--text); }

/* ---------- cards / layout ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card-lg { padding: 28px; border-radius: var(--radius-lg); }
.panel-title { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.panel-sub { font-size: 12.5px; color: var(--text-faint); margin-bottom: 16px; }
.section { padding: 48px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 20px; color: #fff; }
.grid { display: grid; gap: 16px; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-cols-3, .grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr; }
}
.layout-split { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: start; }
@media (max-width: 800px) { .layout-split { grid-template-columns: 1fr; } }

/* ---------- pills / badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 30px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: var(--bg-raised);
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.pill-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill-accent { background: var(--accent-soft); color: var(--accent-bright); border-color: transparent; }
.price-tag { font-weight: 800; color: #fff; font-size: 15px; }
.price-free { color: var(--ok); }

/* ---------- game cards ---------- */
.game-card {
  background: var(--panel-card);
  border-radius: var(--radius-md, var(--radius));
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease;
  display: flex;
  flex-direction: column;
}
.game-card:hover { background: var(--bg-card-hover); }
.game-card-art {
  aspect-ratio: 16/9;
  background: linear-gradient(150deg, var(--color-accent-800), var(--panel) 60%, var(--bg));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent-300);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 12px;
}
.game-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.game-card-title { font-family: var(--font-heading); font-size: 14.5px; font-weight: 500; color: #fff; }
.game-card-desc { font-size: 12.5px; color: var(--text-faint); flex: 1; }
.game-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
th { color: var(--text-faint); font-weight: 700; text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.05em; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---------- side nav (dashboards) ---------- */
.side-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 82px; }
.side-nav a {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}
.side-nav a:hover { background: var(--bg-card); color: #fff; }
.side-nav a.is-active { background: var(--accent-soft); color: var(--accent-bright); }
.side-nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); padding: 14px 12px 6px; }

/* ---------- hero ---------- */
.hero {
  padding: 90px 0 70px;
  background:
    radial-gradient(ellipse 900px 500px at 20% -10%, rgba(202,0,61,0.18), transparent 60%),
    radial-gradient(ellipse 700px 400px at 90% 10%, rgba(76,195,130,0.08), transparent 60%);
  border-bottom: 1px solid var(--border-soft);
}
.hero h1 { font-size: 42px; color: #fff; max-width: 640px; }
.hero p.lead { font-size: 16px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--bg-raised);
  border-top: 1px solid var(--border-soft);
  padding: 56px 0 44px;
  margin-top: 60px;
}
.site-footer-grid { display: grid; grid-template-columns: 1.4fr repeat(2, 1fr); gap: 24px; }
@media (max-width: 750px) { .site-footer-grid { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 10px; }
.site-footer a { display: block; font-size: 13px; color: var(--text-dim); padding: 4px 0; }
.site-footer a:hover { color: #fff; }
.site-footer-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 28px; }
.site-footer-brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.site-footer-links { display: flex; flex-wrap: wrap; align-items: center; flex: 1; margin: -4px -9px; }
.site-footer-links a { display: inline-block; padding: 4px 9px; font-size: 13px; }
.site-footer-copyright { font-size: 12px; color: var(--text-faint); white-space: nowrap; flex-shrink: 0; }
.site-footer-bottom { margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--text-faint); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ---------- misc ---------- */
.divider { height: 1px; background: var(--border-soft); margin: 20px 0; border: none; }
.empty-state { text-align: center; padding: 50px 20px; color: var(--text-faint); }
.empty-state .icon { font-size: 30px; margin-bottom: 10px; }
.skeleton { background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 37%, var(--bg-card) 63%); background-size: 400% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-label { font-size: 11.5px; color: var(--text-faint); margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 800; color: #fff; }

/* ---------- toasts ---------- */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: var(--shadow);
  min-width: 240px;
  max-width: 340px;
  animation: toast-in 0.18s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--accent-bright); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- auth pages ---------- */
.auth-shell { max-width: 400px; margin: 70px auto; padding: 0 20px; }
.auth-shell .card { }
.auth-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-faint); }
.auth-switch a { color: var(--accent-bright); font-weight: 600; }

/* ---------- utility ---------- */
.text-dim { color: var(--text-dim); }
.text-faint { color: var(--text-faint); }
.text-ok { color: var(--ok); }
.text-warn { color: var(--warn); }
.text-accent { color: var(--accent-bright); }
.mt-0 { margin-top: 0; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  .site-nav { display: none; }
  .site-mobile-toggle { display: inline-flex; }
}
