/* =====================================================================
   PORTAFOLIO INVESTIGADOR PARANORMAL (INSPIRADO EN PHASMOPHOBIA)
   GABRIEL BERNAL - FULL-STACK DEVELOPER
   ESTILOS CSS VANILLA - DISEÑO INMERSIVO Y TÁCTICO
   ===================================================================== */

:root {
  /* Paleta Base Táctica & Camión */
  --bg-dark: #0a0c0e;
  --bg-truck-panel: #14171c;
  --bg-truck-border: #232b35;
  --hud-accent: #00ff88;
  --hud-accent-dim: rgba(0, 255, 136, 0.15);
  --hud-amber: #ffaa00;
  --hud-red: #ff3344;
  --hud-cyan: #00e5ff;
  
  /* Paleta del Diario de Papel / Phasmophobia Journal */
  --paper-bg: #e8dec8;
  --paper-darker: #dacdb3;
  --paper-border: #b8a688;
  --paper-shadow: rgba(0, 0, 0, 0.55);
  --ink-primary: #1c1d1f;
  --ink-faded: #4a4d52;
  --ink-red: #b31d1d;
  --tape-color: rgba(255, 248, 220, 0.65);
  --tape-border: rgba(210, 190, 150, 0.5);

  /* Sticky Notes */
  --sticky-yellow: #fff382;
  --sticky-pink: #ffb8d1;
  --sticky-text: #2a2200;

  /* Tipografías */
  --font-hud: 'Share Tech Mono', monospace;
  --font-typewriter: 'Courier Prime', monospace;
  --font-handwriting: 'Permanent Marker', cursive;
  --font-ui: 'Outfit', sans-serif;

  /* Iluminación / Linterna */
  --flashlight-x: 50vw;
  --flashlight-y: 50vh;
  --flashlight-size: 420px;
}

/* =====================================================================
   MODO VISIÓN NOCTURNA CALIBRADO (PHASMOPHOBIA CCTV & GEN-3 PHOSPHOR)
   ALTA LEGIBILIDAD, TONOS VERDES FÓSFORO OSCUROS Y SIN BLOWOUT
   ===================================================================== */
body.night-vision {
  --bg-dark: #040d06;
  --bg-truck-panel: #07170a;
  --bg-truck-border: #133a1a;
  --hud-accent: #39ff75;
  --hud-amber: #6aff9b;
  --hud-red: #88ffaa;
  --hud-cyan: #39ff75;

  /* Diario en visión nocturna: fondo táctico oscuro de alta legibilidad */
  --paper-bg: #091b0e;
  --paper-darker: #06140a;
  --paper-border: #164620;
  --paper-shadow: rgba(0, 0, 0, 0.95);

  /* Tipografía y textos: fósforo verde brillante sobre fondo oscuro */
  --ink-primary: #d4ffd9;
  --ink-faded: #7bc78f;
  --ink-red: #39ff75;
  --tape-color: rgba(20, 65, 28, 0.7);
  --tape-border: rgba(45, 130, 60, 0.5);

  --sticky-yellow: #0d2614;
  --sticky-pink: #0e2916;
  --sticky-text: #b5ffc8;

  background-color: var(--bg-dark);
}

/* El haz de linterna se convierte en un iluminador infrarrojo sutil y enfocado */
body.night-vision .flashlight-layer {
  background: radial-gradient(
    circle calc(var(--flashlight-size) * 1.1) at var(--flashlight-x) var(--flashlight-y),
    rgba(100, 255, 140, 0.08) 0%,
    rgba(15, 60, 25, 0.18) 50%,
    rgba(3, 15, 6, 0.65) 80%,
    rgba(2, 8, 3, 0.88) 100%
  );
}

/* Cuaderno / Diario con brillo de fósforo contenido */
body.night-vision .journal-book {
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.95),
    0 0 0 10px #06180a,
    0 0 0 14px #020a04,
    0 0 35px rgba(0, 255, 100, 0.22);
  border: 1px solid #1a4d23;
}

body.night-vision .journal-page {
  color: var(--ink-primary);
}

/* Pestañas del diario en visión nocturna */
body.night-vision .journal-tab {
  background: #0a1f0f;
  color: #7fcaa8;
  border-top: 3px solid #153f1f;
}

body.night-vision .journal-tab.active {
  background: var(--paper-bg);
  color: #39ff75;
  border-top: 3px solid #39ff75;
  box-shadow: 0 -4px 12px rgba(0, 255, 100, 0.25);
}

/* Títulos con brillo fósforo verde sutil y nítido */
body.night-vision .section-title,
body.night-vision .investigator-name,
body.night-vision .timeline-role,
body.night-vision .case-title-main,
body.night-vision .handwritten-title {
  color: #45ff7e !important;
  text-shadow: 0 0 6px rgba(69, 255, 126, 0.45);
}

body.night-vision .stat-number {
  color: #39ff75 !important;
  text-shadow: 0 0 8px rgba(57, 255, 117, 0.5);
}

body.night-vision .section-subtitle,
body.night-vision .timeline-company,
body.night-vision .cert-info p,
body.night-vision .skill-desc {
  color: var(--ink-faded) !important;
}

/* Tarjetas y contenedores oscuros con bordes verdes tácticos */
body.night-vision .stat-box,
body.night-vision .evidence-item,
body.night-vision .case-nav-btn,
body.night-vision .skill-category,
body.night-vision .cert-card,
body.night-vision .case-description-box,
body.night-vision .contact-item-link,
body.night-vision .case-brief-card,
body.night-vision .handwritten-note,
body.night-vision .tactical-input,
body.night-vision .tactical-textarea {
  background: rgba(12, 34, 18, 0.75) !important;
  border-color: #1a4f24 !important;
  color: #d4ffd9 !important;
}

body.night-vision .timeline-desc-list li {
  color: #bbf0c8 !important;
}

body.night-vision .timeline-desc-list li::before {
  color: #39ff75 !important;
}

body.night-vision .tool-chip,
body.night-vision .case-tags .tag {
  background: #0d2b14 !important;
  border-color: #216330 !important;
  color: #79f59f !important;
}

