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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #222;
  --border: #2e2e2e;
  --text: #f0f0f0;
  --muted: #888;
  --accent: #f97316;
  --accent-dim: rgba(249, 115, 22, 0.12);
  --radius: 10px;
  --radius-lg: 14px;
}

html { scroll-behavior: smooth; }

body {
  /* Full-screen wallpaper, fixed (doesn't scroll), with a slight dark
     overlay so the cards/text on top stay readable. Tweak the overlay
     alpha below if you want more (0.5) or less (0.25) darkening. */
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(10, 10, 10, 0.38), rgba(10, 10, 10, 0.38)),
    url('/assets/textures/wallpaper.jpg');
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app { position: relative; min-height: 100vh; }

.page {
  position: absolute;
  inset: 0;
  min-height: 100vh;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.page.hidden { opacity: 0; pointer-events: none; transform: translateY(10px); }
.page.visible { opacity: 1; pointer-events: all; transform: translateY(0); }

nav {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(15, 15, 15, 0.93);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  gap: 12px;
  flex-wrap: wrap;
}

.meta-chip.cd-chip {
  background: rgba(249, 115, 22, 0.12);
  border-color: rgba(249, 115, 22, 0.35);
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.meta-chip.cd-chip.launched {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.4);
  color: #86efac;
}
.meta-chip.launch-chip {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.3);
  color: #93c5fd;
}

.ip-chip {
  cursor: pointer;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  transition: background .15s, border-color .15s;
}
.ip-chip:hover { border-color: var(--accent); color: var(--accent); }
.ip-chip.copied { background: var(--accent); border-color: var(--accent); color: #fff; }
.ip-chip code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  background: transparent;
}
.nav-logo {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-family: inherit;
}
.nav-logo span { color: var(--text); font-weight: 400; }
.nav-badge {
  font-size: 11px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(249, 115, 22, 0.2);
  padding: 3px 10px;
  border-radius: 999px;
}

