:root {
  --mars-red: #c1440e;
  --rust-orange: #e8622a;
  --dust-brown: #8b4513;
  --sand-ochre: #c8922a;
  --pale-dust: #e8d5b0;

  --signal-cyan: #00d4ff;
  --oxygen-blue: #4a90d9;
  --alert-red: #ff3b3b;
  --safe-green: #3dba6f;
  --energy-yellow: #ffb800;

  --bg-deep-space: #0a0a0f;
  --bg-night-mars: #1a0d08;
  --bg-dark-panel: #1c1c2e;

  --text-primary: #e8d5b0;
  --text-secondary: #a08060;
  --text-muted: #5c4030;
  --text-on-accent: #ffffff;

  --font-main: "Orbitron", "Courier New", monospace;
  --font-body: "Rajdhani", "Arial", sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 32px;

  --transition-fast: 0.15s ease;
  --transition-mid: 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-image: radial-gradient(circle at 50% 0%, #1c1c2e 0%, #0a0a0f 80%);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
}

/*ефект скла для блока*/
.glass-effect {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.mars-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  border-bottom: 1px solid rgba(193, 68, 14, 0.3);
  z-index: 1000;
  background: rgba(23, 23, 33, 0.45);
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.logo-text {
  font-family: var(--font-main);
  font-weight: 900;
  font-size: 1.4rem;
  color: var(--mars-red);
  letter-spacing: 2px;
  text-shadow: 0 0 10px rgba(193, 68, 14, 0.6);
}

.pulse-ring {
  width: 12px;
  height: 12px;
  background-color: var(--alert-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--alert-red);
  animation: pulseAlert 1.5s infinite;
}

@keyframes pulseAlert {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 59, 59, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0);
  }
}

.nav-menu {
  display: flex;
  gap: var(--spacing-lg);
}

.nav-link {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: var(--spacing-xs) 0;
  position: relative;
  transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(193, 68, 14, 0.8);
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--mars-red);
  transition: var(--transition-mid);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
  box-shadow: 0 0 8px var(--mars-red);
}

.system-status {
  font-family: var(--font-main);
  font-size: 0.9rem;
  display: flex;
  gap: var(--spacing-xs);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-default);
}

.status-label {
  color: var(--text-muted);
}
.status-value {
  color: var(--safe-green);
  font-weight: 700;
  text-shadow: 0 0 8px rgba(61, 186, 111, 0.6);
}

.button-wrapper {
  display: flex;
  justify-content: center;
}

.hero {
  padding-top: 120px;
  height: 700px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url("../images/mars-base.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

/* Затінення картинки*/
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 15, 0.2) 0%,
    rgba(10, 10, 15, 1) 100%
  );
}

.hero-container {
  position: relative;
  z-index: 10;
  max-width: 800px;
  padding: 60px 40px;
  text-align: center;
  border-radius: var(--radius-xl);
  /*легке світіння блоку*/
  box-shadow: 0 0 40px rgba(193, 68, 14, 0.15);
}

.hero h1 {
  font-family: var(--font-main);
  font-size: 4.5rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow:
    0 0 20px rgba(193, 68, 14, 0.8),
    0 0 40px rgba(255, 59, 59, 0.4);
}

.hero-subtitle {
  font-size: 1.4rem;
  line-height: 1.6;
  color: var(--pale-dust);
  margin-bottom: 40px;
}

.btn-critical {
  /*червона тінь та анімація пульсації*/
  box-shadow: 0 0 20px rgba(255, 59, 59, 0.4);
  animation: critical-pulse 2s infinite ease-in-out;
}

/*фон з темно-червоним градієнтом */
.btn-critical .btn-background {
  background: linear-gradient(135deg, #3d0808 0%, #8b0000 50%, #ff3b3b 100%);
}

.btn-critical .btn-border {
  border: 2px solid rgba(255, 59, 59, 0.8);
}

.btn-critical .btn-text {
  text-shadow: 0 0 10px rgba(255, 59, 59, 0.8);
}

/*анімація пульсації*/
@keyframes critical-pulse {
  0% {
    box-shadow:
      0 0 15px rgba(255, 59, 59, 0.4),
      inset 0 0 10px rgba(255, 59, 59, 0.2);
  }
  50% {
    box-shadow:
      0 0 35px rgba(255, 59, 59, 0.7),
      inset 0 0 20px rgba(255, 59, 59, 0.4);
  }
  100% {
    box-shadow:
      0 0 15px rgba(255, 59, 59, 0.4),
      inset 0 0 10px rgba(255, 59, 59, 0.2);
  }
}

.btn-critical:hover {
  animation: none; /*Зупинення звичайної пульсації при наведенні*/
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 0 50px rgba(255, 59, 59, 1);
}

.btn-critical {
  box-shadow:
    0 0 15px rgba(255, 59, 59, 0.4),
    inset 0 0 10px rgba(255, 59, 59, 0.2);

  animation: critical-pulse 2s infinite ease-in-out;
}

/* Глибокий металевий градієнт */
.btn-critical .btn-background {
  background: linear-gradient(135deg, #1a0000 0%, #5c0000 40%, #ff3b3b 100%);
}

/* рамка з ефектом світіння */
.btn-critical .btn-border {
  border: 2px solid rgba(255, 59, 59, 0.9);
  box-shadow:
    0 0 10px rgba(255, 59, 59, 0.7),
    inset 0 0 10px rgba(255, 59, 59, 0.3);
}

.btn-critical .btn-text {
  color: #fff;
  text-shadow:
    0 0 8px rgba(255, 59, 59, 1),
    0 0 20px rgba(255, 0, 0, 0.6);
}

.btn-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px rgba(255, 59, 59, 0.9));
}

.btn-critical:hover {
  animation: none;

  transform: translateY(-4px) scale(1.03);

  box-shadow:
    0 0 40px rgba(255, 59, 59, 0.9),
    inset 0 0 20px rgba(255, 59, 59, 0.4);
}

.btn-ultra::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(255, 59, 59, 0.3);
  border-radius: 10px;
  z-index: 2;
}

.btn-ultra {
  position: relative;
  display: inline-block;
  padding: 18px 40px;
  text-decoration: none;
  font-family: var(--font-main);
  letter-spacing: 2px;
  text-transform: uppercase;
  overflow: hidden;
  border-radius: 12px;
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.4s ease,
    filter 0.4s ease;
}

.btn-background {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.btn-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
}

.btn-border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 4;
  pointer-events: none;
}

.btn-scan-line {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  z-index: 2;
  transform: skewX(-20deg);
  animation: scanMove 3s infinite linear;
}

@keyframes scanMove {
  0% {
    left: -100%;
  }
  100% {
    left: 150%;
  }
}

.incident-section {
  padding: 150px 20px;
  position: relative;
  /* Легкий червоний градієнт знизу */
  background: linear-gradient(
    180deg,
    var(--bg-deep-space) 0%,
    rgba(255, 59, 59, 0.05) 100%
  );
  overflow: hidden;
}

/*космічна сітка на фоні */
.incident-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  pointer-events: none;
}

.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  z-index: 2;
  margin-bottom: 200px;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(-50%);
  border-radius: 4px;
  overflow: hidden;
}

/* Ця штука буде росте при скролі (через JS) */
.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(
    to bottom,
    var(--signal-cyan),
    var(--energy-yellow),
    var(--alert-red),
    #ff0000
  );
  box-shadow: 0 0 15px var(--alert-red);
  transition: height 0.2s ease-out;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 120px;
  position: relative;
}

.timeline-item.left {
  flex-direction: row-reverse;
}
.timeline-item.right {
  flex-direction: row;
}

