/* ============================================================
   JustLoofy Mods — global stylesheet
   Dark crimson "blood moon" theme
   ============================================================ */

:root {
  --bg: #08080d;
  --bg-2: #0d0e16;
  --surface: #12131d;
  --surface-2: #1a1b28;
  --border: #232434;
  --border-hover: #3a3b52;
  --text: #e8e9f1;
  --muted: #9a9db1;
  --faint: #62647a;
  --accent: #ff3b4e;
  --accent-soft: rgba(255, 59, 78, 0.12);
  --accent-2: #ff7a59;
  --gradient: linear-gradient(135deg, #ff3b4e 0%, #ff7a59 100%);
  --success: #3ddc84;
  --danger: #ff5c5c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-glow: 0 0 40px rgba(255, 59, 78, 0.15);
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; width: 100%; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
}

::selection { background: rgba(255, 59, 78, 0.35); }

.container {
  width: min(1160px, 92%);
  margin: 0 auto;
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(8, 8, 13, 0.78);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.18rem;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { color: var(--text); }
.logo img { width: 30px; height: 30px; filter: drop-shadow(0 0 8px rgba(255, 59, 78, 0.6)); }
.logo span { background: var(--gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.main-nav a {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a.active { color: var(--text); background: var(--accent-soft); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.avatar-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 14px 6px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 500;
  font-size: 0.92rem;
  background: var(--surface);
  transition: border-color 0.15s;
}
.avatar-chip:hover { border-color: var(--accent); color: var(--text); }
.avatar-chip .avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  width: 40px; height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 22px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s, opacity 0.15s;
  text-decoration: none;
  line-height: 1.2;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 59, 78, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(255, 59, 78, 0.5); color: #fff; transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text); background: var(--surface-2); }

.btn-outline {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}
.btn-outline:hover { background: var(--accent-soft); color: var(--accent); }

.btn-danger { background: transparent; border-color: var(--border); color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); background: rgba(255, 92, 92, 0.08); color: var(--danger); }

.btn-sm { padding: 7px 14px; font-size: 0.86rem; border-radius: 8px; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: 110px 0 90px;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  top: -220px; left: 50%;
  transform: translateX(-50%);
  width: 900px; height: 560px;
  background: radial-gradient(ellipse at center, rgba(255, 59, 78, 0.22) 0%, rgba(255, 122, 89, 0.08) 45%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-2);
  background: var(--accent-soft);
  border: 1px solid rgba(255, 59, 78, 0.3);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 26px;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  margin-bottom: 20px;
}

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

.hero p.sub {
  max-width: 640px;
  margin: 0 auto 36px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

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

.hero-stats {
  margin-top: 70px;
  display: flex;
  justify-content: center;
  gap: clamp(30px, 7vw, 90px);
  flex-wrap: wrap;
}
.hero-stats .stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.9rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-stats .stat span { color: var(--muted); font-size: 0.9rem; }

/* ---------- Sections ---------- */

.section { padding: 70px 0; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 34px;
  flex-wrap: wrap;
}
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.section-head p { color: var(--muted); margin-top: 6px; }

/* ---------- Mod cards ---------- */

.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

.mod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  color: var(--text);
}
.mod-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 59, 78, 0.45);
  box-shadow: var(--shadow-glow);
  color: var(--text);
}

.card-media {
  aspect-ratio: 16 / 9;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.mod-card:hover .card-media img { transform: scale(1.05); }

.card-badge {
  position: absolute;
  top: 12px; left: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(8, 8, 13, 0.8);
  backdrop-filter: blur(6px);
  color: var(--accent-2);
  border: 1px solid rgba(255, 59, 78, 0.4);
}

.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 1.12rem; }
.card-body .tagline {
  color: var(--muted);
  font-size: 0.9rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.price { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.price.free { color: var(--success); }
.game-tag {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ---------- Feature cards ---------- */

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.2s;
}
.feature:hover { border-color: var(--border-hover); }
.feature .icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.feature h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Filters / toolbar ---------- */

.toolbar {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.search-box { position: relative; flex: 1; min-width: 220px; }
.search-box input { padding-left: 42px; }
.search-box::before {
  content: "🔍";
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.6;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.chip:hover { border-color: var(--border-hover); color: var(--text); }
.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-2);
}

/* ---------- Forms ---------- */

input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 59, 78, 0.15);
}
textarea { resize: vertical; min-height: 120px; }
label {
  display: block;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 7px;
}
.field { margin-bottom: 18px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-row { display: flex; align-items: center; gap: 10px; }
.checkbox-row input { width: auto; }
.checkbox-row label { margin: 0; color: var(--text); }

/* ---------- Auth card ---------- */

.auth-wrap {
  max-width: 440px;
  margin: 70px auto;
  width: 92%;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 34px;
  box-shadow: var(--shadow-glow);
}
.auth-card h1 { font-size: 1.6rem; margin-bottom: 6px; text-align: center; }
.auth-card .sub { color: var(--muted); text-align: center; margin-bottom: 28px; font-size: 0.93rem; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 26px;
}
.tabs button {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 9px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.tabs button.active { background: var(--surface-2); color: var(--text); }

.auth-alt { text-align: center; margin-top: 18px; font-size: 0.88rem; color: var(--muted); }

/* ---------- Mod detail ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 40px;
  padding: 50px 0 80px;
  align-items: start;
}

.detail-media {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 4rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.detail-media img { width: 100%; height: 100%; object-fit: cover; }

.detail-info h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin: 14px 0 10px; }
.detail-info .meta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.detail-info .tagline { color: var(--muted); margin-bottom: 24px; }

.buy-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}
.buy-box .price { font-size: 1.9rem; margin-bottom: 16px; display: block; }
.buy-box .owned-note { color: var(--success); font-size: 0.9rem; margin-bottom: 12px; font-weight: 600; }

.detail-desc { padding-bottom: 80px; max-width: 780px; }
.detail-desc h2 { font-size: 1.4rem; margin-bottom: 16px; }
.detail-desc p { color: var(--muted); margin-bottom: 14px; white-space: pre-line; }

.meta-list { list-style: none; margin-top: 18px; }
.meta-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.meta-list li span:first-child { color: var(--muted); }

/* ---------- Account ---------- */

.page-head { padding: 56px 0 10px; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 8px; }
.page-head p { color: var(--muted); }

.account-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 34px;
  padding: 34px 0 80px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
}
.panel h2 { font-size: 1.15rem; margin-bottom: 18px; }

.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--gradient);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: #fff;
  margin: 0 auto 14px;
  box-shadow: 0 0 24px rgba(255, 59, 78, 0.4);
}
.profile-name { text-align: center; font-weight: 700; font-family: var(--font-display); font-size: 1.15rem; }
.profile-email { text-align: center; color: var(--muted); font-size: 0.85rem; margin-bottom: 18px; overflow-wrap: anywhere; }

.library-item {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.library-item .thumb {
  width: 88px; height: 56px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}
.library-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.library-item .info { flex: 1; min-width: 150px; }
.library-item .info b { display: block; }
.library-item .info span { color: var(--muted); font-size: 0.83rem; }

/* ---------- Admin ---------- */

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th {
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: var(--bg-2); }
.table-wrap { overflow-x: auto; }

.pill { font-size: 0.75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.pill.on { background: rgba(61, 220, 132, 0.12); color: var(--success); }
.pill.off { background: rgba(154, 157, 177, 0.12); color: var(--muted); }

/* ---------- Empty / notices ---------- */

.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}
.empty .big { font-size: 2.6rem; margin-bottom: 14px; }

.notice {
  background: var(--accent-soft);
  border: 1px solid rgba(255, 59, 78, 0.3);
  color: var(--accent-2);
  border-radius: var(--radius-sm);
  padding: 13px 18px;
  font-size: 0.9rem;
  margin-bottom: 22px;
}

.demo-banner {
  background: linear-gradient(90deg, rgba(255,59,78,0.14), rgba(255,122,89,0.14));
  border-bottom: 1px solid rgba(255, 59, 78, 0.25);
  color: var(--accent-2);
  text-align: center;
  font-size: 0.85rem;
  padding: 8px 16px;
}
.demo-banner b { font-weight: 700; }

/* ---------- Toast ---------- */

#toast-root {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--border-hover);
  border-left: 3px solid var(--accent);
  color: var(--text);
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 0.9rem;
  max-width: 340px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.25s ease;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Skeleton loading ---------- */

.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  min-height: 280px;
  border: 1px solid var(--border);
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}

/* ---------- Success page ---------- */

.success-wrap {
  max-width: 520px;
  margin: 90px auto;
  text-align: center;
  width: 92%;
}
.success-wrap .icon-big {
  width: 84px; height: 84px;
  margin: 0 auto 26px;
  border-radius: 50%;
  background: rgba(61, 220, 132, 0.12);
  border: 1px solid rgba(61, 220, 132, 0.4);
  display: grid;
  place-items: center;
  font-size: 2.2rem;
}
.success-wrap h1 { font-size: 2rem; margin-bottom: 12px; }
.success-wrap p { color: var(--muted); margin-bottom: 30px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-2);
  margin-top: 60px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding: 50px 0 36px;
}
.footer-inner h4 { font-size: 0.95rem; margin-bottom: 14px; }
.footer-inner p { color: var(--muted); font-size: 0.9rem; max-width: 320px; }
.footer-inner ul { list-style: none; }
.footer-inner li { margin-bottom: 9px; }
.footer-inner li a { color: var(--muted); font-size: 0.9rem; }
.footer-inner li a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 18px 0;
  text-align: center;
  color: var(--faint);
  font-size: 0.83rem;
}