body.night-vision .case-nav-btn.active {
  background: #17421f !important;
  border-color: #39ff75 !important;
  color: #fff !important;
}

body.night-vision .case-btn.primary {
  background: #103b1a !important;
  border-color: #39ff75 !important;
  color: #fff !important;
}

body.night-vision .case-btn.secondary {
  background: #08210e !important;
  border-color: #194a21 !important;
  color: #8ceca4 !important;
}

/* Polaroid en visión nocturna: apariencia cámara infrarroja */
body.night-vision .polaroid-frame,
body.night-vision .project-polaroid-preview {
  background: #0c2413 !important;
  border: 1px solid #1a4c24;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.65);
}

body.night-vision .polaroid-caption,
body.night-vision .project-caption {
  color: #7fcaa8 !important;
}

body.night-vision .polaroid-photo img {
  filter: grayscale(1) sepia(1) hue-rotate(80deg) saturate(220%) contrast(1.15) brightness(0.9);
}

body.night-vision .checkbox-custom {
  background: #0a1f0f;
  border-color: #2e7a3f;
}

body.night-vision .evidence-item input[type="checkbox"]:checked + .checkbox-custom::after {
  color: #39ff75;
}

/* Capa de Óptica NVG y Telemetría OSD */
.nightvision-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1001;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: hidden;
  font-family: var(--font-hud);
}

body.night-vision .nightvision-layer {
  opacity: 1;
}

/* Viñeteado suave en los bordes de la pantalla */
.nvg-lens-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    transparent 55%,
    rgba(0, 20, 6, 0.25) 75%,
    rgba(0, 10, 2, 0.65) 90%,
    rgba(0, 5, 1, 0.9) 100%
  );
}

/* Scanlines suaves y transparentes que no estorban la lectura */
body.night-vision .scanlines-layer {
  opacity: 0.35;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.2) 3px,
    rgba(0, 0, 0, 0.2) 4px
  );
}

/* Grano térmico muy sutil */
body.night-vision .grain-layer {
  opacity: 0.08;
  animation: nvg-scintillation 0.15s infinite steps(2);
  background-image: radial-gradient(#6aff9b 1px, transparent 1px);
}

@keyframes nvg-scintillation {
  0% { transform: translate(0, 0); }
  50% { transform: translate(1px, -1px); }
  100% { transform: translate(-1px, 1px); }
}

/* OSD Superior de la Cámara NVG */
.nvg-hud-top {
  position: absolute;
  top: 14px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #39ff75;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  text-shadow: 0 0 6px rgba(57, 255, 117, 0.6);
}

.nvg-cam-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: bold;
}

.nvg-rec-dot {
  width: 10px;
  height: 10px;
  background-color: #39ff75;
  border-radius: 50%;
  box-shadow: 0 0 8px #39ff75;
  animation: nvg-rec-blink 1s infinite alternate;
}

@keyframes nvg-rec-blink {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.25; transform: scale(0.85); }
}

.nvg-ir-tag {
  background: rgba(0, 40, 12, 0.65);
  border: 1px solid #287a3b;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: bold;
}

.nvg-time {
  font-weight: bold;
}

/* Retícula Central Sutil */
.nvg-reticle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.25;
}

.reticle-line {
  position: absolute;
  background: #39ff75;
  box-shadow: 0 0 4px #00ff66;
}

.reticle-h {
  width: 100%;
  height: 1px;
}

.reticle-v {
  height: 100%;
  width: 1px;
}

.reticle-circle {
  width: 100px;
  height: 100px;
  border: 1px dashed #39ff75;
  border-radius: 50%;
  position: absolute;
}

.reticle-dots {
  position: absolute;
  width: 190px;
  display: flex;
  justify-content: space-between;
  color: #39ff75;
  font-size: 0.75rem;
}

/* OSD Inferior */
.nvg-hud-bottom {
  position: absolute;
  bottom: 14px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #39ff75;
  font-size: 0.8rem;
  letter-spacing: 1.2px;
  text-shadow: 0 0 5px rgba(57, 255, 117, 0.6);
}

.battery-cells {
  letter-spacing: 2px;
  font-weight: bold;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--ink-primary);
  font-family: var(--font-ui);
  overflow-x: hidden;
  position: relative;
}

/* =====================================================================
   CAPAS DE AMBIENTE: LINTERNA, RUIDO Y SCANLINES
   ===================================================================== */
.flashlight-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: radial-gradient(
    circle var(--flashlight-size) at var(--flashlight-x) var(--flashlight-y),
    rgba(255, 255, 235, 0.04) 0%,
    rgba(10, 15, 20, 0.35) 45%,
    rgba(5, 7, 10, 0.88) 85%,
    rgba(2, 3, 5, 0.96) 100%
  );
  transition: opacity 0.3s ease;
}

body.flashlight-off .flashlight-layer {
  background: rgba(5, 7, 10, 0.25);
}

.scanlines-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 998;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.6;
}

.grain-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 997;
  opacity: 0.05;
  background-image: radial-gradient(#fff 1px, transparent 1px);
  background-size: 4px 4px;
}

/* =====================================================================
   HUD SUPERIOR TÁCTICO (ESTILO CAMIÓN HQ)
   ===================================================================== */
.tactical-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: linear-gradient(180deg, #13171e 0%, #0a0d11 100%);
  border-bottom: 2px solid var(--bg-truck-border);
  color: #abb3bf;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  z-index: 100;
  position: sticky;
  top: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
  gap: 15px;
  flex-wrap: wrap;
}

.hud-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator.live {
  width: 10px;
  height: 10px;
  background-color: var(--hud-accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--hud-accent);
  animation: pulse-live 2s infinite ease-in-out;
}

@keyframes pulse-live {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.hud-text {
  color: #e2e8f0;
  letter-spacing: 1px;
}

.hud-location {
  color: var(--hud-amber);
  font-size: 0.8rem;
}

.hud-center {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Medidor de Cordura */
.sanity-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #191e26;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #2f3844;
}

.sanity-label {
  color: #8da2b5;
  font-size: 0.75rem;
  letter-spacing: 1px;
}

.sanity-bar-wrap {
  width: 90px;
  height: 12px;
  background: #0d1014;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #3c4856;
}

.sanity-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff3344 0%, #ffaa00 50%, #00ff88 100%);
  transition: width 0.4s ease;
}