/*хованн контенту до скролу*/
.timeline-content {
  width: 45%;
  padding: 30px;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Анімація вильоту з боків */
.timeline-item.left .timeline-content {
  transform: translateX(-100px) scale(0.9);
}
.timeline-item.right .timeline-content {
  transform: translateX(100px) scale(0.9);
}

.timeline-item.active .timeline-content {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.time-stamp {
  font-family: var(--font-main);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 10px;
  display: block;
}

.timeline-content h3 {
  font-family: var(--font-main);
  letter-spacing: 1px;
  margin-bottom: 15px;
  font-size: 1.6rem;
}

.timeline-content p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* При наведенні картка підіймається  */
.timeline-content:hover {
  transform: translateY(-5px) scale(1.02) !important;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  z-index: 3;
  border: 4px solid var(--bg-deep-space);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s;
}

.timeline-item.active .timeline-dot {
  transform: translate(-50%, -50%) scale(1);
}

.timeline-dot.safe {
  background: var(--safe-green);
  box-shadow: 0 0 15px var(--safe-green);
}
.timeline-dot.warning {
  background: var(--energy-yellow);
  box-shadow: 0 0 15px var(--energy-yellow);
}
.timeline-dot.danger {
  background: var(--alert-red);
  box-shadow: 0 0 20px var(--alert-red);
}

.timeline-dot.critical {
  background: #ff0000;
  box-shadow: 0 0 30px #ff0000;
  animation: pulseCritical 1s infinite;
}

.glitch-text {
  position: relative;
  color: var(--alert-red);
}
.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}
.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 #00d4ff;
  animation: glitch-anim 2s infinite linear alternate-reverse;
}
.glitch-text::after {
  left: -2px;
  text-shadow: -2px 0 #ffb800;
  animation: glitch-anim 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% {
    clip-path: inset(20% 0 80% 0);
  }
  20% {
    clip-path: inset(60% 0 10% 0);
  }
  40% {
    clip-path: inset(40% 0 50% 0);
  }
  60% {
    clip-path: inset(80% 0 5% 0);
  }
  80% {
    clip-path: inset(10% 0 70% 0);
  }
  100% {
    clip-path: inset(30% 0 20% 0);
  }
}

.danger-border {
  border: 1px solid rgba(255, 59, 59, 0.3);
}
.critical-box {
  background: rgba(50, 0, 0, 0.6);
}
.critical-text {
  color: var(--alert-red);
  font-weight: 900;
  animation: blink 1s infinite;
}

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

@media (max-width: 768px) {
  .timeline-line {
    left: 30px;
  }
  .timeline-item.left,
  .timeline-item.right {
    flex-direction: row;
    justify-content: flex-end;
  }
  .timeline-content {
    width: calc(100% - 60px);
  }
  .timeline-dot {
    left: 30px;
  }

  /* Змінення напрямка вильоту для мобілок */
  .timeline-item.left .timeline-content,
  .timeline-item.right .timeline-content {
    transform: translateX(50px) scale(0.9);
  }
}

/* Трясучка для останньої картки*/
.shake-danger.active .timeline-content {
  animation: shakeIt 0.3s infinite;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
  border-color: red;
}

/*кадри для ефекту поломки/землетрусу */
@keyframes shakeIt {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  20% {
    transform: translate(-2px, 0px) rotate(-1deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  60% {
    transform: translate(-1px, 2px) rotate(0deg);
  }
  80% {
    transform: translate(2px, -1px) rotate(-1deg);
  }
  100% {
    transform: translate(0px, 1px) rotate(0deg);
  }
}

.section-title {
  font-family: var(--font-main);
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 60px;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(193, 68, 14, 0.8);
}
.base-monitor {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(193, 68, 14, 0.3);
}

.mars-view {
  position: absolute;
  width: 100%;
  height: 100%;
}

.mars-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;

  /* реалістичний слабкий сигнал */
  filter: contrast(1.05) brightness(0.95) saturate(0.95);
  animation: subtleMove 20s ease-in-out infinite;
}

@keyframes subtleMove {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02) translate(-5px, -2px);
  }
  100% {
    transform: scale(1);
  }
}

.overlay-scan {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;

  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 4px
  );

  opacity: 0.15;
}

.hud-text {
  position: absolute;
  top: 15px;
  left: 20px;
  color: var(--signal-cyan);
  font-family: var(--font-main);
  font-size: 0.9rem;
  letter-spacing: 2px;
  opacity: 0.6;
}

.resources h2 {
  margin-bottom: 20px;
}

.res-item {
  margin-bottom: 20px;
}

.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

.bar {
  height: 100%;
  border-radius: 5px;
}

.bar-oxygen {
  width: 85%;
  background: var(--oxygen-blue);
}
.bar-energy {
  width: 60%;
  background: var(--energy-yellow);
}
.bar-water {
  width: 45%;
  background: var(--signal-cyan);
}
.bar-crew {
  width: 90%;
  background: var(--alert-red);
}

.event-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  margin: 15px 0;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

button {
  padding: 10px;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
}

.btn-repair {
  background: var(--safe-green);
  color: #fff;
}

.btn-ignore {
  background: transparent;
  border: 1px solid var(--alert-red);
  color: var(--alert-red);
}

.base-monitor {
  transition: opacity 0.4s;
}

.main-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 20px;
  height: calc(100vh - 80px);
  padding: 20px;
}

.resources,
.events {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.base-monitor {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(193, 68, 14, 0.4);
  background: black;
}

.mars-view img {
  filter: contrast(1.05) brightness(0.95) saturate(0.95);
  transition: 0.5s;
}

.base-monitor.normal img {
  filter: contrast(1.05) brightness(0.95);
}

.base-monitor.alert img {
  filter: brightness(0.7) contrast(1.2) sepia(0.3);
}

.hud-text {
  color: #00d4ff;
  opacity: 0.7;
  font-size: 0.8rem;
}

@keyframes pulseAlert {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(255, 59, 59, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 59, 59, 0);
  }
}

/*Сітка сторінки*/
.main-layout {
  margin-top: 80px;
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 20px;
  min-height: calc(100vh - 80px);
  padding: 20px;
}

.glass-panel {
  background: rgba(26, 26, 35, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  padding: 20px;
  border-radius: var(--radius-md);
}

.resources,
.events {
  display: flex;
  flex-direction: column;
}

.resources h2 {
  font-family: var(--font-main);
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: var(--text-on-accent);
}

.res-item {
  margin-bottom: 20px;
}

.res-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
  font-weight: 700;
}

.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
}

.bar {
  height: 100%;
  border-radius: 5px;
  transition: width 0.5s ease;
}

.bar-oxygen {
  width: 85%;
  background: var(--oxygen-blue);
}
.bar-energy {
  width: 60%;
  background: var(--energy-yellow);
}
.bar-water {
  width: 45%;
  background: var(--signal-cyan);
}
.bar-crew {
  width: 90%;
  background: var(--alert-red);
}

.base-monitor {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(193, 68, 14, 0.4);
  background: black;
  transition: opacity 0.4s;
  min-height: 400px;
}

.mars-view {
  position: absolute;
  width: 100%;
  height: 100%;
}

.mars-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05) brightness(0.95) saturate(0.95);
  transition: 0.5s;
  animation: subtleMove 20s ease-in-out infinite;
}

@keyframes subtleMove {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02) translate(-5px, -2px);
  }
  100% {
    transform: scale(1);
  }
}

/* стани аварії */
.base-monitor.alert img {
  filter: brightness(0.7) contrast(1.2) sepia(0.3);
}

.overlay-scan {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.12) 4px
  );
  opacity: 0.15;
}

.overlay-noise {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: url("https://www.transparenttextures.com/patterns/noise.png");
  opacity: 0.05;
}

