/* ============================================================
   ROOT — REPLACED PALETTE + HAVENWOOD COMPAT ALIASES
   ============================================================ */
:root {
  /* Replaced core */
  --bg-primary:    #08080A;
  --bg-secondary:  #0D0D12;
  --bg-surface:    #141420;
  --bg-surface-2:  #1A1A2A;
  --border-dim:    #1E1E2E;
  --border-mid:    #2A2A3E;

  --text-primary:  #F0F0F8;
  --text-secondary:#C8C8DC;
  --text-muted:    #9E9EB6;

  --red:           #E62B2B;
  --red-dim:       rgba(230, 43, 43, 0.35);
  --red-glow:      rgba(230, 43, 43, 0.15);
  --red-accent:    #ee4f4f;
  --cyan:           #0eeef6;
  --cyan-dim:       rgba(0, 229, 255, 0.25);
  --green:         #4AF626;
  --green-dim:     rgba(74, 246, 38, 0.2);
  --amber:         #FFB800;
  --purple:        #A855F7;

  /* Havenwood compatibility aliases */
  --neon-cyan:     var(--cyan);
  --neon-red:      var(--red);
  --neon-green:    var(--green);
  --neon-yellow:   var(--amber);
  --neon-orange:   #FF8C00;
  --neon-purple:   var(--purple);
  --neon-blue:     rgba(0, 229, 255, 0.75);
  --neon-pink:     #FF6EB4;

  /* Fonts */
  --font-display:  'Barlow Condensed', sans-serif;
  --font-mono:     'Space Mono', monospace;

  /* Layout */
  --win-bg:        rgba(10, 10, 18, 0.97);
  --win-border:    var(--border-mid);
  --border-color:  var(--border-mid);
  --text-dim:      var(--text-secondary);
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { border: none; background: none; font-family: inherit; cursor: pointer; color: inherit; }
input, textarea { font-family: inherit; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: rgba(6, 6, 12, 0.85); }
::-webkit-scrollbar-thumb { background: #00ff88; border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: #0eeef6; }
body, * { scrollbar-width: thin; scrollbar-color: #00ff88 rgba(6, 6, 12, 0.85); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--cyan, #0eeef6); outline-offset: 2px; }

/* Low-Spec Hardware Containment (R-LOWSPEC) */
.news-card, .survivor-passport-card, .tab-content, .window {
  contain: layout style paint;
}
.wall-comments-accordion {
  overscroll-behavior: contain;
}

/* ============================================================
   CRT OVERLAY + SCANLINES
   ============================================================ */
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9000;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px, transparent 1px,
    rgba(0,0,0,0.2) 1px, rgba(0,0,0,0.2) 2px
  );
}
.crt-overlay::after {
  content: '';
  position: absolute;
  top: -100%; left: 0;
  width: 100%; height: 25%;
  background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.016) 50%, transparent 100%);
  animation: crt-roll 10s linear infinite;
  will-change: transform;
}
@keyframes crt-roll { to { transform: translateY(500%); } }

.noise-overlay {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 8999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)'/%3E%3C/svg%3E");
}
.vignette {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 8998;
  background: radial-gradient(ellipse 100% 100% at 50% 50%, transparent 50%, rgba(0,0,0,0.7) 100%);
}
.bg-layer {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 45% at 50% 105%, rgba(230,43,43,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 90% 10%,  rgba(0,229,255,0.05) 0%, transparent 55%);
}
#matrix-canvas {
  position: fixed; inset: 0;
  width: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.06;
}

/* ============================================================
   POWER SCREEN
   ============================================================ */
#power-screen {
  position: fixed; inset: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  gap: 0;
}

/* ── Power Screen — video de trailer en loop (mute, autoplay) ── */
#power-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: grayscale(50%) contrast(105%) sepia(0%) hue-rotate(190deg)
          brightness(0.15);
  pointer-events: none;
}

#power-screen > *:not(#power-video) {
  position: relative;
  z-index: 1;
}
.power-logo {
  font-family: var(--font-display);
  font-size: clamp(4rem, 14vw, 11rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  color: var(--red);
  text-shadow: 0 0 8px var(--red);
}
.power-logo::before,
.power-logo::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  font-family: inherit; font-size: inherit;
  font-weight: inherit; letter-spacing: inherit;
}
.power-logo::before {
  color: var(--red);
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
  animation: glitch-1 14s infinite;
}
.power-logo::after {
  color: var(--red-accent);
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
  animation: glitch-2 14s infinite;
}
.power-sub {
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  color: var(--text-muted);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}
.power-hint {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin-top: 1.5rem;
  animation: blink 2.5s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.15} }