.sanity-val {
  font-weight: 700;
  color: var(--hud-accent);
  min-width: 35px;
}

.hud-mini-btn {
  background: #2a333f;
  border: 1px solid #48586c;
  color: #ffdf9e;
  border-radius: 4px;
  padding: 3px 8px;
  font-family: var(--font-hud);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.hud-mini-btn:hover {
  background: #ffaa00;
  color: #000;
  box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

/* Lector EMF */
.emf-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #191e26;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #2f3844;
}

.emf-label {
  color: #8da2b5;
  font-size: 0.75rem;
}

.emf-leds {
  display: flex;
  gap: 4px;
}

.emf-led {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: #1a221a;
  color: #4a5c4a;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  transition: all 0.15s ease;
}

.emf-led.led-1.active { background: #00cc44; color: #fff; box-shadow: 0 0 8px #00cc44; }
.emf-led.led-2.active { background: #88dd00; color: #fff; box-shadow: 0 0 8px #88dd00; }
.emf-led.led-3.active { background: #ffcc00; color: #000; box-shadow: 0 0 10px #ffcc00; }
.emf-led.led-4.active { background: #ff8800; color: #fff; box-shadow: 0 0 12px #ff8800; }
.emf-led.led-5.active { 
  background: #ff1133; 
  color: #fff; 
  box-shadow: 0 0 14px #ff1133;
  animation: emf5-glitch 0.2s infinite alternate;
}

@keyframes emf5-glitch {
  0% { transform: scale(1); filter: brightness(1); }
  100% { transform: scale(1.15); filter: brightness(1.5); }
}

/* Botones del HUD */
.hud-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hud-lang-btn {
  background: #1e242d;
  color: var(--hud-amber);
  border: 1px solid #4d4023;
  padding: 8px 14px;
  border-radius: 4px;
  font-family: var(--font-hud);
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.hud-lang-btn:hover {
  background: #2f2717;
  border-color: var(--hud-amber);
  color: #fff;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.4);
}

.hud-lang-btn .lang-badge {
  background: var(--hud-amber);
  color: #000;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 900;
}

.hud-btn {
  background: #1e242d;
  color: #cbd5e1;
  border: 1px solid #333e4d;
  padding: 8px 14px;
  border-radius: 4px;
  font-family: var(--font-hud);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.hud-btn:hover {
  background: #2a333f;
  border-color: var(--hud-accent);
  color: var(--hud-accent);
  box-shadow: 0 0 12px var(--hud-accent-dim);
}

.hud-btn.active {
  background: rgba(0, 255, 136, 0.15);
  border-color: var(--hud-accent);
  color: var(--hud-accent);
}

/* =====================================================================
   ESTRUCTURA DEL DIARIO (PHASMOPHOBIA JOURNAL)
   ===================================================================== */
.journal-wrapper {
  max-width: 1240px;
  margin: 25px auto 50px;
  padding: 0 16px;
  position: relative;
  z-index: 10;
}

.journal-tabs {
  display: grid;
  grid-template-columns: 1fr 45px 1fr;
  width: 100%;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 14px;
  box-sizing: border-box;
}

.tabs-group {
  width: 100%;
  box-sizing: border-box;
}

.tabs-left-page {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
  padding-right: 6px;
  box-sizing: border-box;
}

.tabs-spine-spacer {
  width: 45px;
  height: 100%;
}

.tabs-right-page {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
  padding-left: 6px;
  box-sizing: border-box;
}

.tabs-left-page .journal-tab,
.tabs-right-page .journal-tab {
  width: 100%;
  box-sizing: border-box;
}

.journal-tab {
  background: #8b7355;
  color: #f7eed9;
  border: none;
  outline: none;
  padding: 11px 10px;
  font-family: var(--font-typewriter);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  border-top: 3px solid #6b573e;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
}


.journal-tab:hover {
  background: #a38968;
  transform: translateY(-2px);
  color: #fff;
}

.journal-tab.active {
  background: var(--paper-bg);
  color: var(--ink-primary);
  border-top: 3px solid #d44933;
  transform: translateY(-1px);
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.35);
}

/* Selector de Páginas para Móvil (Oculto en Desktop) */
.mobile-page-switch {
  display: none;
  gap: 8px;
  margin: 10px 0 14px;
  justify-content: center;
}

.mobile-page-btn {
  flex: 1;
  max-width: 220px;
  background: #1c232c;
  color: #8fa0b5;
  border: 1px solid #334050;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 0.8rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mobile-page-btn.active {
  background: var(--paper-bg);
  color: var(--ink-primary);
  border-color: #d44933;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* El Libro: TAMAÑO EXACTO Y CONSTANTE EN TODAS LAS PESTAÑAS */
.journal-book {
  display: grid;
  grid-template-columns: 1fr 45px 1fr;
  background-color: var(--paper-bg);
  border-radius: 12px;
  box-shadow: 
    0 25px 60px rgba(0, 0, 0, 0.85),
    0 0 0 10px #4d3a27,
    0 0 0 14px #261c12;
  height: 710px; /* Tamaño FIJO e invariable en Desktop */
  max-height: 710px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--paper-border);
}

.journal-book::before {
  content: "";
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at center, transparent 40%, rgba(139, 107, 61, 0.18) 100%),
    linear-gradient(to right, rgba(0,0,0,0.12) 0%, transparent 8%, transparent 92%, rgba(0,0,0,0.12) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Páginas con scroll interno suave y continuo */
.journal-page {
  padding: 28px 26px;
  position: relative;
  z-index: 2;
  font-family: var(--font-typewriter);
  color: var(--ink-primary);
  line-height: 1.6;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #a89374 transparent;
}

.journal-page::-webkit-scrollbar {
  width: 6px;
}

.journal-page::-webkit-scrollbar-track {
  background: transparent;
}

.journal-page::-webkit-scrollbar-thumb {
  background: #a89374;
  border-radius: 3px;
}

.journal-page::-webkit-scrollbar-thumb:hover {
  background: #7a6345;
}

.page-left {
  border-right: 1px solid rgba(0, 0, 0, 0.08);
}

.page-right {
  border-left: 1px solid rgba(0, 0, 0, 0.08);
}

/* Espiral central */
.journal-spine {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  background: linear-gradient(to right, #cfc1a5, #baa98c, #cfc1a5);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.35);
  padding: 20px 0;
  z-index: 3;
}

.spiral-hole {
  width: 18px;
  height: 18px;
  background-color: #1a140f;
  border-radius: 50%;
  border: 3px solid #7d6b53;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.8), 0 1px 2px rgba(255,255,255,0.4);
}

.tab-content {
  display: none;
  animation: fadeInJournal 0.3s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeInJournal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================================
   DETALLES ESTILÍSTICOS: CINTA, SELLOS Y NOTAS
   ===================================================================== */
.tape-strip {
  position: absolute;
  background: var(--tape-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  border: 1px dashed var(--tape-border);
  z-index: 4;
  opacity: 0.85;
}

.top-tape {
  width: 110px;
  height: 24px;
  top: -12px;
  left: 35%;
  transform: rotate(-2deg);
}

.left-tape {
  width: 90px;
  height: 22px;
  top: 15px;
  left: -15px;
  transform: rotate(-8deg);
}

.right-tape {
  width: 95px;
  height: 22px;
  top: 10px;
  right: -10px;
  transform: rotate(5deg);
}

.stamp-classified, .stamp-archive {
  display: inline-block;
  font-family: var(--font-hud);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  padding: 4px 10px;
  border: 2px solid var(--ink-red);
  color: var(--ink-red);
  border-radius: 4px;
  transform: rotate(-4deg);
  margin-bottom: 12px;
  text-transform: uppercase;
  opacity: 0.85;
}

.stamp-archive {
  border-color: #3b4252;
  color: #3b4252;
  transform: rotate(2deg);
}

.section-title {
  font-family: var(--font-handwriting);
  font-size: 1.65rem;
  color: #1a1a1a;
  margin-bottom: 8px;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 0.88rem;
  color: var(--ink-faded);
  margin-bottom: 18px;
}

.subsection-title {
  font-family: var(--font-typewriter);
  font-size: 0.95rem;
  font-weight: bold;
  margin: 18px 0 10px;
  text-transform: uppercase;
  color: #2b2b2b;
}

.separator-line {
  border: none;
  border-top: 1px dashed var(--paper-border);
  margin: 18px 0;
}

.sticky-note {
  position: relative;
  padding: 14px 16px;
  font-family: var(--font-typewriter);
  font-size: 0.82rem;
  line-height: 1.5;
  box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.25);
  margin-top: 20px;
  border-radius: 2px;
}

.yellow-sticky {
  background-color: var(--sticky-yellow);
  color: var(--sticky-text);
  transform: rotate(-1.5deg);
}

.pink-sticky {
  background-color: var(--sticky-pink);
  color: #3d001b;
  transform: rotate(1.2deg);
}

.pin {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.4));
}

/* =====================================================================
   SECCIÓN 1: EXPEDIENTE DE GABRIEL BERNAL
   ===================================================================== */
.investigator-badge {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.polaroid-frame {
  background: #fdfdfd;
  padding: 10px 10px 18px 10px;
  box-shadow: 2px 4px 14px rgba(0, 0, 0, 0.35);
  width: 140px;
  flex-shrink: 0;
  text-align: center;
  transform: rotate(-3deg);
  transition: transform 0.3s ease;
}

.polaroid-frame:hover {
  transform: rotate(0deg) scale(1.04);
}

.polaroid-photo {
  width: 100%;
  height: 125px;
  background: #2a2c30;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #1a1a1a;
  position: relative;
}

.polaroid-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: sepia(0.15) contrast(1.1);
}

.polaroid-caption {
  font-family: var(--font-handwriting);
  font-size: 0.8rem;
  margin-top: 8px;
  color: #333;
}

.investigator-meta {
  flex-grow: 1;
}

.investigator-name {
  font-family: var(--font-handwriting);
  font-size: 1.85rem;
  color: #141414;
  margin-bottom: 4px;
}

.investigator-role {
  margin-bottom: 10px;
}

.highlight-tag {
  background: rgba(0, 0, 0, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.82rem;
  color: #2b333e;
}

.investigator-specs {
  list-style: none;
  font-size: 0.82rem;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.investigator-specs li strong {
  color: #222;
}

.handwritten-note {
  background: rgba(0, 0, 0, 0.03);
  padding: 12px 14px;
  border-left: 3px solid #8b7355;
  border-radius: 0 6px 6px 0;
  margin: 14px 0;
}

.handwritten-title {
  font-family: var(--font-handwriting);
  font-size: 1.15rem;
  margin-bottom: 5px;
  color: #382c1e;
}

.handwritten-body {
  font-style: italic;
  font-size: 0.9rem;
  color: #2d2f33;
  line-height: 1.5;
}

/* Estadísticas Página Derecha */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--paper-border);
  padding: 12px 8px;
  text-align: center;
  border-radius: 6px;
  box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.05);
}

.stat-number {
  display: block;
  font-family: var(--font-handwriting);
  font-size: 1.6rem;
  color: #a82020;
  line-height: 1.1;
  margin-bottom: 3px;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: bold;
  text-transform: uppercase;
  color: #4b5563;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.tool-chip {
  background: #d8cbb2;
  border: 1px solid #bda886;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.76rem;
  font-weight: 600;
  color: #23272e;
  box-shadow: 1px 1px 2px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
}

.tool-chip:hover {
  background: #333d47;
  color: #fff;
  transform: translateY(-2px);
}

.case-brief-card {
  background: rgba(0, 0, 0, 0.04);
  padding: 14px;
  border-radius: 6px;
  border: 1px dashed #a89476;
}

.case-brief-card h4 {
  font-family: var(--font-handwriting);
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.case-brief-card p {
  font-size: 0.82rem;
  color: #333;
  line-height: 1.5;
}

/* =====================================================================
   SECCIÓN 2: EVIDENCIAS & HABILIDADES
   ===================================================================== */
.evidence-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.evidence-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--paper-border);
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.evidence-item:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: translateX(4px);
}

.evidence-item input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid #555;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  background: #fff;
}

.evidence-item input[type="checkbox"]:checked + .checkbox-custom::after {
  content: "✖";
  font-family: var(--font-handwriting);
  font-size: 1.2rem;
  color: #b31d1d;
  position: absolute;
  top: -4px;
}

.evidence-name {
  font-weight: bold;
  font-size: 0.88rem;
  flex-grow: 1;
}

.evidence-tag {
  font-size: 0.72rem;
  color: #666;
  background: rgba(0, 0, 0, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
}

.equipment-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  background: rgba(230, 200, 100, 0.25);
  padding: 8px 12px;
  border-radius: 6px;
  border-left: 3px solid #ffaa00;
}

/* Categorías de Habilidades Página Derecha */
.skill-category {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--paper-border);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.skill-category.filtered-out {
  opacity: 0.22;
  filter: grayscale(1);
  transform: scale(0.98);
}

.skill-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.skill-icon {
  font-size: 1.15rem;
}

.skill-title {
  font-family: var(--font-handwriting);
  font-size: 1.15rem;
  flex-grow: 1;
}

.skill-score {
  font-size: 0.72rem;
  font-weight: bold;
  background: #3c4856;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
}

.skill-desc {
  font-size: 0.8rem;
  color: #3b4252;
  margin-bottom: 6px;
}

.skill-meter {
  height: 6px;
  background: #c7bba2;
  border-radius: 3px;
  overflow: hidden;
}

.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, #5b7553, #1e4d2b);
  border-radius: 3px;
}

/* =====================================================================
   SECCIÓN 3: CASOS / PROYECTOS
   ===================================================================== */
.cases-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.case-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--paper-border);
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-typewriter);
  text-align: left;
  transition: all 0.2s ease;
}

