/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Share Tech Mono', monospace;
  color: #fff;
  background: #000;
}

/* ===== CANVAS BG ===== */
#bots {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background: radial-gradient(ellipse at 30% 40%, #0a0f1e 0%, #000507 60%, #000 100%);
}

/* ===== CRT OVERLAY ===== */
#crt {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 255, 170, 0.015) 2px,
      rgba(0, 255, 170, 0.015) 4px
    );
  animation: crtFlicker 8s infinite;
}
@keyframes crtFlicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.85; }
  94% { opacity: 1; }
  97% { opacity: 0.9; }
  98% { opacity: 1; }
}

/* ===== HUD ===== */
#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 0;
  background: rgba(0, 255, 170, 0.04);
  border-bottom: 1px solid rgba(0, 255, 170, 0.25);
  padding: 8px 0;
  backdrop-filter: blur(4px);
}
.hud-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
  border-right: 1px solid rgba(0, 255, 170, 0.15);
}
.hud-block:last-child { border-right: none; }
.hud-label {
  font-family: 'Orbitron', sans-serif;
  font-size: 9px;
  letter-spacing: 3px;
  color: rgba(0, 255, 170, 0.5);
  text-transform: uppercase;
}
.hud-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #00ffaa;
  text-shadow: 0 0 8px rgba(0, 255, 170, 0.7);
  min-width: 48px;
  text-align: center;
  transition: color 0.2s;
}
.hud-value.flash {
  color: #fff;
  text-shadow: 0 0 20px #fff;
}

/* ===== MAIN CARD ===== */
.container {
  position: relative;
  z-index: 3;
  background: rgba(5, 15, 25, 0.88);
  color: #cceeff;
  padding: 36px 40px;
  border-radius: 4px;
  border: 1px solid rgba(0, 200, 255, 0.3);
  box-shadow:
    0 0 0 1px rgba(0,200,255,0.08),
    0 0 40px rgba(0, 100, 255, 0.15),
    inset 0 0 40px rgba(0, 0, 0, 0.5);
  max-width: 580px;
  margin: 70px auto 0;
  text-align: center;
  animation: floatCard 4s ease-in-out infinite;
}
.container::before {
  content: '';
  position: absolute;
  top: -1px; left: 20px; right: 20px; height: 2px;
  background: linear-gradient(90deg, transparent, #00c8ff, transparent);
  border-radius: 2px;
}

@keyframes floatCard {
  0%   { transform: translateY(0px); }
  50%  { transform: translateY(-6px); }
  100% { transform: translateY(0px); }
}

h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.2em;
  font-weight: 900;
  color: #00ffaa;
  text-shadow: 0 0 20px rgba(0,255,170,0.6), 0 0 60px rgba(0,255,170,0.2);
  margin-bottom: 0.2em;
  letter-spacing: 3px;
  animation: glitch 6s infinite;
}

@keyframes glitch {
  0%, 90%, 100% { clip-path: none; transform: none; }
  91% {
    clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
    transform: translate(-3px, 0);
    color: #ff003c;
  }
  92% {
    clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
    transform: translate(3px, 0);
    color: #00c8ff;
  }
  93% { clip-path: none; transform: none; color: #00ffaa; }
}

.subtitle {
  font-size: 0.85em;
  color: rgba(0, 200, 255, 0.6);
  letter-spacing: 1px;
  margin-bottom: 1.2em;
  text-transform: uppercase;
}

.box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 200, 255, 0.15);
  padding: 16px 20px;
  border-radius: 4px;
  margin-bottom: 1.2em;
  font-size: 0.9em;
  line-height: 1.7;
  color: #aad4ee;
  text-align: left;
}
.box p { margin: 0 0 0.5em; }
.box p:last-child { margin: 0; }

/* ===== BUTTONS ===== */
#chaosBtn {
  background: transparent;
  border: 1px solid #00ffaa;
  color: #00ffaa;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85em;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 12px 24px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
}
#chaosBtn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,255,170,0);
  transition: background 0.2s;
}
#chaosBtn:hover {
  box-shadow: 0 0 20px rgba(0,255,170,0.4);
  color: #000;
}
#chaosBtn:hover::before { background: rgba(0,255,170,0.9); }
#chaosBtn:active { transform: scale(0.97); }

footer {
  font-size: 0.72em;
  color: rgba(0,200,255,0.3);
  margin-top: 1.2em;
  letter-spacing: 1px;
}

