/**
 * blacksite.css - CCTV Surveillance Aesthetic
 * Hexworth Prime - BLACKSITE TERMINAL
 *
 * Visual layer for the bomb defusal gamification.
 * Provides the CCTV camera feed look with scanlines,
 * VHS tracking, timestamps, and surveillance panels.
 */

/* ═══════════════════════════════════════════════════════════════
   CSS VARIABLES - Theme Colors
   ═══════════════════════════════════════════════════════════════ */

:root {
    --bs-bg: #0a0a0f;
    --bs-bg-panel: #0d1117;
    --bs-text: #e0e0e0;
    --bs-text-dim: #666;
    --bs-border: rgba(255, 255, 255, 0.1);
    --bs-success: #22c55e;
    --bs-warning: #f59e0b;
    --bs-danger: #ef4444;
}

/* Theme-specific colors */
.blacksite-frame[data-section="grep"] {
    --bs-primary: #4ade80;
    --bs-primary-dim: rgba(74, 222, 128, 0.3);
    --bs-glow: rgba(74, 222, 128, 0.5);
}

.blacksite-frame[data-section="regex"] {
    --bs-primary: #a78bfa;
    --bs-primary-dim: rgba(167, 139, 250, 0.3);
    --bs-glow: rgba(167, 139, 250, 0.5);
}

.blacksite-frame[data-section="pipes"] {
    --bs-primary: #60a5fa;
    --bs-primary-dim: rgba(96, 165, 250, 0.3);
    --bs-glow: rgba(96, 165, 250, 0.5);
}

.blacksite-frame[data-section="boss"] {
    --bs-primary: #ef4444;
    --bs-primary-dim: rgba(239, 68, 68, 0.3);
    --bs-glow: rgba(239, 68, 68, 0.5);
}


/* ═══════════════════════════════════════════════════════════════
   MAIN FRAME
   ═══════════════════════════════════════════════════════════════ */

.blacksite-frame {
    position: relative;
    background: var(--bs-bg);
    border: 2px solid var(--bs-primary-dim);
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    overflow: hidden;
    box-shadow: 0 0 30px var(--bs-glow);
}

.blacksite-frame.success {
    border-color: var(--bs-success);
    box-shadow: 0 0 50px rgba(34, 197, 94, 0.5);
}


/* ═══════════════════════════════════════════════════════════════
   SCANLINES OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.blacksite-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.15) 2px,
        rgba(0, 0, 0, 0.15) 4px
    );
    animation: scanline-move 10s linear infinite;
}

@keyframes scanline-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}


/* ═══════════════════════════════════════════════════════════════
   HEADER BAR
   ═══════════════════════════════════════════════════════════════ */

.blacksite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    border-bottom: 1px solid var(--bs-border);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.blacksite-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.blacksite-rec {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--bs-danger);
    font-weight: bold;
}

.blacksite-rec-dot {
    width: 8px;
    height: 8px;
    background: var(--bs-danger);
    border-radius: 50%;
    animation: rec-blink 1s ease-in-out infinite;
}

@keyframes rec-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.blacksite-cam-id {
    color: var(--bs-primary);
    font-weight: bold;
}

.blacksite-location {
    color: var(--bs-text-dim);
}

.blacksite-timestamp {
    color: var(--bs-text);
    font-family: 'Consolas', monospace;
}

.blacksite-signal {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bs-text-dim);
}

.blacksite-signal-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.blacksite-signal-bars span {
    width: 3px;
    background: var(--bs-primary);
    border-radius: 1px;
}

.blacksite-signal-bars span:nth-child(1) { height: 25%; }
.blacksite-signal-bars span:nth-child(2) { height: 50%; }
.blacksite-signal-bars span:nth-child(3) { height: 75%; }
.blacksite-signal-bars span:nth-child(4) { height: 100%; }


/* ═══════════════════════════════════════════════════════════════
   BODY - MAIN CONTENT GRID
   ═══════════════════════════════════════════════════════════════ */

.blacksite-body {
    display: grid;
    grid-template-columns: 1fr 380px;
    min-height: 500px;
}