/* ================ Server info row (in nav) ================ */
.server-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}
.meta-chip-label { color: var(--muted); font-weight: 400; }
.meta-chip.version  { background: rgba(96, 165, 250, 0.1);  border-color: rgba(96, 165, 250, 0.3);  color: #93c5fd; }
.meta-chip.loader   { background: rgba(74, 222, 128, 0.1);  border-color: rgba(74, 222, 128, 0.3);  color: #86efac; }

/* ================ Hero lore + Play Now CTA ================ */
.hero-lore {
  font-size: 15px;
  color: #ccc;
  line-height: 1.7;
  margin: 1rem 0 0.5rem;
}
.hero-lore p { margin: 0; }
/* In the hero, every inner vertical gap is the same single rhythm value
   — title↔lore, lore↔Play Now, and Play Now↔card edge all match. */
.hero-bg .hero-ctas { margin: 0; }
.mention {
  color: #c084fc;
  font-weight: 500;
  background: rgba(192, 132, 252, 0.08);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* Past-seasons row — small inline chips at the bottom of the lore.
   Stays on one line on desktop; scrolls horizontally on narrow screens
   instead of wrapping. No divider line — the row flows naturally with
   the lore text so the chip reads as one cohesive block. */
.lore-seasons {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-top: 0.75rem;
  overflow-x: auto;
  scrollbar-width: thin;
  -ms-overflow-style: none;
}
.lore-seasons::-webkit-scrollbar { height: 4px; }
.lore-seasons::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.lore-seasons-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-right: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.season-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .15s, background .15s, transform .15s;
}
.season-chip:hover {
  border-color: #ff5252;
  background: rgba(255, 82, 82, 0.12);
  transform: translateY(-1px);
}
.season-chip .cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  font-size: 7px;
  background: #ff0000;
  color: #fff;
  border-radius: 3px;
  font-weight: 700;
  line-height: 1;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Play Now! — big, bold, glowing primary CTA */
.setup-cta.play-now {
  font-size: 18px;
  font-weight: 700;
  padding: 16px 36px;
  letter-spacing: .01em;
  background: linear-gradient(135deg, #fb923c 0%, var(--accent) 50%, #ea580c 100%);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(249, 115, 22, 0.3),
    0 12px 28px rgba(249, 115, 22, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  position: relative;
  overflow: hidden;
}
.setup-cta.play-now:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 0 0 1px rgba(249, 115, 22, 0.5),
    0 16px 36px rgba(249, 115, 22, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.setup-cta.play-now:active {
  transform: translateY(0) scale(1);
}
/* Static halo element — invisible by default. Only animates when
   .invite-glow is applied (first-time visitors who haven't clicked yet). */
.setup-cta.play-now::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(249, 115, 22, 0.55), transparent 70%);
  z-index: -1;
  opacity: 0;
  pointer-events: none;
}

/* "Press me!" inviting glow — pulses the halo + gently breathes the
   button itself. Removed permanently after the first click (the JS
   stores a flag in localStorage). */
.setup-cta.play-now.invite-glow {
  animation: play-now-breathe 2.4s ease-in-out infinite;
}
.setup-cta.play-now.invite-glow::after {
  animation: play-now-halo 2.4s ease-in-out infinite;
}
@keyframes play-now-halo {
  0%, 100% { opacity: 0.25; transform: scale(0.95); }
  50%      { opacity: 1;    transform: scale(1.20); }
}
@keyframes play-now-breathe {
  0%, 100% { transform: translateY(0)    scale(1);     }
  50%      { transform: translateY(-2px) scale(1.025); }
}
/* While hovering: hold the glow on at max so it feels responsive */
.setup-cta.play-now.invite-glow:hover {
  animation: none;
  transform: translateY(-2px) scale(1.02);
}
.setup-cta.play-now.invite-glow:hover::after {
  animation: none;
  opacity: 1;
  transform: scale(1.15);
}
@media (prefers-reduced-motion: reduce) {
  .setup-cta.play-now.invite-glow,
  .setup-cta.play-now.invite-glow::after {
    animation: none;
  }
  .setup-cta.play-now.invite-glow::after { opacity: 0.6; }
}

/* ================ Setup CTA on homepage ================ */
.setup-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1.5rem;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 13px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.setup-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.3);
}

/* ================ Video embed (mod detail) ================ */
.video-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; }
.video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 1rem;
}
.video-placeholder .yt-icon { font-size: 36px; }
.video-placeholder .yt-search {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent);
  padding: 6px 14px;
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: 999px;
  text-decoration: none;
}
.video-placeholder .yt-search:hover { background: rgba(249, 115, 22, 0.2); }
.download-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s, transform .15s;
}
.download-link:hover { background: rgba(249, 115, 22, 0.2); transform: translateY(-1px); }
.download-link svg { flex-shrink: 0; }

