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

:root {
  --files-bg: #0b0a14;
  --files-bg-2: #12111c;
  --files-ink: #e8e0ff;
  --files-muted: #9a8fb8;
  --files-line: rgba(167, 139, 250, 0.18);
  --files-purple: #a78bfa;
  --files-orange: #fb923c;
  --files-green: #34d399;
  --files-sacred: #f5d78a;
}

html { scroll-behavior: smooth; }

body.files-page {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(124, 58, 237, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 40% at 100% 20%, rgba(251, 146, 60, 0.08), transparent 50%),
    radial-gradient(ellipse 40% 30% at 0% 70%, rgba(52, 211, 153, 0.07), transparent 50%),
    var(--files-bg);
  color: var(--files-ink);
  font-family: 'Nunito', sans-serif;
  overflow-x: clip;
}

body.files-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 20%, transparent 75%);
}

.files-rainbow {
  height: 5px;
  background: linear-gradient(90deg, #a78bfa, #fb923c, #34d399, #f5d78a, #a78bfa);
  background-size: 240%;
  animation: files-rb 8s linear infinite;
  position: relative;
  z-index: 2;
}
@keyframes files-rb {
  0% { background-position: 0%; }
  100% { background-position: 240%; }
}

body.files-page nav {
  background: rgba(12, 10, 24, 0.88) !important;
  border-bottom-color: rgba(167, 139, 250, 0.22) !important;
  box-shadow: 0 2px 24px rgba(88, 28, 180, 0.2) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: relative;
  z-index: 20;
}
body.files-page .nav-logo { color: #c9b8ff !important; }
body.files-page .nav-links a { color: #b0a8d0 !important; }
body.files-page .nav-links a:hover { background: rgba(168, 85, 247, 0.12) !important; color: #e0d0ff !important; }
body.files-page .nav-links a.join { background: linear-gradient(135deg, #a855f7, #6d28d9) !important; color: #fff !important; }
body.files-page .nav-links a.nav-maps,
body.files-page .nav-links a.active {
  background: rgba(167, 139, 250, 0.16) !important;
  color: #fff !important;
  border-radius: 20px;
}
body.files-page .nav-dropdown-btn { color: #b0a8d0 !important; }
body.files-page .nav-dropdown-btn:hover { background: rgba(168, 85, 247, 0.12) !important; color: #e0d0ff !important; }
body.files-page .nav-dropdown-menu { background: rgba(15, 15, 35, 0.96) !important; border-color: rgba(168, 85, 247, 0.25) !important; }
body.files-page .nav-dropdown-menu a { color: #b0a8d0 !important; }
body.files-page .nav-dropdown-menu a:hover { background: rgba(168, 85, 247, 0.15) !important; color: #e0d0ff !important; }
body.files-page .gs-input { background: rgba(255, 255, 255, 0.06) !important; border-color: rgba(168, 85, 247, 0.25) !important; color: #d4d0e8 !important; }
body.files-page .gs-results { background: rgba(15, 15, 35, 0.96) !important; border-color: rgba(168, 85, 247, 0.25) !important; }
body.files-page footer { background: transparent !important; color: #706890 !important; }
body.files-page footer a { color: #a78bfa !important; }

.files-main {
  position: relative;
  z-index: 1;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 72px;
}

.files-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--files-line);
  border-radius: 24px;
  margin: 28px 0 22px;
  padding: 48px 28px 36px;
  background: linear-gradient(180deg, rgba(18, 16, 32, 0.75), rgba(10, 9, 20, 0.92));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.files-hero-shot {
  position: absolute;
  inset: 0;
  background: url('/images/purple-map-screenshot.jpg') center 40% / cover no-repeat;
  opacity: 0.22;
  filter: saturate(0.75) contrast(1.05);
}
.files-hero-shot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 10, 20, 0.2) 0%, rgba(11, 10, 20, 0.88) 100%);
}
.files-hero-inner { position: relative; text-align: center; }
.files-kicker {
  font-family: 'Fredoka', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--files-purple);
  margin-bottom: 10px;
}
.files-hero h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: clamp(36px, 7vw, 58px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.05;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #fff 20%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.files-lead {
  max-width: 38em;
  margin: 0 auto 22px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--files-muted);
}
.files-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.files-stat {
  min-width: 120px;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(8, 7, 16, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}
.files-stat b {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.files-stat span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--files-muted);
}

.files-how {
  margin-bottom: 22px;
}
.files-card {
  border: 1px solid var(--files-line);
  border-radius: 18px;
  background: rgba(16, 14, 28, 0.72);
  padding: 18px 20px;
}
.files-card h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #e9e1ff;
}
.files-card p, .files-card ol {
  font-size: 14px;
  line-height: 1.55;
  color: var(--files-muted);
}
.files-card ol { padding-left: 18px; }
.files-card li { margin: 4px 0; }
.files-lead code,
.files-card code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: #ddd6fe;
  background: rgba(167, 139, 250, 0.12);
  padding: 1px 6px;
  border-radius: 6px;
}
.files-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}
.files-tabs {
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  border-radius: 16px;
  background: rgba(8, 7, 16, 0.55);
  border: 1px solid var(--files-line);
  scrollbar-width: thin;
}
.files-tab {
  flex: 1 1 0;
  min-width: 92px;
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #b8aed4;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.files-tab:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.files-tab.active {
  color: #fff;
  transform: translateY(-1px);
}
.files-tab[data-mv-accent="purple"].active {
  background: rgba(167, 139, 250, 0.2);
  border-color: rgba(167, 139, 250, 0.45);
}
.files-tab[data-mv-accent="orange"].active {
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.4);
  color: #fdba74;
}
.files-tab[data-mv-accent="green"].active {
  background: rgba(52, 211, 153, 0.14);
  border-color: rgba(52, 211, 153, 0.38);
  color: #6ee7b7;
}
.files-tab[data-mv-accent="sacred"].active {
  background: rgba(245, 215, 138, 0.14);
  border-color: rgba(245, 215, 138, 0.4);
  color: #fde68a;
}
.files-tab-count { opacity: 0.6; font-weight: 600; font-size: 11px; }

.files-search-wrap {
  position: relative;
  flex: 0 0 240px;
}
.files-search {
  width: 100%;
  height: 100%;
  min-height: 48px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--files-ink);
  background: rgba(8, 7, 16, 0.55);
  border: 1px solid var(--files-line);
  border-radius: 16px;
  padding: 10px 14px 10px 38px;
  outline: none;
}
.files-search:focus {
  border-color: rgba(167, 139, 250, 0.55);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.15);
}
.files-search::placeholder { color: #7c7396; font-weight: 600; }
.files-search-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
}

.files-panel { display: none; }
.files-panel.active { display: block; animation: files-in 0.22s ease; }
@keyframes files-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.files-panel-blurb {
  font-size: 14px;
  color: var(--files-muted);
  margin: 4px 0 16px;
}

.files-family {
  margin-bottom: 10px;
  border: 1px solid var(--files-line);
  border-radius: 16px;
  background: rgba(16, 14, 28, 0.65);
  overflow: hidden;
}
.files-family-header {
  font-family: 'Fredoka', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: #ddd6fe;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.files-family-header::-webkit-details-marker { display: none; }
.files-family-header::before {
  content: '▸';
  display: inline-block;
  font-size: 11px;
  color: #8b80a8;
  transition: transform 0.15s;
}
details.files-family[open] > .files-family-header::before { transform: rotate(90deg); }
.files-family-header:hover { background: rgba(167, 139, 250, 0.06); }
.files-family-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--files-muted);
}
.files-family-body { padding: 0 8px 10px; }