.hud-text {
  position: absolute;
  top: 15px;
  left: 20px;
  color: var(--signal-cyan);
  font-family: var(--font-main);
  font-size: 0.9rem;
  letter-spacing: 2px;
  opacity: 0.7;
}

.events h2 {
  font-family: var(--font-main);
  margin-bottom: 20px;
  font-size: 1.2rem;
  color: var(--text-on-accent);
}

.event-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--energy-yellow);
}

.event-box p {
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}

button {
  padding: 12px;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-repair {
  background: var(--safe-green);
  color: #fff;
}

.btn-repair:hover {
  background: #2e9655;
  box-shadow: 0 0 10px rgba(61, 186, 111, 0.5);
}

.btn-ignore {
  background: transparent;
  border: 1px solid var(--alert-red);
  color: var(--alert-red);
}

.btn-ignore:hover {
  background: rgba(255, 59, 59, 0.1);
  box-shadow: 0 0 10px rgba(255, 59, 59, 0.3);
}

@media (max-width: 1024px) {
  .main-layout {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
  }

  .base-monitor {
    grid-column: 1 / -1;
    min-height: 450px;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 var(--spacing-md);
  }

  .logo-text {
    font-size: 1.1rem;
  }

  .main-layout {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 15px;
  }

  .base-monitor {
    grid-column: 1 / -1;
    min-height: 300px;
    order: -1;
  }

  .resources,
  .events {
    padding: 15px;
  }

  .btn-group {
    flex-direction: row;
  }

  .btn-group button {
    flex: 1;
    font-size: 0.85rem;
    padding: 10px 5px;
  }
}

.game-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.game-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  background: var(--bg-dark-panel);
  border: 2px solid var(--alert-red);
  padding: 40px;
  border-radius: var(--radius-lg);
  text-align: center;
  max-width: 600px;
  box-shadow: 0 0 50px rgba(255, 59, 59, 0.3);
}

.modal-content h1 {
  font-family: var(--font-main);
  color: var(--alert-red);
  font-size: 2.5rem;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.modal-content.win {
  border-color: var(--safe-green);
  box-shadow: 0 0 50px rgba(61, 186, 111, 0.3);
}

.modal-content.win h1 {
  color: var(--safe-green);
}

.modal-content p {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}

.btn-refill {
  padding: 2px 8px;
  font-size: 0.7rem;
  background: var(--safe-green);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.5;
  pointer-events: none;
  transition: 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-refill:hover {
  transform: scale(1.1);
  background: #2e9655;
}

.points-panel {
  margin-top: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--signal-cyan);
  text-align: center;
  border-radius: var(--radius-sm);
}

.points-label {
  font-family: var(--font-main);
  font-size: 0.8rem;
  color: var(--signal-cyan);
}

.points-value {
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 15px var(--signal-cyan);
}

.points-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-choice {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--signal-cyan);
  color: var(--signal-cyan);
  margin-bottom: 10px;
  text-align: left;
  padding: 12px 15px;
}

.btn-choice:hover {
  background: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.btn-choice.risk {
  border-color: var(--energy-yellow);
  color: var(--energy-yellow);
}

.btn-choice.risk:hover {
  background: rgba(255, 184, 0, 0.2);
  box-shadow: 0 0 10px rgba(255, 184, 0, 0.4);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-refill {
  padding: 2px 8px;
  font-size: 0.7rem;
  background: var(--safe-green);
  color: white;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.3;
  pointer-events: none; /* вимикаємо клік поки немає балів */
  transition: 0.3s;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-family: var(--font-main);
  font-weight: bold;
}

/* Коли бали є, ця кнопка стає активною */
.btn-refill.active {
  opacity: 1;
  pointer-events: auto;
  box-shadow: 0 0 10px rgba(61, 186, 111, 0.4);
}

.btn-refill.active:hover {
  transform: scale(1.1);
  background: #2e9655;
}

/* Панель для балів */
.points-panel {
  margin-top: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--signal-cyan);
  text-align: center;
  border-radius: var(--radius-sm);
}

.points-label {
  font-family: var(--font-main);
  font-size: 0.8rem;
  color: var(--signal-cyan);
}

.points-value {
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 15px var(--signal-cyan);
}

.points-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bar-temperature {
  background-color: #ff6b00;
}
.bar-sanity {
  background-color: #b500ff;
}
.bar-ai {
  background-color: #00ffcc;
}

.btn-choice {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--signal-cyan);
  color: var(--signal-cyan);
  margin-bottom: 10px;
  text-align: left;
  padding: 12px 15px;
  width: 100%;
  cursor: pointer;
  transition: 0.2s;
  font-family: var(--font-main);
}

.btn-choice:hover {
  background: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.points-panel {
  margin-top: 20px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed var(--signal-cyan);
  text-align: center;
  border-radius: 8px;
}

.points-label {
  font-family: var(--font-main);
  font-size: 0.8rem;
  color: var(--signal-cyan);
}

.points-value {
  font-family: var(--font-main);
  font-size: 2rem;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 15px var(--signal-cyan);
}

.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--alert-red);
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 8px var(--alert-red);
  animation: recBlink 1s infinite;
}

@keyframes recBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

.cam-timer {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.overlay-noise {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: url("https://www.transparenttextures.com/patterns/noise.png");
  opacity: 0.08;
  animation: noiseJitter 0.2s infinite linear;
}

@keyframes noiseJitter {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 100px 100px;
  }
}

.overlay-scan {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.2) 4px
  );
  opacity: 0.2;
  animation: scanlineMove 10s infinite linear;
}

@keyframes scanlineMove {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 0 100vh;
  }
}

.mars-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.1) brightness(0.9) saturate(0.85) sepia(0.1);
  transition:
    filter 0.1s ease,
    transform 0.1s ease; /* швидкий перехід для різких глюків */
}

.glitch-bars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 5;
}

.glitch-bar {
  position: absolute;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  mix-blend-mode: overlay; /* щоб воно гарно накладалось на картинку */
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.glitch-bar.red {
  background: rgba(255, 59, 59, 0.3);
}

/*ефект лагу */
.crt-screen {
  position: relative;
  overflow: hidden;
}

.crt-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.2));
  mix-blend-mode: overlay;
  pointer-events: none;
}

.crt-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 2px
  );
  animation: crtFlicker 0.15s infinite;
  opacity: 0.2;
}

@keyframes crtFlicker {
  0% {
    opacity: 0.15;
  }
  50% {
    opacity: 0.25;
  }
  100% {
    opacity: 0.15;
  }
}

.glitch-text {
  position: relative;
  color: var(--alert-red);
  animation: glitchMain 2s infinite;
}

@keyframes glitchMain {
  0% {
    transform: none;
  }
  20% {
    transform: skewX(5deg);
  }
  40% {
    transform: translateX(-2px);
  }
  60% {
    transform: translateX(2px);
  }
  80% {
    transform: skewX(-3deg);
  }
  100% {
    transform: none;
  }
}

.radar-circle {
  position: relative;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  border: 1px solid rgba(0, 255, 200, 0.2);
  background: radial-gradient(circle, rgba(0, 255, 200, 0.05), transparent);
  overflow: hidden;
}

.radar-sweep {
  position: absolute;
  width: 100%;
  height: 100%;
  background: conic-gradient(rgba(0, 255, 200, 0.4) 0deg, transparent 60deg);
  animation: radarSpin 3s linear infinite;
}

@keyframes radarSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.target-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  background: red;
  border-radius: 50%;
  box-shadow: 0 0 15px red;
  animation: targetBlink 1s infinite;
}

@keyframes targetBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