/* ---------- Custom form controls ---------- */

/* File picker: hidden native input, themed button + filename readout */
.file-input {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px dashed var(--border-hover);
  border-radius: 10px;
  padding: 9px 12px;
  transition: border-color 0.15s;
}
.file-input:hover { border-color: var(--accent); }
.file-input input[type="file"] { display: none; }
.file-input > label { margin: 0; flex-shrink: 0; }
.file-name {
  color: var(--muted);
  font-size: 0.86rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-name.chosen { color: var(--success); font-weight: 500; }

/* Toggle switch (replaces checkboxes) */
label.switch {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
  margin: 0;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.switch .track {
  position: relative;
  width: 44px; height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-hover);
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 3px;
  width: 17px; height: 17px;
  border-radius: 50%;
  background: var(--muted);
  transition: left 0.2s, background 0.2s;
}
.switch input:checked + .track {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.switch input:checked + .track::after {
  left: 22px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(255, 59, 78, 0.6);
}
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(255, 59, 78, 0.25); }

/* ---------- Shop trust elements ---------- */

.trust-bar {
  margin-top: 48px;
  display: flex;
  justify-content: center;
  gap: 12px 36px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.88rem;
}
.trust-bar div { display: flex; align-items: center; gap: 8px; }

.secure-note {
  margin-top: 12px;
  color: var(--faint);
  font-size: 0.82rem;
  text-align: center;
}

.card-meta {
  display: flex;
  gap: 14px;
  color: var(--faint);
  font-size: 0.8rem;
}

.card-cta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 10px 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(to top, rgba(8, 8, 13, 0.92), rgba(8, 8, 13, 0));
  transform: translateY(100%);
  transition: transform 0.25s ease;
}
.mod-card:hover .card-cta { transform: translateY(0); }