.case-nav-btn:hover {
  background: #fff;
  transform: translateX(4px);
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.1);
}

.case-nav-btn.active {
  background: #2b333e;
  color: #f0f4f8;
  border-color: #1a1f26;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.25);
}

.case-number {
  font-weight: 700;
  color: #a82020;
}

.case-nav-btn.active .case-number {
  color: var(--hud-accent);
}

.case-name {
  flex-grow: 1;
  font-weight: 600;
  font-size: 0.85rem;
}

.case-status.solved {
  font-size: 0.68rem;
  font-weight: bold;
  background: #2a8a48;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
}

/* Detalle del Proyecto */
.case-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: bold;
  background: #8b7355;
  color: #fff;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}

.case-title-main {
  font-family: var(--font-handwriting);
  font-size: 1.45rem;
  margin-bottom: 8px;
  line-height: 1.25;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.case-tags .tag {
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: bold;
}

.project-polaroid-preview {
  background: #fff;
  padding: 10px 10px 16px 10px;
  border-radius: 2px;
  box-shadow: 2px 5px 15px rgba(0,0,0,0.25);
  margin-bottom: 14px;
  transform: rotate(0.8deg);
}

.project-mockup-screen {
  background: #11161d;
  height: 150px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  border: 1px solid #232b35;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mockup-radar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 136, 0.4);
  position: relative;
}

.mockup-radar::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0, 255, 136, 0.3) 0%, transparent 60%);
  animation: radar-sweep 2.5s infinite linear;
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

