/* Import Inter Font */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;500;700;900&display=swap');

:root {
  /* Palette */
  --bg-deep: #0f172a;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Accents */
  --green-hack: #10b981; /* Terminal Green */
  --green-glow: rgba(16, 185, 129, 0.5);
  --cyan-primary: #06b6d4;
  --amber-gold: #f59e0b;
  --red-alarm: #ef4444;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

* { box-sizing: border-box; }

.heist-view {
  width: 100%;
  height: 100%;
  background-color: var(--bg-deep);
  background-image:
    radial-gradient(circle at 80% 20%, rgba(16, 185, 129, 0.1) 0%, transparent 60%),
    linear-gradient(135deg, #020617 0%, #111827 100%);
  font-family: 'Inter', monospace; /* Monospace vibe for hacking */
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

/* Ambient Effects */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.2;
  z-index: 0;
  animation: float 10s infinite ease-in-out;
}
.glow-green { width: 400px; height: 400px; background: var(--green-hack); top: -100px; left: -100px; }
.glow-blue { width: 300px; height: 300px; background: var(--cyan-primary); bottom: -50px; right: -50px; animation-delay: -3s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, 30px); }
}

/* Header */
.heist-header { text-align: center; z-index: 2; margin-bottom: 1.5rem; flex-shrink: 0; }

.header-badge {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 3px;
  font-weight: 700;
  color: var(--green-hack);
  background: rgba(16, 185, 129, 0.1);
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  margin-bottom: 0.5rem;
}

