/* files.css — Fighter & Handler Files Archive */

/* -------------------------------------------- */
/*                    THEME                     */
/* -------------------------------------------- */
:root {
  --bg1: #04030c;
  --bg2: #010008;
  --panel: rgba(7, 5, 18, 0.96);
  --panel-soft: rgba(10, 8, 24, 0.96);
  --border-soft: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.2);

  --accent-cyan: #2de3ff;
  --accent-pink: #ff2da8;
  --accent-gold: #ffd86b;
  --accent-red: #ff4b6b;
  --accent-violet: #c866ff;

  --text-main: #e7e6ff;
  --text-muted: #8b8dbc;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Arial, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 0% 0%, rgba(134, 69, 255, 0.3), transparent 60%),
    radial-gradient(circle at 100% 10%, rgba(0, 230, 255, 0.25), transparent 65%),
    linear-gradient(180deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
}

/* noise + scanlines */
.bg-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    url("assets/noise.png"),
    url("assets/scanline.png");
  opacity: 0.1;
  mix-blend-mode: soft-light;
}

/* -------------------------------------------- */
/*                   LAYOUT                     */
/* -------------------------------------------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 18px auto 40px;
  padding: 0 14px;
}

/* header */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

.logo {
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.logo .accent {
  color: var(--accent-cyan);
}

.logo .sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.09em;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
}

.nav a:hover {
  color: var(--accent-cyan);
}

/* mono helper */
.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco,
    Consolas, "Liberation Mono", "Courier New", monospace;
}

/* -------------------------------------------- */
/*                 HERO PANEL                   */
/* -------------------------------------------- */
.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.2fr);
  gap: 14px;
  margin-bottom: 12px;
}

.hero-main {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 14px 16px 12px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.9);
}

.hero-main::before {
  content: "";
  position: absolute;
  inset: -40%;
  background-image: url("assets/gradient-bg.png");
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  mix-blend-mode: soft-light;
  pointer-events: none;
  animation: heroDrift 26s linear infinite;
}

@keyframes heroDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(14px, -18px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

.hero-main h1 {
  margin: 0 0 6px;
  font-size: 21px;
}

.muted {
  color: var(--text-muted);
}

/* search + filters */
.search-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 10px;
  margin-top: 10px;
}

.search-group,
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-group label,
.filter-group label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.search-group input,
.filter-group select {
  border-radius: 999px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 3, 18, 0.92);
  color: var(--text-main);
  font-size: 13px;
}

.search-group input::placeholder {
  color: rgba(150, 153, 196, 0.8);
}

.search-group input:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* chips / hero foot */
.hero-foot {
  margin-top: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 10px;
}

.chip {
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 2, 14, 0.96);
}

.chip-warn {
  border-color: rgba(255, 75, 107, 0.7);
  color: #ffb1c4;
}

/* right side */
.hero-aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cycle-card {
  background: var(--panel-soft);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 11px 13px 12px;
  position: relative;
  overflow: hidden;
}

.cycle-card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top, rgba(45, 227, 255, 0.18), transparent 65%);
  opacity: 0.9;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.cycle-label {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 4px;
}

.cycle-name {
  font-size: 15px;
  font-weight: 700;
}

.cycle-role {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cycle-blurb {
  font-size: 12px;
  margin: 0 0 8px;
}

.btn-ghost {
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: var(--text-main);
  padding: 5px 11px;
  font-size: 11px;
  cursor: pointer;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* legend */
.legend-card {
  background: rgba(5, 3, 14, 0.96);
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(255, 255, 255, 0.26);
  padding: 9px 11px;
  font-size: 11px;
}

.legend-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.legend-card p {
  margin: 2px 0;
}

.pill {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  margin-right: 6px;
}

.pill-fighter {
  background: var(--accent-pink);
}

.pill-handler {
  background: var(--accent-gold);
}

.pill-locked {
  background: var(--accent-red);
}

/* -------------------------------------------- */
/*                 MAIN LAYOUT                  */
/* -------------------------------------------- */
.file-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 2.2fr);
  gap: 14px;
}

/* left: list */
.file-list-panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 12px 12px 10px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.list-header {
  margin-bottom: 8px;
}

.list-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.count {
  font-size: 11px;
  color: var(--accent-cyan);
}

.list-sub {
  font-size: 11px;
  margin-top: 2px;
}

