.dq-bit.is-one { color: var(--blue); border-color: rgba(56,136,255,0.45); background: rgba(56,136,255,0.08); box-shadow: inset 0 1px 4px rgba(0,0,0,0.2), 0 0 8px rgba(56,136,255,0.15); }
.dq-bit.is-zero { color: var(--text-dim); }

#decrypt-active-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

#decrypt-arrow {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--text-dim);
}

#decrypt-active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(64px, 8vw, 100px);
  height: clamp(44px, 8vh, 80px);
  border: 3px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: bold;
  background: rgba(56, 136, 255, 0.04);
  transition: border-color 0.1s, background 0.1s, color 0.1s, box-shadow 0.1s;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.2);
}

#decrypt-active.idle {
  color: var(--text-dim);
  opacity: 0.3;
  font-size: 1rem;
  animation: decryptIdle 1.5s ease-in-out infinite;
}

@keyframes decryptIdle {
  0%, 100% { opacity: 0.15; border-color: rgba(255,255,255,0.05); }
  50%      { opacity: 0.3; border-color: rgba(255,255,255,0.1); }
}

#decrypt-active.is-one {
  color: var(--blue);
  border-color: var(--blue);
  background: rgba(56, 136, 255, 0.1);
  box-shadow: 0 0 20px rgba(56, 136, 255, 0.35), 0 0 40px rgba(56, 136, 255, 0.15), inset 0 0 15px rgba(56, 136, 255, 0.08);
  position: relative;
  animation: packetPulseOpacity 0.6s ease-in-out infinite;
}

#decrypt-active.is-one::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: radial-gradient(ellipse at center, rgba(56, 136, 255, 0.25) 0%, transparent 70%);
  opacity: 0;
  animation: packetGlowPulse 0.6s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}

#decrypt-active.is-zero {
  color: var(--text-dim);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

#decrypt-active.hit {
  color: var(--green);
  border-color: var(--green);
  background: rgba(56, 255, 92, 0.15);
  box-shadow: 0 0 20px rgba(56, 255, 92, 0.4), 0 0 40px rgba(56, 255, 92, 0.15), inset 0 0 15px rgba(56, 255, 92, 0.1);
}

#decrypt-active.miss {
  color: var(--red);
  border-color: var(--red);
  background: rgba(255, 56, 56, 0.15);
  box-shadow: 0 0 20px rgba(255, 56, 56, 0.4), 0 0 40px rgba(255, 56, 56, 0.15), inset 0 0 15px rgba(255, 56, 56, 0.1);
}

/* Flip-pending warning — bit about to change (COMMANDER+) */
#decrypt-active.flip-pending {
  animation: flipWarn 0.2s ease-in-out infinite !important;
}

@keyframes flipWarn {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

@keyframes packetPulseOpacity {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}

@keyframes packetGlowPulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

/* Legacy packetPulse kept for reference but no longer used (was box-shadow animation) */

.decrypt-timer-track {
  height: 8px;
  max-width: 80%;
  margin: 0 auto;
  border-radius: 4px;
}

.decrypt-timer-fill {
  background: var(--blue);
  box-shadow: 0 0 10px rgba(56, 136, 255, 0.4), 0 0 20px rgba(56, 136, 255, 0.15);
  will-change: transform;
}

/* ── Terminal log feed — mini CRT screen ─────────────────── */
#terminal-log {
  flex: 1;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at center, rgba(0, 255, 65, 0.05) 0%, transparent 70%),
    linear-gradient(180deg, rgba(0,30,10,0.6) 0%, rgba(0,0,0,0.5) 100%);
  border: 3px solid rgba(0, 255, 65, 0.2);
  border-radius: var(--radius-md);
  padding: 6px 8px;
  font-size: 0.52rem;
  line-height: 1.6;
  position: relative;
  box-shadow:
    var(--depth-shadow),
    inset 0 0 25px rgba(0, 0, 0, 0.5),
    inset 0 0 60px rgba(0, 255, 65, 0.025),
    0 0 2px rgba(0, 255, 65, 0.15);
  /* Thin scrollbar to match terminal aesthetic */
  scrollbar-width: thin;
  scrollbar-color: rgba(0,255,65,0.25) transparent;
  /* Outer bezel — monitor housing */
  outline: 2px solid rgba(20, 30, 25, 0.9);
  outline-offset: 1px;
}

/* CRT screen curvature hint */
#terminal-log::before {
  content: 'LOG';
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 0.4rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  opacity: 0.5;
  z-index: 1;
}

/* Scanline micro-overlay on log screen */
#terminal-log::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.04) 2px,
    rgba(0, 0, 0, 0.04) 4px
  );
  z-index: 1;
}
