/* ========================================================
   ImNotMentaL - Bootstrap 5 Dark Gaming Theme (Modspoint Palette)
   Primary Accent: #00d58d (Neon Mint Emerald)
   Background: #070707
   Card / Surface: #16161a / #1a1a20
   ======================================================== */

:root, [data-bs-theme="dark"] {
  --bs-primary: #00d58d;
  --bs-primary-rgb: 0, 213, 141;
  --bs-primary-hover: #00b87a;
  --bs-body-bg: #070707;
  --bs-body-color: #f3f4f6;
  --bs-secondary-color: #9ca3af;
  --bs-border-color: rgba(255, 255, 255, 0.08);
  --bs-card-bg: #16161a;
  --bs-card-border-color: rgba(255, 255, 255, 0.08);
  --bs-card-cap-bg: #121216;
  --bs-tertiary-bg: #121216;
  --primary-glow: rgba(0, 213, 141, 0.25);
}

body {
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #070707;
}
::-webkit-scrollbar-thumb {
  background: #23232b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--bs-primary);
}

/* Primary Button with Modspoint Accent */
.btn-primary {
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
  color: #000 !important;
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover, .btn-primary:focus {
  background-color: var(--bs-primary-hover) !important;
  border-color: var(--bs-primary-hover) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 213, 141, 0.4);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: var(--bs-border-color) !important;
  color: #fff !important;
  font-weight: 600;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}
.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-2px);
}

.btn-outline-primary {
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}
.btn-outline-primary:hover {
  background-color: var(--bs-primary) !important;
  color: #000 !important;
}

/* Mod Card Style */
.mod-card {
  background-color: #16161a;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.85rem;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.mod-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 213, 141, 0.4);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 213, 141, 0.12);
}
.mod-card:hover .mod-thumb {
  transform: scale(1.05);
}
.mod-card:hover .mod-title {
  color: var(--bs-primary) !important;
}

.mod-thumb-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: #0b0b0f;
}
.mod-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

/* Badges */
.badge-game {
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-version {
  background: var(--bs-primary);
  color: #000;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: 0.35rem;
}

.badge-wip {
  background: #f59e0b;
  color: #000;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
  border-radius: 0.35rem;
}

/* Navigation Tabs */
.nav-tabs .nav-link {
  color: var(--bs-secondary-color);
  border: none;
  border-bottom: 2px solid transparent;
  font-weight: 600;
  padding-bottom: 0.75rem;
}
.nav-tabs .nav-link:hover {
  color: #fff;
  border-color: transparent;
}
.nav-tabs .nav-link.active {
  color: var(--bs-primary) !important;
  background-color: transparent !important;
  border-bottom: 2px solid var(--bs-primary) !important;
}

/* Form Controls */
.form-control, .form-select {
  background-color: #16161a !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--bs-primary) !important;
  box-shadow: 0 0 0 0.25rem rgba(0, 213, 141, 0.25) !important;
}

/* Markdown typography styling */
.markdown-body {
  color: #d1d5db;
  line-height: 1.7;
}
.markdown-body h1, .markdown-body h2, .markdown-body h3 {
  color: #fff;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
}
.markdown-body h2 {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 0.4rem;
}
.markdown-body a {
  color: var(--bs-primary);
  text-decoration: none;
}
.markdown-body a:hover {
  text-decoration: underline;
}
.markdown-body code {
  background: rgba(255, 255, 255, 0.08);
  color: var(--bs-primary);
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  font-size: 0.9em;
  font-family: Consolas, Monaco, monospace;
}
.markdown-body pre {
  background: #0f0f14;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.5rem;
  padding: 1rem;
  overflow-x: auto;
}
/* Images, videos and wide content must never overflow the card (guides, mod descriptions, previews) */
.markdown-body { overflow-wrap: anywhere; min-width: 0; }
.markdown-body img, .markdown-body video, .markdown-body iframe, .markdown-body embed, .markdown-body object, .markdown-body svg {
  max-width: 100%;
  height: auto;
}
.markdown-body iframe { aspect-ratio: 16 / 9; width: 100%; }
.markdown-body img { border-radius: 0.5rem; }
/* Tables (Markdown or HTML): bordered cells, centred header; scrolls sideways inside the card when too wide */
.markdown-body table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1rem 0; font-size: 0.95em; }
.markdown-body th, .markdown-body td { border: 1px solid rgba(255,255,255,0.14); padding: 0.55rem 0.9rem; vertical-align: middle; }
.markdown-body th { background: rgba(255,255,255,0.06); color: #fff; font-weight: 700; text-align: center; }
.markdown-body tbody tr:nth-child(even) td, .markdown-body table > tr:nth-child(even) td { background: rgba(255,255,255,0.025); }
.markdown-body td[align="center"], .markdown-body th[align="center"] { text-align: center; }
.markdown-body ul, .markdown-body ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}
.markdown-body li {
  margin-bottom: 0.35rem;
}

