/* ==========================================================================
   VALORANT PROTOCOL COMPENDIUM — OFFICIAL TACTICAL BRUTALIST DESIGN SYSTEM
   Colors: Crimson #FF4655 | Obsidian #0F1923 | Cream #ECE8E1 | Cyan #00F5D4
   ========================================================================== */

:root {
  --val-red: #ff4655;
  --val-red-dark: #bd3944;
  --val-red-glow: rgba(255, 70, 85, 0.35);
  --val-obsidian: #0f1923;
  --val-obsidian-deep: #090f15;
  --val-slate: #1f2731;
  --val-slate-light: #2b3542;
  --val-cream: #ece8e1;
  --val-cream-dim: #b8b5af;
  --val-gray: #768079;
  --val-cyan: #00f5d4;
  --val-cyan-dim: rgba(0, 245, 212, 0.18);
  --val-amber: #f5a623;
  --val-purple: #b86bff;
  --agent-accent: #ff4655;
  --agent-secondary: #25607a;
  --border-line: rgba(236, 232, 225, 0.14);
  --border-strong: rgba(236, 232, 225, 0.32);
  --font-display: 'Bahnschrift SemiCondensed', 'Bahnschrift', 'Oswald', 'Impact', 'Anton', 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei UI', sans-serif;
  --font-sans: 'Inter', 'HarmonyOS Sans SC', 'PingFang SC', 'Microsoft YaHei UI', 'Noto Sans SC', sans-serif;
  --font-mono: 'Cascadia Mono', 'JetBrains Mono', 'Consolas', 'SFMono-Regular', monospace;
}

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

html {
  scroll-behavior: smooth;
  background-color: var(--val-obsidian);
  color: var(--val-cream);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  background-color: var(--val-obsidian);
  color: var(--val-cream);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  selection-background-color: var(--val-red);
}

::selection {
  background: var(--val-red);
  color: var(--val-cream);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--val-obsidian-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--val-red);
}

/* Tactical Background Grid & Noise Overlay */
.tactical-bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-size: 64px 64px;
  background-image:
    linear-gradient(to right, rgba(236, 232, 225, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(236, 232, 225, 0.03) 1px, transparent 1px);
}

.tactical-bg-grid::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 20%, transparent 0%, rgba(9, 15, 21, 0.78) 100%);
}

/* Top Telemetry Bar & Navbar */
.val-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 25, 35, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-line);
}

.telemetry-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 24px;
  background: var(--val-obsidian-deep);
  border-bottom: 1px solid rgba(255, 70, 85, 0.25);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--val-cream-dim);
  text-transform: uppercase;
}

.telemetry-left, .telemetry-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--val-cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--val-cyan);
  margin-right: 6px;
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.navbar-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
  gap: 16px;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--val-cream);
  cursor: pointer;
}

.brand-logo-mark {
  width: 38px;
  height: 38px;
  background: var(--val-red);
  display: flex;
  align-items: center;
  justify-content: center;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: transform 0.2s ease, background 0.2s ease;
}

.brand-cluster:hover .brand-logo-mark {
  transform: scale(1.06);
  background: var(--val-cream);
}

.brand-cluster:hover .brand-logo-mark svg {
  fill: var(--val-obsidian);
}

.brand-logo-mark svg {
  width: 22px;
  height: 22px;
  fill: var(--val-cream);
  transition: fill 0.2s ease;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-main {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--val-red);
  letter-spacing: 0.16em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 100%;
  overflow-x: auto;
}

.nav-tab {
  position: relative;
  height: 100%;
  padding: 0 16px;
  background: transparent;
  border: none;
  color: var(--val-cream-dim);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-tab .tab-idx {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--val-red);
  opacity: 0.85;
}

.nav-tab:hover {
  color: var(--val-cream);
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: var(--val-cream);
  background: rgba(255, 70, 85, 0.1);
}

.nav-tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--val-red);
  box-shadow: 0 -2px 10px var(--val-red);
}

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

/* Brutalist Tactical Buttons */
.val-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--val-cream);
  background: var(--val-red);
  border: 1px solid var(--val-red);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
  cursor: pointer;
  overflow: hidden;
  transition: color 0.25s ease, border-color 0.25s ease, transform 0.15s ease;
  z-index: 1;
}

.val-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--val-obsidian);
  transform: translateX(-105%) skewX(-18deg);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: -1;
}

.val-btn:hover::before {
  transform: translateX(0) skewX(0);
}

.val-btn:hover {
  color: var(--val-cream);
  border-color: var(--val-cream);
}

