/**
 * Haunted Lineage Lab — Tactical Field Sweep Mode Stylesheet
 * Optimized for One-Handed, Pitch-Black (AMOLED #000000 / Red #d41111) Field Sweeps
 */

:root {
    --tactical-bg: #030508;
    --tactical-card: #080d14;
    --tactical-border: rgba(255, 255, 255, 0.12);
    --tactical-red: #d41111;
    --tactical-red-glow: rgba(212, 17, 17, 0.35);
    --tactical-amber: #f59e0b;
    --tactical-blue: #60a5fa;
    --tactical-green: #10b981;
    --tactical-purple: #c084fc;
}

/* Fullscreen / Sticky Tactical Container */
#tactical-sweep-container {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: calc(100vh - 120px);
    max-width: 580px;
    margin: 0 auto 24px auto;
    background: var(--tactical-bg);
    border: 1px solid var(--tactical-border);
    border-radius: 12px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-sizing: border-box;
}

/* Border flashes on instantaneous actions */
#tactical-sweep-container.tactical-flash-snapshot {
    box-shadow: inset 0 0 0 3px var(--tactical-red), 0 0 24px var(--tactical-red-glow);
    transition: box-shadow 0.1s ease-out;
}

#tactical-sweep-container.tactical-flash-ptt {
    box-shadow: inset 0 0 0 3px #ef4444, 0 0 32px rgba(239, 68, 68, 0.6);
}

/* --- ZONE 1: TOP 20% PASSIVE TELEMETRY & FORENSIC STATUS --- */
.tactical-telemetry-zone {
    flex: 0 0 auto;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.7);
    border-bottom: 1px solid var(--tactical-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tactical-status-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-tech, monospace);
    font-size: 0.68rem;
    letter-spacing: 1px;
}

.tactical-badge-rec {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #ef4444;
    font-weight: 700;
}

.tactical-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: tactical-pulse 1.4s infinite alternate;
}

@keyframes tactical-pulse {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.tactical-grid-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.tactical-metric-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    padding: 6px 4px;
    text-align: center;
}

.tactical-metric-label {
    font-size: 0.58rem;
    color: var(--text-muted, #94a3b8);
    text-transform: uppercase;
    font-family: var(--font-tech, monospace);
    letter-spacing: 0.5px;
    display: block;
}

.tactical-metric-val {
    font-size: 0.85rem;
    font-weight: 700;
    color: #ffffff;
    font-family: var(--font-tech, monospace);
    margin-top: 2px;
    display: block;
}

/* Blind sensory lockout banner */
.tactical-blind-lockout-banner {
    display: none;
    background: rgba(212, 17, 17, 0.2);
    border: 1px dashed var(--tactical-red);
    color: #fca5a5;
    font-family: var(--font-tech, monospace);
    font-size: 0.65rem;
    padding: 6px;
    text-align: center;
    border-radius: 4px;
    letter-spacing: 1px;
}

#tactical-sweep-container[data-blind-lockout="true"] .tactical-blind-lockout-banner {
    display: block;
}

#tactical-sweep-container[data-blind-lockout="true"] .tactical-grid-metrics {
    opacity: 0.25;
    filter: blur(2px);
}