.heist-header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  background: linear-gradient(to right, #fff, #a7f3d0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

/* Stage */
.heist-stage {
  flex: 1;
  display: flex;
  gap: 1.5rem;
  z-index: 2;
  min-height: 0;
  padding-bottom: 1rem;
}

/* Left: Vault Panel */
.panel-vault {
  flex: 1;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.vault-housing {
  width: 200px; height: 200px;
  position: relative;
  margin-bottom: 2rem;
}

.vault-door {
  width: 100%; height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #334155 0%, #0f172a 70%);
  border: 4px solid #475569;
  box-shadow:
    inset 0 0 30px #000,
    0 20px 40px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  transition: all 0.5s ease;
}

.lock-mechanism { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }

.lock-ring {
  position: absolute; border-radius: 50%; border: 4px dashed #64748b;
  transition: all 0.5s ease;
}
.ring-outer { width: 80%; height: 80%; }
.ring-inner { width: 50%; height: 50%; border-color: #94a3b8; }

.lock-center { font-size: 2rem; z-index: 2; }

/* Vault States */
.vault-door.state-empty { filter: grayscale(1); opacity: 0.5; }

.vault-door.state-locking .ring-outer { animation: spin 2s infinite linear; }
.vault-door.state-locking .ring-inner { animation: spin-rev 1.5s infinite linear; }

.vault-door.state-hacking { border-color: var(--green-hack); box-shadow: 0 0 30px var(--green-glow); }
.vault-door.state-hacking .ring-outer { border-color: var(--green-hack); animation: spin 0.5s infinite linear; }
.vault-door.state-hacking .ring-inner { border-color: var(--green-hack); animation: spin-rev 0.3s infinite linear; }

.vault-door.state-open { border-color: var(--amber-gold); background: radial-gradient(circle, #fcd34d 0%, #d97706 70%); }
.vault-door.state-open .ring-outer, .vault-door.state-open .ring-inner { opacity: 0; }

.vault-door.state-locked { border-color: var(--red-alarm); box-shadow: 0 0 50px var(--red-alarm); animation: shake 0.5s infinite; }

.vault-readout {
  text-align: center;
  background: rgba(0,0,0,0.4);
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}
.vault-readout .label { display: block; font-size: 0.7rem; color: var(--text-muted); letter-spacing: 2px; margin-bottom: 4px; }
.vault-readout .value { font-size: 2rem; font-weight: 900; font-family: 'Inter', sans-serif; color: var(--amber-gold); text-shadow: 0 0 15px rgba(245, 158, 11, 0.4); }

/* Right: Crew Panel */
.panel-crew {
  width: 350px;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.5rem;
  display: flex; flex-direction: column;
}

.panel-header {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 2px; color: var(--text-muted);
  margin-bottom: 1rem; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 0.5rem;
}

.crew-grid { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }

.crew-card {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.03);
  padding: 12px; border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}
.crew-card.leader { border-color: var(--cyan-primary); background: rgba(6, 182, 212, 0.1); }
.crew-card.invited { border-color: var(--green-hack); }

.crew-icon { font-size: 1.5rem; background: rgba(0,0,0,0.3); width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.crew-info { flex: 1; }
.crew-name { font-weight: 700; font-size: 1rem; }
.crew-role { font-size: 0.6rem; color: var(--text-muted); letter-spacing: 1px; }

.slide-in { animation: slideIn 0.3s ease forwards; opacity: 0; transform: translateX(20px); }
@keyframes slideIn { to { opacity: 1; transform: translateX(0); } }

/* Hacking Overlay */
.hacking-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(5px);
  z-index: 10;
  display: flex; justify-content: center; align-items: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.hacking-overlay.active { opacity: 1; pointer-events: auto; }

.terminal-window {
  width: 500px; background: #000;
  border: 2px solid var(--green-hack);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 0 30px var(--green-glow);
  font-family: 'Courier New', monospace;
}

.terminal-header { color: var(--green-hack); font-weight: 700; border-bottom: 1px solid var(--green-hack); padding-bottom: 0.5rem; margin-bottom: 1rem; }
.terminal-logs { height: 150px; overflow-y: auto; color: #fff; font-size: 0.9rem; display: flex; flex-direction: column; gap: 4px; }
.log-line { color: #a7f3d0; }

.progress-bar-track { height: 6px; background: #1e293b; margin-top: 1rem; border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; width: 0%; background: var(--green-hack); box-shadow: 0 0 10px var(--green-hack); }

/* Footer */
.hud-footer {
  margin-top: 1rem; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 1rem; flex-shrink: 0;
}

.player-pill {
  display: flex; gap: 10px; background: rgba(0,0,0,0.4); padding: 8px 16px; border-radius: 50px; border: 1px solid var(--glass-border); font-size: 0.8rem;
}
.player-pill .label { color: var(--text-muted); font-weight: 700; font-size: 0.6rem; letter-spacing: 1px; }
.player-pill .value { font-weight: 700; color: #fff; }
.player-pill .coins { color: var(--amber-gold); font-weight: 700; margin-left: 8px; }

.message-glass {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 3rem;
  border-radius: 100px;
  border: 1px solid var(--glass-border);
  text-align: center;
  min-width: 400px;
  font-weight: 500;
  font-family: monospace;
}
.message-glass.active { border-color: var(--cyan-primary); color: var(--cyan-primary); }
.message-glass.warning { border-color: var(--green-hack); color: var(--green-hack); }
.message-glass.success { border-color: var(--green-success); color: var(--green-success); background: rgba(16, 185, 129, 0.1); }
.message-glass.error { border-color: var(--red-alarm); color: var(--red-alarm); background: rgba(239, 68, 68, 0.1); }
.message-glass.highlight { border-color: var(--amber-gold); color: var(--amber-gold); }

/* Flashes */
.flash-success { animation: flashGreen 0.5s; }
.flash-alarm { animation: flashRed 0.5s infinite; }

@keyframes flashGreen { 0% { filter: brightness(1); } 50% { filter: brightness(1.5) sepia(1) hue-rotate(90deg); } }
@keyframes flashRed { 0% { box-shadow: inset 0 0 0 transparent; } 50% { box-shadow: inset 0 0 50px var(--red-alarm); } }

/* Money Particle */
.money-particle {
  position: absolute; top: -20px; font-size: 2rem;
  animation: fall 2s linear forwards; pointer-events: none; z-index: 20;
}
@keyframes fall { to { top: 100vh; transform: rotate(360deg); } }

/* Animations */
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes spin-rev { 100% { transform: rotate(-360deg); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes blink { 50% { opacity: 0; } }
.pulse { animation: pulse 0.3s; }
@keyframes pulse { 50% { transform: scale(1.2); } }