/* Sticky buy column on mod detail pages */
@media (min-width: 861px) {
  .detail-info { position: sticky; top: 96px; }
}

/* ---------- Star ratings ---------- */

.card-meta .star-gold { color: #ffb347; font-weight: 600; }

.rating-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-top: 24px;
}
.rating-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}
.stars-avg { letter-spacing: 2px; }
.stars-avg .star { color: var(--faint); font-size: 1.1rem; }
.stars-avg .star.on { color: #ffb347; }

.rate-row { display: flex; gap: 2px; margin-top: 12px; }
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--faint);
  padding: 2px 4px;
  transition: color 0.12s, transform 0.12s;
}
.star-btn.on { color: #ffb347; }
.star-btn:hover { transform: scale(1.2); }
.rate-hint { color: var(--faint); font-size: 0.84rem; margin-top: 10px; }

/* ---------- Image gallery (mod detail) ---------- */

.gallery { position: relative; }
.gallery img { transition: opacity 0.2s ease; }
.gallery img.fading { opacity: 0; }

.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(8, 8, 13, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-hover);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0 0 4px;
  z-index: 2;
  transition: background 0.15s, border-color 0.15s;
}
.gallery-btn:hover { border-color: var(--accent); background: rgba(255, 59, 78, 0.3); }
.gallery-btn.prev { left: 12px; }
.gallery-btn.next { right: 12px; }

.gallery-count {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(8, 8, 13, 0.75);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 999px;
  z-index: 2;
}

.gallery-dots {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 7px;
  z-index: 2;
}
.gallery-dots button {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s, transform 0.15s;
}
.gallery-dots button:hover { background: rgba(255, 255, 255, 0.7); }
.gallery-dots button.active { background: var(--accent); transform: scale(1.3); }

/* ---------- FAQ ---------- */