.mockup-code-lines {
  position: absolute;
  left: 20px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.code-line {
  height: 4px;
  background: rgba(0, 229, 255, 0.5);
  border-radius: 2px;
}

.code-line:nth-child(1) { width: 110px; }
.code-line:nth-child(2) { width: 70px; }
.code-line:nth-child(3) { width: 130px; }

.project-caption {
  font-family: var(--font-handwriting);
  font-size: 0.8rem;
  color: #444;
  text-align: center;
  margin-top: 8px;
}

.case-description-box {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--paper-border);
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 14px;
}

.desc-heading {
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.case-description-box p {
  font-size: 0.84rem;
  line-height: 1.55;
}

.case-action-buttons {
  display: flex;
  gap: 10px;
}

.case-btn {
  flex: 1;
  text-align: center;
  padding: 9px 12px;
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 0.82rem;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.2s ease;
}

.case-btn.primary {
  background: #1f2937;
  color: #fff;
  border: 1px solid #111827;
}

.case-btn.primary:hover {
  background: #000;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.case-btn.secondary {
  background: #e2d7c0;
  color: #2b333e;
  border: 1px solid #ad9c7e;
}

.case-btn.secondary:hover {
  background: #f4ecdc;
  transform: translateY(-2px);
}

/* =====================================================================
   SECCIÓN 4: BITÁCORA / EXPERIENCIA
   ===================================================================== */
.timeline-log {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  padding-left: 20px;
  border-left: 2px dashed #a08c70;
}

.timeline-entry {
  position: relative;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #b31d1d;
  border: 2px solid var(--paper-bg);
}

.timeline-marker {
  display: inline-block;
  font-family: var(--font-hud);
  font-size: 0.72rem;
  background: #2b333e;
  color: #fff;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 4px;
}

.timeline-role {
  font-family: var(--font-handwriting);
  font-size: 1.25rem;
  margin-bottom: 2px;
}

.timeline-company {
  font-weight: bold;
  font-size: 0.84rem;
  color: #555;
  margin-bottom: 6px;
}

.timeline-desc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.timeline-desc-list li {
  position: relative;
  padding-left: 16px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #2b3038;
}

.timeline-desc-list li::before {
  content: "▹";
  position: absolute;
  left: 0;
  top: 0;
  color: #a82020;
  font-weight: bold;
}

/* Certificaciones */
.certs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.cert-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--paper-border);
  padding: 10px 12px;
  border-radius: 6px;
}

.cert-icon {
  font-size: 1.4rem;
}

.cert-info h4 {
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 2px;
}