/* ===== Mod detail page ===== */
.surface-panel { background-color: #121216; border-color: rgba(255,255,255,0.08) !important; }
.gallery-nav { width: 2.5rem; height: 2.5rem; background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.1); opacity: 0.85; }
.gallery-nav:hover { background: rgba(0,0,0,0.9); opacity: 1; }
.gallery-nav-left { left: 0.75rem; }
.gallery-nav-right { right: 0.75rem; }
.gallery-thumb { width: 7rem; aspect-ratio: 16 / 9; border: 2px solid rgba(255,255,255,0.1); border-radius: 0.5rem; overflow: hidden; background: none; transition: border-color 0.2s; }
.gallery-thumb:hover { border-color: rgba(255,255,255,0.4); }
.gallery-thumb.active { border-color: #00d58d; box-shadow: 0 0 0 3px rgba(0,213,141,0.3); }
.lightbox-overlay { position: fixed; inset: 0; z-index: 1080; background: rgba(0,0,0,0.9); backdrop-filter: blur(6px); }
.lightbox-close { position: absolute; top: 1.25rem; right: 1.25rem; }

/* ===== Admin pages (login + admin/*) ===== */
.admin-header { background-color: #121216; border-color: rgba(255,255,255,0.08) !important; }
.admin-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #00d58d; }
.admin-card { background-color: #121216; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; }
.admin-card .card-header { background-color: transparent; border-bottom: 1px solid rgba(255,255,255,0.08); padding: 1rem 1.5rem; }
.admin-card-accent { background-color: #16161a; border-color: rgba(0,213,141,0.3); }
.admin-code-box { background: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.05); border-radius: 8px; color: #d1d5db; }
.admin-card .table { --bs-table-bg: transparent; }
.admin-card .table thead th { color: #9ca3af; font-weight: 600; background: rgba(255,255,255,0.02); }
.admin-card .form-control, .admin-card .form-select { background-color: #16161a; border-color: rgba(255,255,255,0.1); color: #fff; }
.admin-card .form-control:focus, .admin-card .form-select:focus { border-color: #00d58d; box-shadow: 0 0 0 0.2rem rgba(0,213,141,0.15); }
.admin-card .form-check-input:checked { background-color: #00d58d; border-color: #00d58d; }

/* ========================================================
   Admin: screenshot gallery manager
   ======================================================== */
.gallery-dropzone {
  display: block;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 0.75rem;
  padding: 1.75rem 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.gallery-dropzone:hover,
.gallery-dropzone.is-over {
  border-color: var(--bs-primary);
  background-color: rgba(0, 213, 141, 0.06);
}
.gallery-thumb-sm {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 0.4rem;
  border: 1px solid var(--bs-border-color);
  background: #0b0b0d;
  display: block;
}
#gallery-table tr[draggable="true"] { cursor: default; }

/* Admin: gallery picker + media field previews */
.media-preview {
  margin-top: 0.5rem;
  width: 100%;
  max-height: 110px;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color);
  background: #0b0b0d;
}
.picker-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0.6rem;
  overflow: hidden;
  background: #0b0b0d;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.picker-item img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.picker-item:hover { border-color: rgba(0, 213, 141, 0.6); transform: translateY(-2px); }
.picker-item.selected { border-color: var(--bs-primary); box-shadow: 0 0 0 2px rgba(0, 213, 141, 0.25); }

/* ========================================================
   Header live search dropdown
   ======================================================== */
#search-dropdown {
  left: auto !important;
  right: 0 !important;
  width: min(420px, 92vw);
  max-height: none !important;
  overflow: hidden;
  background: #121216 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 0.85rem !important;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(0, 213, 141, 0.06);
}
#search-results { max-height: 70vh; overflow-y: auto; padding: 0.4rem; }

.search-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.6rem;
  color: #f3f4f6;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.search-item:hover, .search-item.active { background: rgba(0, 213, 141, 0.1); color: #fff; }
.search-item.active { box-shadow: inset 0 0 0 1px rgba(0, 213, 141, 0.35); }

.search-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #0b0b0d;
}
.search-thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--bs-primary); font-size: 1.1rem; }

.search-info { min-width: 0; flex: 1; }
.search-title {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-mark { background: transparent; color: var(--bs-primary); padding: 0; font-weight: 800; }
.search-meta { display: flex; align-items: center; gap: 0.6rem; font-size: 0.72rem; color: #9ca3af; margin-top: 0.1rem; }
.search-cat {
  padding: 0.05rem 0.45rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.07);
  color: #d1d5db;
}

.search-all {
  margin-top: 0.3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0 0 0.6rem 0.6rem;
  padding-top: 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bs-primary);
}
.search-empty { padding: 1.5rem 1rem; text-align: center; color: #9ca3af; font-size: 0.85rem; }
.search-empty i { display: block; font-size: 1.6rem; margin-bottom: 0.4rem; color: #6b7280; }
.search-empty small { color: #6b7280; }

/* Horizontal scrollers clip hover effects (overflow-x:auto forces overflow-y:auto too).
   Pad the scroller so lifts/glows/rings have room, and cancel the padding with negative margins
   so the surrounding layout doesn't move. */
.scroll-x-safe {
  padding: 10px 6px 16px;
  margin: -10px -6px -4px;
}

/* Admin: shared navigation (views/partials/admin-nav.ejs) */
.admin-nav-link {
  color: #9ca3af;
  text-decoration: none;
  padding: 0.3rem 0.65rem;
  border-radius: 0.5rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.admin-nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.admin-nav-link.active { color: var(--bs-primary); background: rgba(0, 213, 141, 0.1); }

/* Users admin */
.usr-you { background: rgba(0, 213, 141, 0.18); color: #00d58d; border: 1px solid #00d58d; }

/* ---- CMS Pages (pg-) ---- */
.pg-preview-panel { border: 1px solid var(--bs-border-color); border-radius: .5rem; padding: 1rem 1.25rem; background: rgba(255,255,255,0.03); max-height: 520px; overflow: auto; }
.pg-draft-banner { border-left: 4px solid #ffc107; }
.pg-card img { max-width: 100%; height: auto; }

/* ---- Admin media library (med-) ---- */
.med-drop { border: 2px dashed rgba(255,255,255,0.18); border-radius: 10px; padding: 1.5rem; cursor: pointer; transition: border-color .15s, background .15s; }
.med-drop:hover, .med-drop-active { border-color: #00d58d; background: rgba(0,213,141,0.06); }
.med-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; background: #111; cursor: pointer; }
.med-thumb.med-broken { opacity: .25; }
.med-preview { background: #0b0b0b; border-radius: 8px; display: flex; align-items: center; justify-content: center; min-height: 160px; }
.med-preview img { max-width: 100%; max-height: 300px; border-radius: 6px; }
.med-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.med-picker-item { background: #151515; border: 2px solid transparent; border-radius: 8px; padding: 4px; color: #adb5bd; font-size: 11px; text-align: center; cursor: pointer; overflow: hidden; }
.med-picker-item:hover { border-color: #00d58d; }
.med-picker-item img { width: 100%; height: 90px; object-fit: cover; border-radius: 4px; display: block; }
.med-picker-item span { display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Admin menus (mnu-) ---- */
.mnu-row { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; margin-bottom: .35rem; border: 1px solid var(--bs-border-color); border-radius: .5rem; background: rgba(255,255,255,.03); cursor: grab; }
.mnu-row.mnu-child { margin-left: 2rem; border-left: 3px solid #00d58d; }
.mnu-row.mnu-hidden { opacity: .6; border-style: dashed; }
.mnu-row.mnu-before { box-shadow: 0 -3px 0 0 #00d58d; }
.mnu-row.mnu-after { box-shadow: 0 3px 0 0 #00d58d; }
.mnu-row.mnu-into { outline: 2px dashed #00d58d; outline-offset: -2px; }
.mnu-grip { color: var(--bs-secondary-color); }
.mnu-main { flex: 1 1 auto; min-width: 0; }
.mnu-pv-bar { display: flex; flex-wrap: wrap; gap: .25rem; padding: .5rem; background: #000; border: 1px solid var(--bs-border-color); border-radius: .5rem; }
.mnu-pv-item { position: relative; }
.mnu-pv-link { display: inline-block; padding: .35rem .7rem; font-weight: 600; font-size: .85rem; color: #dee2e6; }
.mnu-pv-dd { display: none; position: absolute; left: 0; top: 100%; min-width: 11rem; z-index: 5; background: #212529; border: 1px solid var(--bs-border-color); border-radius: .4rem; padding: .25rem 0; }
.mnu-pv-item:hover .mnu-pv-dd { display: block; }
.mnu-pv-dditem { padding: .3rem .8rem; font-size: .85rem; color: #dee2e6; }

/* ---- Categories / Games admin (cg-) ---- */
.cg-row { cursor: grab; }
.cg-row.cg-dragging { opacity: .4; }
.cg-handle { cursor: grab; }
.cg-up:hover, .cg-down:hover { color: var(--bs-primary, #00d58d) !important; }
.cg-filter-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.cg-game-select { min-width: 12rem; }

/* Footer social buttons (Admin > Menus > Social Buttons) */
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #d1d5db;
  font-size: 1.05rem;
  text-decoration: none;
  transition: all 0.2s ease;
}
.social-btn:hover {
  color: #000;
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 213, 141, 0.3);
}

/* Admin > Menus: icon picker for the Social Buttons menu */
.mnu-icon-grid { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.mnu-icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #d1d5db;
  font-size: 1.05rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mnu-icon-btn:hover { color: #fff; border-color: rgba(0, 213, 141, 0.6); }
.mnu-icon-btn.active { color: #000; background: var(--bs-primary); border-color: var(--bs-primary); }
.social-btn .material-icons { font-size: 1.2rem; line-height: 1; }
.mnu-icon-tabs { display: flex; gap: 0.25rem; margin-bottom: 0.5rem; }
.mnu-icon-tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: #9ca3af;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 2rem;
  cursor: pointer;
}
.mnu-icon-tab.active { color: #000; background: var(--bs-primary); border-color: var(--bs-primary); }
.mnu-icon-btn .material-icons { font-size: 1.2rem; line-height: 1; }

/* Pictures for Games and Categories (admin > Games / Categories > Picture) */
.gt-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 1px solid var(--bs-border-color);
  background: #0b0b0d;
}
.gt-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.filter-pic { display: block; height: 56px; width: auto; max-width: 160px; object-fit: cover; border-radius: 0.5rem; border: 1px solid var(--bs-border-color); }
.pill-img { width: 18px; height: 18px; object-fit: cover; border-radius: 50%; margin-right: 0.35rem; vertical-align: -3px; }
.cg-pic-preview {
  flex: 0 0 auto;
  width: 160px;
  aspect-ratio: 16 / 9;
  border-radius: 0.6rem;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: #0b0b0d;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cg-pic-preview img { width: 100%; height: 100%; object-fit: cover; }

/* Guides: admin list thumbnail + public cover image */
.gd-thumb {
  width: 80px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 0.4rem;
  border: 1px solid var(--bs-border-color);
  background: #0b0b0d;
  display: block;
}
.gd-thumb-empty { display: flex; align-items: center; justify-content: center; color: #6b7280; font-size: 1.1rem; }
.guide-hero {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 0.85rem;
  border: 1px solid var(--bs-border-color);
}

/* Pagination (views/partials/pagination.ejs) */
.pagination-dark { --bs-pagination-bg: #16161a; --bs-pagination-color: #d1d5db; --bs-pagination-border-color: rgba(255, 255, 255, 0.1);
  --bs-pagination-hover-bg: rgba(0, 213, 141, 0.12); --bs-pagination-hover-color: #fff; --bs-pagination-hover-border-color: rgba(0, 213, 141, 0.5);
  --bs-pagination-focus-bg: rgba(0, 213, 141, 0.12); --bs-pagination-focus-color: #fff; --bs-pagination-focus-box-shadow: 0 0 0 0.2rem rgba(0, 213, 141, 0.25);
  --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-color: #000; --bs-pagination-active-border-color: var(--bs-primary);
  --bs-pagination-disabled-bg: #101013; --bs-pagination-disabled-color: #6b7280; --bs-pagination-disabled-border-color: rgba(255, 255, 255, 0.06);
  gap: 0.3rem; }
.pagination-dark .page-link { border-radius: 0.5rem !important; min-width: 2.4rem; text-align: center; font-weight: 600; font-size: 0.85rem; }
.pagination-dark .page-item.active .page-link { font-weight: 800; }

/* "Pick your game or software": wrapping grid of cover pictures with the title underneath */
.game-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
@media (min-width: 576px) { .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 992px) { .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .game-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.game-card { display: block; text-decoration: none; color: #fff; }
.gc-img {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 0.8rem;
  overflow: hidden;
  background: #101015;
  border: 1px solid rgba(255, 255, 255, 0.07);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.gc-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.35s ease; }
.gc-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bs-primary);
  font-size: 2.6rem;
  background: radial-gradient(circle at 28% 18%, rgba(0, 213, 141, 0.2), transparent 58%), linear-gradient(135deg, #1c1c26, #0e0e13);
}
.game-card:hover .gc-img { border-color: rgba(0, 213, 141, 0.55); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 213, 141, 0.2); transform: translateY(-3px); }
.game-card:hover .gc-img img { transform: scale(1.06); }
.gc-title { margin-top: 0.65rem; font-weight: 800; font-size: 0.92rem; line-height: 1.25; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gc-count { font-size: 0.75rem; color: #9ca3af; margin-top: 0.1rem; }
.games-all { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.25rem; font-weight: 700; font-size: 0.9rem; color: #9ca3af; text-decoration: none; transition: color 0.15s ease, gap 0.15s ease; }
.games-all:hover { color: var(--bs-primary); gap: 0.65rem; }

/* ========================================================
   Home hero: featured slider + 4 side cards (views/pages/index.ejs, slider script in public/js/main.js)
   ======================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  height: clamp(420px, 38vw, 540px);
}
.hero-grid-solo { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.hero-slider {
  grid-column: 1;
  grid-row: 1 / span 2;
  position: relative;
  overflow: hidden;
  border-radius: 1.1rem;
  background: #0e0e12;
  border: 1px solid var(--bs-border-color);
}
.hero-grid-solo .hero-slider { grid-row: 1; }
.hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity 0.7s ease, visibility 0.7s; }
.hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.hero-img, .hero-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 34%, rgba(0, 0, 0, 0.06) 68%, rgba(0, 0, 0, 0.28) 100%);
  pointer-events: none;
}
.hero-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 2;
  max-width: 60%;
  padding: 0.2rem 0.55rem;
  border-radius: 0.45rem;
  background: rgba(20, 20, 24, 0.72);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 2rem 2rem 2.7rem; }
.hero-title { font-size: clamp(1.5rem, 3.1vw, 2.6rem); font-weight: 900; line-height: 1.1; margin: 0 0 1.1rem; text-shadow: 0 2px 14px rgba(0, 0, 0, 0.65); }
.hero-title a { color: #fff; text-decoration: none; }
.hero-author { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 0.9rem; color: #fff; margin-bottom: 1.1rem; min-width: 0; }
.hero-author .bi-patch-check-fill { color: #38bdf8; }
.hero-avatar {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  object-position: left center;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.hero-view {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.7rem;
  border-radius: 2rem;
  background: var(--bs-primary);
  color: #000;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(0, 213, 141, 0.3);
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.hero-view:hover { background: var(--bs-primary-hover); color: #000; transform: translateY(-2px); }
.hero-dots { position: absolute; right: 1.25rem; bottom: 1.1rem; z-index: 3; display: flex; gap: 0.45rem; }
.hero-dot { width: 26px; height: 4px; padding: 0; border: 0; border-radius: 2px; background: rgba(255, 255, 255, 0.35); cursor: pointer; transition: background-color 0.2s ease, width 0.2s ease; }
.hero-dot:hover { background: rgba(255, 255, 255, 0.65); }
.hero-dot.active { width: 40px; background: #fff; }

.hero-card { position: relative; display: block; overflow: hidden; border-radius: 1rem; background: #0e0e12; border: 1px solid var(--bs-border-color); color: #fff; text-decoration: none; transition: border-color 0.2s ease, transform 0.2s ease; }
.hero-card img { transition: transform 0.4s ease; }
.hero-card:hover { border-color: rgba(0, 213, 141, 0.55); transform: translateY(-2px); }
.hero-card:hover img { transform: scale(1.06); }
.hero-card-body { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 0.9rem; }
.hero-card-title {
  margin: 0 0 0.45rem;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-card .hero-author { margin: 0; gap: 0.4rem; font-size: 0.78rem; color: #e5e7eb; }
.hero-card .hero-avatar { width: 20px; height: 20px; }
.hero-card .hero-dl { margin-left: 0; display: inline-flex; align-items: center; gap: 0.25rem; opacity: 0.9; flex: 0 0 auto; }

@media (max-width: 991.98px) {
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: none; height: auto; }
  .hero-slider, .hero-grid-solo .hero-slider { grid-column: 1 / -1; grid-row: auto; height: 380px; }
  .hero-card { aspect-ratio: 16 / 10; }
}
@media (max-width: 575.98px) {
  .hero-slider, .hero-grid-solo .hero-slider { height: 320px; }
  .hero-body { padding: 1.2rem 1.2rem 2.2rem; }
  .hero-card-title { font-size: 0.9rem; }
  .hero-grid { gap: 0.7rem; }
}

/* Icon-only row actions (grouped buttons with tooltips) used by the admin lists */
.row-actions .btn { min-width: 2rem; padding-left: 0.5rem; padding-right: 0.5rem; line-height: 1.4; }
.row-actions .btn i { font-size: 0.95rem; vertical-align: -1px; }

/* Hover label for icon-only action buttons: pure CSS, so it can never get "stuck" open.
   Shown only while the pointer is over the button, or for keyboard focus (:focus-visible, not after a mouse click). */
.row-actions .btn[data-tip]:hover::after,
.row-actions .btn[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  z-index: 30;
  padding: 0.25rem 0.55rem;
  border-radius: 0.4rem;
  background: #f3f4f6;
  color: #111827;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.row-actions .btn[data-tip]:hover::before,
.row-actions .btn[data-tip]:focus-visible::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 2px);
  right: 0.7rem;
  z-index: 30;
  border: 6px solid transparent;
  border-top-color: #f3f4f6;
  border-bottom: 0;
  pointer-events: none;
}

/* DataTables row details (Mods list): chevron control + expanded panel */
.dt-toggle-th, td.dt-toggle-cell { width: 34px; padding-right: 0 !important; }
.dt-toggle { background: none; border: 0; padding: 0.15rem 0.35rem; color: #9ca3af; line-height: 1; cursor: pointer; border-radius: 0.35rem; }
.dt-toggle:hover { color: var(--bs-primary); background: rgba(255, 255, 255, 0.06); }
.dt-toggle i { display: inline-block; transition: transform 0.15s ease; }
tr.shown .dt-toggle { color: var(--bs-primary); }
tr.shown .dt-toggle i { transform: rotate(90deg); }
tr.shown, tr.shown + tr > td { background-color: rgba(0, 213, 141, 0.05) !important; }
.md-details { display: flex; flex-wrap: wrap; gap: 0.75rem 2.5rem; padding: 0.35rem 0.5rem 0.35rem 2.4rem; }
.md-label { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #9ca3af; margin-bottom: 0.15rem; }

/* ========================================================
   Mod page (Modspoint style): views/pages/mod-detail.ejs
   ======================================================== */
.md-page { font-family: 'Outfit', var(--bs-body-font-family), sans-serif; }
.md-back { display: inline-flex; align-items: center; gap: 0.6rem; margin-bottom: 1.25rem; color: #fff; font-weight: 600; text-decoration: none; }
.md-back:hover { color: var(--bs-primary); }
.md-card { background: #0a1519; border: 1px solid #13262d; border-radius: 1.1rem; }
.md-section { padding: 1.6rem 1.75rem; margin-bottom: 1.25rem; }
.md-h2 { margin: 0 0 1rem; font-family: 'Oswald', sans-serif; font-size: 1.5rem; font-weight: 600; letter-spacing: 0.02em; text-transform: uppercase; color: #fff; }
.md-count { margin-left: 0.4rem; padding: 0.1rem 0.55rem; border-radius: 2rem; background: #13262d; color: #9db0b6; font-family: 'Outfit', sans-serif; font-size: 0.8rem; font-weight: 600; vertical-align: middle; }

/* gallery: video + screenshots */
.md-viewer { aspect-ratio: 16 / 9; background: #05090c; border: 1px solid #13262d; border-radius: 1.1rem; overflow: hidden; }
.md-viewer-img { display: block; width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; }
.md-viewer-video { position: absolute; inset: 0; }
.md-viewer-video iframe { display: block; width: 100%; height: 100%; border: 0; }
.md-facade { position: relative; display: block; width: 100%; height: 100%; padding: 0; border: 0; background: #000; cursor: pointer; }
.md-facade img { width: 100%; height: 100%; object-fit: cover; opacity: 0.88; transition: opacity 0.2s ease; }
.md-facade:hover img { opacity: 1; }
.md-play { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(0, 213, 141, 0.95); color: #000; font-size: 2.6rem; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55); transition: transform 0.15s ease; }
.md-facade:hover .md-play { transform: translate(-50%, -50%) scale(1.08); }
.md-thumbs { display: flex; gap: 0.6rem; margin-top: 0.9rem; overflow-x: auto; }
.gallery-thumb.md-thumb { position: relative; flex: 0 0 auto; width: 8.5rem; overflow: hidden; border: 2px solid #13262d; border-radius: 0.7rem; background: #05090c; box-shadow: none; }
.md-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.md-thumb:hover { border-color: #2a4650; }
.gallery-thumb.md-thumb.active { border-color: var(--bs-primary); box-shadow: none; }
.md-thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.38); color: #fff; font-size: 1.9rem; pointer-events: none; }

/* right column */
.md-pill { display: inline-block; padding: 0.28rem 0.85rem; border-radius: 2rem; background: #fff; color: #0b1519; font-size: 0.82rem; font-weight: 700; text-decoration: none; }
.md-pill:hover { background: var(--bs-primary); color: #000; }
.md-pill-alt { background: transparent; color: #fff; border: 1px solid #2a4650; }
.md-pill-alt:hover { background: transparent; border-color: var(--bs-primary); color: var(--bs-primary); }
.md-title { margin: 0 0 0.75rem; font-family: 'Oswald', sans-serif; font-size: clamp(2rem, 4.2vw, 3.1rem); font-weight: 700; line-height: 1.05; letter-spacing: 0.01em; text-transform: uppercase; color: #fff; }
.md-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.1rem; margin-bottom: 1rem; color: #9db0b6; font-size: 0.95rem; }
.md-meta i { margin-right: 0.3rem; color: var(--bs-primary); }
.md-version { padding: 0.05rem 0.55rem; border-radius: 0.35rem; background: var(--bs-primary); color: #000; font-size: 0.8rem; font-weight: 800; }
.md-summary { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 1.4rem; color: #b4c2c7; font-size: 1.05rem; line-height: 1.55; }
.md-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.md-download { display: inline-flex; flex: 1 1 220px; align-items: center; justify-content: center; gap: 0.65rem; height: 54px; border-radius: 0.9rem; background: var(--bs-primary); color: #04110c; font-size: 1.05rem; font-weight: 700; text-decoration: none; box-shadow: 0 8px 22px rgba(0, 213, 141, 0.25); transition: transform 0.15s ease, background-color 0.15s ease; }
.md-download:hover { background: var(--bs-primary-hover); color: #000; transform: translateY(-2px); }
.md-download small { font-weight: 600; opacity: 0.7; }
.md-download-off, .md-download-off:hover { background: #122128; color: #6f858d; box-shadow: none; transform: none; cursor: not-allowed; }
.md-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 54px; height: 54px; border-radius: 0.9rem; border: 1px solid #1d3a44; background: #0e1c22; color: #e6eef0; font-size: 1.15rem; cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease; }
.md-iconbtn:hover, .md-iconbtn.is-on { border-color: var(--bs-primary); color: var(--bs-primary); }
.md-report { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0 0.5rem; color: #c8d4d8; font-weight: 600; text-decoration: none; }
.md-report:hover { color: #fff; }
.md-link { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.85rem; border: 1px solid #1d3a44; border-radius: 0.6rem; background: #0e1c22; color: #dbe6e9; font-size: 0.88rem; font-weight: 600; text-decoration: none; }
.md-link:hover { border-color: var(--bs-primary); color: var(--bs-primary); }

/* sections below */
.md-body { color: #d4dde0; font-size: 1.02rem; line-height: 1.7; }
.md-req { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 100%; padding: 0.9rem 1rem; border: 1px solid #13262d; border-radius: 0.8rem; background: #0d1b20; }
.md-release { padding: 1.1rem 1.2rem; border: 1px solid #13262d; border-radius: 0.9rem; background: #0d1b20; }
.md-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem 1.5rem; margin: 0; }
.md-facts dt { margin: 0 0 0.15rem; color: #8ea3aa; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.md-facts dd { margin: 0; color: #fff; font-weight: 600; }
.md-facts a { color: #fff; text-decoration: none; }
.md-facts a:hover { color: var(--bs-primary); }
.md-toast { position: fixed; left: 50%; bottom: 1.5rem; z-index: 2000; padding: 0.55rem 1rem; border-radius: 0.6rem; background: #e8f1f3; color: #0b1519; font-weight: 600; opacity: 0; pointer-events: none; transform: translate(-50%, 20px); transition: opacity 0.2s ease, transform 0.2s ease; }
.md-toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 575.98px) {
  .md-section { padding: 1.2rem; }
  .gallery-thumb.md-thumb { width: 6.5rem; }
  .md-iconbtn { width: 48px; height: 48px; }
  .md-download { height: 50px; }
}

/* ===== Mod page: download chooser ===== */
button.md-download { border: 0; cursor: pointer; font: inherit; }
.md-modal { position: fixed; inset: 0; z-index: 1090; display: flex; align-items: center; justify-content: center; padding: 1rem; background: rgba(0,0,0,0.78); backdrop-filter: blur(5px); }
.md-modal.d-none { display: none; }
.md-modal-box { width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; background: #0b1519; border: 1px solid #1d3a44; border-radius: 1rem; padding: 1.25rem; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.md-modal-title { font-family: 'Oswald', sans-serif; font-size: 1.35rem; text-transform: uppercase; letter-spacing: 0.02em; color: #fff; margin: 0; }
.md-dl-option { display: flex; align-items: center; gap: 0.85rem; padding: 0.75rem 1rem; border: 1px solid #1d3a44; border-radius: 0.75rem; background: #0e1c22; color: #dbe6e9; text-decoration: none; }
.md-dl-option:hover, .md-dl-option:focus-visible { border-color: var(--bs-primary); color: #fff; background: #11262d; outline: 0; }
.md-dl-option > .bi:first-child { font-size: 1.3rem; color: var(--bs-primary); }
.md-dl-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.md-dl-text small { color: #8aa0a6; }
.md-dl-tag { display: inline-block; margin-left: 0.35rem; padding: 0 0.4rem; border-radius: 0.35rem; background: rgba(0,213,141,0.15); color: var(--bs-primary); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; }

/* ===== Admin: pick gallery images from another mod ===== */
.fm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; max-height: 320px; overflow-y: auto; }
.fm-item { position: relative; display: block; aspect-ratio: 16 / 10; border: 2px solid transparent; border-radius: 0.5rem; overflow: hidden; cursor: pointer; background: #0b0b0e; }
.fm-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fm-item input { position: absolute; top: 6px; left: 6px; z-index: 1; width: 1.1rem; height: 1.1rem; }
.fm-item:has(input:checked) { border-color: var(--bs-primary); }

/* ===== Mod page: likes, comments, suggest a video ===== */
.md-iconbtn.md-like { width: auto; padding: 0 1.1rem; gap: 0.45rem; font-weight: 700; font-size: 1rem; }
.md-iconbtn.md-like.is-on { color: #ff5a7a; border-color: #ff5a7a; }
.cm-avatar { width: 40px; height: 40px; object-fit: cover; border: 1px solid #1d3a44; }
.cm-avatar-fallback { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: #0e1c22; color: #8aa0a6; font-size: 1.3rem; }
.cm-body { white-space: pre-wrap; overflow-wrap: anywhere; color: #d5e0e3; margin-top: 0.15rem; }
.cm-login { display: flex; align-items: center; gap: 0.85rem; flex-wrap: wrap; padding: 0.9rem 1rem; border: 1px dashed #1d3a44; border-radius: 0.8rem; background: #0b1519; color: #c8d4d8; }
.min-w-0 { min-width: 0; }

/* ===== Visitor accounts: login / register / account ===== */
.auth-card { width: 100%; max-width: 420px; background: #0b1519; border: 1px solid #1d3a44; border-radius: 1.1rem; padding: 2rem; box-shadow: 0 20px 60px rgba(0,0,0,0.45); }
.auth-title { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.02em; color: #fff; font-size: 1.7rem; margin-bottom: 0.4rem; }
.auth-perks { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: 0.35rem; color: #c8d4d8; }
.auth-perks .bi { color: var(--bs-primary); margin-right: 0.45rem; }
.auth-fine { font-size: 0.75rem; color: #6f8389; }
.auth-btn { display: flex; align-items: center; justify-content: center; gap: 0.6rem; padding: 0.7rem 1rem; border-radius: 0.7rem; font-weight: 700; border: 1px solid transparent; color: #fff; }
.auth-btn:hover { color: #fff; filter: brightness(1.12); }
.auth-btn .bi { font-size: 1.15rem; }
.auth-discord { background: #5865f2; }
.auth-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.auth-google:hover { color: #1f1f1f; }
.auth-google .bi { color: #ea4335; }
.auth-github { background: #24292f; border-color: #3a4048; }
.auth-gitlab { background: #fc6d26; border-color: #e24329; }
.auth-apple { background: #000; border-color: #3a3a3a; }
.auth-passkey { background: #0e1c22; border-color: var(--bs-primary); color: var(--bs-primary); }
.auth-passkey:hover { color: var(--bs-primary); }
.auth-or { display: flex; align-items: center; gap: 0.75rem; color: #6f8389; font-size: 0.8rem; margin-bottom: 0.9rem; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; border-top: 1px solid #1d3a44; }
.auth-code { letter-spacing: 0.35em; font-variant-numeric: tabular-nums; }
.acc-card { background: #0b1519; border: 1px solid #1d3a44; border-radius: 1rem; padding: 1.25rem 1.4rem; margin-bottom: 1rem; }
.acc-danger { border-color: rgba(220,53,69,0.35); }
.acc-h { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.02em; font-size: 1.15rem; color: #fff; margin-bottom: 0.75rem; }
.acc-row { display: flex; align-items: center; gap: 0.85rem; padding: 0.6rem 0.8rem; border: 1px solid #1d3a44; border-radius: 0.7rem; background: #0e1c22; }
.acc-codes { background: #000; border: 1px solid #1d3a44; border-radius: 0.6rem; padding: 0.8rem 1rem; color: #00d58d; font-size: 1rem; columns: 2; user-select: all; }
.nav-member img, .nav-member .cm-avatar { width: 28px; height: 28px; }

/* ===== Admin: video suggestions ===== */
.vs-thumb { position: relative; display: block; width: 200px; aspect-ratio: 16 / 9; border-radius: 0.6rem; overflow: hidden; background: #000; flex-shrink: 0; }
.vs-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vs-thumb span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 2.2rem; color: #fff; background: rgba(0,0,0,0.25); }

/* ===== Mod page: screenshot captions ===== */
.md-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 1.6rem 1rem 0.7rem; background: linear-gradient(transparent, rgba(0,0,0,0.78)); color: #fff; font-size: 0.9rem; pointer-events: none; border-radius: 0 0 1rem 1rem; }
.md-caption.d-none { display: none; }

/* ===== Mod edit page: Screenshot Gallery as a narrow right-hand column (col-lg-3) ===== */
@media (min-width: 992px) {
  .gallery-col > #gallery-manager { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
#gallery-manager .card-header { padding: 0.75rem 1rem; }
#gallery-manager .gallery-dropzone { padding: 1rem 0.75rem; }
#gallery-manager #gallery-url-form { flex-wrap: wrap; row-gap: 0.4rem; }
#gallery-manager #gallery-url-form .form-control { flex: 1 1 100%; border-radius: 0.375rem !important; }
#gallery-manager #gallery-url-form .btn { flex: 1 1 auto; border-radius: 0.375rem !important; margin-left: 0 !important; }
#gallery-manager #fm-filter, #gallery-manager #fm-mod { max-width: 100% !important; flex: 1 1 100%; }
#gallery-manager .fm-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
/* The gallery table becomes a stack of compact cards: handle | thumb | name | delete, caption underneath */
#gallery-table thead { display: none; }
#gallery-table, #gallery-table tbody { display: block; }
#gallery-table tr[data-id] {
  display: grid; grid-template-columns: 18px 64px minmax(0, 1fr) auto; grid-template-areas: "h t f d" "c c c c";
  gap: 0.35rem 0.5rem; align-items: center; padding: 0.55rem 0.25rem; border-bottom: 1px solid rgba(255,255,255,0.08);
}
#gallery-table tr:not([data-id]), #gallery-table tr:not([data-id]) td { display: block; }
#gallery-table td { display: block; padding: 0 !important; border: 0 !important; background: transparent !important; min-width: 0; }
#gallery-table tr[data-id] td:nth-child(1) { grid-area: h; }
#gallery-table tr[data-id] td:nth-child(2), #gallery-table tr[data-id] td:nth-child(6) { display: none; }
#gallery-table tr[data-id] td:nth-child(3) { grid-area: t; }
#gallery-table tr[data-id] td:nth-child(4) { grid-area: f; overflow: hidden; }
#gallery-table tr[data-id] td:nth-child(4) div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#gallery-table tr[data-id] td:nth-child(5) { grid-area: c; min-width: 0 !important; }
#gallery-table tr[data-id] td:nth-child(7) { grid-area: d; }
#gallery-table .gallery-thumb-sm { width: 64px; height: 40px; }

/* Mod edit page: Media & External Links in the narrow right column */
#media-links .link-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; grid-template-areas: "l v b" "u u u"; gap: 0.35rem; }
#media-links .link-row > * { border-radius: 0.375rem !important; margin: 0 !important; max-width: none !important; width: auto; }
#media-links .link-row > :nth-child(1) { grid-area: l; }
#media-links .link-row > :nth-child(2) { grid-area: v; }
#media-links .link-row > :nth-child(3) { grid-area: u; }
#media-links .link-row > :nth-child(4) { grid-area: b; }
#media-links .video-row > * { border-radius: 0.375rem !important; margin-left: 0 !important; }
#media-links .video-row { gap: 0.35rem; flex-wrap: nowrap; }

/* Side cards use the same padding as the main card (p-4, p-md-5 = 1.5rem / 3rem) */
#gallery-manager .card-header { padding: 1rem 1.5rem; }
@media (min-width: 768px) { #gallery-manager .card-header { padding: 1rem 3rem; } }
.md-dl-name { overflow-wrap: anywhere; }
.md-dl-name .md-dl-tag { vertical-align: 0.1em; }

/* Releases & Changelogs: a release with several files gets a dropdown instead of a single Download link */
.md-files { position: relative; }
.md-files > summary { list-style: none; cursor: pointer; display: inline-flex; }
.md-files > summary::-webkit-details-marker { display: none; }
.md-files-list { display: grid; gap: 0.5rem; margin-top: 0.5rem; padding: 0.6rem; border: 1px solid #1d3a44; border-radius: 0.85rem; background: #0b161b; box-shadow: 0 12px 32px rgba(0,0,0,0.5); }
@media (min-width: 576px) {
  .md-files-list { position: absolute; right: 0; z-index: 20; width: min(440px, 90vw); }
}
.dt-check-cell { width: 34px; padding-right: 0 !important; }

/* ===== Header "Games" mega menu ===== */
.navbar .nav-item.mega { position: static; }
.mega-caret { font-size: 0.65rem; margin-left: 0.15rem; transition: transform 0.2s ease; }
/* Header dropdowns (Donate...) use the same chevron as Games, not Bootstrap's triangle */
.navbar-nav > .dropdown > .dropdown-toggle::after { display: none; }
.navbar-nav > .dropdown > .dropdown-toggle.show .mega-caret { transform: rotate(180deg); }
.mega.open > .mega-toggle { color: #fff; }
.mega.open .mega-caret { transform: rotate(180deg); }
.mega-panel { display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 1030; background: #000; border: 1px solid var(--bs-border-color); border-top: 0; border-radius: 0 0 1rem 1rem; padding: 1.25rem; box-shadow: 0 24px 48px rgba(0, 0, 0, 0.6); max-height: calc(100vh - 80px); overflow-y: auto; }
.mega.open > .mega-panel { display: block; }
.mega-inner { max-width: 1320px; margin: 0 auto; }
.mega-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem 1.1rem; }
.mega-card { display: block; text-decoration: none; color: #fff; min-width: 0; }
.mega-img { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9; border-radius: 0.8rem; overflow: hidden; background: #0e1c22; border: 1px solid transparent; transition: border-color 0.15s ease, transform 0.15s ease; }
.mega-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mega-img .bi { font-size: 2rem; color: var(--bs-primary); }
.mega-card:hover .mega-img, .mega-card:focus-visible .mega-img { border-color: var(--bs-primary); transform: translateY(-2px); }
.mega-name { display: block; margin-top: 0.45rem; font-weight: 700; font-size: 0.85rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mega-all { display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1.1rem; color: #cbd5e1; text-decoration: none; font-weight: 700; font-size: 0.85rem; }
.mega-all:hover { color: var(--bs-primary); }
@media (max-width: 991.98px) {
  /* inside the collapsed mobile menu the panel is part of the page flow */
  .mega-panel { position: static; border: 0; border-radius: 0; box-shadow: none; padding: 0.5rem 0 0.75rem; max-height: none; background: transparent; }
  .mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
}

/* Pill tabs (admin Videos / any .nav-pills): use the site accent instead of Bootstrap's default blue */
.nav-pills {
  --bs-nav-pills-link-active-bg: var(--bs-primary);
  --bs-nav-pills-link-active-color: #03160f;
  --bs-nav-link-color: var(--bs-secondary-color);
  --bs-nav-link-hover-color: #fff;
}
.nav-pills .nav-link { font-weight: 600; }
.nav-pills .nav-link:hover:not(.active) { background: rgba(255, 255, 255, 0.06); }
.nav-pills .nav-link .badge { background: rgba(255, 255, 255, 0.14) !important; color: #e5e7eb !important; font-weight: 700; }
.nav-pills .nav-link.active .badge { background: rgba(3, 22, 15, 0.22) !important; color: #03160f !important; }