.strength-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, red, orange, yellow, lime, cyan);
  box-shadow: 0 0 10px currentColor;
  transition: width 0.2s ease;
}

.glass-panel {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.glass-panel:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.sidebar {
  width: 340px;
  background: #0a0a0a;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
}

.panel-header {
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-header h2 {
  color: #00ffe7;
  margin-bottom: 6px;
}

.panel-subtitle {
  color: #888;
  font-size: 13px;
}

.panel-content {
  padding: 20px;
}

.panel-description {
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px;
  border-radius: 6px;
}

.stat-label {
  font-size: 11px;
  color: #888;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 18px;
  color: white;
}

.progress-wrap {
  margin-bottom: 20px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #aaa;
  font-size: 13px;
}

.progress-bar {
  height: 6px;
  background: #222;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  width: 92%;
  height: 100%;
  background: #00ffe7;
}

.alert-box {
  padding: 14px;
  background: rgba(255, 80, 0, 0.08);
  border-left: 3px solid #ff5522;
  color: #ffccbb;
  line-height: 1.5;
}

.app {
  display: flex;
  height: 100vh;
}

.workspace {
  flex: 1;
  display: flex;
  overflow: hidden;
  margin-top: 75px;
}

.map-wrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.map-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 49px,
      rgba(192, 57, 43, 0.07) 50px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 49px,
      rgba(192, 57, 43, 0.07) 50px
    );
  pointer-events: none;
  z-index: 0;
}
.map-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 55% 55% at 50% 54%,
    rgba(150, 30, 10, 0.22) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

#base-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.zone {
  cursor: pointer;
  transition:
    filter 0.2s,
    opacity 0.2s;
}
.zone:hover .zone-shape {
  filter: brightness(1.6);
}
.zone:hover .zone-ring {
  opacity: 1;
}

.zone-shape {
  transition: filter 0.25s;
}
.zone-ring {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.5;
  opacity: 0;
  transition: opacity 0.25s;
}
.zone.active .zone-shape {
  filter: brightness(1.9);
}
.zone.active .zone-ring {
  opacity: 1;
  animation: pulse-ring 1.6s ease-in-out infinite;
}
@keyframes pulse-ring {
  0%,
  100% {
    stroke-opacity: 1;
    stroke-width: 1.5;
  }
  50% {
    stroke-opacity: 0.35;
    stroke-width: 3;
  }
}

/* Zone labels */
.zone-label {
  font-family: "Orbitron", monospace;
  font-size: 7px;
  fill: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.06em;
  pointer-events: none;
  text-anchor: middle;
}
.zone-icon {
  font-size: 12px;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
}

.conn-line {
  stroke: rgba(192, 57, 43, 0.28);
  stroke-width: 1;
  stroke-dasharray: 4 5;
  fill: none;
  animation: dash-flow 3s linear infinite;
}
@keyframes dash-flow {
  to {
    stroke-dashoffset: -18;
  }
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 255, 231, 0.18) 40%,
    rgba(0, 255, 231, 0.35) 50%,
    rgba(0, 255, 231, 0.18) 60%,
    transparent 100%
  );
  animation: scan 5s linear infinite;
  pointer-events: none;
  z-index: 2;
}
@keyframes scan {
  0% {
    top: -2px;
  }
  100% {
    top: 100%;
  }
}

.compass {
  position: absolute;
  bottom: 18px;
  left: 22px;
  width: 52px;
  height: 52px;
  z-index: 3;
  opacity: 0.55;
}

.scale-bar {
  position: absolute;
  bottom: 22px;
  right: 22px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.scale-bar-line {
  width: 80px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0,
    var(--cyan) 10%,
    var(--cyan) 90%,
    transparent 100%
  );
}
.scale-bar-text {
  font-family: "Orbitron", monospace;
  font-size: 7px;
  color: var(--cyan);
  opacity: 0.6;
  letter-spacing: 0.08em;
}

.side-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--panel-bg);
  border-left: 1px solid rgba(192, 57, 43, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 14px 18px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.panel-header h2 {
  font-family: "Orbitron", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--cyan);
}
.panel-header .sub {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 2px;
  letter-spacing: 0.06em;
}

.zone-list {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.zone-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
  color: rgba(255, 255, 255, 0.6);
  font-family: "Rajdhani", sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}
.zone-btn:hover {
  background: rgba(192, 57, 43, 0.12);
  border-color: rgba(192, 57, 43, 0.35);
  color: #fff;
}
.zone-btn.active {
  background: rgba(0, 255, 231, 0.07);
  border-color: var(--cyan);
  color: var(--cyan);
}
.zone-btn .zb-icon {
  font-size: 1rem;
  flex-shrink: 0;
}
.zone-btn .zb-status {
  margin-left: auto;
  font-size: 0.65rem;
  font-family: "Orbitron", monospace;
  padding: 1px 5px;
  border-radius: 2px;
}
.status-ok {
  background: rgba(0, 255, 100, 0.12);
  color: #00ff88;
  border: 1px solid rgba(0, 255, 100, 0.3);
}
.status-warn {
  background: rgba(255, 170, 0, 0.12);
  color: var(--amber);
  border: 1px solid rgba(255, 170, 0, 0.3);
}
.status-crit {
  background: rgba(255, 60, 0, 0.15);
  color: var(--red-glow);
  border: 1px solid rgba(255, 60, 0, 0.3);
}

/* Detail pane */
.detail-pane {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}
.detail-pane::-webkit-scrollbar {
  width: 3px;
}
.detail-pane::-webkit-scrollbar-thumb {
  background: rgba(192, 57, 43, 0.4);
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 10px;
  opacity: 0.3;
}
.detail-empty .big-icon {
  font-size: 2.5rem;
}
.detail-empty p {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-align: center;
}

.detail-zone {
  display: none;
}
.detail-zone.visible {
  display: block;
  animation: fade-in 0.3s ease;
}
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dz-title {
  font-family: "Orbitron", monospace;
  font-size: 1rem;
  color: #fff;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.dz-subtitle {
  font-size: 0.75rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
  opacity: 0.7;
  margin-bottom: 14px;
}
.dz-desc {
  font-size: 0.88rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--dim);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 3px;
  padding: 8px 10px;
}
.stat-label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 4px;
}
.stat-value {
  font-family: "Orbitron", monospace;
  font-size: 0.9rem;
  color: #fff;
}
.stat-value.ok {
  color: #00ff88;
}
.stat-value.warn {
  color: var(--amber);
}
.stat-value.crit {
  color: var(--red-glow);
}

.mini-bar-wrap {
  margin-bottom: 12px;
}
.mini-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 4px;
  letter-spacing: 0.06em;
}
.mini-bar-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 2px;
  overflow: hidden;
}
.mini-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}
.fill-ok {
  background: linear-gradient(90deg, #00cc66, #00ff88);
}
.fill-warn {
  background: linear-gradient(90deg, #cc8800, var(--amber));
}
.fill-crit {
  background: linear-gradient(90deg, #cc2200, var(--red-glow));
}

.crew-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.crew-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}
.crew-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  flex-shrink: 0;
}

.alert-box {
  padding: 8px 12px;
  border-left: 2px solid var(--red-glow);
  background: rgba(255, 60, 0, 0.07);
  font-size: 0.78rem;
  color: rgba(255, 200, 180, 0.8);
  line-height: 1.5;
  border-radius: 0 3px 3px 0;
  margin-top: 4px;
}
.alert-box.ok {
  border-color: #00ff88;
  background: rgba(0, 255, 100, 0.05);
  color: rgba(180, 255, 210, 0.8);
}

#map-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(5, 2, 1, 0.92);
  border: 1px solid rgba(0, 255, 231, 0.35);
  padding: 5px 10px;
  border-radius: 3px;
  font-family: "Orbitron", monospace;
  font-size: 0.62rem;
  color: var(--cyan);
  letter-spacing: 0.08em;
  white-space: nowrap;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.15s;
}

