/* Prison-themed animations and effects */

/* Fluorescent flicker — mimics failing prison hallway lights */
@keyframes flicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.7; }
  97% { opacity: 1; }
  98% { opacity: 0.5; }
  99% { opacity: 0.9; }
}

/* Rust corrosion — slow orange pulse on panels */
@keyframes rust-pulse {
  0%, 100% { box-shadow: inset 0 0 20px rgba(200,90,48,0); }
  50% { box-shadow: inset 0 0 20px rgba(200,90,48,0.08); }
}

/* Cell bar scan — horizontal line sweeping down */
@keyframes cell-scan {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

/* Lockdown pulse — red warning glow */
@keyframes lockdown-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(204,48,48,0); }
  50% { box-shadow: 0 0 30px rgba(204,48,48,0.15); }
}

/* Drip — water dripping effect */
@keyframes drip {
  0% { transform: translateY(-10px); opacity: 0; }
  10% { opacity: 0.6; }
  100% { transform: translateY(100px); opacity: 0; }
}

/* Steel glow — cold blue pulse */
@keyframes steel-glow {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 12px rgba(58,138,255,0.4); }
}

/* Concrete crack spread */
@keyframes crack-spread {
  0% { clip-path: inset(50% 50% 50% 50%); }
  100% { clip-path: inset(0 0 0 0); }
}

/* Alarm strobe */
@keyframes alarm-strobe {
  0%, 49% { background: transparent; }
  50%, 51% { background: rgba(204,48,48,0.05); }
  52%, 100% { background: transparent; }
}

/* Apply classes */
.flicker { animation: flicker 4s infinite; }
.rust-pulse { animation: rust-pulse 6s ease-in-out infinite; }
.lockdown-pulse { animation: lockdown-pulse 3s ease-in-out infinite; }
.steel-glow { animation: steel-glow 4s ease-in-out infinite; }

/* Cell bar overlay */
.cell-bars::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%, transparent 8%,
    rgba(200,90,48,0.1) 8%, rgba(200,90,48,0.1) 8.5%,
    transparent 8.5%, transparent 16.5%,
    rgba(200,90,48,0.1) 16.5%, rgba(200,90,48,0.1) 17%,
    transparent 17%, transparent 25%,
    rgba(200,90,48,0.1) 25%, rgba(200,90,48,0.1) 25.5%,
    transparent 25.5%, transparent 33.5%,
    rgba(200,90,48,0.1) 33.5%, rgba(200,90,48,0.1) 34%,
    transparent 34%
  );
  animation: cell-scan 8s linear infinite;
  pointer-events: none;
  z-index: 9998;
}

/* Concrete texture overlay */
.concrete-texture::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9997;
  opacity: 0.02;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Rust drip accent */
.rust-drip {
  position: relative;
  overflow: hidden;
}
.rust-drip::after {
  content: '';
  position: absolute;
  top: 0;
  right: 20%;
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--rust-orange), transparent);
  opacity: 0.3;
  animation: drip 5s ease-in infinite;
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .flicker,
  .rust-pulse,
  .lockdown-pulse,
  .steel-glow { animation: none; }
  .cell-bars::before { animation: none; display: none; }
  .rust-drip::after { animation: none; }
}