.files-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 0.12s;
}
.files-row:hover { background: rgba(255, 255, 255, 0.04); }
.files-row.is-lone {
  border: 1px solid var(--files-line);
  border-radius: 16px;
  background: rgba(16, 14, 28, 0.65);
  margin-bottom: 10px;
  padding: 14px 16px;
}
.files-name {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 13px;
  color: #e4ddf8;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.files-actions { display: flex; flex-wrap: wrap; gap: 6px; flex-shrink: 0; }

.files-dl {
  font-family: 'Fredoka', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.1);
  color: #e0d0ff;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.files-dl:hover {
  background: rgba(167, 139, 250, 0.22);
  border-color: rgba(196, 181, 253, 0.6);
  color: #fff;
}
.files-dl-alt {
  font-size: 11px;
  padding: 5px 10px;
  opacity: 0.78;
}
.files-dl-alt:hover { opacity: 1; }

.files-panel[data-mv-accent="orange"] .files-family-header,
.files-panel[data-mv-accent="orange"] .files-name { color: #fed7aa; }
.files-panel[data-mv-accent="orange"] .files-dl {
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(251, 146, 60, 0.08);
  color: #fdba74;
}
.files-panel[data-mv-accent="orange"] .files-dl:hover {
  background: rgba(251, 146, 60, 0.2);
  color: #fff;
}
.files-panel[data-mv-accent="green"] .files-family-header,
.files-panel[data-mv-accent="green"] .files-name { color: #a7f3d0; }
.files-panel[data-mv-accent="green"] .files-dl {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.08);
  color: #6ee7b7;
}
.files-panel[data-mv-accent="green"] .files-dl:hover {
  background: rgba(52, 211, 153, 0.2);
  color: #fff;
}
.files-panel[data-mv-accent="sacred"] .files-family-header,
.files-panel[data-mv-accent="sacred"] .files-name { color: #fde68a; }
.files-panel[data-mv-accent="sacred"] .files-dl {
  border-color: rgba(245, 215, 138, 0.4);
  background: rgba(245, 215, 138, 0.08);
  color: #fde68a;
}
.files-panel[data-mv-accent="sacred"] .files-dl:hover {
  background: rgba(245, 215, 138, 0.2);
  color: #1a1208;
}

.files-empty {
  display: none;
  text-align: center;
  padding: 36px 16px;
  color: var(--files-muted);
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
}
.files-empty.visible { display: block; }

.files-empty-vault {
  text-align: center;
  padding: 48px 16px;
  color: var(--files-muted);
}

@media (max-width: 720px) {
  .files-hero { padding: 36px 18px 28px; margin-top: 16px; }
  .files-toolbar { flex-direction: column; }
  .files-search-wrap { flex: 1 1 auto; }
  .files-tab { flex: 0 0 auto; }
  .files-row, .files-row.is-lone {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .files-actions { width: 100%; }
  .files-dl { flex: 1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .files-rainbow, .files-panel.active { animation: none; }
}
