body {
  margin: 0;
  background: #0a0f1a;
  color: #e9f6ff;
  font-family: "Roboto", sans-serif;
  overflow-x: hidden;
}

.scanlines {
  pointer-events: none;
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02) 0,
    rgba(255, 255, 255, 0.02) 1px,
    transparent 2px,
    transparent 4px
  );
  opacity: 0.15;
  z-index: 40;
}

/* Animated background */
.bg-animation {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(
      ellipse at 20% 80%,
      rgba(107, 76, 255, 0.15) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 80% 20%,
      rgba(51, 175, 255, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse at 50% 50%,
      rgba(51, 175, 255, 0.05) 0%,
      transparent 60%
    );
  animation: bgPulse 8s ease-in-out infinite;
  z-index: -1;
}

@keyframes bgPulse {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

/* Stars */
.stars {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, white, transparent),
    radial-gradient(
      2px 2px at 40px 70px,
      rgba(255, 255, 255, 0.8),
      transparent
    ),
    radial-gradient(1px 1px at 90px 40px, white, transparent),
    radial-gradient(
      2px 2px at 130px 80px,
      rgba(255, 255, 255, 0.6),
      transparent
    ),
    radial-gradient(1px 1px at 160px 120px, white, transparent);
  background-size: 200px 200px;
  animation: twinkle 4s ease-in-out infinite;
  z-index: -1;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 40px;
  border-bottom: 1px solid rgba(51, 175, 255, 0.25);
  backdrop-filter: blur(6px);
  position: relative;
  z-index: 80;
}

.logo {
  font-family: "Orbitron", sans-serif;
  font-size: 28px;
  color: #33afff;
  text-shadow: 0 0 12px #33afff;
  margin: 0;
}

.nav a {
  color: #e9f6ff;
  margin-left: 25px;
  text-decoration: none;
  font-size: 16px;
  transition: 0.3s;
}

.nav a:hover {
  color: #33afff;
  text-shadow: 0 0 10px #33afff;
}

.header-buttons {
  display: flex;
  gap: 15px;
  align-items: center;
}

.boot-button {
  padding: 10px 26px;
  font-family: "Orbitron";
  border: 2px solid #33afff;
  background: rgba(10, 15, 25, 0.7);
  color: #33afff;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.25s;
  box-shadow:
    0 0 8px #33afff inset,
    0 0 12px #33afff;
  backdrop-filter: blur(5px);
}

.boot-button:hover {
  background: #33afff;
  color: #05070d;
  transform: translateY(-2px);
}

/* Emergency Button */
.emergency-button {
  padding: 10px 26px;
  font-family: "Orbitron";
  border: 2px solid #ff3333;
  background: rgba(255, 0, 0, 0.2);
  color: #ff3333;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.25s;
  box-shadow:
    0 0 8px #ff3333 inset,
    0 0 12px #ff3333;
  backdrop-filter: blur(5px);
  font-size: 14px;
  font-weight: bold;
}

.emergency-button:hover {
  background: #ff3333;
  color: #fff;
  transform: translateY(-2px);
  box-shadow:
    0 0 15px #ff3333 inset,
    0 0 25px #ff3333;
}

.emergency-button.active {
  background: #ff3333;
  color: #fff;
  animation: emergencyPulse 0.5s infinite;
}

@keyframes emergencyPulse {
  0%, 100% { box-shadow: 0 0 15px #ff3333 inset, 0 0 25px #ff3333; }
  50% { box-shadow: 0 0 30px #ff3333 inset, 0 0 50px #ff3333; }
}

/* Emergency Overlay */
.emergency-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: flashRed 0.5s infinite;
}

.emergency-overlay.active {
  display: flex;
}

@keyframes flashRed {
  0%, 100% { background: rgba(0, 0, 0, 0.9); }
  50% { background: rgba(139, 0, 0, 0.9); }
}

.locked-content {
  text-align: center;
  color: #ff3333;
  animation: lockShake 0.1s infinite;
}

@keyframes lockShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.lock-icon {
  font-size: 120px;
  margin-bottom: 20px;
  animation: lockPulse 1s infinite;
}

@keyframes lockPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 20px #ff3333); }
  50% { transform: scale(1.1); filter: drop-shadow(0 0 40px #ff0000); }
}

.locked-content h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 48px;
  margin: 0 0 15px 0;
  text-shadow: 0 0 20px #ff3333;
  letter-spacing: 5px;
}

.locked-content p {
  font-size: 20px;
  margin: 10px 0;
  opacity: 0.8;
}

.locked-content .blink-text {
  animation: blinkText 0.5s infinite;
}

@keyframes blinkText {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Emergency Mode Body Effect */
body.emergency-mode {
  animation: bodyFlash 0.5s infinite;
}

@keyframes bodyFlash {
  0%, 100% { background: #0a0f1a; }
  50% { background: #2a0a0a; }
}

body.emergency-mode .module-card {
  pointer-events: none;
  border-color: #ff3333 !important;
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.4) !important;
  position: relative;
}

body.emergency-mode .module-card::after {
  content: "🔒 LOCKED";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Orbitron", sans-serif;
  font-size: 24px;
  color: #ff3333;
  border-radius: 18px;
  text-shadow: 0 0 15px #ff3333;
}

body.emergency-mode .side-panel {
  border-color: #ff3333 !important;
  box-shadow: 0 0 40px rgba(255, 0, 0, 0.4) !important;
}

body.emergency-mode .side-panel h2 {
  color: #ff3333 !important;
  text-shadow: 0 0 10px #ff3333 !important;
}

body.emergency-mode .side-panel li::before {
  background: #ff3333 !important;
  box-shadow: 0 0 8px #ff3333 !important;
}

body.emergency-mode .logo {
  color: #ff3333 !important;
  text-shadow: 0 0 20px #ff3333 !important;
  animation: logoFlash 0.3s infinite;
}

@keyframes logoFlash {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

body.emergency-mode .boot-button {
  pointer-events: none;
  border-color: #ff3333 !important;
  color: #ff3333 !important;
  box-shadow: 0 0 8px #ff3333 inset, 0 0 12px #ff3333 !important;
  opacity: 0.5;
}

.dashboard {
  display: grid;
  grid-template-columns: 2fr 1fr;
  padding: 40px 40px 80px;
  gap: 40px;
}

.modules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
}

.module-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(51, 175, 255, 0.45);
  padding: 26px;
  border-radius: 18px;
  text-decoration: none;
  color: #e9f6ff;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(51, 175, 255, 0.12);
  transition: 0.25s;
}

.module-card h2 {
  margin: 0 0 10px 0;
  font-family: "Orbitron";
  font-size: 28px;
  color: #33afff;
  text-shadow: 0 0 10px #33afff;
}

.module-card p {
  font-size: 18px;
  opacity: 0.85;
}

.module-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: #33afff;
  box-shadow: 0 0 50px rgba(51, 175, 255, 0.35);
}

.module-card.casino {
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.15);
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.08),
    rgba(0, 100, 0, 0.1)
  );
}