.val-btn:active {
  transform: scale(0.97);
}

.val-btn-outline {
  background: rgba(31, 39, 49, 0.75);
  border-color: var(--border-strong);
}

.val-btn-outline::before {
  background: var(--val-red);
}

.val-btn-outline:hover {
  border-color: var(--val-red);
}

.val-btn-sm {
  padding: 6px 12px;
  font-size: 11px;
  font-family: var(--font-mono);
}

/* Main Content Container & Section headers */
main {
  position: relative;
  z-index: 1;
}

.compendium-section {
  position: relative;
  padding: 56px 32px;
  max-width: 1640px;
  margin: 0 auto;
  border-bottom: 1px solid var(--border-line);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-line);
  position: relative;
}

.section-header::before {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 96px;
  height: 3px;
  background: var(--val-red);
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--val-red);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 44px);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--val-cream);
}

.section-watermark {
  position: absolute;
  right: 0;
  top: -18px;
  font-family: var(--font-display);
  font-size: clamp(54px, 7vw, 108px);
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(236, 232, 225, 0.08);
  pointer-events: none;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   SECTION 1: HERO // INTERACTIVE AGENT STAGE
   ========================================================================== */
.hero-stage-section {
  padding-top: 24px;
  padding-bottom: 40px;
  min-height: calc(100vh - 92px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-stage-grid {
  display: grid;
  grid-template-columns: 248px minmax(380px, 1fr) 510px;
  gap: 20px;
  align-items: stretch;
  min-height: 760px;
}

/* Left Protocol Roster Rail */
.stage-agent-rail {
  background: rgba(15, 25, 35, 0.78);
  border: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  height: 760px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%);
}

.rail-header {
  padding: 11px 14px;
  background: rgba(255, 70, 85, 0.1);
  border-bottom: 1px solid var(--border-line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--val-cream);
}

.rail-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: rgba(31, 39, 49, 0.4);
  border: 1px solid transparent;
  border-left: 3px solid transparent;
  cursor: pointer;
  color: var(--val-cream-dim);
  text-align: left;
  transition: all 0.18s ease;
}

.rail-item:hover {
  background: rgba(236, 232, 225, 0.08);
  color: var(--val-cream);
  border-left-color: var(--val-cream-dim);
}

.rail-item.active {
  background: linear-gradient(90deg, rgba(255, 70, 85, 0.24) 0%, rgba(31, 39, 49, 0.6) 100%);
  border-color: rgba(255, 70, 85, 0.45);
  border-left-color: var(--val-red);
  color: var(--val-cream);
}

.rail-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--val-red);
  min-width: 24px;
}

.rail-avatar {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  background: var(--val-obsidian-deep);
  border: 1px solid var(--border-line);
  object-fit: cover;
  flex-shrink: 0;
}

.rail-avatar-redacted {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 70, 85, 0.2);
  border: 1px dashed var(--val-red);
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 12px;
  color: var(--val-red);
}

.rail-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rail-name-zh {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-name-en {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--val-gray);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Center 3D Parallax Visual Stage */
.stage-visual-arena {
  position: relative;
  height: 760px;
  background: radial-gradient(circle at 50% 45%, var(--agent-accent, #ff4655) 0%, rgba(15, 25, 35, 0.95) 68%);
  border: 1px solid var(--border-line);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1100px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

#stage-particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.stage-giant-stroke {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: clamp(72px, 9vw, 136px);
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(236, 232, 225, 0.16);
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
  user-select: none;
  transition: transform 0.15s ease-out;
}

.stage-bg-graffiti {
  position: absolute;
  height: 92%;
  width: auto;
  opacity: 0.22;
  filter: contrast(1.15) drop-shadow(0 0 24px rgba(0, 0, 0, 0.6));
  z-index: 2;
  pointer-events: none;
  transition: transform 0.18s ease-out, opacity 0.35s ease;
}

.stage-portrait-wrap {
  position: relative;
  z-index: 4;
  height: 94%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease-out;
}

.stage-portrait-img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 22px 36px rgba(0, 0, 0, 0.78));
  animation: portraitFloat 5s ease-in-out infinite;
}

@keyframes portraitFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.stage-redacted-hologram {
  z-index: 5;
  padding: 36px;
  max-width: 420px;
  text-align: center;
  background: rgba(9, 15, 21, 0.85);
  border: 2px dashed var(--val-red);
  box-shadow: 0 0 40px rgba(255, 70, 85, 0.3);
}

.redacted-glitch-num {
  font-family: var(--font-display);
  font-size: 96px;
  font-weight: 900;
  line-height: 1;
  color: var(--val-red);
  text-shadow: 3px 0 var(--val-cyan), -3px 0 #ff0055;
  margin-bottom: 12px;
}

.stage-hud-overlay-top {
  position: absolute;
  top: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 6;
  pointer-events: none;
}

.stage-protocol-badge {
  background: rgba(9, 15, 21, 0.82);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--val-red);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
}

