/* ============================================
   AI 未来战争幻想 - Stylesheet (Bright Theme)
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Rajdhani:wght@400;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --cyan: #00997a;
  --cyan-bright: #00ccaa;
  --red: #dd1133;
  --red-dim: #991133;
  --orange: #ee7700;
  --yellow: #ddbb00;
  --bg-dark: #1a2030;
  --bg-panel: rgba(20, 30, 45, 0.88);
  --bg-panel-light: rgba(240, 245, 255, 0.92);
  --text: #1a2030;
  --text-bright: #ffffff;
  --text-hud: #e0e8f0;
  --accent: #0077cc;
  --font-display: 'Orbitron', monospace;
  --font-ui: 'Rajdhani', sans-serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #c0d0e0;
  color: var(--text);
  font-family: var(--font-ui);
  cursor: crosshair;
  user-select: none;
}

canvas { display: block; }

/* ---- Loading Screen ---- */
#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(180deg, #2a3a50 0%, #1a2535 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.6s;
}
#loading-screen.hidden { opacity: 0; pointer-events: none; }
#loading-screen h1 {
  font-family: var(--font-display);
  font-size: 2.4rem; font-weight: 900;
  color: var(--cyan-bright);
  text-shadow: 0 0 30px rgba(0,153,122,0.5), 0 0 60px rgba(0,153,122,0.3);
  letter-spacing: 4px; margin-bottom: 30px;
}
#loading-screen .subtitle {
  font-size: 1rem; color: #8899aa;
  letter-spacing: 6px; margin-bottom: 40px;
}
.loader-bar {
  width: 300px; height: 6px;
  background: rgba(0,153,122,0.15);
  border-radius: 3px; overflow: hidden;
}
.loader-bar-inner {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--cyan), var(--cyan-bright));
  border-radius: 3px; transition: width 0.3s;
}
.load-tip {
  margin-top: 20px; font-size: 0.8rem;
  color: #667788; letter-spacing: 2px;
}

/* ---- Start Screen ---- */
#start-screen {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(180deg, #1a2535 0%, #2a3a55 50%, #1e2d42 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.8s;
}
#start-screen.hidden { opacity: 0; pointer-events: none; }

.game-logo {
  text-align: center; margin-bottom: 40px;
}
.game-logo h1 {
  font-family: var(--font-display);
  font-size: 3.2rem; font-weight: 900;
  background: linear-gradient(135deg, var(--cyan-bright), #00bbff, #7c3aed);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(0,153,122,0.5));
  letter-spacing: 6px;
}
.game-logo .cn-title {
  font-family: var(--font-ui);
  font-size: 1.6rem; font-weight: 700;
  color: #aabbcc; letter-spacing: 12px;
  margin-top: 8px;
}
.game-logo .tagline {
  font-size: 0.85rem; color: rgba(0,204,170,0.8);
  letter-spacing: 4px; margin-top: 16px;
  font-family: var(--font-display);
}

.lore-text {
  max-width: 600px; text-align: center;
  font-size: 0.95rem; line-height: 1.8;
  color: #8899aa;
  margin-bottom: 40px; padding: 0 20px;
}
.lore-text strong { color: var(--red); }

.btn-start {
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), #00bbee);
  border: none; padding: 16px 60px;
  letter-spacing: 4px; cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  transition: all 0.2s;
}
.btn-start:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 30px rgba(0,187,238,0.5);
  transform: scale(1.05);
}
.controls-info {
  margin-top: 40px; font-size: 0.75rem;
  color: #556677;
  letter-spacing: 2px; text-align: center;
  line-height: 2;
}
.controls-info kbd {
  background: rgba(0,153,122,0.15);
  color: var(--cyan-bright);
  padding: 2px 8px; border-radius: 3px;
  font-family: var(--font-display);
  font-size: 0.7rem;
}

/* ---- HUD ---- */
#hud {
  position: fixed; inset: 0; z-index: 50;
  pointer-events: none;
}
#hud.hidden { display: none; }

/* Crosshair */
.crosshair {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 40px; height: 40px;
}
.crosshair::before, .crosshair::after {
  content: ''; position: absolute;
  background: rgba(0,0,0,0.6);
}
.crosshair::before {
  width: 2px; height: 100%;
  left: 50%; transform: translateX(-50%);
}
.crosshair::after {
  width: 100%; height: 2px;
  top: 50%; transform: translateY(-50%);
}
.crosshair-dot {
  position: absolute; top: 50%; left: 50%;
  width: 4px; height: 4px; border-radius: 50%;
  background: #dd1133;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px rgba(221,17,51,0.8);
}

/* Health Bar */
.hud-health {
  position: absolute; bottom: 30px; left: 30px;
  width: 280px;
}
.hud-health .label {
  font-family: var(--font-display);
  font-size: 0.65rem; letter-spacing: 3px;
  color: var(--accent); margin-bottom: 4px;
}
.health-bar-bg {
  width: 100%; height: 8px;
  background: rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.2);
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.health-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--orange));
  transition: width 0.3s;
}
.health-text {
  font-family: var(--font-display);
  font-size: 0.7rem; color: rgba(0,0,0,0.7);
  margin-top: 4px;
}