.helena-quote {
  color: rgba(255, 255, 255, 0.78);
  opacity: 0.68;
  margin-top: 45px;
  max-width: 580px;
  line-height: 1.5;
  font-size: 0.68rem;
  text-transform: none;
  text-shadow: 0 0 5px rgba(255, 255, 255, 0.2);
  font-family: 'Space Mono', monospace;
  transition: opacity 0.5s ease, filter 0.5s ease, transform 0.5s ease;
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  cursor: default;
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.helena-quote.quote-transitioning {
  opacity: 0;
  filter: blur(6px);
  transform: translateY(-4px);
}

.helena-quote.quote-glitch {
  animation: quote-glitch-anim 4s infinite steps(1);
  color: var(--neon-red, #ff003c) !important;
  text-shadow: 2px 0 0 rgba(0, 255, 136, 0.4), -2px 0 0 rgba(0, 180, 255, 0.4);
}

@keyframes quote-glitch-anim {
  0%, 94%, 100% {
    transform: translate(0, 0) skew(0deg);
    filter: none;
    text-shadow: 2px 0 0 rgba(0, 255, 136, 0.4), -2px 0 0 rgba(0, 180, 255, 0.4);
  }
  95% {
    transform: translate(-1px, 1px) skew(-2deg);
    filter: hue-rotate(90deg);
    text-shadow: -2px 0 0 rgba(255, 0, 60, 0.6), 2px 0 0 rgba(0, 255, 136, 0.6);
  }
  96% {
    transform: translate(1px, -1px) skew(3deg);
    filter: invert(0.15);
  }
  97% {
    transform: translate(-2px, -1px) skew(-3deg);
    text-shadow: 3px 0 0 rgba(0, 180, 255, 0.6), -3px 0 0 rgba(255, 0, 60, 0.6);
  }
  98% {
    transform: translate(2px, 2px) skew(1deg);
    filter: none;
  }
  99% {
    transform: translate(-1px, -1px) skew(0deg);
  }
}

.helena-quote .quote-highlight {
  color: #5effeb;
  font-weight: 600;
  text-shadow: 0 0 5px rgba(94, 255, 235, 0.4);
}

.helena-quote .quote-author {
  color: #00e5ff;
  font-weight: bold;
  text-shadow: 0 0 6px rgba(0, 229, 255, 0.5);
  margin-left: 6px;
}




/* ============================================================
   BOOT OVERLAY
   ============================================================ */
.boot-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9500;
  opacity: 1;
  transition: opacity 0.5s;
}
.boot-overlay.hidden { display: none; }
.boot-overlay.active { display: flex; }
.boot-shell {
  width: min(860px, 95vw);
  height: min(480px, 90vh);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0,229,255,0.25);
  background: rgba(6,6,12,0.96);
  box-shadow: 0 0 60px rgba(0,229,255,0.1), inset 0 0 30px rgba(0,0,0,0.8);
  overflow: hidden;
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 24px 100%, 0 calc(100% - 24px));
}
.boot-shell-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(0,229,255,0.15);
  background: rgba(0,229,255,0.03);
}
.boot-brand {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--red-accent);
}
.boot-status-label {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--red-accent);
}
.boot-lines {
  flex: 1;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.7;
  color: #ccc;
  padding: 1rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--red-accent) transparent;
}
.boot-line { margin-bottom: 1px; }
.boot-line.ok     { color: var(--green); }
.boot-line.warn   { color: var(--amber); }
.boot-line.error  { color: var(--red); }
.boot-line.cyan   { color: var(--red-accent); }
.boot-line.dim    { color: var(--text-muted); }