/* ===== SHAKE ===== */
@keyframes shake {
  0%   { transform: translate(1px, 1px) rotate(0deg); }
  10%  { transform: translate(-2px, -2px) rotate(-1deg); }
  20%  { transform: translate(-3px, 0) rotate(1deg); }
  30%  { transform: translate(3px, 2px) rotate(0deg); }
  40%  { transform: translate(1px, -1px) rotate(1deg); }
  50%  { transform: translate(-1px, 2px) rotate(-1deg); }
  60%  { transform: translate(-3px, 1px) rotate(0deg); }
  70%  { transform: translate(3px, 1px) rotate(-1deg); }
  80%  { transform: translate(-1px, -1px) rotate(1deg); }
  90%  { transform: translate(1px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}
.shake { animation: shake 0.5s; }

/* ===== ABILITIES PANEL ===== */
#abilities {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  z-index: 6;
  background: rgba(0, 0, 0, 0.6);
  padding: 10px 16px;
  border: 1px solid rgba(0,200,255,0.2);
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 20px rgba(0,200,255,0.05);
  backdrop-filter: blur(8px);
}
.ability-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.ability {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(0,255,170,0.5);
  color: #00ffaa;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.88em;
  padding: 10px 16px;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.ability:hover:not(:disabled) {
  background: rgba(0,255,170,0.12);
  box-shadow: 0 0 14px rgba(0,255,170,0.4);
}
.ability:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.ability-emp {
  border-color: rgba(255,200,0,0.5);
  color: #ffcc00;
}
.ability-emp:hover:not(:disabled) {
  background: rgba(255,200,0,0.1);
  box-shadow: 0 0 14px rgba(255,200,0,0.4);
}
.ability-captcha {
  border-color: rgba(200,100,255,0.5);
  color: #cc66ff;
}
.ability-captcha:hover:not(:disabled) {
  background: rgba(200,100,255,0.1);
  box-shadow: 0 0 14px rgba(200,100,255,0.4);
}
.cd {
  font-family: 'Orbitron', sans-serif;
  font-size: 10px;
  opacity: 0.7;
  color: inherit;
  height: 14px;
}

/* ===== COMBO POPUP ===== */
#comboPopup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 3em;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 30px #ff6600, 0 0 60px #ff6600;
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.3s;
  letter-spacing: 2px;
}
#comboPopup.show {
  opacity: 1;
  animation: comboPop 0.8s ease-out forwards;
}
@keyframes comboPop {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  30%  { opacity: 1; transform: translate(-50%, -60%) scale(1.2); }
  70%  { opacity: 1; transform: translate(-50%, -70%) scale(1.0); }
  100% { opacity: 0; transform: translate(-50%, -90%) scale(0.9); }
}

/* ===== EVENT MESSAGE ===== */
#eventMsg {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.95em;
  color: #ff3c3c;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,60,60,0.4);
  padding: 8px 20px;
  border-radius: 3px;
  z-index: 8;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
}
#eventMsg.show { opacity: 1; }

/* ===== EMP FLASH ===== */
@keyframes empFlash {
  0%   { background: rgba(255,220,0,0.0); }
  15%  { background: rgba(255,220,0,0.18); }
  100% { background: rgba(255,220,0,0.0); }
}
body.emp-flash::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  animation: empFlash 0.5s ease-out forwards;
}

/* ===== CAPTCHA TRAP VISUAL ===== */
.trap-pulse {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  animation: trapPulse 1.5s ease-out infinite;
}
@keyframes trapPulse {
  0%   { box-shadow: 0 0 0 0 rgba(200,100,255,0.6); }
  70%  { box-shadow: 0 0 0 20px rgba(200,100,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(200,100,255,0); }
}

/* ===== WAVE ALERT ===== */
.wave-alert {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5em;
  font-weight: 900;
  color: #ff003c;
  text-shadow: 0 0 40px rgba(255,0,60,0.8);
  z-index: 25;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  letter-spacing: 4px;
}
.wave-alert.show {
  animation: waveAlert 2.5s ease-in-out forwards;
}
@keyframes waveAlert {
  0%   { opacity: 0; transform: translate(-50%,-50%) scale(1.3); }
  20%  { opacity: 1; transform: translate(-50%,-50%) scale(1.0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%,-50%) scale(0.9); }
}

/* ===== КНОПКА СВОРАЧИВАНИЯ ===== */
#toggleCard {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: 1px solid rgba(0,200,255,0.35);
  color: rgba(0,200,255,0.7);
  font-size: 1em;
  font-family: 'Orbitron', sans-serif;
  padding: 2px 9px;
  border-radius: 3px;
  cursor: pointer;
  line-height: 1.4;
  transition: all 0.15s;
  z-index: 2;
}
#toggleCard:hover {
  background: rgba(0,200,255,0.12);
  color: #00c8ff;
  box-shadow: 0 0 8px rgba(0,200,255,0.3);
  transform: none;
}

/* ===== СВЁРНУТОЕ СОСТОЯНИЕ ===== */
.container.minimized {
  padding: 10px 16px;
  max-width: 260px;
  overflow: hidden;
  animation: none;
  transform: translateY(0);
}
.container.minimized h1 {
  font-size: 1.1em;
  margin: 0;
  display: inline-block;
  vertical-align: middle;
}
.container.minimized .subtitle,
.container.minimized .box,
.container.minimized #chaosBtn,
.container.minimized footer {
  display: none;
}