/* Ammo */
.hud-ammo {
  position: absolute; bottom: 30px; right: 30px;
  text-align: right;
}
.hud-ammo .label {
  font-family: var(--font-display);
  font-size: 0.65rem; letter-spacing: 3px;
  color: var(--accent); margin-bottom: 4px;
}
.ammo-count {
  font-family: var(--font-display);
  font-size: 2.4rem; font-weight: 900;
  color: rgba(0,0,0,0.85);
  line-height: 1;
  text-shadow: 0 0 8px rgba(255,255,255,0.6);
}
.ammo-count .divider { color: rgba(0,0,0,0.3); font-size: 1.4rem; }
.ammo-count .max { font-size: 1rem; color: rgba(0,0,0,0.4); }
.weapon-name {
  font-family: var(--font-display);
  font-size: 0.6rem; letter-spacing: 2px;
  color: var(--accent); margin-top: 4px;
}

/* Wave & Score */
.hud-top {
  position: absolute; top: 20px; left: 50%;
  transform: translateX(-50%);
  text-align: center;
}
.wave-text {
  font-family: var(--font-display);
  font-size: 0.7rem; letter-spacing: 4px;
  color: var(--accent);
}
.wave-number {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 900;
  color: rgba(0,0,0,0.85);
  line-height: 1;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}
.kill-count {
  font-family: var(--font-display);
  font-size: 0.65rem; letter-spacing: 2px;
  color: rgba(0,0,0,0.5);
  margin-top: 4px;
}

/* Threat Warning */
.threat-warning {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0; transition: opacity 0.15s;
}
.threat-warning.active { opacity: 1; }
.threat-text {
  font-family: var(--font-display);
  font-size: 1.4rem; font-weight: 900;
  color: var(--red);
  text-shadow: 0 0 10px rgba(221,17,51,0.5), 0 0 3px #fff;
  letter-spacing: 6px;
  animation: threatPulse 0.3s infinite alternate;
}
@keyframes threatPulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Dodge Indicator */
.dodge-indicator {
  position: absolute; top: 60%; left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
}
.dodge-indicator.active { opacity: 1; }
.dodge-arrow {
  font-family: var(--font-display);
  font-size: 2rem; font-weight: 900;
  color: #dd7700;
  text-shadow: 0 0 8px rgba(221,119,0,0.5), 0 0 3px #fff;
  animation: dodgeFlash 0.15s infinite alternate;
}
@keyframes dodgeFlash {
  from { transform: translateX(-5px); }
  to { transform: translateX(5px); }
}

/* Wave Announcement */
.wave-announce {
  position: absolute; top: 30%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.5s;
}
.wave-announce.active { opacity: 1; }
.wave-announce h2 {
  font-family: var(--font-display);
  font-size: 2.8rem; font-weight: 900;
  color: var(--red);
  text-shadow: 0 0 20px rgba(221,17,51,0.4), 0 0 3px #fff;
  letter-spacing: 8px;
}
.wave-announce p {
  font-family: var(--font-ui);
  font-size: 1rem; color: rgba(0,0,0,0.7);
  letter-spacing: 3px; margin-top: 8px;
  text-shadow: 0 0 5px rgba(255,255,255,0.5);
}

/* Damage overlay */
.damage-overlay {
  position: absolute; inset: 0;
  border: 4px solid transparent;
  pointer-events: none;
  transition: border-color 0.1s;
}
.damage-overlay.hit {
  border-color: rgba(221,17,51,0.6);
  background: radial-gradient(ellipse at center, transparent 50%, rgba(221,17,51,0.1) 100%);
}

/* Minimap */
.minimap-container {
  position: absolute; top: 20px; right: 20px;
  width: 160px; height: 160px;
  border: 1px solid rgba(0,0,0,0.2);
  background: rgba(200,210,225,0.85);
  border-radius: 4px; overflow: hidden;
}
.minimap-container canvas {
  width: 100%; height: 100%;
}

/* Weapon slots */
.weapon-slots {
  position: absolute; bottom: 100px; right: 30px;
  display: flex; gap: 8px;
}
.weapon-slot {
  width: 50px; height: 50px;
  background: rgba(200,210,225,0.8);
  border: 1px solid rgba(0,0,0,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  opacity: 0.5; transition: all 0.2s;
}
.weapon-slot.active {
  opacity: 1;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0,119,204,0.3);
  background: rgba(220,230,245,0.95);
}
.weapon-slot .key {
  font-family: var(--font-display);
  font-size: 0.55rem; color: var(--accent);
  letter-spacing: 1px;
}
.weapon-slot .icon {
  font-size: 1.1rem; color: rgba(0,0,0,0.7);
}

/* ---- Game Over Screen ---- */
#gameover-screen {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(30,15,15,0.9);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.6s;
}
#gameover-screen.hidden { opacity: 0; pointer-events: none; }
#gameover-screen h1 {
  font-family: var(--font-display);
  font-size: 3rem; font-weight: 900;
  color: var(--red);
  text-shadow: 0 0 30px rgba(221,17,51,0.5);
  letter-spacing: 8px;
}
#gameover-screen .stats {
  margin: 30px 0; text-align: center;
  font-family: var(--font-display);
  font-size: 0.85rem; color: #aabbcc;
  letter-spacing: 2px; line-height: 2.2;
}
#gameover-screen .stats span {
  color: var(--cyan-bright); font-weight: 700;
}
.btn-restart {
  font-family: var(--font-display);
  font-size: 0.9rem; font-weight: 700;
  color: #ffffff;
  background: transparent;
  border: 1px solid var(--red);
  padding: 12px 50px;
  letter-spacing: 4px; cursor: pointer;
  transition: all 0.2s;
}
.btn-restart:hover {
  background: var(--red);
  box-shadow: 0 0 20px rgba(221,17,51,0.4);
}

/* Scanlines overlay (subtle) */
.scanlines {
  position: fixed; inset: 0; z-index: 9998;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0,0,0,0.01) 0px,
    rgba(0,0,0,0.01) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.3;
}