.boot-progress-container {
  padding: 0.75rem 1.5rem 1rem;
  border-top: 1px solid rgba(0,229,255,0.1);
}
.boot-progress-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.35rem;
}
.boot-percent {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.1em;
}
.boot-progress-track {
  width: 100%;
  height: 3px;
  background: var(--border-dim);
  position: relative;
}
.boot-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--red-accent));
  transition: width 0.2s linear;
  position: relative;
}
.boot-progress-fill::after {
  content: '';
  position: absolute;
  right: -2px; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  background: var(--red);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

/* ============================================================
   OS SHELL — post-boot blank screen
   ============================================================ */
.os-shell {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.os-shell.hidden { display: none; }
.os-shell--visible { opacity: 1; }

.os-ready-label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-family: var(--font-mono);
  font-size: clamp(0.75rem, 1.5vw, 1rem);
  letter-spacing: 0.3em;
  color: var(--red-accent);
  text-shadow: 0 0 12px var(--red-accent);
  text-transform: uppercase;
  user-select: none;
}
.os-ready-cursor {
  animation: blink-cursor 1s step-start infinite;
  color: var(--red-accent);
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ============================================================
   GLITCH ANIMATIONS
   ============================================================ */
@keyframes glitch-1 {
  0%,88%,100% { transform: translate(0); opacity: 0; }
  89% { transform: translate(-8px, 0); opacity: 0.9; }
  90% { transform: translate( 5px, 0); opacity: 0.6; }
  91% { opacity: 0; }
}
@keyframes glitch-2 {
  0%,88%,100% { transform: translate(0); opacity: 0; }
  89% { transform: translate( 8px, 0); opacity: 0.8; }
  90% { transform: translate(-5px, 0); opacity: 1; }
  91% { opacity: 0; }
}
.glitch { animation: glitch-base 12s infinite; }
.glitch-font { animation: glitch-base 12s infinite; }
@keyframes glitch-base {
  0%,91%,100% { transform: translate(0); }
  92% { transform: translate(-3px,  2px); }
  93% { transform: translate( 3px, -2px); }
  94% { transform: translate(-2px,  0);   }
  95% { transform: translate( 2px,  0);   }
  96% { transform: translate(0); }
  97% { transform: translate(0); }
}
@keyframes pulse-alert { 0%,100%{opacity:1} 50%{opacity:0.5} }

/* ============================================================
    MISC / ANIMATIONS
    ============================================================ */
.hidden { display: none !important; }
.image-skeleton {
    background: linear-gradient(90deg, rgba(0,20,30,0.3) 25%, rgba(0,229,255,0.08) 50%, rgba(0,20,30,0.3) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}
@keyframes skeleton-loading { to { background-position: -200% 0; } }

.image-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 5px; color: var(--red-accent);
    background: rgba(0,20,30,0.6);
    border: 1px dashed var(--red-accent);
    font-size: 0.75rem; padding: 0.75rem; text-align: center;
}
.global-footer {
    font-family: var(--font-mono);
    letter-spacing: 0.08em;
}

/* CYBER BUTTON */
.cyber-btn {
    padding: 0.6rem 2rem;
    background: transparent;
    border: 1px solid var(--red);
    color: var(--red);
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
    clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}
.cyber-btn:hover {
    background: var(--red-dim);
    box-shadow: 0 0 15px var(--red-glow);
}
.cyber-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* CYBER BUTTON VARIANTS */
.cyber-btn.cyber-btn-primary,
.cyber-btn-primary {
    border-color: var(--red);
    color: var(--red);
}
.cyber-btn.cyber-btn-secondary,
.cyber-btn-secondary {
    border-color: var(--cyan);
    color: var(--cyan);
}
.cyber-btn.cyber-btn-secondary:hover:not(:disabled),
.cyber-btn-secondary:hover:not(:disabled) {
    background: rgba(14, 238, 246, 0.15);
    box-shadow: 0 0 15px rgba(14, 238, 246, 0.4);
}
.cyber-btn.cyber-btn-danger,
.cyber-btn-danger {
    border-color: var(--red);
    color: var(--red);
    background: rgba(230, 43, 43, 0.12);
}
.cyber-btn.cyber-btn-danger:hover:not(:disabled),
.cyber-btn-danger:hover:not(:disabled) {
    background: rgba(230, 43, 43, 0.3);
    box-shadow: 0 0 15px var(--red-glow);
    color: #ffffff;
}
.cyber-btn.cyber-btn-success,
.cyber-btn-success {
    border-color: var(--green);
    color: var(--green);
}
.cyber-btn.cyber-btn-success:hover:not(:disabled),
.cyber-btn-success:hover:not(:disabled) {
    background: rgba(74, 246, 38, 0.15);
    box-shadow: 0 0 15px rgba(74, 246, 38, 0.4);
}

/* LOGIN FORM STYLES */
.login-container {
    text-align: center;
    padding: 2rem;
}
.login-title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--red-accent);
    text-align: center;
    margin-bottom: 2rem;
    text-shadow: 0 0 10px var(--red-accent);
}
.login-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}
.login-form label {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-primary);
    width: 100%;
    max-width: 300px;
    text-align: left;
}
.login-form input {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem;
    border: 1px solid var(--border-mid);
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-radius: 3px;
}
.login-form input:focus {
    outline: none;
    border-color: var(--red-accent);
    box-shadow: 0 0 10px var(--cyan-dim);
}
.login-fields {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
    max-width: 300px;
}
.login-notes {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 300px;
    line-height: 1.5;
}
.login-error {
    color: var(--red);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    min-height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* WELCOME MESSAGE STYLES */
.welcome-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(600px, 90vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
}
.welcome-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green);
    text-shadow: 0 0 15px var(--green-dim);
    margin-bottom: 1rem;
}
.welcome-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--red-accent);
    margin-bottom: 0.5rem;
}
.welcome-subtext {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--text-secondary);
}

