﻿/* ==========================================================================
   大哥云 单词防御 (Word Defense) - 霓虹雨巷街机挑战
   ========================================================================== */

.game-terminal-container {
  background: #0d0a14;
  border: 1px solid var(--neon-purple);
  border-radius: var(--radius-md);
  box-shadow: 0 0 25px rgba(187, 102, 255, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  position: relative;
  margin: 20px 0;
}

/* 游戏头部面板：分数、计时、生命、连击 */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(23, 17, 36, 0.95);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.game-hud-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hud-value {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.hud-value.highlight-amber {
  color: var(--neon-amber);
  text-shadow: 0 0 8px rgba(255, 225, 107, 0.5);
}

.hud-value.highlight-pink {
  color: var(--neon-pink);
  text-shadow: 0 0 8px rgba(255, 74, 168, 0.5);
}

.hud-value.highlight-blue {
  color: var(--neon-blue);
  text-shadow: 0 0 8px rgba(77, 141, 255, 0.5);
}

.hud-lives {
  display: flex;
  gap: 4px;
}

.hud-life-pip {
  display: inline-block;
  width: 14px;
  height: 14px;
  background: var(--neon-pink);
  box-shadow: 0 0 6px var(--neon-pink);
  border-radius: 2px;
  transition: all 0.2s ease;
}

.hud-life-pip.lost {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.game-hud-controls {
  display: flex;
  gap: 10px;
}

.game-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.game-btn:hover {
  background: var(--neon-blue);
  border-color: var(--neon-blue);
  color: #fff;
  box-shadow: 0 0 10px rgba(77, 141, 255, 0.5);
}

.game-btn.primary {
  background: var(--neon-pink);
  border-color: var(--neon-pink);
  color: #fff;
  box-shadow: 0 0 10px rgba(255, 74, 168, 0.4);
}

.game-btn.primary:hover {
  background: #ff2a98;
  box-shadow: 0 0 16px rgba(255, 74, 168, 0.7);
}

/* 核心游戏舞台区域 */
.game-stage-wrapper {
  position: relative;
  width: 100%;
  height: 340px;
  background: #0a0710;
  background-image: 
    linear-gradient(rgba(187, 102, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(77, 141, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  overflow: hidden;
  user-select: none;
}

/* 左侧警戒红线防御界 */
.defense-barrier-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 20px;
  width: 3px;
  background: linear-gradient(180deg, transparent, var(--neon-pink) 20%, var(--neon-pink) 80%, transparent);
  box-shadow: 0 0 12px var(--neon-pink);
  z-index: 5;
}

.defense-barrier-label {
  position: absolute;
  top: 10px;
  left: 28px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--neon-pink);
  letter-spacing: 0.1em;
  opacity: 0.7;
}

/* 单词目标实体 (Word Target Entity) */
.word-entity {
  position: absolute;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  background: rgba(23, 17, 36, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}

/* 已锁定目标：高亮并带有呼吸光效 */
.word-entity.is-locked {
  border-color: var(--neon-pink);
  background: rgba(255, 74, 168, 0.16);
  box-shadow: 0 0 16px rgba(255, 74, 168, 0.6), inset 0 0 8px rgba(255, 74, 168, 0.3);
  z-index: 20;
}

/* 已匹配字符高亮 */
.word-matched-chars {
  color: var(--neon-amber);
  text-shadow: 0 0 6px var(--neon-amber);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.word-remaining-chars {
  color: #fff;
}

/* 命中消除爆炸动效 */
@keyframes wordExplode {
  0% {
    transform: translateY(-50%) scale(1);
    opacity: 1;
    filter: brightness(1.8);
  }
  50% {
    transform: translateY(-50%) scale(1.35);
    opacity: 0.8;
  }
  100% {
    transform: translateY(-50%) scale(1.8);
    opacity: 0;
  }
}

.word-entity.is-exploding {
  animation: wordExplode 0.35s forwards cubic-bezier(0.1, 0.9, 0.2, 1);
  border-color: var(--neon-amber);
  box-shadow: 0 0 30px var(--neon-amber);
}

/* 屏幕底部的输入反馈与移动端真实输入框区域 */
.game-input-dock {
  background: rgba(16, 12, 24, 0.98);
  border-top: 1px solid var(--border-subtle);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.input-feedback-col {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 240px;
}

.input-target-badge {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-subtle);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.current-typed-display {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--neon-amber);
  letter-spacing: 0.1em;
  min-width: 100px;
  border-bottom: 2px solid var(--neon-blue);
  padding-bottom: 2px;
}

/* 移动端真实输入框：键盘输入保障，防遮挡 */
.mobile-real-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-native-input {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  width: 180px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.game-native-input:focus {
  border-color: var(--neon-pink);
  box-shadow: 0 0 10px rgba(255, 74, 168, 0.4);
}

.game-instructions-bar {
  background: rgba(23, 17, 36, 0.8);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 20px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.game-instruction-item kbd {
  background: #2a203c;
  color: var(--neon-amber);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 游戏覆盖层：开始、暂停、游戏结束结算 */
.game-overlay-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(16, 12, 24, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  text-align: center;
  padding: 24px;
}

.game-overlay-modal.hidden {
  display: none !important;
}

.overlay-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 10px;
}

.overlay-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  max-width: 480px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.overlay-stats-summary {
  display: flex;
  gap: 24px;
  margin-bottom: 26px;
}

.summary-stat-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  min-width: 90px;
}

.summary-stat-box .val {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--neon-amber);
}

.summary-stat-box .lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* 屏幕震动反馈（扣生命时触发） */
@keyframes screenShake {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-4px, 2px); }
  40% { transform: translate(4px, -2px); }
  60% { transform: translate(-3px, -1px); }
  80% { transform: translate(2px, 3px); }
  100% { transform: translate(0, 0); }
}

.game-stage-wrapper.shake {
  animation: screenShake 0.3s ease;
  border: 1px solid var(--neon-pink);
}

/* 移动端自适应 */
@media (max-width: 768px) {
  .game-stage-wrapper {
    height: 280px;
  }
  .game-hud {
    padding: 10px 14px;
  }
  .hud-value {
    font-size: 1.1rem;
  }
  .game-input-dock {
    flex-direction: column;
    align-items: stretch;
    padding: 12px 14px;
  }
  .mobile-real-input-wrapper {
    width: 100%;
  }
  .game-native-input {
    width: 100%;
  }
  .game-instructions-bar {
    font-size: 0.72rem;
  }
}