@media (max-width: 1100px) {
    .blacksite-body {
        grid-template-columns: 1fr 320px;
    }
}

@media (max-width: 900px) {
    .blacksite-body {
        grid-template-columns: 1fr;
    }

    .blacksite-cctv-mount {
        max-height: 350px;
    }
}


/* ═══════════════════════════════════════════════════════════════
   TERMINAL PANEL
   ═══════════════════════════════════════════════════════════════ */

.blacksite-terminal-panel {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--bs-border);
}

.blacksite-terminal-chrome {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    border-bottom: 1px solid var(--bs-border);
}

.blacksite-terminal-dots {
    display: flex;
    gap: 6px;
    margin-right: 12px;
}

.blacksite-terminal-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.blacksite-terminal-dots .dot.red { background: #ef4444; }
.blacksite-terminal-dots .dot.yellow { background: #f59e0b; }
.blacksite-terminal-dots .dot.green { background: #22c55e; }

.blacksite-terminal-title {
    flex: 1;
    color: var(--bs-text-dim);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
}

.blacksite-terminal-controls {
    display: flex;
    gap: 8px;
}

.blacksite-btn {
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bs-border);
    border-radius: 4px;
    color: var(--bs-text-dim);
    font-size: 0.7rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.blacksite-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--bs-text);
}

.blacksite-terminal-container {
    display: flex;
    flex-direction: column;
    background: var(--bs-bg-panel);
}

.blacksite-terminal-output {
    padding: 15px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--bs-text);
    min-height: 300px;
    max-height: 400px;
}

/* CLHTerminal styling within blacksite */
.blacksite-terminal-output .terminal-line {
    margin: 2px 0;
}

.blacksite-terminal-output .clh-success {
    color: var(--bs-success);
}

.blacksite-terminal-output .clh-error {
    color: var(--bs-danger);
}

.blacksite-terminal-input-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid var(--bs-border);
}

.blacksite-prompt {
    color: var(--bs-primary);
    margin-right: 8px;
    white-space: nowrap;
}

.blacksite-terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--bs-text);
    font-family: inherit;
    font-size: 0.9rem;
    caret-color: var(--bs-primary);
}

.blacksite-terminal-input:focus {
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.5);
}


/* ═══════════════════════════════════════════════════════════════
   RADIO PANEL (Below Terminal)
   ═══════════════════════════════════════════════════════════════ */

.blacksite-radio-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bs-bg-panel);
    border-top: 1px solid var(--bs-border);
}

.blacksite-radio-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid var(--bs-border);
}

.blacksite-radio-icon {
    font-size: 1.1rem;
    animation: radio-pulse 2s ease-in-out infinite;
}

@keyframes radio-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.blacksite-radio-title {
    font-size: 0.75rem;
    color: var(--bs-primary);
    letter-spacing: 0.1em;
    font-weight: bold;
}

.blacksite-radio-status {
    margin-left: auto;
    font-size: 0.7rem;
    color: #22c55e;
    animation: status-blink 1s ease-in-out infinite;
}

@keyframes status-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.blacksite-radio-log {
    flex: 1;
    overflow-y: auto;
    padding: 10px 15px;
    font-size: 0.8rem;
    line-height: 1.6;
    min-height: 80px;
}

.blacksite-radio-msg {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #9ca3af;
    animation: radio-msg-in 0.3s ease;
}

@keyframes radio-msg-in {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.blacksite-radio-msg.urgent {
    color: #ef4444;
    font-weight: 500;
}

.blacksite-radio-msg.urgent.flash {
    animation: radio-msg-in 0.3s ease, urgent-flash 0.5s ease-in-out 3;
}

@keyframes urgent-flash {
    0%, 100% { background: transparent; }
    50% { background: rgba(239, 68, 68, 0.1); }
}

.blacksite-radio-msg.success {
    color: #22c55e;
}

.blacksite-radio-time {
    color: #555;
    margin-right: 10px;
    font-size: 0.7rem;
    font-family: 'Consolas', monospace;
}

/* Radio log scrollbar */
.blacksite-radio-log::-webkit-scrollbar {
    width: 4px;
}

.blacksite-radio-log::-webkit-scrollbar-track {
    background: transparent;
}

.blacksite-radio-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.blacksite-radio-log::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}