.map-wrap {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.map-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-zone {
  position: absolute;

  transform: translate(-50%, -50%);

  background: none;
  border: none;

  display: flex;
  align-items: center;

  cursor: pointer;

  z-index: 20;
}

.map-zone-dot {
  width: 10px;
  height: 10px;

  border-radius: 50%;

  background: #00ffe7;

  box-shadow: 0 0 10px rgba(0, 255, 231, 0.8);

  flex-shrink: 0;
}

.map-zone-line {
  width: 65px;
  height: 2px;

  margin: 0 10px;

  background: linear-gradient(
    90deg,
    rgba(0, 255, 231, 0.8),
    rgba(0, 255, 231, 0.15)
  );
}

.map-zone-label {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 8px 14px;

  border-radius: 12px;

  background: linear-gradient(
    180deg,
    rgba(22, 12, 8, 0.95),
    rgba(10, 5, 3, 0.95)
  );

  border: 1px solid rgba(255, 255, 255, 0.08);

  color: white;

  font-family: "Orbitron", sans-serif;
  font-size: 13px;
  font-weight: 700;

  white-space: nowrap;

  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
}

.map-zone-icon {
  font-size: 14px;
}

.map-zone:hover .map-zone-dot {
  background: #ffb36c;

  box-shadow: 0 0 16px rgba(255, 180, 80, 0.95);
}

.map-zone:hover .map-zone-line {
  background: linear-gradient(
    90deg,
    rgba(255, 180, 80, 0.95),
    rgba(255, 180, 80, 0.2)
  );
}

.map-zone:hover .map-zone-label {
  border-color: rgba(255, 180, 80, 0.35);

  box-shadow: 0 0 18px rgba(255, 150, 60, 0.2);
}

.map-zone.active .map-zone-dot {
  background: #ff6b3d;
}

.map-zone.active .map-zone-label {
  border-color: rgba(255, 120, 60, 0.55);
}

.map-zone-command{
  left: 62%;
  top: 50%;
}

.map-zone-tower {
  left: 61%;
  top: 5%;
}

.map-zone-antenna {
  left: 56%;
  top: 8%;
}

.map-zone-biodome-a {
  left: 40%;
  top: 35%;
}

.map-zone-biodome-b {
  left: 79%;
  top: 35%;
}

.map-zone-hangar-left {
  left: 25%;
  top: 50%;
}

.map-zone-hangar-right {
  left: 90%;
  top: 50%;
}

.map-zone-reactor {
  left: 39%;
  top: 70%;
}

.map-zone-quarters {
  left: 58%;
  top: 88%;
}

.map-zone-storage {
  left: 78%;
  top: 70%;
}


#map-zones {
  position: absolute;
  inset: 0;

  z-index: 40;
}

.cam-switcher {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}
.btn-cam {
  flex: 1;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--signal-cyan, #00ffe7);
  color: var(--signal-cyan, #00ffe7);
  font-family: "Orbitron", monospace;
  font-size: 0.65rem;
  cursor: pointer;
  opacity: 0.5;
}

.btn-cam.active {
  opacity: 1;
  background: rgba(0, 255, 231, 0.1);
}
.btn-cam:hover {
  opacity: 0.85;
}

.tw-cursor {
  display: inline-block;
  color: var(--signal-cyan, #00ffe7);
  animation: tw-blink 0.6s step-end infinite;
  font-weight: 700;
  margin-left: 1px;
}
@keyframes tw-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.event-box {
  transition: opacity 0.25s ease;
}

#story-choices .btn-choice {
  will-change: opacity, transform;
}

.body {
  background: var(--bg);
  background-image: radial-gradient(circle at 50% 0%, #1c0d08 0%, #0a0a0f 70%);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

.body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

.body::after {
  content: "";
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 700px;
  background: radial-gradient(
    ellipse,
    rgba(193, 68, 14, 0.09) 0%,
    transparent 65%
  );
  pointer-events: none;
  z-index: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(10, 10, 15, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logo {
  font-family: var(--display);
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--mars-red);
  letter-spacing: 4px;
  text-decoration: none;
  text-shadow: 0 0 10px rgba(193, 68, 14, 0.6);
  transition:
    color 0.2s,
    text-shadow 0.2s;
}
.header-logo:hover {
  color: var(--rust-orange);
  text-shadow: 0 0 18px rgba(232, 98, 42, 0.8);
}

.header-title {
  font-family: var(--display);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 3px;
  text-align: center;
}

.header-badge {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--alert-red);
  border: 1px solid var(--alert-red);
  padding: 3px 8px;
  animation: blink-badge 2.4s infinite;
  box-shadow: 0 0 8px rgba(255, 59, 59, 0.25);
}

@keyframes blink-badge {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.4;
  }
}

html, body, .body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: visible; 
}

.layout {
  display: flex;
  align-items: flex-start; 
  overflow: visible;       
}

html, body, .body {
  height: auto;
  min-height: 100%;
  overflow-x: hidden; 
  overflow-y: visible; 
}

.sidebar {
  position: fixed;             
  left: 0;
  top: 0;                     
  width: 260px;
  height: 100vh;              
  overflow-y: auto;
  border-right: 1px solid rgba(193, 68, 14, 0.22);
  padding: 24px 0;
  z-index: 500;
}

.sidebar::-webkit-scrollbar { 
  display: none; 
}

.sidebar-section-label {
  font-family: var(--mono);
  font-size: 0.58rem;
  color: var(--text-dim);
  letter-spacing: 3px;
  padding: 0 20px 8px;
  margin-top: 16px;
  display: block;
  text-transform: uppercase;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  font-family: var(--body);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.sidebar a:hover,
.sidebar a.active {
  color: var(--pale-dust);
  border-left-color: var(--mars-red);
  background: rgba(193, 68, 14, 0.08);
  text-shadow: 0 0 8px rgba(193, 68, 14, 0.4);
}

.sidebar a .nav-icon {
  font-size: 1rem;
  width: 18px;
  text-align: center;
}

.main {
  flex: 1;
  padding: 40px 48px 80px;
  max-width: 900px;
  margin-left: 260px;          
}

.guide-section {
  margin-bottom: 72px;
  opacity: 0;
  transform: translateY(16px);
  animation: fadeUp 0.5s ease forwards;
}

.guide-section:nth-child(1) {
  animation-delay: 0.05s;
}
.guide-section:nth-child(2) {
  animation-delay: 0.12s;
}
.guide-section:nth-child(3) {
  animation-delay: 0.19s;
}
.guide-section:nth-child(4) {
  animation-delay: 0.26s;
}
.guide-section:nth-child(5) {
  animation-delay: 0.33s;
}
.guide-section:nth-child(6) {
  animation-delay: 0.4s;
}
.guide-section:nth-child(7) {
  animation-delay: 0.47s;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: none;
  }
}

.section-eyebrow {
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--accent-dim);
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.section-heading {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: 2px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border2);
  position: relative;
  text-shadow: 0 0 20px rgba(193, 68, 14, 0.3);
}

.section-heading::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 1px;
  background: var(--mars-red);
  box-shadow: 0 0 8px var(--mars-red);
}

p {
  margin-bottom: 14px;
  font-size: 0.97rem;
  line-height: 1.7;
  font-weight: 400;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border2);
  padding: 18px 20px;
  position: relative;
}

.card:hover {
  border-color: var(--border);
  background: rgba(193, 68, 14, 0.09);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
}