.stage-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(9, 15, 21, 0.82);
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
}

.stage-role-pill img {
  width: 16px;
  height: 16px;
}

.stage-hud-overlay-bottom {
  position: absolute;
  bottom: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  z-index: 6;
}

.stage-quick-nav {
  display: flex;
  gap: 8px;
}

/* Right Tactical Dossier Panel */
.stage-dossier-panel {
  background: rgba(15, 25, 35, 0.88);
  border: 1px solid var(--border-line);
  padding: 16px 20px;
  min-height: 760px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}

.dossier-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-line);
  padding-bottom: 12px;
}

.dossier-name-zh {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  color: var(--val-cream);
}

.dossier-name-en {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--val-red);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dossier-codename {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--val-cyan);
  letter-spacing: 0.14em;
}

.dossier-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.meta-cell {
  background: rgba(31, 39, 49, 0.55);
  border: 1px solid rgba(236, 232, 225, 0.08);
  padding: 8px 10px;
}

.meta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--val-gray);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.meta-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--val-cream);
  margin-top: 2px;
}

/* Causal Chain Box A -> B -> C */
.causal-chain-box {
  background: linear-gradient(90deg, rgba(255, 70, 85, 0.12) 0%, rgba(0, 245, 212, 0.06) 100%);
  border: 1px solid rgba(255, 70, 85, 0.35);
  padding: 10px 12px;
}

.causal-chain-title {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--val-red);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.causal-steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.causal-node {
  background: rgba(9, 15, 21, 0.82);
  border: 1px solid rgba(236, 232, 225, 0.18);
  padding: 3px 8px;
  color: var(--val-cream);
  font-weight: 600;
}

.causal-arrow {
  color: var(--val-red);
  font-family: var(--font-mono);
  font-weight: 800;
}

/* Stage Ability Selector */
.stage-abilities-block {
  border-top: 1px solid var(--border-line);
  padding-top: 12px;
}

.ability-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ability-slot-btn {
  flex: 1;
  height: 52px;
  background: rgba(31, 39, 49, 0.65);
  border: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  transition: all 0.18s ease;
  padding: 4px;
}

.ability-slot-btn img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0.95);
}

.ability-slot-btn .slot-key {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--val-cream-dim);
}

.ability-slot-btn:hover {
  border-color: var(--val-cream);
  background: rgba(236, 232, 225, 0.1);
}

.ability-slot-btn.active {
  background: var(--val-red);
  border-color: var(--val-red);
}

.ability-slot-btn.active .slot-key {
  color: var(--val-cream);
  font-weight: 800;
}

.ability-inspector {
  background: rgba(9, 15, 21, 0.72);
  border: 1px solid var(--border-line);
  padding: 10px 12px;
  font-size: 12.5px;
}

.ability-inspector-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.ability-inspector-name {
  font-weight: 800;
  color: var(--val-cream);
  font-size: 14px;
}

.ability-lore-note {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(236, 232, 225, 0.14);
  color: var(--val-cyan);
  font-size: 12px;
}

/* Highlight tags inside official ability text */
.val-tag-bold {
  color: #ffffff;
  font-weight: 700;
}
.val-tag-debuff {
  color: var(--val-red);
  font-weight: 700;
  background: rgba(255, 70, 85, 0.14);
  padding: 0 4px;
}
.val-tag-buff {
  color: var(--val-cyan);
  font-weight: 700;
  background: rgba(0, 245, 212, 0.12);
  padding: 0 4px;
}

/* Radar + Action Footer inside Stage Panel */
.stage-radar-and-cta {
  display: grid;
  grid-template-columns: 165px 1fr;
  gap: 14px;
  align-items: center;
  border-top: 1px solid var(--border-line);
  padding-top: 12px;
  margin-top: auto;
}

