/* ============================================================
   Home · 战术指挥终端（矩阵雨 / 雷达 / FFT）
   ============================================================ */

#homeScreen {
  position: fixed;
  inset: 0;
  background: #00050a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'Consolas', 'Courier New', monospace;
}

#homeScreen.hidden { display: none; }

/* 1. 数字字母矩阵雨画布 */
#homeStarsCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* 2. 边缘阴影与扫描线 */
.home-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, transparent 40%, rgba(0, 5, 15, 0.95) 100%);
  pointer-events: none;
  z-index: 2;
}

.home-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0, 162, 255, 0.05) 3px);
  pointer-events: none;
  z-index: 3;
}

/* 警报边缘 */
#homeScreen::after {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 50px rgba(0, 162, 255, 0.2);
  border: 2px solid rgba(0, 162, 255, 0.3);
  pointer-events: none;
  z-index: 10;
  animation: borderAlert 2.5s infinite;
}

@keyframes borderAlert {
  0%, 100% { border-color: rgba(0, 162, 255, 0.2); box-shadow: inset 0 0 30px rgba(0, 162, 255, 0.1); }
  50% { border-color: rgba(0, 229, 255, 0.8); box-shadow: inset 0 0 80px rgba(0, 229, 255, 0.3); }
}

/* ---------- 顶部标题 ---------- */
.home-header {
  position: absolute;
  top: 30px;
  text-align: center;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-logo-mark {
  font-size: 1rem;
  color: #00e5ff;
  letter-spacing: 5px;
  margin-bottom: 10px;
  text-shadow: 0 0 10px #00e5ff;
}

.home-title {
  font-size: 2.8rem;
  font-family: 'Impact', 'Arial Black', sans-serif;
  font-weight: 900;
  letter-spacing: 0.15em;
  color: #ffffff;
  text-shadow: 0 0 15px rgba(0, 162, 255, 0.8), 0 0 30px rgba(0, 162, 255, 0.5);
  line-height: 1.1;
}

.home-title span { color: #00a2ff; }

.home-subtitle {
  font-size: 0.8rem;
  letter-spacing: 0.6em;
  color: #4daaff;
  margin-top: 10px;
  text-shadow: 0 0 5px #4daaff;
}

/* ---------- 四角 HUD 面板 ---------- */
.hud-panel {
  position: absolute;
  z-index: 15;
  background: rgba(0, 10, 20, 0.6);
  border: 1px solid rgba(0, 162, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 162, 255, 0.1), inset 0 0 15px rgba(0, 162, 255, 0.05);
  padding: 10px;
  border-radius: 4px;
}

.hud-panel::before, .hud-panel::after {
  content: ''; position: absolute; width: 10px; height: 10px; border: 2px solid #00e5ff;
}
.hud-panel::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.hud-panel::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }

.hud-title {
  font-size: 0.65rem;
  color: #00e5ff;
  letter-spacing: 1px;
  margin-bottom: 8px;
  text-shadow: 0 0 5px #00e5ff;
}

/* 左上角：日志 */
.hud-top-left {
  top: 30px;
  left: 30px;
  width: 260px;
  height: 160px;
  display: flex;
  flex-direction: column;
}

.log-scroll {
  flex: 1;
  overflow: hidden;
  font-size: 0.65rem;
  color: #4daaff;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* 让日志从下往上顶 */
}

.log-scroll div {
  opacity: 0;
  animation: logFadeIn 0.5s forwards;
}

@keyframes logFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 左下角：FFT 频谱 */
.hud-bottom-left {
  bottom: 30px;
  left: 30px;
  width: 260px;
}

#fftCanvas {
  display: block;
  width: 100%;
  height: 100px;
  filter: drop-shadow(0 0 5px #00e5ff);
}

/* 右下角：军用雷达 */
.hud-bottom-right {
  bottom: 30px;
  right: 30px;
  width: 200px;
  height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.radar-display {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 136, 0.6);
  background: radial-gradient(circle, rgba(0, 255, 136, 0.1) 0%, transparent 70%);
  box-shadow: 0 0 15px rgba(0, 255, 136, 0.3), inset 0 0 15px rgba(0, 255, 136, 0.2);
  overflow: hidden;
}

/* 扫描线（旋转） */
.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(0, 255, 136, 0.8) 0deg, transparent 90deg);
  animation: radarSpin 3s linear infinite;
}