/* ================ Setup page ================ */
.setup-inner { max-width: 780px; margin: 0 auto; padding: 0 2rem 4rem; }
.setup-inner > .back-btn { margin: 1rem 0 0.75rem; }
.setup-hero {
  padding: 0.5rem 0 1.25rem;
  text-align: center;
  margin-bottom: 1.5rem;
}
.setup-hero h1 {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1.5rem;
  font-size: clamp(22px, 4vw, 30px);
  color: #fff;
  font-weight: 600;
  margin-bottom: .5rem;
}
.setup-hero p { font-size: 15px; color: var(--muted); max-width: 480px; margin: 0 auto; }
.setup-steps { display: flex; flex-direction: column; gap: 1.5rem; }
.setup-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
}
.setup-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.setup-step-body { flex: 1; min-width: 0; }
.setup-step h2 { font-size: 16px; color: #fff; margin-bottom: 6px; }
.setup-step p { font-size: 14px; color: #bbb; line-height: 1.7; margin-bottom: 10px; }
.setup-step p:last-child { margin-bottom: 0; }
.setup-step ul { font-size: 14px; color: #bbb; line-height: 1.7; margin-left: 1.25rem; }
.setup-step a, .setup-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted rgba(249, 115, 22, 0.4);
}
.setup-step a:hover, .setup-link:hover { border-bottom-style: solid; }
.setup-step .step-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  text-decoration: none;
}
.setup-step .step-cta:hover { transform: translateY(-1px); }
.setup-step .placeholder-box {
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* Modpack import — two-option cards */
.modpack-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.modpack-option {
  display: block;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none !important;
  color: var(--text);
  transition: transform .15s, border-color .15s, background .15s;
  border-bottom: 1px solid var(--border) !important;
}
.modpack-option:hover {
  transform: translateY(-2px);
  border-color: #555;
  background: var(--surface);
}
.modpack-option.recommended {
  background: var(--accent-dim);
  border-color: rgba(249, 115, 22, 0.35);
}
.modpack-option.recommended:hover {
  border-color: var(--accent);
  background: rgba(249, 115, 22, 0.18);
}
.modpack-option-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.modpack-option.recommended .modpack-option-tag {
  color: var(--accent);
  background: rgba(249, 115, 22, 0.1);
  border-color: rgba(249, 115, 22, 0.3);
}
.modpack-option-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 5px;
}
.modpack-option-desc {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.hero { max-width: 960px; margin: 0 auto; padding: 3.5rem 2rem 2.5rem; }

/* Hero with showcase screenshot as background — text inside sits in
   frosted chips so it stays readable against the busy image. */
.hero-bg {
  position: relative;
  margin: 2rem auto;
  padding: 2.5rem 2.5rem 1.25rem; /* tighter bottom so Play Now grounds the card */
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate; /* so ::before can sit beneath content via z-index */
  background-image: url('/assets/showcase/hero.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
}
/* Darkening overlay so chips read — pretty subtle so the cherry-blossom
   shot really pops through. Tweak these alphas to taste:
   higher = darker / more readable; lower = brighter image. */
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 10, 10, 0.08),
    rgba(10, 10, 10, 0.28)
  );
  z-index: -1;
}

/* Shared chip look used by hero text blocks */
.hero-bg .hero-title-chip,
.hero-bg .hero-lore {
  background: rgba(15, 15, 15, 0.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
/* Title chip — fits the title text */
.hero-bg .hero-title-chip {
  display: inline-block;
  width: auto;
  padding: 1rem 1.5rem;
  margin: 0 0 0.75rem;
}
/* Lore chip — wider, sits below title. Same top/bottom padding as the
   title chip so the visual gap between text blocks reads uniform. */
.hero-bg .hero-lore {
  padding: 1rem 1.5rem;
  margin: 0 0 0.75rem;
}

/* Floating tip-of-the-day chip — pinned to bottom-right of the viewport.
   Two-step click pattern: tap once to expand and read, tap again to open
   the referenced mod's page. X button collapses without navigating. */
.tip-fab {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 50;
  cursor: pointer;
  color: var(--text);
  /* Stone bricks + dark overlay so the chip reads anywhere */
  background-image:
    linear-gradient(rgba(10, 10, 10, 0.78), rgba(10, 10, 10, 0.78)),
    url('/assets/textures/bricks.jpg');
  background-repeat: repeat;
  background-size: auto, 180px auto;
  border: 1px solid var(--border);
  border-radius: 999px; /* pill in collapsed state */
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: border-color .2s, box-shadow .2s, border-radius .2s, transform .15s;
  overflow: hidden;
  max-width: calc(100vw - 2rem);
}
.tip-fab:hover { border-color: var(--accent); box-shadow: 0 8px 24px rgba(249, 115, 22, 0.25); }

/* Lightbulb emoji glow on hover — soft warm pulse */
.tip-bulb {
  display: inline-block;
  transition: filter .25s ease;
  filter: drop-shadow(0 0 0 transparent);
}
.tip-fab:hover .tip-bulb,
.tip-fab:focus-visible .tip-bulb {
  animation: tip-bulb-glow 1.4s ease-in-out infinite;
}
@keyframes tip-bulb-glow {
  0%, 100% {
    filter:
      drop-shadow(0 0 4px rgba(255, 226, 130, 0.85))
      drop-shadow(0 0 10px rgba(255, 196, 60, 0.55));
  }
  50% {
    filter:
      drop-shadow(0 0 9px rgba(255, 240, 170, 1))
      drop-shadow(0 0 20px rgba(255, 206, 80, 0.75));
  }
}
@media (prefers-reduced-motion: reduce) {
  .tip-fab:hover .tip-bulb,
  .tip-fab:focus-visible .tip-bulb {
    animation: none;
    filter:
      drop-shadow(0 0 6px rgba(255, 226, 130, 0.9))
      drop-shadow(0 0 14px rgba(255, 196, 60, 0.6));
  }
}
.tip-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Collapsed = small pill */
.tip-fab.collapsed .tip-fab-collapsed { display: block; padding: 10px 18px; font-size: 13px; font-weight: 500; letter-spacing: .01em; }
.tip-fab.collapsed .tip-fab-expanded  { display: none; }

/* Expanded = full card */
.tip-fab.expanded {
  border-radius: var(--radius-lg);
  width: 380px;
  cursor: pointer; /* tap-to-navigate */
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(249, 115, 22, 0.22);
}
.tip-fab.expanded .tip-fab-collapsed { display: none; }
.tip-fab.expanded .tip-fab-expanded  { display: block; padding: 14px 16px; }

.tip-fab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.tip-fab-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
}
.tip-fab-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 4px;
  line-height: 1;
  font-family: inherit;
  transition: color .15s;
}
.tip-fab-close:hover { color: var(--text); }

