/* OTAKU NOIR — hackfx.css — ship-systems fiction layer
   (SHIP OPS terminal + SIGNAL INTRUSION set piece) */

/* ─── SHIP OPS terminal ─────────────────────────── */
.ops-term {
  width: min(680px, 92vw);
  margin: 34px auto 0;
  border: 1px solid var(--border);
  background: rgba(16, 16, 21, 0.82);
  text-align: left;
  box-shadow: 0 0 32px rgba(255, 46, 60, 0.05);
}
.ops-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--fg-dim);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 46, 60, 0.04);
}
.ops-ch { margin-left: auto; color: var(--accent-2); }
.ops-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: ops-pulse 2.2s infinite;
}
@keyframes ops-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
.ops-body {
  padding: 12px 14px 14px;
  min-height: 178px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--fg-dim);
}
.ops-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: ops-in 0.18s steps(2, end); }
.ops-line.warn { color: var(--accent-3); }
.ops-line.ok { color: var(--accent-2); }
.ops-line:last-child::after {
  content: "▊";
  margin-left: 2px;
  color: var(--accent);
  animation: ops-pulse 1s infinite;
}
@keyframes ops-in { from { opacity: 0; transform: translateY(3px); } }

/* ─── SIGNAL INTRUSION overlay ──────────────────── */
.hx-trigger { cursor: pointer; }
.hx-trigger:hover { color: var(--accent); text-shadow: 0 0 8px rgba(255, 46, 60, 0.5); }

.hx-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(7, 7, 10, 0.94);
  opacity: 1;
  transition: opacity 0.6s;
  animation: hx-flicker 0.09s 6 alternate;
  cursor: pointer;
  overflow: hidden;
}
.hx-overlay.hx-out { opacity: 0; pointer-events: none; }
@keyframes hx-flicker { from { filter: brightness(1); } to { filter: brightness(1.8) hue-rotate(-8deg); } }

.hx-rain { position: absolute; inset: 0; opacity: 0.5; }

.hx-stage {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
}

.hx-klaxon {
  font-size: clamp(20px, 4.4vw, 44px);
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(255, 46, 60, 0.65);
  animation: hx-klaxon 0.9s infinite steps(2, end);
}
@keyframes hx-klaxon { 50% { opacity: 0.35; } }
.hx-sub {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

/* counter-trace block — hidden until phase-counter */
.hx-counter { display: none; width: min(560px, 88vw); margin-top: 10px; }
.phase-counter .hx-counter { display: block; animation: ops-in 0.3s; }
.hx-counter-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent-2);
  margin-bottom: 10px;
}
.hx-bar {
  position: relative;
  height: 16px;
  border: 1px solid var(--accent-2);
  background: rgba(0, 224, 255, 0.06);
}
.hx-bar-fill {
  height: 100%;
  width: 0%;
  background: repeating-linear-gradient(
    -45deg,
    rgba(0, 224, 255, 0.85) 0 8px,
    rgba(0, 224, 255, 0.45) 8px 16px
  );
  transition: width 0.18s steps(4, end);
}
.hx-pct {
  position: absolute;
  right: 6px;
  top: -1px;
  font-size: 11px;
  color: var(--fg);
  mix-blend-mode: difference;
}
.hx-nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 12px;
}
.hx-node {
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 3px 8px;
  border: 1px solid var(--fg-faint);
  color: var(--fg-faint);
  transition: all 0.2s;
}
.hx-node.lit {
  border-color: var(--accent-2);
  color: var(--accent-2);
  box-shadow: 0 0 10px rgba(0, 224, 255, 0.35);
}

/* all-clear — hidden until phase-clear; klaxon+counter yield */
.hx-clear { display: none; }
.phase-clear .hx-klaxon,
.phase-clear .hx-sub,
.phase-clear .hx-counter { display: none; }
.phase-clear .hx-clear { display: block; animation: ops-in 0.4s; }
.hx-clear-big {
  font-size: clamp(24px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent-2);
  text-shadow: 0 0 22px rgba(0, 224, 255, 0.6);
}
.hx-clear-sub {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--fg-dim);
  text-transform: uppercase;
}

/* reduced motion — no flicker/klaxon strobe, static rain layer stays off */
@media (prefers-reduced-motion: reduce) {
  .hx-overlay { animation: none; }
  .hx-klaxon { animation: none; }
  .ops-line { animation: none; }
}
