/* ==========================================================================
   AGOR PROTOCOL // MATRIX & RETRO TERMINAL THEME STYLESHEET
   Cyberpunk / Monospace Telemetry / CRT HUD Effects
   ========================================================================== */

:root {
  --bg-deep: #06050b;
  --bg-surface: #0d0a1a;
  --bg-surface-elevated: #151128;
  --bg-surface-glass: rgba(13, 10, 26, 0.88);
  --border-dim: #231b40;
  --border-neon: #9353ff;
  --border-cyan: #00f0ff;
  --border-amber: #ffb700;
  
  --neon-purple: #9353ff;
  --neon-purple-glow: rgba(147, 83, 255, 0.35);
  --neon-violet: #a855f7;
  --neon-indigo: #6366f1;
  --neon-green: #00ff88;
  --neon-cyan: #00f0ff;
  --neon-cyan-glow: rgba(0, 240, 255, 0.25);
  --neon-amber: #ffb700;
  --neon-pink: #f43f5e;
  
  --text-main: #f1f5f9;
  --text-dim: #94a3b8;
  --text-muted: #5e5977;
  --text-highlight: #ffffff;
  
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  --font-sans: 'Space Grotesk', system-ui, -apple-system, sans-serif;
}

/* Matrix Background Canvas */
#matrixCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.12;
  transition: opacity 0.5s ease;
}

body.matrix-active #matrixCanvas {
  opacity: 0.25;
}

/* CRT Scanlines Overlay */
.scanline-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999;
  pointer-events: none;
  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% 3px, 6px 100%;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

body.crt-off .scanline-overlay {
  display: none;
}

/* Subtle Screen Flicker */
@keyframes crtFlicker {
  0% { opacity: 0.99; }
  50% { opacity: 1; }
  52% { opacity: 0.96; }
  54% { opacity: 1; }
  100% { opacity: 0.99; }
}

body.crt-flicker {
  animation: crtFlicker 0.15s infinite;
}

/* Cyber Terminal HUD Glows & Badges */
.badge-terminal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  border: 1px solid rgba(147, 83, 255, 0.3);
  background: rgba(147, 83, 255, 0.08);
  color: var(--neon-purple);
}

.badge-terminal.purple {
  border-color: rgba(192, 132, 252, 0.4);
  background: rgba(192, 132, 252, 0.1);
  color: #c084fc;
}

.badge-terminal.cyan {
  border-color: rgba(0, 240, 255, 0.3);
  background: rgba(0, 240, 255, 0.06);
  color: var(--neon-cyan);
}

.badge-terminal.amber {
  border-color: rgba(255, 183, 0, 0.3);
  background: rgba(255, 183, 0, 0.06);
  color: var(--neon-amber);
}

.badge-terminal.pink {
  border-color: rgba(244, 63, 94, 0.3);
  background: rgba(244, 63, 94, 0.06);
  color: var(--neon-pink);
}

/* Glowing Neon Text Effects */
.glow-purple {
  color: var(--neon-purple);
  text-shadow: 0 0 10px rgba(147, 83, 255, 0.6), 0 0 20px rgba(147, 83, 255, 0.3);
}

.glow-green {
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.6);
}

.glow-cyan {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6), 0 0 20px rgba(0, 240, 255, 0.2);
}

.glow-amber {
  color: var(--neon-amber);
  text-shadow: 0 0 10px rgba(255, 183, 0, 0.6);
}

/* Cyberpunk Terminal Cards */
.cyber-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-dim);
  border-radius: 6px;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.cyber-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-purple), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.cyber-card:hover {
  border-color: rgba(147, 83, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(147, 83, 255, 0.12);
}

.cyber-card:hover::before {
  opacity: 1;
}

/* Cyber Corner Accents */
.cyber-corners {
  position: relative;
}

.cyber-corners::after {
  content: '';
  position: absolute;
  top: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--neon-purple);
  border-right: 2px solid var(--neon-purple);
  pointer-events: none;
}

/* Terminal Console Box */
.terminal-window {
  background: #06090e;
  border: 1px solid #1a2536;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 255, 136, 0.05);
  font-family: var(--font-mono);
  display: flex;
  flex-direction: column;
}

.terminal-header {
  background: #0d131e;
  border-bottom: 1px solid #1a2536;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-body {
  padding: 14px;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #a0aec0;
  overflow-y: auto;
  max-height: 380px;
}

.terminal-line {
  display: flex;
  gap: 10px;
  margin-bottom: 4px;
  word-break: break-all;
}

.terminal-time {
  color: #4a5d78;
  flex-shrink: 0;
}

.terminal-tag {
  color: var(--neon-cyan);
  flex-shrink: 0;
  font-weight: 600;
}

.terminal-msg {
  color: #cbd5e1;
}

.terminal-msg.spawn {
  color: var(--neon-green);
  font-weight: 600;
}

.terminal-msg.payout {
  color: var(--neon-amber);
  font-weight: 600;
}

.terminal-msg.alert {
  color: var(--neon-pink);
}

.terminal-prompt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #080c14;
  border-top: 1px solid #1a2536;
  padding: 8px 14px;
}

.terminal-prompt-symbol {
  color: var(--neon-purple);
  font-weight: bold;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #c084fc;
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

/* Glitch Animation */
@keyframes textGlitch {
  0% { transform: translate(0) }
  20% { transform: translate(-2px, 1px) }
  40% { transform: translate(-1px, -1px) }
  60% { transform: translate(2px, 0px) }
  80% { transform: translate(1px, 2px) }
  100% { transform: translate(0) }
}

.glitch-on-hover:hover {
  animation: textGlitch 0.2s ease infinite;
}

/* Glowing Pulsing Status Beacon */
.status-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-purple);
  box-shadow: 0 0 10px var(--neon-purple);
  position: relative;
  display: inline-block;
}

.status-beacon::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 1px solid var(--neon-purple);
  animation: beaconPulse 1.8s infinite;
}

@keyframes beaconPulse {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #06090e;
}
::-webkit-scrollbar-thumb {
  background: #1a2536;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--neon-green);
}
