html {
  color-scheme: dark;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Тонкая пиксельная сетка — SOC dashboard atmosphere */
  background-color: #000;
  background-image:
    linear-gradient(rgba(195, 245, 60, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(195, 245, 60, 0.035) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

/* Убираем подпрыгивание при ресайзе */
* {
  -webkit-tap-highlight-color: transparent;
}

/* Pulse для мини-игры */
@keyframes pulse-glitch {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 85, 85, 0.6);
    background-color: rgba(255, 85, 85, 0.08);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 85, 85, 0);
    background-color: rgba(255, 85, 85, 0.20);
  }
}

.animate-pulse-glitch {
  animation: pulse-glitch 1.6s ease-in-out infinite;
}

/* Disable animation on prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .animate-pulse-glitch {
    animation: none;
    background-color: rgba(255, 85, 85, 0.15);
  }
  .animate-float-rock {
    animation: none;
    transform: none;
  }
}

/* Плавающие пиксель-частицы на всех экранах */
@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-18px, -30px) rotate(45deg); }
}
@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(20px, -22px); }
}
@keyframes drift-3 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-25px); }
}

.particle {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .particle {
    animation: none !important;
  }
}

/* Пиксельные фейерверки на экране разблокировки результата */
@keyframes pixel-firework-burst {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0;
  }
  10% { opacity: 1; }
  100% {
    transform: translate(var(--dx, 0), var(--dy, 0)) scale(0.4);
    opacity: 0;
  }
}

.firework {
  position: absolute;
  pointer-events: none;
  width: 0;
  height: 0;
  z-index: 0;
}

.firework-pixel {
  position: absolute;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  margin-top: -2.5px;
  background: var(--firework-color, #C3F53C);
  animation: pixel-firework-burst 1.8s ease-out infinite;
  animation-delay: var(--delay, 0s);
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .firework-pixel {
    animation: none;
    opacity: 0;
  }
}

/* Покачивание ID-карты на экране профиля */
@keyframes float-rock {
  0%, 100% { transform: rotate(-1.8deg); }
  50% { transform: rotate(1.8deg); }
}

.animate-float-rock {
  animation: float-rock 5s ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
}

/* Найденный маркер фишинга — лаймовая подсветка */
.spot-found {
  background: rgba(195, 245, 60, 0.18) !important;
  outline: 1.5px solid #C3F53C;
  outline-offset: 2px;
  border-radius: 4px;
  color: #C3F53C !important;
  transition: all 0.25s ease;
}

/* Подсказка после 2 промахов — красное пульсирование вокруг признака */
@keyframes spot-hint-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 85, 85, 0);
    background-color: transparent;
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 85, 85, 0.22);
    background-color: rgba(255, 85, 85, 0.10);
  }
}

.spot-hint {
  animation: spot-hint-pulse 1.4s ease-in-out infinite;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .spot-hint {
    animation: none;
    background-color: rgba(255, 85, 85, 0.14);
  }
}

/* Select styling */
select {
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%239a9a9a' d='M6 8L2 4h8z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Inputs placeholder */
input::placeholder {
  color: #6A6A6A;
}

/* Source citations — subtle, secondary, link-on-hover */
.source-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #7A7A7A;
  text-decoration: none;
  border-bottom: 1px dotted rgba(154, 154, 154, 0.35);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.source-link:hover {
  color: #B8B8B8;
  border-bottom-color: rgba(184, 184, 184, 0.6);
}
.source-link::after {
  content: '↗';
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.6;
}