/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════ */

.blacksite-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--bs-border);
}

.blacksite-panel {
    background: var(--bs-bg-panel);
    padding: 12px;
}

.blacksite-panel-header {
    font-size: 0.7rem;
    color: var(--bs-primary);
    letter-spacing: 0.15em;
    margin-bottom: 10px;
    font-weight: bold;
}


/* Timer */
.blacksite-timer {
    text-align: center;
}

.blacksite-timer-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--bs-text);
    font-family: 'Consolas', monospace;
    text-shadow: 0 0 10px var(--bs-glow);
}

.blacksite-timer-display.warning {
    color: var(--bs-warning);
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.5);
}

.blacksite-timer-display.critical {
    color: var(--bs-danger);
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.7);
    animation: timer-pulse 0.5s ease-in-out infinite;
}

@keyframes timer-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.blacksite-timer-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 10px;
}

.blacksite-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--bs-primary), var(--bs-glow));
    border-radius: 3px;
    transition: width 0.1s linear;
}

.blacksite-timer-bar.warning {
    background: linear-gradient(90deg, var(--bs-warning), rgba(245, 158, 11, 0.5));
}

.blacksite-timer-bar.critical {
    background: linear-gradient(90deg, var(--bs-danger), rgba(239, 68, 68, 0.5));
}


/* Device Feed */
.blacksite-device-feed {
    text-align: center;
    padding: 15px 0;
}

.blacksite-bomb-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px var(--bs-danger));
}

.blacksite-fuse-container {
    height: 30px;
    position: relative;
}

.blacksite-threat-label {
    font-size: 0.65rem;
    color: var(--bs-danger);
    letter-spacing: 0.1em;
    margin-top: 10px;
    animation: threat-blink 2s ease-in-out infinite;
}

@keyframes threat-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* CCTV Panel Mount */
.blacksite-cctv-panel {
    padding: 0;
    overflow: hidden;
}

.blacksite-cctv-panel .blacksite-panel-header {
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    margin-bottom: 0;
}

.blacksite-cctv-mount {
    max-height: 450px;
    overflow: hidden;
}

.blacksite-cctv-mount .cctv-system {
    border-radius: 0;
}

.blacksite-cctv-mount .cctv-main-feed {
    min-height: 200px;
}

.blacksite-cctv-mount .cctv-scene-display {
    font-size: 0.5rem;
}

.blacksite-cctv-mount .cctv-controls {
    padding: 6px 10px;
    gap: 8px;
}

.blacksite-cctv-mount .cctv-camera-grid {
    gap: 3px;
}

.blacksite-cctv-mount .cctv-cam-btn {
    padding: 4px 6px;
}

.blacksite-cctv-mount .cctv-cam-num {
    font-size: 0.75rem;
}

.blacksite-cctv-mount .cctv-cam-label {
    font-size: 0.4rem;
}

.blacksite-cctv-mount .cctv-view-modes,
.blacksite-cctv-mount .cctv-extra-controls {
    padding-left: 6px;
}

.blacksite-cctv-mount .cctv-mode-btn {
    width: 26px;
    height: 26px;
    font-size: 0.75rem;
}

.blacksite-cctv-mount .cctv-ctrl-btn {
    padding: 3px 6px;
    font-size: 0.55rem;
}

.blacksite-cctv-mount .cctv-ptz {
    display: none;
}

.blacksite-cctv-mount .cctv-radio {
    max-height: 60px;
}

.blacksite-cctv-mount .cctv-radio-log {
    max-height: 40px;
}

.blacksite-cctv-mount .cctv-pip {
    width: 100px;
    bottom: 30px;
    right: 5px;
}

.blacksite-cctv-mount .cctv-pip-scene {
    font-size: 0.25rem;
    max-height: 50px;
}

/* Fuse Elements (created by BlacksiteParticles.js) */
.blacksite-fuse-container .blacksite-fuse-track {
    height: 4px;
    background: #333;
    border-radius: 2px;
    position: relative;
    margin: 0 10px;
}