/* ============================================================
    UTILITY CLASSES
    ============================================================ */
.t-green {
  color: var(--green);
}
.t-cyan {
  color: var(--cyan);
}
.blink {
  animation: blink 1s step-end infinite;
}
.error-text {
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
/* ============================================================
   SECCIÓN: NETWORK NEWS / TRANSMISIONES DE RED — Cards
   ============================================================ */

/* ── Card base ──────────────────────────────────────────── */
.news-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 1rem 1.15rem;
    margin-bottom: 0.85rem;
    border-left: 2px solid transparent;
    border-bottom: 1px dashed var(--border-mid);
    padding-bottom: 0.85rem;
    transition:
        background  0.18s ease,
        border-color 0.18s ease,
        transform    0.18s ease;
    cursor: default;
    opacity: 0;
    animation: news-card-in 0.35s ease forwards;
}

.news-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.news-card:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: translateX(3px);
}

.news-card--video  { border-left-color: var(--green); }
.news-card--video:hover { border-left-color: var(--green); }

.news-card--patch  { border-left-color: var(--red-accent); }
.news-card--patch:hover { border-left-color: var(--red-accent); }

.news-card--upcoming { border-left-color: var(--amber); }
.news-card--upcoming:hover { border-left-color: var(--amber); }

/* ── Metadatos: tipo de transmisión + timestamp ─────────── */
.news-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.news-status {
    padding: 0.08rem 0.45rem;
    letter-spacing: 0.14em;
    border: 1px solid currentColor;
    font-weight: 700;
    flex-shrink: 0;
    font-size: 0.58rem;
}

.news-status--live    { color: var(--red);    animation: pulse-alert 2.2s ease-in-out infinite; }
.news-status--archive { color: var(--red-accent);   }
.news-status--queue   { color: var(--amber);  }

/* Alias para los spans heredados en home.js */
.news-card .t-green { color: var(--green); }
.news-card .warn     { color: var(--amber); }

/* ── Título / archivo de la transmisión ────────────────── */
.news-title {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.06em;
    line-height: 1.4;
}

/* ── Cuerpo / descripción ───────────────────────────────── */
.news-body {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: var(--text-secondary);
    line-height: 1.75;
    text-align: justify;
}

.news-body a,
.news-body--link {
    color: var(--red-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 229, 255, 0.25);
    transition: border-color 0.15s ease;
}

.news-body a:hover,
.news-body--link:hover {
    border-bottom-color: var(--red-accent);
}

/* ── Placeholder visual "sin señal" (para videos offline) ─ */
.news-offline-box {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0.9rem;
    margin-top: 0.3rem;
    background:
        repeating-linear-gradient(
            -45deg,
            rgba(0, 0, 0, 0) 0px,
            rgba(0, 0, 0, 0) 8px,
            rgba(230, 43, 43, 0.04) 8px,
            rgba(230, 43, 43, 0.04) 16px
        );
    border: 1px dashed var(--border-dim);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    transition: border-color 0.2s ease;
}

.news-offline-box:hover {
    border-color: var(--red);
    color: var(--text-secondary);
}

.news-offline-icon {
    flex-shrink: 0;
    color: var(--red);
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ── Animación de entrada escalonada ──────────────────── */
@keyframes news-card-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0);    }
}


.news-card:nth-child(1) { animation-delay: 0.05s; }
.news-card:nth-child(2) { animation-delay: 0.18s; }
.news-card:nth-child(3) { animation-delay: 0.31s; }
.news-card:nth-child(4) { animation-delay: 0.44s; }
.news-card:nth-child(5) { animation-delay: 0.57s; }

