/* ============================================================
   tactical.css — "CRT Military Outpost" theme.
   Palette: phosphor green #33FF00 / dark olive #0A0F0A
   Full-screen CRT effects: scanlines, curvature, vignette, glow.
   ============================================================ */

.tactical-panel {
  --theme-primary: #33ff00;
  --theme-bg: #0a0f0a;
  background: #050805;
  color: #b6ffb6;
}

.tactical-panel .panel-return { border-color: rgba(51,255,0,0.5); color: #33ff00; font-family: 'JetBrains Mono', monospace; }
.tactical-panel .panel-return:hover { background: rgba(51,255,0,0.12); box-shadow: 0 0 16px rgba(51,255,0,0.3); }
.tactical-panel .eyebrow { color: #33ff00; }
.tactical-panel h1 { color: #e6ffe6; text-shadow: 0 0 8px #33ff00, 0 0 24px rgba(51,255,0,0.6); letter-spacing: 0.04em; }
.tactical-panel h2 { color: #9ee68a; border-bottom: 1px dashed rgba(51,255,0,0.3); padding-bottom: 8px; text-shadow: 0 0 6px rgba(51,255,0,0.3); }
.tactical-panel h3 { color: #33ff00; }
.tactical-panel p { color: #8acc80; }
.tactical-panel strong { color: #e6ffe6; }
.tactical-panel code { background: rgba(51,255,0,0.12); color: #b6ffb6; }
.tactical-panel .muted { color: #5a8a55; font-size: 12px; letter-spacing: 0.04em; }

/* CRT wrapper — curvature + scanlines + vignette */
.crt-screen {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #0a140a 0%, #050805 80%);
  padding: 8px;
}
.crt-content { position: relative; z-index: 2; }

.crt-scanlines {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,0) 0px,
    rgba(0,0,0,0) 2px,
    rgba(0,0,0,0.35) 3px,
    rgba(0,0,0,0.35) 4px
  );
  mix-blend-mode: multiply;
}
.crt-vignette {
  position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.75) 100%);
}
/* subtle phosphor flicker on the whole panel */
.tactical-panel .crt-screen::after {
  content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  background: rgba(51,255,0,0.02);
  animation: crt-flicker 5s infinite;
}
@keyframes crt-flicker {
  0%, 100% { opacity: 0.9; }
  3% { opacity: 0.6; }
  6% { opacity: 0.95; }
  47% { opacity: 0.85; }
  48% { opacity: 0.55; }
  49% { opacity: 0.9; }
}

/* signal-acquisition title flicker */
.tac-hero { padding: 20px 0; }
#tac-title { font-size: clamp(26px, 5vw, 56px); font-weight: 800; word-break: break-all; }
#tac-title.flicker { opacity: 0.55; }
.tac-subtitle { color: #6fdc6f; letter-spacing: 0.08em; text-transform: uppercase; font-size: 12px; margin-top: 8px; }

/* IFF mech roster */
.mech-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; max-width: 760px; }
.mech-card {
  position: relative; padding: 18px 14px; text-align: center;
  border: 1px solid rgba(51,255,0,0.3); border-radius: 4px;
  background: rgba(51,255,0,0.03);
  transition: all 200ms;
}
.mech-card:hover, .mech-card:focus { outline: none; border-color: #33ff00; background: rgba(51,255,0,0.08); box-shadow: 0 0 24px rgba(51,255,0,0.4); }
.iff { width: 56px; height: 56px; margin: 0 auto 10px; color: #5a8a55; transition: color 200ms, filter 200ms; }
.iff svg { width: 100%; height: 100%; }
.mech-card:hover .iff { color: #33ff00; filter: drop-shadow(0 0 8px #33ff00); }
.mech-id { font-size: 10px; color: #5a8a55; letter-spacing: 0.1em; margin-bottom: 10px; }
.mech-name { font-size: 12px; font-weight: 700; color: #9ee68a; margin-top: 10px; opacity: 0; transform: translateY(4px); transition: all 200ms; }
.mech-card:hover .mech-name { opacity: 1; transform: none; }
.mech-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px;
  font-size: 10px; opacity: 0; max-height: 0; overflow: hidden;
  transition: all 250ms;
}
.mech-card:hover .mech-stats, .mech-card:focus .mech-stats { opacity: 1; max-height: 160px; }
.mech-stat { display: flex; justify-content: space-between; gap: 4px; }
.ms-key { color: #5a8a55; }
.ms-val { color: #b6ffb6; font-weight: 700; }

/* campaign map */
.sector-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; max-width: 820px; }
.sector { padding: 14px; border: 1px solid rgba(51,255,0,0.25); border-radius: 4px; background: rgba(51,255,0,0.02); }
.sector-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 10px; }
.sector-name { color: #33ff00; font-weight: 700; letter-spacing: 0.08em; }
.sector-range { color: #5a8a55; }
.sector-floors { display: flex; flex-direction: column; gap: 3px; }
.floor { font-size: 9px; padding: 2px 6px; border-left: 2px solid; line-height: 1.3; }
.fl-done { color: #b6ffb6; border-color: #33ff00; background: rgba(51,255,0,0.08); }
.fl-active { color: #6fdc6f; border-color: rgba(51,255,0,0.6); background: rgba(51,255,0,0.04); animation: floor-pulse 1.4s infinite; }
.fl-pending { color: #5a8a55; border-color: rgba(90,138,85,0.4); }
.fl-locked { color: #3a5a35; border-color: rgba(90,138,85,0.2); }
@keyframes floor-pulse { 50% { opacity: 0.5; } }
.sector-status { margin-top: 10px; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; text-align: right; }
.status-cleared { color: #33ff00; }
.status-contested { color: #f5a623; }
.status-hostile { color: #ff4d4d; }
.status-locked { color: #5a8a55; }

/* typing directory tree */
.dir-tree {
  font-size: 12px; line-height: 1.5; color: #b6ffb6;
  background: rgba(0,0,0,0.5); border: 1px solid rgba(51,255,0,0.25);
  border-radius: 4px; padding: 16px 18px; max-width: 560px;
  white-space: pre; overflow-x: auto;
  text-shadow: 0 0 4px rgba(51,255,0,0.4);
}
.dir-tree::after { content: '█'; color: #33ff00; animation: caret 0.8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }

.tactical-cta:hover { box-shadow: 0 0 20px rgba(51,255,0,0.5); }

/* reduce CRT cost: lower flicker frequency when reduced motion */
@media (prefers-reduced-motion: reduce) {
  .tactical-panel .crt-screen::after { animation: none; }
  .fl-active { animation: none; }
}