.cert-info p {
  font-size: 0.76rem;
  color: #555;
}

/* =====================================================================
   SECCIÓN 5: RADIO / SPIRIT BOX CONTACTO
   ===================================================================== */
.spirit-box-widget {
  background: #171d24;
  border: 3px solid #2d3846;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 18px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.radio-screen {
  background: #0d1217;
  border: 1px solid #3c4c5f;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  font-family: var(--font-hud);
}

.frequency-display {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: center;
}

.freq-tag {
  color: #64748b;
  font-size: 0.68rem;
  letter-spacing: 1px;
}

.freq-number {
  font-size: 1.7rem;
  color: var(--hud-accent);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
  font-weight: bold;
}

.freq-status {
  font-size: 0.76rem;
  color: var(--hud-amber);
  animation: blink-status 1.2s infinite alternate;
}

@keyframes blink-status {
  0% { opacity: 0.4; }
  100% { opacity: 1; }
}

.radio-controls {
  display: flex;
  gap: 8px;
}

.radio-action-btn {
  flex: 1;
  background: #252e3a;
  border: 1px solid #48586c;
  color: #e2e8f0;
  font-family: var(--font-hud);
  font-size: 0.72rem;
  padding: 8px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-action-btn:hover {
  background: #394759;
  border-color: var(--hud-accent);
  color: var(--hud-accent);
}

.contact-links-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact-item-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--paper-border);
  border-radius: 6px;
  color: var(--ink-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.contact-item-link:hover {
  background: #fff;
  transform: translateX(4px);
  color: #000;
}

/* Formulario de Transmisión */
.radio-transmission-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: bold;
}

.tactical-input, .tactical-textarea {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--paper-border);
  padding: 8px 10px;
  border-radius: 4px;
  font-family: var(--font-typewriter);
  font-size: 0.85rem;
  color: #1a1a1a;
  outline: none;
  transition: all 0.2s ease;
}

.tactical-input:focus, .tactical-textarea:focus {
  background: #fff;
  border-color: #3b4252;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.submit-transmission-btn {
  background: #1f2937;
  color: var(--hud-accent);
  border: 1px solid #111827;
  padding: 10px;
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 0.88rem;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.submit-transmission-btn:hover {
  background: #000;
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
  transform: translateY(-2px);
}

/* =====================================================================
   PORTADA DEL DIARIO CERRADO DE GOLPE (HUNT EVENT / 0% CORDURA)
   ===================================================================== */
.journal-closed-cover {
  width: 100%;
  max-width: 680px;
  height: 710px;
  max-height: 710px;
  margin: 0 auto;
  background: linear-gradient(135deg, #1f140e 0%, #120a06 50%, #291a13 100%);
  border-radius: 12px;
  box-shadow: 
    0 30px 70px rgba(0, 0, 0, 0.95),
    0 0 0 10px #2a1910,
    0 0 0 14px #120a06,
    0 0 45px rgba(255, 30, 30, 0.35);
  border: 2px solid #5a3825;
  position: relative;
  overflow: hidden;
  animation: book-slam 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

@keyframes book-slam {
  0% { transform: scale(1.15) rotate(-3deg); opacity: 0; filter: blur(4px); }
  60% { transform: scale(0.98) rotate(0.5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; filter: blur(0); }
}

.cover-leather {
  width: 100%;
  height: 100%;
  border: 2px dashed #6b442e;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  background: radial-gradient(circle at center, rgba(139, 69, 19, 0.15) 0%, rgba(0, 0, 0, 0.5) 100%);
}

.cover-strap {
  position: absolute;
  right: -2px;
  top: 45%;
  width: 90px;
  height: 38px;
  background: #3e2417;
  border: 2px solid #6b422a;
  border-radius: 6px 0 0 6px;
  box-shadow: -2px 3px 6px rgba(0, 0, 0, 0.6);
}

.cover-badge {
  display: inline-block;
  font-family: var(--font-hud);
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 2px;
  padding: 5px 12px;
  background: #150905;
  color: #ffaa00;
  border: 1px solid #734226;
  border-radius: 4px;
  margin-bottom: 18px;
}

.cover-title {
  font-family: var(--font-handwriting);
  font-size: 2.8rem;
  color: #d1b894;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px #000, 0 0 15px rgba(255, 170, 0, 0.3);
  margin-bottom: 6px;
}

.cover-subtitle {
  font-family: var(--font-hud);
  font-size: 0.95rem;
  color: #9c8266;
  letter-spacing: 1.5px;
  margin-bottom: 25px;
}

.cover-seal {
  font-size: 3.5rem;
  margin: 15px 0;
  animation: pulse-seal 1.5s infinite alternate;
  filter: drop-shadow(0 0 15px rgba(255, 50, 50, 0.6));
}

@keyframes pulse-seal {
  0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 50, 50, 0.4)); }
  100% { transform: scale(1.1); filter: drop-shadow(0 0 25px rgba(255, 50, 50, 0.9)); }
}

.cover-warning {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: bold;
  color: #ff3344;
  background: rgba(40, 5, 5, 0.85);
  border: 1px solid #ff3344;
  padding: 8px 16px;
  border-radius: 4px;
  letter-spacing: 1px;
  animation: warning-flicker 1.2s infinite;
}

@keyframes warning-flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* =====================================================================
   VIEWPORT DE CÁMARA (AFECTADO POR LA TORSIÓN DE CUELLO / NECK SNAP)
   ===================================================================== */
.camera-viewport {
  width: 100%;
  min-height: 100vh;
  transform-origin: center center;
  transition: transform 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28), filter 0.25s ease;
}

body.neck-snapped .camera-viewport {
  transform: rotate(34deg) translateY(70px) scale(0.96);
  filter: blur(2.5px) contrast(1.5) brightness(0.65);
}

/* =====================================================================
   ANIMACIÓN CINEMÁTICA DE MUERTE PHASMOPHOBIA (KILL HANDS & NECK SNAP)
   ===================================================================== */
.phasmo-death-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phasmo-death-screen.interactive {
  pointer-events: auto;
}