.card.c-cyan::before {
  background: var(--sand-ochre);
}
.card.c-red::before {
  background: var(--alert-red);
}
.card.c-green::before {
  background: var(--safe-green);
}
.card.c-orange::before {
  background: var(--rust-orange);
}
.card.c-yellow::before {
  background: var(--energy-yel);
}

.card-icon {
  font-size: 1.4rem;
  margin-bottom: 8px;
}
.card-title {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--heading);
  margin-bottom: 6px;
}
.card-body {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
  margin: 0;
}

.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border2);
  padding: 7px 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
}

.stat-chip .chip-label {
  color: var(--text-dim);
}
.stat-chip .chip-val {
  color: var(--sand-ochre);
}
.stat-chip.danger .chip-val {
  color: var(--alert-red);
}
.stat-chip.warn .chip-val {
  color: var(--rust-orange);
}
.stat-chip.good .chip-val {
  color: var(--safe-green);
}

.hazard-grid {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.hazard-row {
  display: grid;
  grid-template-columns: 36px 1fr 1fr;
  gap: 12px;
  align-items: start;
  background: var(--panel);
  border: 1px solid var(--border2);
  padding: 14px 16px;
  transition: border-color 0.2s;
}

.hazard-row:hover {
  border-color: var(--border);
}

.hazard-row .hz-icon {
  font-size: 1.3rem;
}
.hz-name {
  font-family: var(--display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--heading);
  margin-bottom: 4px;
}
.hz-desc {
  font-size: 0.84rem;
  color: var(--text);
  margin: 0;
}
.hz-effect {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--rust-orange);
  line-height: 1.55;
}

.failure-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.88rem;
}

.failure-table thead tr {
  border-bottom: 1px solid var(--border);
}

.failure-table th {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--accent-dim);
  letter-spacing: 2px;
  text-align: left;
  padding: 8px 12px;
  font-weight: 400;
}

.failure-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border2);
  vertical-align: top;
}

.failure-table tr:hover td {
  background: rgba(193, 68, 14, 0.04);
}

.failure-table .f-name {
  color: var(--heading);
  font-weight: 600;
}
.failure-table .f-dmg {
  color: var(--alert-red);
  font-family: var(--mono);
  font-size: 0.8rem;
}
.failure-table .f-clk {
  color: var(--sand-ochre);
  font-family: var(--mono);
  font-size: 0.8rem;
}

.step-list {
  list-style: none;
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.step-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  background: transparent;
  border: 1px solid var(--mars-red);
  color: var(--mars-red);
  font-family: var(--mono);
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  box-shadow: 0 0 6px rgba(193, 68, 14, 0.3);
}

.step-body {
  font-size: 0.92rem;
  line-height: 1.6;
}
.step-body strong {
  color: var(--heading);
}

.tip-box {
  background: rgba(193, 68, 14, 0.06);
  border: 1px solid rgba(193, 68, 14, 0.28);
  border-left: 3px solid var(--mars-red);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 0.9rem;
}

.tip-box.danger {
  background: var(--red-dim);
  border-color: rgba(255, 59, 59, 0.35);
  border-left-color: var(--alert-red);
}

.tip-box.warn {
  background: rgba(232, 98, 42, 0.07);
  border-color: rgba(232, 98, 42, 0.3);
  border-left-color: var(--rust-orange);
}

.tip-label {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 3px;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.tip-box .tip-label {
  color: var(--sand-ochre);
}
.tip-box.danger .tip-label {
  color: var(--alert-red);
}
.tip-box.warn .tip-label {
  color: var(--rust-orange);
}

.ending-grid {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}

.ending-row {
  background: var(--panel);
  border: 1px solid var(--border2);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 20px;
  align-items: start;
  transition: border-color 0.2s;
}
.ending-row:hover {
  border-color: var(--border);
}

.ending-title {
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--heading);
  margin-bottom: 4px;
}

.ending-desc {
  font-size: 0.86rem;
  color: var(--text);
  margin: 0;
}

.ending-badge {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 1px;
  padding: 3px 8px;
  border: 1px solid;
  white-space: nowrap;
  align-self: start;
}

.eb-good {
  color: var(--safe-green);
  border-color: var(--safe-green);
}
.eb-bad {
  color: var(--alert-red);
  border-color: var(--alert-red);
}
.eb-neutral {
  color: var(--text-dim);
  border-color: var(--text-dim);
}
.eb-twist {
  color: var(--sand-ochre);
  border-color: var(--sand-ochre);
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}

.score-item {
  background: var(--panel);
  border: 1px solid var(--border2);
  padding: 14px 16px;
  transition: border-color 0.2s;
}
.score-item:hover {
  border-color: var(--border);
}

.score-item .si-label {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.score-item .si-val {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--rust-orange);
  text-shadow: 0 0 10px rgba(232, 98, 42, 0.4);
}

.score-item .si-desc {
  font-size: 0.83rem;
  color: var(--text);
  margin-top: 4px;
}

.resource-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.resource-item {
  background: var(--panel);
  border: 1px solid var(--border2);
  padding: 14px 18px;
  transition: border-color 0.2s;
}
.resource-item:hover {
  border-color: var(--border);
}

.res-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.res-name {
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--heading);
}

.res-start {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent-dim);
}

.res-bar-bg {
  height: 4px;
  background: rgba(255, 255, 255, 0.07);
  margin-bottom: 8px;
}

.res-bar-fill {
  height: 100%;
  transition: width 0.4s;
}

.res-desc {
  font-size: 0.84rem;
  color: var(--text);
}
.res-restore {
  font-size: 0.82rem;
  color: var(--safe-green);
  margin-top: 4px;
}

.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  padding: 2px 7px;
  border: 1px solid;
  margin: 2px;
}

.tag-cyan {
  color: var(--sand-ochre);
  border-color: rgba(200, 146, 42, 0.45);
}
.tag-red {
  color: var(--alert-red);
  border-color: rgba(255, 59, 59, 0.4);
}
.tag-green {
  color: var(--safe-green);
  border-color: rgba(61, 186, 111, 0.4);
}
.tag-orange {
  color: var(--rust-orange);
  border-color: rgba(232, 98, 42, 0.4);
}

hr.deco {
  border: none;
  border-top: 1px solid var(--border2);
  margin: 32px 0;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
}

@media (max-width: 700px) {
  .sidebar {
    display: none;
  }
  .main {
    margin-left: 0;             
    padding: 24px 20px 60px;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .score-grid {
    grid-template-columns: 1fr;
  }
  .hazard-row {
    grid-template-columns: 28px 1fr;
  }
  .hz-effect {
    grid-column: 2;
  }
}

.glass-effect {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
}

.hero {
  padding-top: 120px;
  min-height: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-image: url("../images/mars-base.png");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.4) 0%, rgba(10, 10, 15, 1) 100%);
}

.hero-container {
  position: relative;
  z-index: 10;
  max-width: 800px;
  width: 90%;
  padding: 60px 40px;
  text-align: center;
  border-radius: var(--radius-xl);
  box-shadow: 0 0 40px rgba(193, 68, 14, 0.15);
}

.hero h1 {
  font-family: var(--font-main);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  color: #fff;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(193, 68, 14, 0.8), 0 0 40px rgba(255, 59, 59, 0.4);
}

.hero-subtitle {
  font-size: clamp(1.1rem, 3vw, 1.4rem);
  line-height: 1.6;
  color: var(--pale-dust);
  margin-bottom: 40px;
}

.btn-critical {
  box-shadow: 0 0 15px rgba(255, 59, 59, 0.4), inset 0 0 10px rgba(255, 59, 59, 0.2);
  animation: critical-pulse 2s infinite ease-in-out;
}