/* ── WELCOME MESSAGE HELPERS ─────────────────────────── */

.welcome-divider {
    height: 1px;
    background: var(--border-mid);
    margin: 15px 0;
    width: 100%;
    border: none;
    padding: 0;
}

.welcome-hint {
    font-size: 0.65rem;
    margin-top: 15px;
    color: var(--text-muted);
    letter-spacing: 0.2em;
    animation: blink 1.5s infinite;
}

/* ============================================================
   ACCESSIBILITY — prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Localiza la clase exacta de los enlaces alternativos de login/registro */
.auth-toggle-link, 
#toggle-auth-mode,
.power-screen .power-hint {
    /* 1. Forzar el puntero de clic en todo momento */
    cursor: pointer;
    
    /* 2. Bloquear por completo la selección de texto en el navegador */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none;    /* Firefox */
    -ms-user-select: none;     /* IE10+ */
    user-select: none;         /* Estándar moderno */
    
    /* 3. Asegurar que el comportamiento visual responda a la interacción */
    transition: color 0.15s ease-in-out;
}

/* Optimización extra para el estado Hover de esos botones */
.auth-toggle-link:hover {
    filter: drop-shadow(0 0 4px var(--neon-red, #ff003c));
    text-decoration: underline;
}

/* ============================================================
   RESPONSIVE MOBILE TACTICAL ENFORCEMENT (Rule 01 & 02)
   ============================================================ */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    overscroll-behavior-y: none;
}

/* ============================================================
   1993 RETRO HUD CRT RED-GLOW ICON SYSTEM
   ============================================================ */
.cyber-icon,
.nav-icon {
    color: #ff2244;
    text-shadow: 0 0 6px rgba(255, 34, 68, 0.8), 0 0 12px rgba(255, 34, 68, 0.4);
    filter: drop-shadow(0 0 4px rgba(255, 34, 68, 0.7));
    transition: filter 0.2s ease, text-shadow 0.2s ease;
}

.cyber-icon:hover,
.nav-icon:hover {
    filter: drop-shadow(0 0 8px rgba(255, 34, 68, 1));
    text-shadow: 0 0 10px #ff2244, 0 0 18px rgba(255, 34, 68, 0.7);
}

.cyber-btn i,
.cyber-btn-amber i,
button.cyber-btn i {
    color: inherit !important;
    text-shadow: inherit !important;
    filter: inherit !important;
}

@media (max-width: 768px) {
    :root {
        --cinema-pad-x: 2dvh;
    }

    /* Reducir sobrecarga de GPU en dispositivos móviles */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    #user-profile-modal-overlay,
    .app-content-panel,
    .modal-aside {
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
    }

    .app-content-panel,
    .modal-aside-content {
        overscroll-behavior: contain !important;
        touch-action: pan-y !important;
    }
}



/* Global Motion Blur */
.global-motion-blur-active {
    filter: blur(8px) !important;
    will-change: filter;
    transition: filter 0.15s ease-out;
}

/* ============================================================
   TACTICAL SKELETONS & HIGH-DENSITY CRUD (CRT PHOSPHOR)
   ============================================================ */
.skeleton-crt-pulse {
    position: relative;
    overflow: hidden;
    background: rgba(14, 14, 22, 0.7);
    border: 1px solid rgba(0, 255, 136, 0.15);
}

.skeleton-crt-pulse::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 255, 136, 0.12) 50%, transparent 100%);
    animation: skeleton-phosphor-sweep 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    pointer-events: none;
    transform: translateZ(0);
}

@keyframes skeleton-phosphor-sweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.skeleton-patch-card {
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    background: rgba(8, 8, 14, 0.6);
    border: 1px solid var(--border-dim);
    border-left: 3px solid rgba(0, 255, 136, 0.4);
}

.skeleton-line {
    height: 12px;
    margin-bottom: 8px;
    background: rgba(30, 30, 46, 0.8);
    border-radius: 1px;
}

.skeleton-line-title { height: 20px; width: 65%; margin-bottom: 12px; }
.skeleton-line-meta { height: 11px; width: 40%; margin-bottom: 16px; }
.skeleton-line-paragraph { height: 12px; width: 95%; margin-bottom: 6px; }
.skeleton-line-short { height: 12px; width: 50%; margin-bottom: 14px; }

/* TACTICAL BUTTON LOADING STATE */
.cyber-btn.is-loading {
    opacity: 0.75;
    pointer-events: none;
    cursor: wait;
}