.radar-canvas-box {
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-cta-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ==========================================================================
   SECTION 2: ROSTER // TACTICAL MATRIX & FILTERS
   ========================================================================== */
.roster-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  background: rgba(31, 39, 49, 0.55);
  border: 1px solid var(--border-line);
  padding: 16px 20px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  padding: 7px 14px;
  background: rgba(15, 25, 35, 0.85);
  border: 1px solid var(--border-line);
  color: var(--val-cream-dim);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-pill:hover {
  color: var(--val-cream);
  border-color: var(--val-cream-dim);
}

.filter-pill.active {
  background: var(--val-red);
  border-color: var(--val-red);
  color: var(--val-cream);
}

.search-box-wrap {
  position: relative;
  min-width: 290px;
  flex: 1;
  max-width: 420px;
}

.tactical-input {
  width: 100%;
  padding: 9px 14px;
  background: rgba(9, 15, 21, 0.9);
  border: 1px solid var(--border-strong);
  color: var(--val-cream);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.tactical-input:focus {
  border-color: var(--val-red);
  box-shadow: 0 0 12px rgba(255, 70, 85, 0.25);
}

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 20px;
}

.agent-poster-card {
  position: relative;
  height: 390px;
  background: linear-gradient(165deg, rgba(31, 39, 49, 0.9) 0%, rgba(9, 15, 21, 0.98) 100%);
  border: 1px solid var(--border-line);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease, box-shadow 0.25s ease;
}

.agent-poster-card:hover {
  transform: translateY(-6px);
  border-color: var(--val-red);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65), 0 0 20px rgba(255, 70, 85, 0.2);
}

.poster-bg-num {
  position: absolute;
  top: 8px;
  left: 12px;
  font-family: var(--font-display);
  font-size: 68px;
  font-weight: 900;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(236, 232, 225, 0.18);
  z-index: 1;
  pointer-events: none;
}

.poster-role-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgba(9, 15, 21, 0.82);
  border: 1px solid var(--border-line);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.poster-role-badge img {
  width: 13px;
  height: 13px;
}

.poster-portrait {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  height: 82%;
  width: auto;
  object-fit: contain;
  z-index: 2;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
}

.agent-poster-card:hover .poster-portrait {
  transform: translateX(-50%) scale(1.07);
}

.poster-info-plate {
  position: relative;
  z-index: 4;
  background: linear-gradient(0deg, rgba(9, 15, 21, 0.98) 0%, rgba(9, 15, 21, 0.88) 78%, transparent 100%);
  padding: 28px 16px 14px;
  border-top: 2px solid var(--val-red);
}

.poster-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.poster-name-zh {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--val-cream);
}

.poster-name-en {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--val-red);
  text-transform: uppercase;
  font-weight: 700;
}

.poster-realname {
  font-size: 12px;
  color: var(--val-cream-dim);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poster-tags-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(236, 232, 225, 0.1);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--val-cyan);
}

/* ==========================================================================
   SECTION 3: VERSUS // DUAL AGENT COMPARATOR
   ========================================================================== */
.versus-layout {
  display: grid;
  grid-template-columns: 1fr 380px 1fr;
  gap: 24px;
  align-items: stretch;
}

.versus-fighter-card {
  background: rgba(31, 39, 49, 0.55);
  border: 1px solid var(--border-line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.versus-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--val-obsidian-deep);
  border: 1px solid var(--border-strong);
  color: var(--val-cream);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
}

.versus-center-radar {
  background: rgba(9, 15, 21, 0.85);
  border: 1px solid var(--border-line);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.versus-bond-banner {
  margin-top: 20px;
  background: linear-gradient(90deg, rgba(255, 70, 85, 0.14), rgba(0, 245, 212, 0.12));
  border: 1px solid var(--border-strong);
  padding: 16px 20px;
}

/* ==========================================================================
   SECTION 4: NEXUS // INTERACTIVE RELATIONSHIP GRAPH
   ========================================================================== */
.nexus-container {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 24px;
  min-height: 620px;
}

.nexus-canvas-wrap {
  position: relative;
  background: radial-gradient(circle at center, rgba(31, 39, 49, 0.7) 0%, rgba(9, 15, 21, 0.95) 100%);
  border: 1px solid var(--border-line);
  height: 620px;
  overflow: hidden;
}

#nexus-graph-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
}

#nexus-graph-canvas:active {
  cursor: grabbing;
}

.nexus-legend-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  z-index: 4;
  pointer-events: auto;
}