.blacksite-fuse-container .blacksite-fuse-burned {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #333, #666);
    transition: width 0.1s linear;
}

.blacksite-fuse-container .blacksite-fuse-remaining {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 8px var(--bs-warning);
    transition: width 0.1s linear;
}

.blacksite-fuse-container .blacksite-fuse-ember {
    position: absolute;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fff 0%, #f59e0b 40%, #ef4444 70%, transparent 100%);
    border-radius: 50%;
    top: -3px;
    box-shadow: 0 0 10px #f59e0b, 0 0 20px #ef4444;
    animation: ember-glow 0.3s ease-in-out infinite alternate;
}

@keyframes ember-glow {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.3); filter: brightness(1.3); }
}


/* Objectives */
.blacksite-objectives-panel {
    flex: 1;
}

.blacksite-objectives-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
}

.blacksite-objective {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--bs-text-dim);
    transition: all 0.3s;
}

.blacksite-objective.complete {
    background: rgba(34, 197, 94, 0.1);
    color: var(--bs-success);
}

.blacksite-objective-num {
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: bold;
}

.blacksite-objective.complete .blacksite-objective-num {
    background: var(--bs-success);
    color: #000;
}

.blacksite-objective-text {
    flex: 1;
    line-height: 1.3;
}

.blacksite-objectives-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--bs-border);
}

.blacksite-progress-bar-container {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.blacksite-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--bs-success);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.blacksite-progress-text {
    font-size: 0.7rem;
    color: var(--bs-text-dim);
}


/* Audio Panel */
.blacksite-audio-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 0.7rem;
    color: var(--bs-text-dim);
}

.blacksite-audio-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 16px;
}

.blacksite-audio-bars span {
    width: 3px;
    background: var(--bs-primary);
    border-radius: 1px;
    animation: audio-bar 0.8s ease-in-out infinite;
}

.blacksite-audio-bars span:nth-child(1) { height: 30%; animation-delay: 0.0s; }
.blacksite-audio-bars span:nth-child(2) { height: 60%; animation-delay: 0.1s; }
.blacksite-audio-bars span:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.blacksite-audio-bars span:nth-child(4) { height: 40%; animation-delay: 0.3s; }
.blacksite-audio-bars span:nth-child(5) { height: 70%; animation-delay: 0.4s; }

@keyframes audio-bar {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.5); }
}

.blacksite-audio-toggle {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.blacksite-audio-toggle:hover {
    opacity: 1;
}


/* ═══════════════════════════════════════════════════════════════
   FOOTER BAR
   ═══════════════════════════════════════════════════════════════ */

.blacksite-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 15px;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 100%);
    border-top: 1px solid var(--bs-border);
    font-size: 0.7rem;
}

.blacksite-footer-controls {
    display: flex;
    gap: 15px;
    color: var(--bs-text-dim);
}

.blacksite-footer-status {
    color: var(--bs-primary);
    font-weight: bold;
    letter-spacing: 0.1em;
}


/* ═══════════════════════════════════════════════════════════════
   WIRE CUTTING MODAL
   ═══════════════════════════════════════════════════════════════ */

.blacksite-wire-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s;
}

.blacksite-wire-modal.active {
    opacity: 1;
}

.blacksite-wire-content {
    background: #1a1a2e;
    border: 2px solid var(--bs-warning);
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 0 50px rgba(245, 158, 11, 0.3);
}

.blacksite-wire-title {
    font-size: 1.5rem;
    color: var(--bs-warning);
    margin-bottom: 20px;
    animation: wire-title-pulse 1s ease-in-out infinite;
}

@keyframes wire-title-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.blacksite-wire-question {
    color: #e0e0e0;
    margin-bottom: 25px;
    line-height: 1.6;
}

.blacksite-wire-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blacksite-wire-option {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #e0e0e0;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.blacksite-wire-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--bs-primary);
}

.blacksite-wire-option.correct {
    background: rgba(34, 197, 94, 0.2);
    border-color: var(--bs-success);
    color: var(--bs-success);
}

.blacksite-wire-option.incorrect {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--bs-danger);
    color: var(--bs-danger);
}