@keyframes radarSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 十字准星与同心圆 */
.radar-cross-h { position: absolute; top: 50%; left: 0; width: 100%; height: 1px; background: rgba(0, 255, 136, 0.4); }
.radar-cross-v { position: absolute; top: 0; left: 50%; width: 1px; height: 100%; background: rgba(0, 255, 136, 0.4); }

.radar-ring { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid rgba(0, 255, 136, 0.3); }
.ring-1 { width: 33%; height: 33%; }
.ring-2 { width: 66%; height: 66%; }
.ring-3 { width: 100%; height: 100%; border: none; }

/* 雷达光点 */
.radar-blip { position: absolute; width: 4px; height: 4px; background: #ffffff; border-radius: 50%; box-shadow: 0 0 8px #ffffff; }
.blip-1 { top: 20%; left: 30%; animation: blipFlash 1s infinite alternate; }
.blip-2 { top: 60%; left: 70%; animation: blipFlash 1.5s infinite alternate; }
.blip-3 { top: 40%; left: 80%; animation: blipFlash 2s infinite alternate; }
.blip-4 { top: 80%; left: 20%; animation: blipFlash 0.8s infinite alternate; }

@keyframes blipFlash {
  0%, 20% { opacity: 0; }
  50%, 100% { opacity: 1; }
}

/* ---------- 底部按钮与版权 ---------- */
.home-mode-row {
  position: absolute;
  bottom: 200px; /* 上移，避开下方雷达和频谱 */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  z-index: 20;
}

@media (max-width: 768px) {
  .hud-top-left, .hud-bottom-left, .hud-bottom-right { transform: scale(0.8); }
  .hud-top-left { top: 10px; left: 10px; }
  .hud-bottom-left { bottom: 10px; left: 10px; }
  .hud-bottom-right { bottom: 10px; right: 10px; }
  .home-mode-row { flex-direction: column; bottom: 160px; gap: 15px; }
}

.home-start-btn {
  position: relative;
  background: rgba(0, 30, 60, 0.6);
  border: 1px solid #00a2ff;
  color: #00e5ff;
  border-radius: 2px;
  padding: 15px 30px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: all 0.1s;
  font-family: 'Courier New', monospace;
  letter-spacing: 2px;
  font-weight: bold;
  text-transform: uppercase;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.home-start-btn:hover {
  background: rgba(0, 162, 255, 0.3);
  box-shadow: 0 0 20px rgba(0, 162, 255, 0.8), inset 0 0 10px rgba(0, 162, 255, 0.5);
  color: #ffffff;
  text-shadow: 0 0 5px #ffffff;
}

.home-start-btn.skirmish-btn {
  border-color: #0088cc;
  color: #4daaff;
}

.home-start-btn.skirmish-btn:hover {
  background: rgba(0, 136, 204, 0.3);
  box-shadow: 0 0 20px rgba(0, 162, 255, 0.6);
}

.hsb-line {
  width: 20px;
  height: 2px;
  background: currentColor;
  opacity: 0.6;
  box-shadow: 0 0 5px currentColor;
}

.hsb-line:first-child {
  width: 8px; height: 8px;
  animation: blinkText 1s infinite;
}

.hsb-text { font-size: 0.9rem; }

.home-footer {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  font-size: 0.7rem;
  color: rgba(0, 162, 255, 0.4);
  letter-spacing: 2px;
  z-index: 10;
}

.home-footer::before {
  content: "// SYSTEM STANDBY :: ALL SENSORS ACTIVE // ";
  display: block;
  color: #ff2222;
  font-size: 0.6rem;
  margin-bottom: 5px;
  animation: blinkText 2s infinite;
}

@keyframes blinkText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}