.tip-fab-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.tip-icon {
  font-size: 22px;
  flex-shrink: 0;
  line-height: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tip-content { flex: 1; min-width: 0; }
.tip-text {
  font-size: 13px;
  color: #ddd;
  line-height: 1.55;
  margin-bottom: 6px;
}
.tip-mod {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: .02em;
}
.tip-mod span { color: var(--accent); font-weight: 500; }

@media (max-width: 600px) {
  /* Collapsed = small lightbulb circle pinned bottom-right.
     Doesn't stretch across the screen. */
  .tip-fab.collapsed {
    bottom: 0.75rem;
    right: 0.75rem;
    left: auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  }
  .tip-fab.collapsed .tip-fab-collapsed {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    font-size: 24px;
    line-height: 1;
  }
  .tip-fab.collapsed .tip-collapsed-text { display: none; }

  /* Expanded = full readable card across the bottom of the viewport */
  .tip-fab.expanded {
    bottom: 0.75rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-width: none;
  }
}

/* Browse panel — single unified card containing the modpack pitch,
   search, filters, and both mod grids. */
.browse-panel {
  max-width: 960px;
  margin: 1.5rem auto 2rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
/* Modpack pitch sits at the top of the panel — no extra border/bg
   since the panel itself provides that. Separated from the controls
   below by a horizontal divider. */
.browse-panel .modpack-card {
  margin: 0 0 1.5rem;
  padding: 0 0 1.5rem;
  border: none;
  background: transparent;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
/* Override inner padding/margins so things flow naturally inside the panel */
.browse-panel .controls {
  padding: 0 0 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  max-width: none;
}
.browse-panel .section-header {
  padding: 0 0 0.75rem;
  margin: 0;
  max-width: none;
}
.browse-panel .grid,
.browse-panel .grid-hood {
  padding: 0;
  margin: 0;
  max-width: none;
  background: transparent;
}
.browse-panel #gameplay-section {
  margin-bottom: 1.5rem;
}
.browse-panel #hood-section {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.browse-panel .hood-note {
  padding: 0 0 0.75rem;
  max-width: none;
  margin: 0;
}
.browse-panel .hood-note > div {
  background: var(--surface2);
}
/* Mod cards inside the panel — slightly different shade so they stand out
   against the panel surface */
.browse-panel .mod-card {
  background: var(--surface2);
}
.browse-panel .mod-card:hover {
  background: #2a2a2a;
}

@media (max-width: 600px) {
  .hero-bg { margin: 1rem; padding: 1.5rem; }
  .hero-bg .hero-title-chip { padding: 1rem 1.25rem; }
  .browse-panel { margin: 1rem; padding: 1.25rem; }
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.25);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 600;
  color: #fff;
  line-height: 1.15;
  margin-bottom: .75rem;
}
.hero h1 span { color: var(--accent); }
.hero p { font-size: 15px; color: var(--muted); }
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.stat-num { font-size: 22px; font-weight: 600; color: #fff; }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ================ Modpack feature card (replaces hero stats) ================ */
.modpack-card {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border);
}
.modpack-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.25);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: .75rem;
}
.modpack-title {
  font-size: clamp(22px, 3.5vw, 28px);
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  margin-bottom: .5rem;
}
.modpack-desc {
  font-size: 14px;
  color: #bbb;
  line-height: 1.7;
}