.cyber-btn .btn-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 8px;
    border: 2px solid rgba(0, 255, 136, 0.3);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: btn-spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   TACTICAL DISCRETE UI STATES (R-DISCRETE-UI-STATES)
   ============================================================ */
.tactical-state-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    background: rgba(10, 9, 8, 0.75);
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
    font-family: var(--font-mono, monospace);
    animation: tactical-state-fadein 0.3s ease-out;
}

@keyframes tactical-state-fadein {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.tactical-state-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    opacity: 0.6;
}

/* Estado de Error Táctico */
.tactical-state-error {
    border: 1px solid rgba(230, 43, 43, 0.5);
    border-left: 3px solid var(--red, #E62B2B);
    box-shadow: inset 0 0 20px rgba(230, 43, 43, 0.08), 0 4px 20px rgba(0, 0, 0, 0.5);
    color: var(--red, #E62B2B);
}

.tactical-state-error .tactical-state-icon,
.tactical-state-error i.tactical-state-icon,
.tactical-state-error i.fa-solid,
.tactical-state-error i.fa-regular {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--red, #E62B2B) !important;
    text-shadow: 0 0 12px rgba(230, 43, 43, 0.6) !important;
    filter: drop-shadow(0 0 6px rgba(230, 43, 43, 0.7)) !important;
    animation: crt-alarm-pulse 2s ease-in-out infinite;
}

@keyframes crt-alarm-pulse {
    0%, 100% { opacity: 0.9; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.96); }
}

.tactical-state-error .tactical-state-title {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #ff5555;
    margin-bottom: 0.5rem;
}

.tactical-state-error .tactical-state-body {
    font-size: 0.88rem;
    color: var(--text-muted, #9E9EB6);
    max-width: 480px;
    line-height: 1.5;
    margin: 0 auto 1.25rem auto;
}

.tactical-state-retry-btn {
    margin-top: 0.5rem;
    padding: 8px 18px;
    font-size: 0.82rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    background: rgba(230, 43, 43, 0.15);
    border: 1px solid var(--red, #E62B2B);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tactical-state-retry-btn:hover {
    background: var(--red, #E62B2B);
    box-shadow: 0 0 15px rgba(230, 43, 43, 0.5);
}

/* Estado Vacío Táctico (Silencio de canal) */
.tactical-state-empty {
    border: 1px dashed var(--border-mid, #2A2A3E);
    border-left: 3px solid var(--cyan, #0eeef6);
    box-shadow: inset 0 0 15px rgba(14, 238, 246, 0.03);
    color: var(--cyan, #0eeef6);
}

.tactical-state-empty .tactical-state-icon,
.tactical-state-empty i.tactical-state-icon,
.tactical-state-empty i.fa-solid,
.tactical-state-empty i.fa-regular {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--cyan, #0eeef6) !important;
    opacity: 0.85;
    text-shadow: 0 0 10px rgba(14, 238, 246, 0.5) !important;
    filter: drop-shadow(0 0 5px rgba(14, 238, 246, 0.6)) !important;
}

.tactical-state-empty .tactical-state-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-primary, #F0F0F8);
    margin-bottom: 0.5rem;
}

.tactical-state-empty .tactical-state-body {
    font-size: 0.85rem;
    color: var(--text-muted, #9E9EB6);
    max-width: 440px;
    line-height: 1.5;
    margin: 0 auto 1rem auto;
}

.tactical-state-action-btn {
    margin-top: 0.5rem;
}

.tactical-state-loading {
    border-color: rgba(14, 238, 246, 0.35);
    box-shadow: 0 0 25px rgba(14, 238, 246, 0.12);
}

.tactical-state-loading .tactical-state-icon,
.tactical-state-loading i.tactical-state-icon,
.tactical-state-loading i.fa-solid,
.tactical-state-loading i.fa-regular {
    color: var(--cyan, #0eeef6) !important;
    text-shadow: 0 0 14px rgba(14, 238, 246, 0.8) !important;
    animation: tactical-state-pulse 1.5s infinite ease-in-out;
}

@keyframes tactical-state-pulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.06); }
}

.tactical-state-loading .tactical-state-title {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--cyan, #0eeef6);
    margin-bottom: 0.5rem;
}

.tactical-state-loading .tactical-state-body {
    font-size: 0.85rem;
    color: var(--text-muted, #9E9EB6);
    max-width: 440px;
    line-height: 1.5;
    margin: 0 auto 1rem auto;
}


