/* =========================================================
   THE SYNDICATE - CYBERPUNK SHOOTER STYLESHEET
   ========================================================= */

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

:root {
  --neon-green: #00ff66;
  --neon-cyan: #00f3ff;
  --neon-red: #ff0055;
  --neon-gold: #ffd700;
  --neon-purple: #b537f2;
  --dark-bg: #07090e;
  --panel-bg: rgba(12, 16, 24, 0.88);
  --border-glow: 0 0 12px rgba(0, 255, 102, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--dark-bg);
  font-family: 'Rajdhani', sans-serif;
  color: #e2e8f0;
}

/* Canvas fills the screen */
#game-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* CRT Scanlines Overlay */
.scanlines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    rgba(18, 16, 16, 0) 50%,
    rgba(0, 0, 0, 0.25) 50%
  ), linear-gradient(
    90deg,
    rgba(255, 0, 0, 0.03),
    rgba(0, 255, 0, 0.01),
    rgba(0, 0, 255, 0.03)
  );
  background-size: 100% 4px, 6px 100%;
}

/* Vignette */
.vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.8);
}

/* ===================== HUD OVERLAY ===================== */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

/* Top Bar: Player Status & Radar */
.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}

/* Player Bio Frame */
.player-frame {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel-bg);
  border: 1px solid rgba(0, 243, 255, 0.4);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
  padding: 10px 16px;
  border-radius: 4px;
  backdrop-filter: blur(8px);
}

.avatar-wrapper {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  overflow: hidden;
  background: #000;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-scanline {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
  animation: scanAvatar 2s linear infinite;
}

@keyframes scanAvatar {
  0% { top: 0%; opacity: 0.8; }
  50% { top: 100%; opacity: 0.8; }
  100% { top: 0%; opacity: 0.8; }
}

.player-meters {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.player-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  display: flex;
  justify-content: space-between;
}

.meter-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}

#hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff0055, #ff3366);
  box-shadow: 0 0 8px #ff0055;
  transition: width 0.15s ease;
}

#shield-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #0088ff, #00f3ff);
  box-shadow: 0 0 8px #00f3ff;
  transition: width 0.15s ease;
}

.emp-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #a0aec0;
}

.emp-bar {
  flex-grow: 1;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

#emp-cooldown-fill {
  width: 100%;
  height: 100%;
  background: var(--neon-green);
  box-shadow: 0 0 6px var(--neon-green);
}

/* Radar & Score */
.hud-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.radar-box {
  width: 110px;
  height: 110px;
  background: var(--panel-bg);
  border: 1px solid rgba(0, 243, 255, 0.4);
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.15);
  backdrop-filter: blur(6px);
}

#radar-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.score-panel {
  text-align: right;
  background: var(--panel-bg);
  padding: 6px 14px;
  border: 1px solid rgba(0, 255, 102, 0.3);
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.15);
  border-radius: 4px;
}

.score-title {
  font-size: 11px;
  letter-spacing: 2px;
  color: #8899aa;
}

#hud-score {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
}

#hud-combo {
  font-size: 13px;
  font-weight: 700;
  color: var(--neon-green);
}

/* Boss Health Bar */
#boss-hud-bar {
  display: none;
  position: absolute;
  top: 25px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  max-width: 85%;
  background: var(--panel-bg);
  border: 1px solid var(--neon-red);
  box-shadow: 0 0 20px rgba(255, 0, 85, 0.4);
  padding: 8px 14px;
  border-radius: 4px;
  text-align: center;
}

.boss-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--neon-red);
  margin-bottom: 5px;
}

.boss-bar {
  width: 100%;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 0, 85, 0.5);
  overflow: hidden;
  border-radius: 2px;
}

#boss-hp-fill {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff0055, #ff5500);
  box-shadow: 0 0 12px #ff0055;
  transition: width 0.1s linear;
}

/* Bottom Bar: Weapon Selector & Audio toggle */
.hud-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.weapon-dock {
  display: flex;
  gap: 12px;
  pointer-events: auto;
}

.wep-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 90px;
}

.wep-slot:hover {
  border-color: var(--neon-cyan);
}