/* ================ Whitelist form ================ */
.whitelist-form {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 10px;
}
.form-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.form-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.form-row input[type="text"] {
  flex: 1;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  padding: 10px 12px;
  outline: none;
  transition: border-color .15s;
  min-width: 0;
}
.form-row input[type="text"]:focus { border-color: var(--accent); }
.form-row input[type="text"]:invalid:not(:placeholder-shown) { border-color: #f87171; }
.form-submit {
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 10px 18px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform .15s, opacity .15s;
  white-space: nowrap;
}
.form-submit:hover:not(:disabled) { transform: translateY(-1px); }
.form-submit:disabled { opacity: 0.6; cursor: default; }
.form-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}
.form-success,
.form-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}
.form-success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #86efac;
}
.form-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #f87171;
}

.controls {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 1.5rem;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 300px; }
.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-wrap input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 8px 12px 8px 34px;
  outline: none;
  transition: border-color .15s;
}
.search-wrap input:focus { border-color: var(--accent); }
.search-wrap input::placeholder { color: var(--muted); }
.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.filter-btn {
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-btn:hover { border-color: #555; color: var(--text); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter-btn .filter-count {
  font-size: 10px;
  opacity: .7;
  font-variant-numeric: tabular-nums;
}

.section-header {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.5rem 2rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-header-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.section-header-line { flex: 1; height: 1px; background: var(--border); }
.section-header-count { font-size: 12px; color: var(--muted); }

.grid,
.grid-hood {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}
.grid-hood { padding-bottom: 4rem; }

.mod-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.mod-card:hover { border-color: #444; background: var(--surface2); transform: translateY(-2px); }
.mod-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Hood cards: dimmer at rest to signal they're support utilities, but
   fully interactive — click opens the same detail page as gameplay mods. */
.mod-card.hood { opacity: .85; }
.mod-card.hood:hover { opacity: 1; }
.mod-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.mod-name { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.3; }
.mod-desc { font-size: 12px; color: var(--muted); line-height: 1.5; flex: 1; }
.mod-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  width: fit-content;
}
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: 14px;
}

/* MOD DETAIL PAGE */
.mod-page-inner { max-width: 780px; margin: 0 auto; padding: 0 2rem 5rem; }

.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 0 1rem;
  gap: 1rem;
}
/* Back + Share styled as chips that match the meta-chip aesthetic */
.back-btn,
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.back-btn:hover,
.share-btn:hover {
  border-color: #555;
  background: var(--surface2);
  color: #fff;
}
.share-btn.copied {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}
.back-btn:hover svg { transform: translateX(-3px); }
.back-btn svg { transition: transform .15s; }

/* Unified header card — icon + title + tagline + about, all in one chip */
.mod-page-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.mod-page-header-top {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}
.mod-page-about {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.mod-page-about .section-title {
  margin-bottom: 0.75rem;
}
.mod-page-about p {
  font-size: 14px;
  color: #bbb;
  line-height: 1.7;
}
.mod-page-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.mod-page-title { font-size: 26px; font-weight: 600; color: #fff; margin-bottom: 4px; }
.mod-page-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.mod-page-tagline { font-size: 14px; color: var(--muted); line-height: 1.6; }

.sections { display: flex; flex-direction: column; gap: 1.5rem; }
.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section p { font-size: 14px; color: #bbb; line-height: 1.7; }

.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid var(--border); }
.step:last-child { border-bottom: none; padding-bottom: 0; }
.step:first-child { padding-top: 0; }
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.25);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.step-title { font-size: 13px; font-weight: 500; color: #fff; margin-bottom: 2px; }
.step-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 8px;
}
.item-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.item-card-body { flex: 1; min-width: 0; }
.item-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  image-rendering: pixelated;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px;
  object-fit: contain;
}
.item-name { font-size: 13px; font-weight: 500; color: #fff; margin-bottom: 3px; }
.item-desc { font-size: 12px; color: var(--muted); line-height: 1.45; }

.recipe-list { display: flex; flex-direction: column; gap: 14px; }

/* JEI-style recipe card */
.recipe-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.recipe-card-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}
.recipe-card-name { font-size: 13px; font-weight: 600; color: #fff; }
.recipe-card-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
}