.nexus-inspector {
  background: rgba(15, 25, 35, 0.9);
  border: 1px solid var(--border-line);
  padding: 20px;
  height: 620px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rel-card {
  background: rgba(31, 39, 49, 0.65);
  border-left: 3px solid var(--val-red);
  padding: 12px 14px;
  cursor: pointer;
  transition: background 0.18s ease;
}

.rel-card:hover {
  background: rgba(255, 70, 85, 0.15);
}

/* ==========================================================================
   SECTION 5: WORLD, TIMELINE & 14 MAPS ATLAS
   ========================================================================== */
.world-subnav {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
}

.timeline-track {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--val-red);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.timeline-card {
  position: relative;
  background: rgba(31, 39, 49, 0.6);
  border: 1px solid var(--border-line);
  padding: 18px 22px;
  transition: border-color 0.2s ease;
}

.timeline-card::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 22px;
  width: 12px;
  height: 12px;
  background: var(--val-red);
  border: 2px solid var(--val-cream);
  transform: rotate(45deg);
}

.timeline-card:hover {
  border-color: var(--val-red);
}

.maps-atlas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 22px;
}

.map-dossier-card {
  background: rgba(15, 25, 35, 0.92);
  border: 1px solid var(--border-line);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-visual-box {
  position: relative;
  height: 210px;
  background: var(--val-obsidian-deep);
  overflow: hidden;
}

.map-visual-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.map-dossier-card:hover .map-visual-box img {
  transform: scale(1.05);
}

.map-earth-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(9, 15, 21, 0.88);
  border: 1px solid var(--val-cyan);
  color: var(--val-cyan);
}

.map-earth-badge.omega {
  border-color: var(--val-red);
  color: var(--val-red);
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.pillar-card {
  background: rgba(31, 39, 49, 0.6);
  border: 1px solid var(--border-line);
  border-top: 3px solid var(--val-red);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   SECTION 6: ENCRYPTED COMMS & BANTER TERMINAL
   ========================================================================== */
.comms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
  gap: 20px;
}

.comm-terminal-card {
  background: rgba(9, 15, 21, 0.92);
  border: 1px solid var(--border-line);
  border-left: 4px solid var(--val-cyan);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.comm-line {
  background: rgba(31, 39, 49, 0.55);
  padding: 10px 12px;
  border-radius: 2px;
}

.comm-speaker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--val-red);
  margin-bottom: 3px;
}

/* ==========================================================================
   FULL-SCREEN AGENT DOSSIER MODAL
   ========================================================================== */
.dossier-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(9, 15, 21, 0.92);
  backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dossier-modal-backdrop.open {
  display: flex;
}

.dossier-modal-window {
  width: 100%;
  max-width: 1320px;
  height: min(88vh, 860px);
  background: var(--val-obsidian);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.9);
  display: grid;
  grid-template-columns: 380px 1fr;
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

.modal-left-showcase {
  position: relative;
  background: radial-gradient(circle at 50% 40%, var(--val-red-glow), var(--val-obsidian-deep) 78%);
  border-right: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  overflow: hidden;
}

.modal-right-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.modal-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--val-obsidian-deep);
  border-bottom: 1px solid var(--border-line);
}

.modal-tabs-bar {
  display: flex;
  border-bottom: 1px solid var(--border-line);
  background: rgba(31, 39, 49, 0.5);
  overflow-x: auto;
}

.modal-tab-btn {
  padding: 12px 18px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--val-cream-dim);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.modal-tab-btn.active {
  color: var(--val-cream);
  border-bottom-color: var(--val-red);
  background: rgba(255, 70, 85, 0.12);
}

.modal-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.lore-article-card {
  background: rgba(31, 39, 49, 0.55);
  border: 1px solid var(--border-line);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.lore-badge {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  background: var(--val-red);
  color: var(--val-cream);
  margin-bottom: 8px;
}

.lore-badge.extended {
  background: var(--val-cyan);
  color: var(--val-obsidian);
}

/* Footer */
.val-footer {
  padding: 36px 32px;
  background: var(--val-obsidian-deep);
  border-top: 1px solid var(--border-line);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--val-gray);
}

/* Responsive Breakpoints */
@media (max-width: 1220px) {
  .hero-stage-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .stage-agent-rail {
    height: auto;
  }
  .rail-list {
    flex-direction: row;
    overflow-x: auto;
  }
  .rail-item {
    min-width: 150px;
  }
  .stage-visual-arena {
    height: 500px;
  }
  .stage-dossier-panel {
    height: auto;
  }
  .versus-layout, .nexus-container, .dossier-modal-window {
    grid-template-columns: 1fr;
  }
  .modal-left-showcase {
    display: none;
  }
}

@media (max-width: 768px) {
  .compendium-section {
    padding: 36px 16px;
  }
  .comms-grid, .maps-atlas-grid, .pillars-grid {
    grid-template-columns: 1fr;
  }
  .telemetry-strip {
    display: none;
  }
}