/* --- ZONE 2: MID-TOP 10% ROOM ANCHOR CAROUSEL --- */
.tactical-carousel-zone {
    flex: 0 0 auto;
    padding: 10px 12px;
    background: rgba(10, 14, 20, 0.95);
    border-bottom: 1px solid var(--tactical-border);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.tactical-carousel-zone::-webkit-scrollbar {
    display: none;
}

.tactical-room-chip {
    flex: 0 0 auto;
    min-height: 52px;
    min-width: 86px;
    padding: 0 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #e2e8f0;
    font-family: var(--font-tech, monospace);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.tactical-room-chip:active {
    transform: scale(0.96);
}

.tactical-room-chip.active {
    background: var(--tactical-red) !important;
    border-color: #f87171 !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 0 14px var(--tactical-red-glow);
}

.tactical-room-chip.add-chip {
    border-style: dashed;
    color: var(--accent-blue-light, #60a5fa);
    border-color: rgba(96, 165, 250, 0.4);
}

/* --- ZONE 3: CENTER 40% SENSOR VIEWPORT --- */
.tactical-viewport-zone {
    flex: 1 1 auto;
    min-height: 180px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, rgba(16, 24, 38, 0.6) 0%, rgba(2, 4, 8, 0.95) 100%);
}

.tactical-live-canvas {
    width: 100%;
    height: 140px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: block;
}

.tactical-viewport-overlay-text {
    position: absolute;
    bottom: 18px;
    left: 20px;
    font-family: var(--font-tech, monospace);
    font-size: 0.68rem;
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
}

/* --- ZONE 4: BOTTOM 30% TACTICAL THUMB CLUSTER --- */
.tactical-thumb-zone {
    flex: 0 0 auto;
    padding: 12px;
    background: #020408;
    border-top: 1px solid var(--tactical-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 2x3 Grid of 6 Phenomenological Pills */
.tactical-pill-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.tactical-pill-btn {
    min-height: 56px;
    padding: 6px 4px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-family: var(--font-tech, monospace);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    position: relative;
    transition: all 0.12s ease;
    text-align: center;
}

.tactical-pill-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.12);
}

.tactical-pill-btn .pill-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.tactical-pill-btn .pill-text {
    font-size: 0.62rem;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

/* Active / Stacked State */
.tactical-pill-btn.active {
    background: rgba(212, 17, 17, 0.35) !important;
    border-color: #ef4444 !important;
    color: #fee2e2 !important;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.4);
}

/* Tally Badge (e.g. x2, x3) */
.tactical-pill-badge {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    border: 1px solid #ffffff;
}

/* High Stress Alarm Pulse */
.tactical-pill-btn.high-stress-pulse {
    animation: tactical-alarm-pulse 0.6s infinite alternate;
    border-color: #ef4444 !important;
}

@keyframes tactical-alarm-pulse {
    0% { background: rgba(212, 17, 17, 0.2); transform: scale(1); }
    100% { background: rgba(212, 17, 17, 0.7); transform: scale(1.04); }
}

/* Giant Polymorphic Master Action Bar */
.tactical-master-bar {
    width: 100%;
    min-height: 64px;
    border-radius: 10px;
    background: #111827;
    border: 2px solid var(--tactical-red);
    color: #ffffff;
    font-family: var(--font-tech, monospace);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
    transition: all 0.15s ease;
}

.tactical-master-bar:active,
#tactical-sweep-container[data-master-state="ARMED"] .tactical-master-bar {
    background: #1f2937;
    border-color: #f87171;
    transform: scale(0.98);
}

#tactical-sweep-container[data-master-state="RECORDING_PTT"] .tactical-master-bar {
    background: #991b1b !important;
    border-color: #ef4444 !important;
    animation: tactical-ptt-pulse 1s infinite alternate;
}

@keyframes tactical-ptt-pulse {
    0% { box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    100% { box-shadow: 0 0 28px rgba(239, 68, 68, 0.9); }
}

/* High Stress Viewport Adaptation: lower cluster expands */
#tactical-sweep-container[data-high-stress="true"] .tactical-master-bar {
    min-height: 80px;
}

/* Zero-Modal Undo / Shake to Retract Progress Bar */
.tactical-undo-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(220, 38, 38, 0.18);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 6px;
    color: #fca5a5;
    font-family: var(--font-tech, monospace);
    font-size: 0.68rem;
    cursor: pointer;
}

.tactical-undo-bar:hover {
    background: rgba(220, 38, 38, 0.3);
}

.tactical-undo-btn-badge {
    background: #ef4444;
    color: #000000;
    font-weight: 800;
    font-size: 0.62rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

