/* Midnight Interrogation Room Theme - Intensely Eerie */
body {
  margin: 0;
  overflow: hidden;
  background-color: #050608;
  font-family: 'Courier New', monospace;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

/* Vignette overlay - deep, oppressive darkness at edges */
#vignette-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 30%,
    rgba(0, 0, 0, 0.3) 60%,
    rgba(0, 0, 0, 0.7) 85%,
    rgba(0, 0, 0, 0.9) 100%
  );
}

/* Scan lines overlay - subtle CRT/surveillance camera effect */
#scanlines-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  animation: scanlineFlicker 0.1s infinite;
}

@keyframes scanlineFlicker {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.55; }
}

/* Occasional screen distortion/glitch */
@keyframes screenGlitch {
  0%, 99.5% { 
    transform: none;
    filter: none;
  }
  99.6% { 
    transform: translate(-2px, 1px);
    filter: hue-rotate(90deg);
  }
  99.7% { 
    transform: translate(2px, -1px);
    filter: hue-rotate(-90deg);
  }
  99.8% { 
    transform: none;
    filter: none;
  }
}

#ui-container {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 10;
  width: 100%;
}

#status {
  color: rgba(200, 210, 220, 0.95);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: 0 0 15px rgba(80, 120, 160, 0.5), 0 2px 10px rgba(0, 0, 0, 0.8);
  background: linear-gradient(180deg, rgba(20, 25, 35, 0.9) 0%, rgba(10, 15, 20, 0.95) 100%);
  padding: 12px 35px;
  border-radius: 4px;
  backdrop-filter: blur(8px);
  display: inline-block;
  border: 1px solid rgba(80, 100, 120, 0.3);
  box-shadow: 
    0 0 20px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#game-controls {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 12px;
  pointer-events: auto;
}

.control-btn {
  background: linear-gradient(180deg, rgba(35, 40, 50, 0.9) 0%, rgba(20, 25, 30, 0.95) 100%);
  border: 1px solid rgba(100, 120, 140, 0.3);
  color: rgba(180, 190, 200, 0.9);
  padding: 10px 24px;
  border-radius: 3px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.control-btn:hover {
  background: linear-gradient(180deg, rgba(50, 60, 75, 0.95) 0%, rgba(30, 40, 50, 0.95) 100%);
  border-color: rgba(120, 140, 180, 0.5);
  color: rgba(220, 230, 240, 1);
  transform: translateY(-1px);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(80, 120, 180, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.control-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.mute-btn {
  font-size: 18px;
  padding: 8px 14px;
  min-width: 48px;
}

.control-select {
  background: linear-gradient(180deg, rgba(35, 40, 50, 0.9) 0%, rgba(20, 25, 30, 0.95) 100%);
  border: 1px solid rgba(100, 120, 140, 0.3);
  color: rgba(180, 190, 200, 0.9);
  padding: 10px 18px;
  border-radius: 3px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(5px);
  outline: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.control-select:hover {
  background: linear-gradient(180deg, rgba(50, 60, 75, 0.95) 0%, rgba(30, 40, 50, 0.95) 100%);
  border-color: rgba(120, 140, 180, 0.5);
}

.control-select option {
  background: #1a1e24;
  color: #c0c8d0;
  font-family: 'Courier New', monospace;
}

#controls-hint {
  position: absolute;
  bottom: 25px;
  width: 100%;
  text-align: center;
  color: rgba(120, 140, 160, 0.5);
  font-size: 11px;
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  text-transform: uppercase;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

#loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0a0c0f;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: rgba(150, 170, 190, 0.8);
  font-family: 'Courier New', monospace;
  font-size: 16px;
  letter-spacing: 3px;
  text-transform: uppercase;
  z-index: 999;
  transition: opacity 0.5s;
}

#loading::after {
  content: '';
  width: 40px;
  height: 2px;
  background: rgba(100, 130, 160, 0.6);
  margin-top: 20px;
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.3; width: 40px; }
  50% { opacity: 1; width: 80px; }
}

/* Flickering light effect for tension */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
  97% { opacity: 1; }
}

/* Blood drip effect on status when in check */
#status[style*="color: rgb(255, 255, 102)"]::before,
#status[style*="color:#ffff66"]::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 0;
  background: linear-gradient(180deg, #660000, #330000);
  animation: bloodDrip 2s ease-in forwards;
  border-radius: 0 0 2px 2px;
}

@keyframes bloodDrip {
  0% { height: 0; }
  100% { height: 30px; }
}

/* Pulsing red glow for checkmate */
#status[style*="color: rgb(255, 102, 102)"],
#status[style*="color:#ff6666"] {
  animation: checkmatePulse 1s ease-in-out infinite;
}

@keyframes checkmatePulse {
  0%, 100% { 
    text-shadow: 0 0 15px rgba(255, 50, 50, 0.5), 0 2px 10px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 30px rgba(255, 0, 0, 0.3);
  }
  50% { 
    text-shadow: 0 0 25px rgba(255, 50, 50, 0.8), 0 2px 10px rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 0 50px rgba(255, 0, 0, 0.5);
  }
}

/* Subtle shake effect for the whole screen on capture - applied via JS */
.screen-shake {
  animation: screenShake 0.15s ease-out;
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, 3px); }
  80% { transform: translate(2px, -1px); }
}