.wep-slot.active {
  border-color: var(--neon-green);
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.4);
  background: rgba(0, 255, 102, 0.1);
  transform: translateY(-4px);
}

.wep-key {
  font-size: 10px;
  color: #718096;
}

.wep-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 700;
  margin: 3px 0;
}

.wep-ammo {
  font-size: 11px;
  color: var(--neon-green);
}

.hud-controls-hint {
  font-size: 11px;
  color: #718096;
  background: var(--panel-bg);
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: auto;
}

/* Floating Center Announcement */
#announcement-banner {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 3px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 20;
}

/* ===================== TOUCH CONTROLS (MOBILE) ===================== */
#touch-controls {
  position: absolute;
  bottom: 15px;
  left: 0;
  width: 100%;
  padding: 0 20px;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
  z-index: 15;
}

@media (pointer: coarse) {
  #touch-controls {
    display: flex;
  }
  .hud-controls-hint {
    display: none;
  }
}

#touch-joystick-zone {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(0, 243, 255, 0.1);
  border: 2px dashed rgba(0, 243, 255, 0.4);
  position: relative;
  pointer-events: auto;
}

#touch-joystick-knob {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan);
  position: absolute;
  top: 33px;
  left: 33px;
  pointer-events: none;
}

.touch-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
}

.touch-btn-row {
  display: flex;
  gap: 10px;
}

.touch-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--panel-bg);
  border: 2px solid var(--neon-green);
  color: var(--neon-green);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 255, 102, 0.3);
  cursor: pointer;
}

.touch-btn:active {
  background: rgba(0, 255, 102, 0.3);
  transform: scale(0.92);
}

/* ===================== TITLE & MODAL SCREENS ===================== */
.screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 8, 14, 0.94);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.title-card {
  max-width: 750px;
  width: 95%;
  background: var(--panel-bg);
  border: 1px solid var(--neon-green);
  box-shadow: var(--border-glow);
  padding: 35px;
  border-radius: 8px;
  text-align: center;
  position: relative;
}

.title-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.title-logo-badge {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  box-shadow: 0 0 16px var(--neon-green);
}

.main-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 38px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.main-subtitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--neon-green);
  margin-bottom: 24px;
}

.briefing-box {
  background: rgba(0, 0, 0, 0.4);
  border-left: 3px solid var(--neon-cyan);
  padding: 14px 18px;
  text-align: left;
  font-size: 15px;
  line-height: 1.5;
  color: #cbd5e0;
  margin-bottom: 25px;
}

.briefing-box strong {
  color: var(--neon-cyan);
}

/* 2D Character Selector */
.character-select-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--neon-cyan);
  text-align: left;
  margin-bottom: 10px;
}

.character-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.char-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-align: left;
}

.char-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--neon-cyan);
  transform: translateY(-2px);
}

.char-card.active {
  background: rgba(0, 243, 255, 0.12);
  border-color: var(--neon-green);
  box-shadow: 0 0 16px rgba(0, 255, 102, 0.35);
  transform: translateY(-3px);
}

.char-badge-frame {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.char-card.active .char-badge-frame {
  border-color: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
}

.char-badge-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.char-info {
  flex-grow: 1;
}

.char-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}

.char-card.active .char-name {
  color: var(--neon-green);
}

.char-tagline {
  font-size: 10px;
  letter-spacing: 1px;
  color: #a0aec0;
  margin-bottom: 2px;
}

.char-perk {
  font-size: 10px;
  color: var(--neon-cyan);
}

.controls-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
  font-size: 13px;
}

.guide-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 10px;
  border-radius: 4px;
}

.guide-key {
  color: var(--neon-green);
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;
  display: block;
  margin-bottom: 2px;
}

.btn-group {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.cyber-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 12px 28px;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  text-transform: uppercase;
}

.cyber-btn-primary {
  background: var(--neon-green);
  color: #05080e;
  box-shadow: 0 0 16px rgba(0, 255, 102, 0.5);
}

.cyber-btn-primary:hover {
  background: #26ff7d;
  box-shadow: 0 0 24px rgba(0, 255, 102, 0.8);
  transform: translateY(-2px);
}