/* ═══════════════════════════════════════════════════════════════
   EXPLOSION OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.blacksite-explosion-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.blacksite-explosion-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.blacksite-explosion-flash {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    opacity: 0;
}

.blacksite-explosion-flash.active {
    animation: explosion-flash 0.3s ease-out;
}

@keyframes explosion-flash {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.blacksite-explosion-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.blacksite-explosion-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s;
}

.blacksite-explosion-message.visible {
    opacity: 1;
}

.blacksite-explosion-title {
    font-size: 3rem;
    font-weight: bold;
    color: var(--bs-danger);
    text-shadow: 0 0 30px var(--bs-danger);
    margin-bottom: 20px;
}

.blacksite-explosion-stats {
    color: #888;
    margin-bottom: 30px;
}

.blacksite-retry-btn {
    padding: 15px 40px;
    background: var(--bs-danger);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s;
}

.blacksite-retry-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}


/* ═══════════════════════════════════════════════════════════════
   SCREEN SHAKE
   ═══════════════════════════════════════════════════════════════ */

body.shake {
    animation: screen-shake 0.5s ease-out;
}

@keyframes screen-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}


/* ═══════════════════════════════════════════════════════════════
   CCTV SURVEILLANCE SYSTEM
   Advanced multi-camera feed with effects
   ═══════════════════════════════════════════════════════════════ */

.cctv-system {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    font-family: 'Consolas', 'Monaco', monospace;
}

/* Main Feed Area */
.cctv-main-feed {
    position: relative;
    background: #0a0a0f;
    min-height: 280px;
    overflow: hidden;
}

/* View Mode Filters */
.cctv-main-feed.nightvision {
    filter: sepia(100%) saturate(300%) brightness(70%) hue-rotate(70deg);
}

.cctv-main-feed.nightvision .cctv-scene-display {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.cctv-main-feed.thermal {
    filter: saturate(150%);
}

.cctv-main-feed.thermal .cctv-scene-display {
    background: linear-gradient(180deg,
        rgba(255, 100, 0, 0.1) 0%,
        rgba(255, 200, 0, 0.05) 50%,
        rgba(0, 100, 255, 0.1) 100%);
    color: #ff6600;
}

/* Overlay Effects Container */
.cctv-overlay-effects {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 50;
}

/* CCTV Scanlines */
.cctv-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 1px,
        rgba(0, 0, 0, 0.2) 1px,
        rgba(0, 0, 0, 0.2) 2px
    );
    animation: cctv-scan-drift 8s linear infinite;
}

@keyframes cctv-scan-drift {
    0% { transform: translateY(0); }
    100% { transform: translateY(2px); }
}

/* Vignette Effect */
.cctv-vignette {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at center,
        transparent 50%,
        rgba(0, 0, 0, 0.5) 100%
    );
}

/* Glitch Overlay */
.cctv-glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    background: repeating-linear-gradient(
        90deg,
        rgba(255, 0, 0, 0.1) 0px,
        transparent 1px,
        rgba(0, 255, 255, 0.1) 2px,
        transparent 3px
    );
    mix-blend-mode: screen;
}

.cctv-glitch-overlay.active {
    opacity: 1;
    animation: cctv-glitch 0.2s steps(3) infinite;
}

@keyframes cctv-glitch {
    0% { transform: translateX(-5px) skewX(-5deg); }
    33% { transform: translateX(5px) skewX(5deg); }
    66% { transform: translateX(-3px) skewX(-2deg); }
    100% { transform: translateX(3px) skewX(2deg); }
}

/* Static Overlay */
.cctv-static-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 100px 100px;
    mix-blend-mode: overlay;
    transition: opacity 0.1s;
}

.cctv-static-overlay.active {
    opacity: 0.8;
    animation: cctv-static-flicker 0.1s steps(2) infinite;
}

@keyframes cctv-static-flicker {
    0%, 100% { background-position: 0 0; }
    50% { background-position: 50px 50px; }
}

/* Feed Header */
.cctv-feed-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 60;
    font-size: 0.7rem;
}

.cctv-rec-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ef4444;
    font-weight: bold;
}