/* JEI grid layout: inputs → arrow → output */
.recipe-jei {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.recipe-inputs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 280px;
}
.recipe-slot {
  background: #0a0a0a;
  border: 1px solid #333;
  border-radius: 4px;
  min-width: 64px;
  min-height: 64px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  /* faint inner shadow like a JEI slot */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}
.recipe-slot-icon {
  font-size: 22px;
  line-height: 1;
  margin-bottom: 3px;
}
.slot-img {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
  margin-bottom: 3px;
  object-fit: contain;
}
.recipe-output .slot-img { width: 40px; height: 40px; }
.recipe-slot-label {
  font-size: 10px;
  color: #ddd;
  line-height: 1.2;
  word-break: break-word;
}
.recipe-arrow {
  color: var(--muted);
  font-size: 20px;
  user-select: none;
  flex-shrink: 0;
}
.recipe-output {
  position: relative;
}
.recipe-output .recipe-slot {
  background: var(--accent-dim);
  border-color: rgba(249, 115, 22, 0.35);
  min-width: 72px;
  min-height: 72px;
}
.recipe-output .recipe-slot-label { color: #fff; font-weight: 500; }

/* Free-form / textual recipes (when no ingredient list to slot up) */
.recipe-text {
  font-size: 12px;
  color: #bbb;
  line-height: 1.5;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.recipe-text .ing-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  display: block;
  margin-bottom: 4px;
}

/* Real-screenshot override */
.recipe-image-wrap {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  justify-content: center;
}
.recipe-image-wrap img {
  max-width: 100%;
  max-height: 220px;
  image-rendering: pixelated; /* keep MC textures crisp */
  border-radius: 4px;
}
.recipe-image-credit {
  font-size: 10px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}
.recipe-image-credit a { color: var(--muted); text-decoration: underline; }
.recipe-image-credit a:hover { color: var(--text); }

.recipe-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

@media (max-width: 500px) {
  .recipe-slot { min-width: 56px; min-height: 56px; }
  .recipe-output .recipe-slot { min-width: 64px; min-height: 64px; }
  .recipe-slot-icon { font-size: 18px; }
}

.build-list { display: flex; flex-direction: column; gap: 10px; }
.build-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #ccc;
  line-height: 1.5;
}
.build-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

.tip-box {
  background: var(--accent-dim);
  border: 1px solid rgba(249, 115, 22, 0.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  color: #f4a76a;
  line-height: 1.6;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.tip-icon { font-size: 16px; flex-shrink: 0; }

/* ================ Screenshot gallery ================ */
.screenshots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
}
.screenshot-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  cursor: zoom-in;
  padding: 0;
  transition: border-color .15s, transform .15s;
}
.screenshot-thumb:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.screenshot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  display: block;
}
.screenshot-thumb .thumb-num {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.gallery-credit {
  font-size: 11px;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
}
.gallery-credit a { color: var(--muted); }

/* ================ Lightbox modal ================ */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.lightbox.visible { opacity: 1; pointer-events: all; }
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  border-radius: 6px;
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.8);
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: background .15s, transform .15s;
  z-index: 1;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.08);
}
.lightbox-close { top: 20px; right: 20px; }
.lightbox-prev  { left: 20px;  top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #ccc;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 14px;
  border-radius: 999px;
}

.hood-note {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem .75rem;
}
.hood-note > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 600px) {
  /* Match nav horizontal padding to the hero so the logo+chips line up
     flush-left with the title underneath, instead of being indented. */
  nav { padding: 0; }
  .nav-top { padding: 0.85rem 1rem; }
  .hero { padding: 2rem 1rem 1.5rem; }
  .controls { padding: 0 1rem 1.5rem; }
  .grid, .grid-hood, .section-header { padding-left: 1rem; padding-right: 1rem; }
  .mod-page-inner, .setup-inner { padding: 0 1rem 4rem; }
  .hero-stats { gap: 1.25rem; }
  .search-kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