/* file list area */
.file-list {
  margin-top: 6px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* scrollbars (webkit only, graceful elsewhere) */
.file-list::-webkit-scrollbar {
  width: 6px;
}
.file-list::-webkit-scrollbar-track {
  background: transparent;
}
.file-list::-webkit-scrollbar-thumb {
  background: rgba(151, 154, 204, 0.6);
  border-radius: 999px;
}

/* file cards */
.file-card {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.96));
  padding: 7px 9px;
  text-align: left;
  color: var(--text-main);
  cursor: pointer;
  position: relative;
  overflow: hidden;

  /* FIX 1: prevent squishing, enable vertical layout */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  min-height: 54px;
}

.file-card:hover {
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.95);
  transform: translateY(-2px);
}

.file-card .file-tag-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
  font-size: 10px;

  /* FIX 2: allow wrapping instead of squeezing */
  flex-wrap: wrap;
}

.file-card .file-name {
  font-size: 13px;
  font-weight: 700;

  /* FIX 3: prevent shrinking */
  flex-shrink: 0;
}

.file-card .file-sub {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* tag chips on cards */
.file-tag-pill {
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap; /* FIX 4: prevent overflow collapse */
}

.file-tag-fighter {
  border-color: rgba(255, 45, 168, 0.75);
  color: #ffc9f0;
}

.file-tag-handler {
  border-color: rgba(255, 216, 107, 0.8);
  color: #ffeeb4;
}

.file-tag-locked {
  border-color: rgba(255, 75, 107, 0.9);
  color: #ffc4d1;
}

/* locked style */
.file-card.locked {
  border-style: dashed;
  background: radial-gradient(circle at top, rgba(255, 75, 107, 0.16), rgba(6, 1, 10, 0.98));
}

/* right: detail */
.file-detail-panel {
  position: relative;
  background: var(--panel-soft);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  padding: 13px 14px 12px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.95);
  overflow: hidden;
}

.file-detail-panel::before {
  content: "";
  position: absolute;
  inset: -45%;
  background-image: url("assets/gradient-bg.png");
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  mix-blend-mode: soft-light;
  pointer-events: none;
  animation: detailDrift 30s linear infinite;
}

@keyframes detailDrift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-16px, 14px, 0);
  }
  100% {
    transform: translate3d(0, 0, 0);
  }
}

/* content inside detail */
.detail-header {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.detail-heading h2 {
  margin: 2px 0 2px;
  font-size: 18px;
}

.detail-label {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.pill-soft {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(8, 4, 20, 0.9);
}

.detail-flag {
  font-size: 11px;
  color: #ffc3cc;
  max-width: 220px;
  text-align: right;
}

/* sections */
.detail-section {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-section h3 {
  margin: 0 0 4px;
  font-size: 13px;
}

.detail-text {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-main);
}

/* -------------------------------------------- */
/*                LOCK OVERLAY                  */
/* -------------------------------------------- */
.lock-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: radial-gradient(circle at top, rgba(0, 0, 0, 0.7), rgba(3, 0, 8, 0.98));
  display: flex;
  align-items: center;
  justify-content: center;
}

.lock-inner {
  max-width: 380px;
  width: 90%;
  background: rgba(10, 5, 22, 0.98);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 14px 14px 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 1);
}

.lock-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-red);
  margin-bottom: 4px;
}

.lock-text {
  font-size: 12px;
  margin-top: 0;
  margin-bottom: 8px;
}

.lock-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.lock-input {
  width: 100%;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(4, 2, 12, 0.96);
  color: var(--text-main);
  padding: 7px 10px;
  font-size: 12px;
  margin-bottom: 8px;
}

.lock-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.btn-primary {
  display: inline-block;
  border-radius: var(--radius-pill);
  border: none;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-cyan));
  color: #050509;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.lock-error {
  margin-top: 5px;
  min-height: 14px;
  font-size: 10px;
  color: #ff9aa7;
}

/* hide element utility */
.hidden {
  display: none;
}

/* footer */
.site-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
}

/* -------------------------------------------- */
/*               RESPONSIVE LAYOUT              */
/* -------------------------------------------- */
@media (max-width: 980px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }
  .file-layout {
    grid-template-columns: 1fr;
  }
  .file-detail-panel {
    order: -1;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .nav {
    margin-top: 4px;
  }
  .search-row {
    grid-template-columns: 1fr;
  }
}