.cctv-rec-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    animation: cctv-rec-blink 1s ease-in-out infinite;
    box-shadow: 0 0 8px #ef4444;
}

@keyframes cctv-rec-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.cctv-cam-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cctv-cam-id {
    color: var(--bs-primary, #4ade80);
    font-weight: bold;
    padding: 2px 8px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    border-radius: 3px;
}

.cctv-cam-name {
    color: #fff;
    letter-spacing: 0.05em;
}

.cctv-timestamp {
    color: #aaa;
    font-family: 'Consolas', monospace;
}

/* Scene Display */
.cctv-scene-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 30px;
    min-height: 200px;
}

.cctv-scene-display {
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.65rem;
    line-height: 1.2;
    color: #4ade80;
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.3);
    white-space: pre;
    margin: 0;
    transition: transform 0.2s ease;
}

.cctv-scene-display.zoomed {
    transform: scale(1.3);
}

/* PTZ Movement Effects */
.cctv-scene-display.ptz-up { transform: translateY(5px); }
.cctv-scene-display.ptz-down { transform: translateY(-5px); }
.cctv-scene-display.ptz-left { transform: translateX(5px); }
.cctv-scene-display.ptz-right { transform: translateX(-5px); }

/* Feed Footer */
.cctv-feed-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 60;
    font-size: 0.65rem;
}

.cctv-location {
    color: #888;
    letter-spacing: 0.1em;
}

.cctv-signal {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #4ade80;
}

.cctv-signal-icon {
    font-size: 0.8rem;
}

/* Motion Alert */
.cctv-motion-alert {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 8px 20px;
    background: rgba(239, 68, 68, 0.9);
    border: 2px solid #ef4444;
    border-radius: 4px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 0.1em;
    z-index: 70;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
}

.cctv-motion-alert.active {
    opacity: 1;
    animation: cctv-alert-pulse 0.5s ease-in-out infinite;
}

@keyframes cctv-alert-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
}