.faq {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 20px;
  transition: border-color 0.2s;
}
.faq details[open] { border-color: var(--border-hover); }
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  font-weight: 600;
  font-family: var(--font-display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq-icon {
  color: var(--accent);
  font-size: 1.25rem;
  line-height: 1;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}
.faq details[open] .faq-icon { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding: 0 0 18px; font-size: 0.93rem; }

/* ---------- Motion & animations ---------- */

#app.route-in { animation: page-in 0.4s ease both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
}
#app { min-height: 60vh; }

/* Scroll-reveal (elements with .reveal get .in when scrolled into view) */
.reveal { opacity: 0; }
.reveal.in { animation: fade-up 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Glowing pulsing logo moon */
.logo img { animation: moon-glow 3.5s ease-in-out infinite; }
@keyframes moon-glow {
  0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 59, 78, 0.5)); }
  50% { filter: drop-shadow(0 0 15px rgba(255, 59, 78, 0.95)); }
}

/* Shimmering gradient text in the hero */
.hero h1 .grad {
  background: linear-gradient(90deg, #ff3b4e, #ff7a59, #ffb347, #ff3b4e);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer-text 5s linear infinite;
}
@keyframes shimmer-text {
  to { background-position: 250% center; }
}

/* Big floating blood moon behind the hero */
.hero .container { position: relative; z-index: 1; }
.hero-moon {
  position: absolute;
  top: 40px; right: 6%;
  width: clamp(160px, 22vw, 300px);
  opacity: 0.16;
  filter: blur(1px);
  pointer-events: none;
  animation: float-slow 11s ease-in-out infinite;
}
@keyframes float-slow {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-22px) rotate(4deg); }
}

/* Rising embers in the hero */
.embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.embers span {
  position: absolute;
  bottom: -14px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 12px 3px rgba(255, 100, 60, 0.5);
  opacity: 0;
  animation: ember-rise linear infinite;
}
.embers span:nth-child(1) { left: 6%;  animation-duration: 9s;    animation-delay: 0s;   width: 5px; height: 5px; }
.embers span:nth-child(2) { left: 18%; animation-duration: 12s;   animation-delay: 2.2s; }
.embers span:nth-child(3) { left: 31%; animation-duration: 8s;    animation-delay: 4.1s; width: 4px; height: 4px; }
.embers span:nth-child(4) { left: 47%; animation-duration: 11s;   animation-delay: 1.3s; width: 7px; height: 7px; }
.embers span:nth-child(5) { left: 60%; animation-duration: 9.5s;  animation-delay: 3.4s; }
.embers span:nth-child(6) { left: 74%; animation-duration: 13s;   animation-delay: 0.8s; width: 5px; height: 5px; }
.embers span:nth-child(7) { left: 86%; animation-duration: 10s;   animation-delay: 5s; }
.embers span:nth-child(8) { left: 94%; animation-duration: 8.5s;  animation-delay: 2.8s; width: 4px; height: 4px; }
@keyframes ember-rise {
  0%   { transform: translateY(0) scale(1); opacity: 0; }
  8%   { opacity: 0.85; }
  55%  { opacity: 0.45; }
  100% { transform: translateY(-580px) scale(0.3); opacity: 0; }
}

/* Shine sweep across card art on hover */
.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.16) 50%, transparent 60%);
  transform: translateX(-130%);
  transition: transform 0.65s ease;
  pointer-events: none;
}
.mod-card:hover .card-media::after { transform: translateX(130%); }

/* Animated underline on the active nav link */
.main-nav a { position: relative; }
.main-nav a::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.main-nav a.active::after { transform: scaleX(1); }

/* Auth card entrance */
.auth-card { animation: card-in 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
}

/* Feature icons pop on hover */
.feature .icon { transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1); }
.feature:hover .icon { transform: scale(1.15) rotate(-6deg); }

/* CTA band before the footer */
.cta-band {
  position: relative;
  text-align: center;
  padding: 64px 28px;
  border-radius: 20px;
  border: 1px solid rgba(255, 59, 78, 0.35);
  background:
    radial-gradient(ellipse at 50% -30%, rgba(255, 59, 78, 0.28), transparent 60%),
    var(--surface);
  overflow: hidden;
}
.cta-band h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); margin-bottom: 10px; }
.cta-band p { color: var(--muted); margin-bottom: 28px; }

/* Dark scrollbar */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 8px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* Respect users who turn off animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; }
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .detail-grid, .account-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: grid; place-items: center; }
  .main-nav {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    gap: 4px;
  }
  .main-nav.open { display: flex; }
  .header-inner { justify-content: space-between; }
  .field-row { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero { padding: 70px 0 60px; }
  .hero-moon { opacity: 0.1; right: -30px; }
}