.cyber-btn-secondary {
  background: transparent;
  color: var(--neon-cyan);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 12px rgba(0, 243, 255, 0.3);
}

.cyber-btn-secondary:hover {
  background: rgba(0, 243, 255, 0.15);
  transform: translateY(-2px);
}

/* ===================== THE SYNDICATE ENDING SCREEN ===================== */
#ending-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
  padding: 20px;
}

#ending-screen.hidden {
  display: none;
}

/* Cinematic Widescreen Backdrop */
.ending-backdrop-container {
  position: relative;
  max-width: 980px;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 102, 0.4);
  box-shadow: 0 0 40px rgba(0, 255, 102, 0.25);
  background: #05070a;
}

.ending-banner-img {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(0.9) contrast(1.1);
}

/* Dialogue Typewriter Box */
#ending-dialogue-box {
  position: absolute;
  bottom: 25px;
  left: 5%;
  right: 5%;
  background: rgba(7, 10, 16, 0.94);
  border: 1px solid var(--neon-green);
  box-shadow: 0 0 25px rgba(0, 255, 102, 0.4);
  padding: 20px 24px;
  border-radius: 6px;
  display: flex;
  gap: 20px;
  align-items: center;
  backdrop-filter: blur(10px);
}

.speaker-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid var(--neon-green);
  box-shadow: 0 0 12px var(--neon-green);
  object-fit: cover;
  flex-shrink: 0;
}

.dialogue-content {
  flex-grow: 1;
}

#ending-speaker {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--neon-green);
  margin-bottom: 6px;
}

#ending-text {
  font-size: 17px;
  line-height: 1.4;
  color: #f0f4f8;
  min-height: 48px;
}

#ending-text.highlight-text {
  color: var(--neon-green);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 1px;
}

/* Victory Panel */
#ending-victory-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  width: 100%;
  background: rgba(5, 8, 14, 0.96);
  border-top: 2px solid var(--neon-green);
}

.victory-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  color: #ffffff;
  margin-bottom: 4px;
}

.victory-subtitle {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--neon-green);
  margin-bottom: 24px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 650px;
  margin-bottom: 26px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px;
  border-radius: 4px;
  text-align: center;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: #718096;
}

.stat-val {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
}

.rank-badge-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(0, 255, 102, 0.08);
  border: 1px solid var(--neon-green);
  padding: 14px 28px;
  border-radius: 6px;
  box-shadow: 0 0 20px rgba(0, 255, 102, 0.2);
  margin-bottom: 28px;
}

#res-rank {
  font-family: 'Orbitron', sans-serif;
  font-size: 48px;
  font-weight: 900;
  color: var(--neon-green);
  text-shadow: 0 0 15px var(--neon-green);
}

#res-rank-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
}

/* ===================== DOSSIER MODAL ===================== */
#dossier-modal {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 5, 10, 0.95);
  backdrop-filter: blur(10px);
  z-index: 70;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.dossier-content {
  background: var(--panel-bg);
  border: 1px solid var(--neon-cyan);
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.25);
  border-radius: 8px;
  max-width: 820px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}

.dossier-close {
  position: absolute;
  top: 18px;
  right: 20px;
  background: none;
  border: none;
  color: var(--neon-red);
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.dossier-tabs {
  display: flex;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 12px;
  margin-bottom: 20px;
}

.dossier-tab-btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #a0aec0;
  cursor: pointer;
  border-radius: 4px;
}

.dossier-tab-btn.active {
  background: rgba(0, 243, 255, 0.15);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.3);
}

.dossier-card {
  display: none;
  gap: 24px;
  align-items: flex-start;
}

.dossier-card.active {
  display: flex;
}

.dossier-art {
  width: 260px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.dossier-info {
  flex-grow: 1;
}

.dossier-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.dossier-role {
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--neon-green);
  margin-bottom: 16px;
}

.dossier-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #cbd5e0;
  margin-bottom: 16px;
}

.spec-list {
  list-style: none;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.spec-list li strong {
  color: var(--neon-cyan);
}

/* Utility Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