.death-cinematic-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 35%, rgba(0, 0, 0, 0.75) 70%, #000 100%);
  pointer-events: none;
}

.death-red-flash {
  position: absolute;
  inset: 0;
  background: rgba(180, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 3;
}

.death-red-flash.flashing {
  opacity: 1;
}

/* Escenario de Manos Fantasmales */
.death-hands-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.ghost-hand {
  position: absolute;
  bottom: -60px;
  width: 460px;
  max-width: 48vw;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 0 30px rgba(0, 255, 200, 0.25));
}

.ghost-hand-left {
  left: -80px;
  transform-origin: bottom left;
}

.ghost-hand-right {
  right: -80px;
  transform-origin: bottom right;
}

.hand-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Animación de la Mano Izquierda alcanzando y torciendo el cuello */
.ghost-hand.animating-left {
  animation: phasmo-left-hands-choke 2.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes phasmo-left-hands-choke {
  0% {
    transform: translate(-120%, 90%) rotate(-45deg);
    opacity: 0;
  }
  35% {
    transform: translate(-20%, 15%) rotate(-20deg);
    opacity: 0.95;
  }
  70% {
    /* Manos envolviendo el cuello a los costados */
    transform: translate(6%, -6%) rotate(-5deg) scale(1.05);
    opacity: 1;
  }
  80% {
    /* Quiebre y torsión fatal hacia la derecha */
    transform: translate(32%, -38%) rotate(42deg) scale(1.18);
    filter: drop-shadow(0 0 35px rgba(255, 30, 30, 0.85));
  }
  100% {
    transform: translate(45%, 15%) rotate(48deg) scale(1.05);
    opacity: 0;
  }
}

/* Animación de la Mano Derecha alcanzando y torciendo el cuello */
.ghost-hand.animating-right {
  animation: phasmo-right-hands-choke 2.1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes phasmo-right-hands-choke {
  0% {
    transform: translate(120%, 90%) rotate(45deg);
    opacity: 0;
  }
  35% {
    transform: translate(20%, 15%) rotate(20deg);
    opacity: 0.95;
  }
  70% {
    /* Manos envolviendo el cuello */
    transform: translate(-6%, -6%) rotate(5deg) scale(1.05);
    opacity: 1;
  }
  80% {
    /* Torsión contraria fatal hacia la izquierda */
    transform: translate(-38%, -15%) rotate(-44deg) scale(1.18);
    filter: drop-shadow(0 0 35px rgba(255, 30, 30, 0.85));
  }
  100% {
    transform: translate(-50%, 15%) rotate(-50deg) scale(1.05);
    opacity: 0;
  }
}

/* Tarjeta del Purgatorio (Post-Muerte) */
.afterlife-card {
  position: relative;
  z-index: 10;
  max-width: 580px;
  width: 90%;
  background: rgba(10, 14, 18, 0.95);
  border: 2px solid #ff3344;
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: 
    0 0 60px rgba(255, 30, 50, 0.6),
    inset 0 0 35px rgba(80, 0, 0, 0.7);
  animation: afterlife-appear 0.6s ease forwards;
  backdrop-filter: blur(10px);
}

@keyframes afterlife-appear {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.afterlife-blood-seal {
  display: inline-block;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 6px 14px;
  background: #b31d1d;
  color: #fff;
  border-radius: 4px;
  box-shadow: 0 0 15px rgba(255, 50, 50, 0.7);
  margin-bottom: 16px;
}

.afterlife-title {
  font-family: var(--font-handwriting);
  font-size: 2.2rem;
  color: #fff;
  letter-spacing: 1px;
  text-shadow: 0 0 15px rgba(255, 60, 60, 0.8);
  margin-bottom: 12px;
}

.afterlife-whisper {
  font-family: var(--font-hud);
  font-size: 0.95rem;
  color: #ff99aa;
  font-style: italic;
  line-height: 1.5;
  background: rgba(25, 10, 12, 0.8);
  border: 1px dashed #ff4455;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 22px;
}

.afterlife-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.afterlife-revive-btn {
  flex: 1.4;
  background: #ffaa00;
  color: #000;
  border: none;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(255, 170, 0, 0.6);
  transition: all 0.2s ease;
}

.afterlife-revive-btn:hover {
  background: #ffcc33;
  transform: scale(1.03);
  box-shadow: 0 0 30px rgba(255, 200, 0, 0.9);
}

.afterlife-contact-btn {
  flex: 1;
  background: #b31d1d;
  color: #fff;
  border: 1px solid #ff4455;
  padding: 12px 16px;
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 0.9rem;
  font-weight: bold;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.afterlife-contact-btn:hover {
  background: #ff1133;
  box-shadow: 0 0 20px rgba(255, 30, 50, 0.7);
  transform: scale(1.03);
}

/* Efectos visuales de Cacería */
body.hunt-active .flashlight-layer {
  animation: flashlight-hunt-flicker 0.15s infinite;
}

@keyframes flashlight-hunt-flicker {
  0%, 100% { opacity: 1; }
  25% { opacity: 0.1; }
  50% { opacity: 0.8; }
  75% { opacity: 0.05; }
}

body.hunt-active .tactical-hud {
  border-bottom-color: #ff3344;
}

body.hunt-active .status-indicator.live {
  background-color: #ff3344;
  box-shadow: 0 0 15px #ff3344;
}

/* =====================================================================
   PIE DE PÁGINA TÁCTICO
   ===================================================================== */
.tactical-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #0c0f14;
  border-top: 1px solid var(--bg-truck-border);
  color: #64748b;
  font-family: var(--font-hud);
  font-size: 0.75rem;
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
  gap: 10px;
}

/* =====================================================================
   RESPONSIVE DESIGN (TABLETS & MÓVILES - TOTALMENTE ADAPTADO)
   ===================================================================== */
@media (max-width: 900px) {
  /* Mostrar selector de páginas en móviles */
  .mobile-page-switch {
    display: flex;
  }

  .journal-book {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 540px;
    max-height: 76vh;
    border-radius: 10px;
  }

  .journal-spine {
    display: none;
  }

  /* Alternar entre Página Izquierda y Derecha en móviles */
  .journal-book.mobile-show-right .page-left {
    display: none !important;
  }

  .journal-book.mobile-show-right .page-right {
    display: block !important;
    border-left: none;
  }

  .journal-book:not(.mobile-show-right) .page-right {
    display: none !important;
  }

  .journal-book:not(.mobile-show-right) .page-left {
    display: block !important;
    border-right: none;
  }

  .journal-page {
    padding: 22px 18px;
    height: 100%;
    max-height: 74vh;
  }

  /* HUD en pantallas medianas */
  .tactical-hud {
    padding: 10px 16px;
    gap: 10px;
  }

  .hud-left {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 6px;
  }

  .hud-center {
    width: 100%;
    justify-content: space-between;
  }

  .hud-right {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }

  .journal-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin-left: 0;
    gap: 6px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .journal-tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs-spine-spacer {
    display: none;
  }

  .tabs-group {
    display: flex;
    gap: 6px;
    padding: 0;
  }

  .tabs-left-page .journal-tab,
  .tabs-right-page .journal-tab {
    flex: none;
  }
}

@media (max-width: 600px) {
  .tactical-hud {
    padding: 8px 12px;
  }

  .hud-status .hud-text {
    font-size: 0.75rem;
  }

  .hud-location {
    font-size: 0.72rem;
  }

  .sanity-card {
    padding: 4px 8px;
    gap: 6px;
  }

  .sanity-bar-wrap {
    width: 65px;
    height: 10px;
  }

  .emf-widget {
    padding: 4px 8px;
    gap: 6px;
  }

  .emf-led {
    width: 13px;
    height: 13px;
    font-size: 0.6rem;
  }

  .hud-btn, .hud-lang-btn {
    padding: 6px 10px;
    font-size: 0.72rem;
  }

  .journal-tab {
    padding: 8px 12px;
    font-size: 0.78rem;
  }

  .investigator-badge {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .polaroid-frame {
    transform: rotate(0deg);
    width: 125px;
  }

  .polaroid-photo {
    height: 110px;
  }

  .investigator-name {
    font-size: 1.5rem;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .stat-number {
    font-size: 1.3rem;
  }

  .case-action-buttons {
    flex-direction: column;
  }

  .tactical-input, .tactical-textarea {
    font-size: 16px; /* Evita zoom automático en Safari iOS */
  }

  .tape-strip {
    opacity: 0.5;
  }

  .tactical-footer {
    flex-direction: column;
    text-align: center;
    gap: 6px;
    padding: 12px;
  }
}

/* =====================================================================
   ANIMACIÓN DE MUERTE CINEMÁTICA PHASMOPHOBIA (MANOS + TORSIÓN DE CUELLO)
   ===================================================================== */
#main-camera-viewport {
  width: 100%;
  min-height: 100vh;
  transition: transform 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28), filter 0.3s ease;
  transform-origin: 50% 50%;
}

body.neck-snapped #main-camera-viewport {
  transform: rotate(34deg) translateY(50px) scale(1.04);
  filter: contrast(1.5) saturate(0.1) brightness(0.4) blur(2px);
  pointer-events: none;
}

.phasmo-death-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  pointer-events: none;
  overflow: hidden;
  display: none;
  align-items: center;
  justify-content: center;
}

.phasmo-death-screen.active {
  display: flex;
}

.phasmo-death-screen.interactive {
  pointer-events: auto;
}

/* Viñeta de terror y destello de sangre al fracturar cuello */
.death-cinematic-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.4) 30%, rgba(5, 10, 12, 0.95) 90%);
  pointer-events: none;
}