.btn-critical .btn-background {
  background: linear-gradient(135deg, #1a0000 0%, #5c0000 40%, #ff3b3b 100%);
}

.btn-critical .btn-border {
  border: 2px solid rgba(255, 59, 59, 0.9);
  box-shadow: 0 0 10px rgba(255, 59, 59, 0.7), inset 0 0 10px rgba(255, 59, 59, 0.3);
}

.btn-critical .btn-text {
  color: #fff;
  text-shadow: 0 0 8px rgba(255, 59, 59, 1), 0 0 20px rgba(255, 0, 0, 0.6);
}

.btn-icon {
  font-size: 1.3rem;
  filter: drop-shadow(0 0 6px rgba(255, 59, 59, 0.9));
}

.btn-critical:hover {
  animation: none;
  transform: translateY(-4px) scale(1.03);
  box-shadow: 0 0 40px rgba(255, 59, 59, 0.9), inset 0 0 20px rgba(255, 59, 59, 0.4);
}

@keyframes critical-pulse {
  0% { box-shadow: 0 0 15px rgba(255, 59, 59, 0.4), inset 0 0 10px rgba(255, 59, 59, 0.2); }
  50% { box-shadow: 0 0 35px rgba(255, 59, 59, 0.7), inset 0 0 20px rgba(255, 59, 59, 0.4); }
  100% { box-shadow: 0 0 15px rgba(255, 59, 59, 0.4), inset 0 0 10px rgba(255, 59, 59, 0.2); }
}

.btn-ultra::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(255, 59, 59, 0.3);
  border-radius: 10px;
  z-index: 2;
}

.btn-ultra {
  position: relative;
  display: inline-block;
  padding: 18px 40px;
  text-decoration: none;
  font-family: var(--font-main);
  letter-spacing: 2px;
  text-transform: uppercase;
  overflow: hidden;
  border-radius: 12px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, filter 0.4s ease;
}

.btn-background {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.btn-content {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.1rem;
}

.btn-border {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 4;
  pointer-events: none;
}

.btn-scan-line {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  z-index: 2;
  transform: skewX(-20deg);
  animation: scanMove 3s infinite linear;
}

@keyframes scanMove {
  0% { left: -100%; }
  100% { left: 150%; }
}

.incident-section {
  padding: 100px 20px;
  position: relative;
  background: linear-gradient(180deg, var(--bg-deep-space) 0%, rgba(255, 59, 59, 0.05) 100%);
  overflow: hidden;
}

.incident-bg-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  pointer-events: none;
}

.section-title {
  font-family: var(--font-main);
  font-size: clamp(2rem, 5vw, 2.5rem);
  text-align: center;
  margin-bottom: 60px;
  color: var(--text-primary);
  text-shadow: 0 0 10px rgba(193, 68, 14, 0.8);
}

.timeline {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  z-index: 2;
  margin-bottom: 100px;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 4px;
  height: 100%;
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(-50%);
  border-radius: 4px;
  overflow: hidden;
}

.timeline-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(to bottom, var(--signal-cyan), var(--energy-yellow), var(--alert-red), #ff0000);
  box-shadow: 0 0 15px var(--alert-red);
  transition: height 0.2s ease-out;
}

.timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 60px;
  position: relative;
}

.timeline-item.left { flex-direction: row-reverse; }
.timeline-item.right { flex-direction: row; }

.timeline-content {
  width: 45%;
  padding: 30px;
  border-radius: var(--radius-lg);
  opacity: 1;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.timeline-item.left .timeline-content { transform: translateX(0); }
.timeline-item.right .timeline-content { transform: translateX(0); }

.time-stamp {
  font-family: var(--font-main);
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 10px;
  display: block;
}

.timeline-content h3 {
  font-family: var(--font-main);
  letter-spacing: 1px;
  margin-bottom: 15px;
  font-size: 1.4rem;
}

.timeline-content p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-content:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  z-index: 3;
  border: 4px solid var(--bg-deep-space);
}

.timeline-dot.safe { background: var(--safe-green); box-shadow: 0 0 15px var(--safe-green); }
.timeline-dot.warning { background: var(--energy-yellow); box-shadow: 0 0 15px var(--energy-yellow); }
.timeline-dot.danger { background: var(--alert-red); box-shadow: 0 0 20px var(--alert-red); }
.timeline-dot.critical { background: #ff0000; box-shadow: 0 0 30px #ff0000; animation: pulseCritical 1s infinite; }

.glitch-text {
  position: relative;
  color: var(--alert-red);
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
}

.glitch-text::before {
  left: 2px;
  text-shadow: -2px 0 #00d4ff;
  animation: glitch-anim 2s infinite linear alternate-reverse;
}

.glitch-text::after {
  left: -2px;
  text-shadow: -2px 0 #ffb800;
  animation: glitch-anim 3s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% { clip-path: inset(20% 0 80% 0); }
  20% { clip-path: inset(60% 0 10% 0); }
  40% { clip-path: inset(40% 0 50% 0); }
  60% { clip-path: inset(80% 0 5% 0); }
  80% { clip-path: inset(10% 0 70% 0); }
  100% { clip-path: inset(30% 0 20% 0); }
}

.danger-border { border: 1px solid rgba(255, 59, 59, 0.3); }
.critical-box { background: rgba(50, 0, 0, 0.6); }
.critical-text { color: var(--alert-red); font-weight: 900; animation: blink 1s infinite; }

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

.shake-danger:hover .timeline-content {
  animation: shakeIt 0.3s infinite;
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
  border-color: red;
}

@keyframes shakeIt {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  20% { transform: translate(-2px, 0px) rotate(-1deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  60% { transform: translate(-1px, 2px) rotate(0deg); }
  80% { transform: translate(2px, -1px) rotate(-1deg); }
  100% { transform: translate(0px, 1px) rotate(0deg); }
}

@media (max-width: 768px) {
  .hero {
    min-height: auto;
    padding-top: 140px;
    padding-bottom: 80px;
  }
  .hero-container {
    padding: 40px 20px;
  }
  .btn-ultra {
    padding: 14px 24px;
  }
  .btn-content {
    font-size: 0.95rem;
  }
  .nav-menu {
    display: none;
  }
  .timeline::before {
    content: none;
  }
  .timeline-line {
    left: 20px;
    transform: translateX(0);
  }
  .timeline-item, .timeline-item.left, .timeline-item.right {
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 40px;
  }
  .timeline-content {
    width: calc(100% - 50px);
    padding: 20px;
  }
  .timeline-dot {
    left: 10px;
    transform: translate(0, -50%);
  }
  .timeline-item.left .timeline-content,
  .timeline-item.right .timeline-content {
    transform: none;
  }
  .timeline-item.left .timeline-content:hover,
  .timeline-item.right .timeline-content:hover {
    transform: translateY(-5px);
  }
}

.base-monitor {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 2px solid rgba(193, 68, 14, 0.4);
  background: black;
  transition: opacity 0.4s;
  min-height: 400px;
}

.mars-view {
  position: absolute;
  width: 100%;
  height: 100%;
}

.mars-view img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.05) brightness(0.95) saturate(0.95);
  transition: 0.5s;
  animation: subtleMove 20s ease-in-out infinite;
}

@keyframes subtleMove {
  0% { transform: scale(1); }
  50% { transform: scale(1.02) translate(-5px, -2px); }
  100% { transform: scale(1); }
}

/* Основний стиль хедера */
.mars-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 70px;
  z-index: 1000;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  align-items: center;
}

.header-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Навігація */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  font-family: var(--font-main);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: 0.3s;
}

.nav-link:hover, .nav-link.active {
  color: var(--signal-cyan);
  text-shadow: 0 0 10px var(--signal-cyan);
}