.module-card.casino h2 {
  color: #ffd700;
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.7);
}

.module-card.casino:hover {
  border-color: #ffd700;
  box-shadow: 0 0 60px rgba(255, 215, 0, 0.4);
}

.side-panels {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.side-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(51, 175, 255, 0.45);
  padding: 26px;
  border-radius: 18px;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(51, 175, 255, 0.12);
  transition: 0.25s;
}

.side-panel h2 {
  font-family: "Orbitron";
  margin: 0 0 12px 0;
  font-size: 22px;
  color: #33afff;
  text-shadow: 0 0 10px #33afff;
}

.side-panel ul {
  list-style: none;
  padding-left: 0;
  text-align: left;
}

.side-panel li {
  position: relative;
  padding-left: 22px;
  text-align: left;
}

.side-panel li::before {
  content: "";
  width: 10px;
  height: 10px;
  background: #33afff;
  box-shadow: 0 0 8px #33afff;
  border-radius: 50%;
  position: absolute;
  left: 0;
  top: 5px;
}

.side-panel li.warning {
  color: #ffcc00;
}

.side-panel li.error {
  color: #ff3b3b;
}

@keyframes flicker {
  0% {
    opacity: 0.92;
  }
  20% {
    opacity: 1;
  }
  40% {
    opacity: 0.85;
  }
  60% {
    opacity: 0.97;
  }
  80% {
    opacity: 0.9;
  }
  100% {
    opacity: 1;
  }
}

.side-panel li {
  animation: flicker 1.2s infinite ease-in-out;
}

#telemetryGraph {
  margin-top: 15px;
  width: 100%;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px #33afff);
}

.side-panel.warning {
  border-color: #ffcc00;
  box-shadow: 0 0 40px rgba(255, 204, 0, 0.4);
}

.side-panel.error {
  border-color: #ff3b3b;
  box-shadow: 0 0 40px rgba(255, 59, 59, 0.4);
}

.module-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(51, 175, 255, 0.45);
  padding: 26px;
  border-radius: 18px;
  text-decoration: none;
  color: #e9f6ff;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 40px rgba(51, 175, 255, 0.12);
  transition: 0.25s;

  text-align: center;

  display: flex;
  flex-direction: column;
  justify-content: center;
}