.death-red-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(160, 0, 0, 0.9) 10%, rgba(20, 0, 0, 0.95) 80%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.08s ease-out;
  z-index: 10;
}

.death-red-flash.flashing {
  opacity: 1;
}

/* Escenario de Manos de Phasmophobia (Video Transparente / Canvas) */
.death-hands-video-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 8;
  overflow: hidden;
}

#phasmo-death-video {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

#phasmo-death-video.playing {
  opacity: 1;
}

.death-video-canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.death-video-canvas.playing {
  opacity: 1;
}


/* Tarjeta del Más Allá / Purgatorio */
.afterlife-card {
  position: relative;
  z-index: 20;
  background: rgba(12, 16, 20, 0.96);
  border: 2px solid #a82020;
  border-radius: 8px;
  padding: 30px;
  max-width: 520px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 50px rgba(168, 32, 32, 0.4), 0 20px 60px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  animation: afterlifeFadeIn 0.8s ease forwards;
}

@keyframes afterlifeFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.afterlife-blood-seal {
  font-family: var(--font-hud);
  font-size: 0.85rem;
  letter-spacing: 3px;
  color: #a82020;
  margin-bottom: 12px;
  font-weight: bold;
}

.afterlife-title {
  font-family: var(--font-hud);
  font-size: 1.6rem;
  color: #fff;
  letter-spacing: 2px;
  margin-bottom: 15px;
  text-shadow: 0 0 15px rgba(255, 50, 50, 0.6);
}

.afterlife-whisper {
  font-family: var(--font-body);
  font-size: 1rem;
  color: #b5c2c7;
  line-height: 1.6;
  margin-bottom: 25px;
  border-left: 3px solid #a82020;
  padding-left: 15px;
  text-align: left;
  font-style: italic;
}

.afterlife-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.afterlife-revive-btn {
  background: linear-gradient(135deg, #1d6a42 0%, #114228 100%);
  color: #fff;
  border: 1px solid #38ef7d;
  padding: 14px 20px;
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 0.92rem;
  font-weight: bold;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(56, 239, 125, 0.25);
}

.afterlife-revive-btn:hover {
  background: linear-gradient(135deg, #248251 0%, #155533 100%);
  box-shadow: 0 6px 22px rgba(56, 239, 125, 0.45);
  transform: translateY(-2px);
}

.afterlife-contact-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 12px 20px;
  border-radius: 6px;
  font-family: var(--font-hud);
  font-size: 0.85rem;
  letter-spacing: 1px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease;
}

.afterlife-contact-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: #fff;
}