/* Picture-in-Picture */
.cctv-pip {
    position: absolute;
    bottom: 40px;
    right: 10px;
    width: 180px;
    background: #000;
    border: 2px solid var(--bs-primary, #4ade80);
    border-radius: 4px;
    overflow: hidden;
    z-index: 65;
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.cctv-pip.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.cctv-pip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    font-size: 0.6rem;
}

.cctv-pip-cam {
    color: var(--bs-primary, #4ade80);
    font-weight: bold;
}

.cctv-pip-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

.cctv-pip-close:hover {
    color: #fff;
}

.cctv-pip-scene {
    font-size: 0.35rem;
    line-height: 1.1;
    color: #4ade80;
    padding: 5px;
    margin: 0;
    white-space: pre;
    overflow: hidden;
    max-height: 100px;
}

/* Control Bar */
.cctv-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 15px;
    background: #0d1117;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    flex-wrap: wrap;
}

/* Camera Grid */
.cctv-camera-grid {
    display: flex;
    gap: 5px;
}

.cctv-cam-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.cctv-cam-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.cctv-cam-btn.active {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--bs-primary, #4ade80);
}

.cctv-cam-num {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--bs-primary, #4ade80);
}

.cctv-cam-label {
    font-size: 0.5rem;
    color: #666;
    letter-spacing: 0.05em;
    margin-top: 2px;
}

.cctv-cam-btn.active .cctv-cam-label {
    color: #aaa;
}

/* View Modes */
.cctv-view-modes {
    display: flex;
    gap: 5px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.cctv-mode-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.cctv-mode-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.cctv-mode-btn.active {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--bs-primary, #4ade80);
}

/* Extra Controls */
.cctv-extra-controls {
    display: flex;
    gap: 5px;
    padding-left: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.cctv-ctrl-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: #888;
    font-size: 0.65rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.cctv-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
}

.cctv-ctrl-btn.active {
    background: rgba(74, 222, 128, 0.1);
    border-color: var(--bs-primary, #4ade80);
    color: var(--bs-primary, #4ade80);
}

/* PTZ Controls */
.cctv-ptz {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    margin-left: auto;
}

.cctv-ptz-grid {
    display: grid;
    grid-template-columns: repeat(3, 24px);
    grid-template-rows: repeat(3, 20px);
    gap: 2px;
}

.cctv-ptz-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    color: #666;
    font-size: 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cctv-ptz-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.cctv-ptz-btn:active {
    background: var(--bs-primary, #4ade80);
    color: #000;
}

.cctv-ptz-btn[data-dir="up"] { grid-column: 2; grid-row: 1; }
.cctv-ptz-btn[data-dir="left"] { grid-column: 1; grid-row: 2; }
.cctv-ptz-btn[data-dir="center"] { grid-column: 2; grid-row: 2; }
.cctv-ptz-btn[data-dir="right"] { grid-column: 3; grid-row: 2; }
.cctv-ptz-btn[data-dir="down"] { grid-column: 2; grid-row: 3; }

.cctv-ptz-center {
    background: rgba(74, 222, 128, 0.2);
    color: var(--bs-primary, #4ade80);
}

.cctv-ptz-label {
    font-size: 0.5rem;
    color: #555;
    letter-spacing: 0.1em;
}

/* Radio Chatter */
.cctv-radio {
    background: #0a0a0f;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cctv-radio-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.5);
    font-size: 0.65rem;
    color: #888;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.cctv-radio-icon {
    font-size: 0.9rem;
}

.cctv-radio-freq {
    margin-left: auto;
    color: var(--bs-primary, #4ade80);
    font-size: 0.6rem;
}

.cctv-radio-log {
    max-height: 80px;
    overflow-y: auto;
    padding: 8px 12px;
}

.cctv-radio-msg {
    font-size: 0.7rem;
    color: #888;
    padding: 3px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    animation: cctv-radio-fade-in 0.3s ease;
}

@keyframes cctv-radio-fade-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.cctv-radio-msg.urgent {
    color: #ef4444;
}

.cctv-radio-msg.success {
    color: #4ade80;
}

.cctv-radio-time {
    color: #555;
    margin-right: 8px;
    font-size: 0.6rem;
}

/* Scrollbar for radio log */
.cctv-radio-log::-webkit-scrollbar {
    width: 4px;
}

.cctv-radio-log::-webkit-scrollbar-track {
    background: transparent;
}

.cctv-radio-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Hidden state for CCTV internal radio when using external */
.cctv-radio.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .cctv-controls {
        justify-content: center;
    }

    .cctv-ptz {
        display: none;
    }

    .cctv-scene-display {
        font-size: 0.5rem;
    }

    .cctv-pip {
        width: 120px;
    }

    .cctv-pip-scene {
        font-size: 0.25rem;
    }
}

/* ═══════════════════════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
    .blacksite-scanlines,
    .blacksite-rec-dot,
    .blacksite-btn,
    .blacksite-radio-icon,
    .blacksite-radio-status,
    .blacksite-radio-msg,
    .blacksite-radio-msg.urgent.flash,
    .blacksite-objective,
    .blacksite-progress-bar,
    .blacksite-timer-bar,
    .blacksite-timer-display.critical,
    .blacksite-fuse-container .blacksite-fuse-burned,
    .blacksite-fuse-container .blacksite-fuse-remaining,
    .blacksite-fuse-container .blacksite-fuse-ember,
    .blacksite-threat-label,
    .blacksite-audio-bars span,
    .blacksite-audio-toggle,
    .blacksite-wire-modal,
    .blacksite-wire-option,
    .blacksite-wire-title,
    .blacksite-explosion-overlay,
    .blacksite-explosion-flash.active,
    .blacksite-explosion-message,
    .blacksite-retry-btn,
    body.shake,
    .cctv-scanlines,
    .cctv-glitch-overlay.active,
    .cctv-static-overlay,
    .cctv-static-overlay.active,
    .cctv-rec-dot,
    .cctv-scene-display,
    .cctv-motion-alert.active,
    .cctv-pip,
    .cctv-cam-btn,
    .cctv-mode-btn,
    .cctv-ctrl-btn,
    .cctv-ptz-btn,
    .cctv-radio-msg {
        animation: none !important;
        transition: none !important;
    }
}