/* Мобільна кнопка (прихована на десктопі) */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1100;
}

.mobile-toggle .bar {
  width: 30px;
  height: 2px;
  background-color: var(--signal-cyan);
  box-shadow: 0 0 5px var(--signal-cyan);
  transition: 0.3s;
}

/* Адаптив під телефони */
@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    flex-direction: column;
    padding: 100px 40px;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid var(--mars-red);
  }

  .nav-menu.active {
    right: 0;
  }

  .system-status {
    margin-top: 20px;
  }
}

/* Анімація іконки при відкритті */
.mobile-toggle.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.mobile-toggle.active .bar:nth-child(2) {
  opacity: 0;
}
.mobile-toggle.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.workspace {
  display: flex;
  min-height: 100vh;
  padding-top: 70px;
}

.map-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: calc(100vh - 70px);
  overflow: hidden;
  background: #080810;
}

.scan-line {
  position: absolute;
  top: -4px;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--signal-cyan), transparent);
  box-shadow: 0 0 18px var(--signal-cyan);
  z-index: 10;
  animation: scanMove 6s linear infinite;
  pointer-events: none;
}

@keyframes scanMove {
  0%   { top: -4px; opacity: 1; }
  95%  { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.map-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 212, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 255, 0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 2;
  pointer-events: none;
}

.map-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.75) 100%);
  z-index: 3;
  pointer-events: none;
}

.map-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.8) brightness(0.85) contrast(1.1);
  transition: filter 0.4s ease;
}

.map-wrap:hover .map-image {
  filter: saturate(0.95) brightness(0.95) contrast(1.05);
}

.scale-bar {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scale-bar-line {
  width: 80px;
  height: 2px;
  background: var(--signal-cyan);
  box-shadow: 0 0 8px var(--signal-cyan);
  position: relative;
}

.scale-bar-line::before,
.scale-bar-line::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 2px;
  height: 10px;
  background: var(--signal-cyan);
}

.scale-bar-line::before { left: 0; }
.scale-bar-line::after  { right: 0; }

.scale-bar-text {
  font-family: var(--font-main);
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: var(--signal-cyan);
  text-shadow: 0 0 6px var(--signal-cyan);
}

#map-tooltip {
  position: absolute;
  z-index: 20;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid var(--signal-cyan);
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.72rem;
  letter-spacing: 1px;
  color: var(--signal-cyan);
  text-shadow: 0 0 6px var(--signal-cyan);
  pointer-events: none;
  display: none;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 14px rgba(0, 212, 255, 0.3);
  white-space: nowrap;
}

#map-tooltip.visible {
  display: block;
}

.side-panel {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 20, 0.92);
  border-left: 1px solid rgba(0, 212, 255, 0.15);
  backdrop-filter: blur(20px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--mars-red) transparent;
}

.side-panel::-webkit-scrollbar { width: 4px; }
.side-panel::-webkit-scrollbar-track { background: transparent; }
.side-panel::-webkit-scrollbar-thumb {
  background: var(--mars-red);
  border-radius: 2px;
}

.panel-header {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(10, 10, 20, 0.98);
}

.panel-header h2 {
  font-family: var(--font-main);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--text-primary);
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(193, 68, 14, 0.6);
  margin-bottom: 4px;
}

.panel-header .sub {
  font-family: var(--font-body);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.zone-list {
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zone-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.zone-item:hover {
  background: rgba(0, 212, 255, 0.06);
  border-color: rgba(0, 212, 255, 0.25);
  color: var(--text-primary);
  transform: translateX(4px);
}

.zone-item.active {
  background: rgba(193, 68, 14, 0.12);
  border-color: rgba(193, 68, 14, 0.4);
  color: var(--pale-dust);
}

.zone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.detail-pane {
  padding: 16px;
  flex: 1;
}

.detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 20px;
  text-align: center;
  opacity: 0.35;
}

.detail-empty .big-icon {
  font-size: 3rem;
  line-height: 1;
  filter: grayscale(1);
}

.detail-empty p {
  font-family: var(--font-main);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: var(--text-muted);
  line-height: 1.8;
}

.detail-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  padding: 20px;
  animation: fadeSlideIn 0.25s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.detail-card h3 {
  font-family: var(--font-main);
  font-size: 0.9rem;
  letter-spacing: 2px;
  color: var(--text-primary);
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.detail-card p {
  font-family: var(--font-body);
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.detail-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-family: var(--font-main);
  font-size: 0.72rem;
  letter-spacing: 1px;
}

.detail-stat:last-child { border-bottom: none; }
.detail-stat .label { color: var(--text-muted); text-transform: uppercase; }
.detail-stat .value { color: var(--safe-green); text-shadow: 0 0 6px rgba(61, 186, 111, 0.5); }
.detail-stat .value.warn   { color: var(--energy-yellow); text-shadow: 0 0 6px rgba(255, 184, 0, 0.5); }
.detail-stat .value.danger { color: var(--alert-red);     text-shadow: 0 0 6px rgba(255, 59, 59, 0.5); }

@media (max-width: 1024px) {
  .side-panel {
    width: 280px;
  }
}

@media (max-width: 768px) {
  .workspace {
    flex-direction: column;
    padding-top: 70px;
    min-height: 100vh;
  }

  .map-wrap {
    display: none;
  }

  .side-panel {
    width: 100%;
    height: auto;
    min-height: calc(100vh - 70px);
    max-height: none;
    border-left: none;
    border-top: none;
    border-radius: 0;
    transform: none !important;
    position: static;
    overflow-y: auto;
    background: var(--bg-deep-space);
  }

  .panel-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(193, 68, 14, 0.25);
    cursor: default;
  }

  .panel-header::before {
    display: none;
  }

  .panel-header h2 {
    font-size: 1rem;
  }

  .zone-list {
    padding: 12px 12px 0;
    gap: 8px;
  }

  .zone-item {
    padding: 14px 16px;
    font-size: 0.82rem;
    border-radius: var(--radius-md);
    transform: none !important;
  }

  .zone-item:hover {
    transform: none !important;
  }

  .zone-item:active {
    background: rgba(193, 68, 14, 0.15);
    border-color: rgba(193, 68, 14, 0.4);
  }

  .zone-status {
    margin-left: auto;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 1px;
    font-weight: 700;
  }

  .detail-pane {
    padding: 12px;
  }

  .detail-card {
    padding: 16px;
  }
}


@media (max-width: 480px) {
  .panel-header h2 {
    font-size: 0.9rem;
  }

  .zone-item {
    font-size: 0.78rem;
    padding: 12px 14px;
  }
}



.header-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Приховуємо статус для різних версій */
.mobile-only { display: none; }

/* Стилі для бургера */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-toggle span {
  width: 100%;
  height: 2px;
  background-color: var(--mars-red);
  transition: 0.3s;
}

/* Анімація бургера в хрестик */
.mobile-toggle.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* Адаптивність для телефонів */
@media (max-width: 768px) {
  .mobile-toggle {
    display: flex; /* Показуємо кнопку */
  }

  .desktop-only {
    display: none; /* Ховаємо статус з фону */
  }

  .nav-menu {
    position: fixed;
    top: 70px;
    left: -100%; /* Ховаємо меню зліва */
    width: 100%;
    height: calc(100vh - 70px);
    background: var(--bg-deep-space);
    flex-direction: column;
    align-items: center;
    padding-top: 50px;
    gap: 30px;
    transition: 0.4s;
    border-top: 1px solid rgba(193, 68, 14, 0.3);
  }

  .nav-menu.active {
    left: 0; /* Висуваємо меню */
  }

  .mobile-only {
    display: block;
    margin-top: 20px;
  }
}