* {
  scrollbar-width: thin;
  scrollbar-color: #1a2744 #0a0f1a;
}
*::-webkit-scrollbar { width: 6px; }
*::-webkit-scrollbar-track { background: #0a0f1a; }
*::-webkit-scrollbar-thumb { background: #1a2744; border-radius: 3px; }
*::-webkit-scrollbar-thumb:hover { background: #2a3d5e; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 5px rgba(0, 229, 255, 0.3); }
  50% { box-shadow: 0 0 20px rgba(0, 229, 255, 0.6); }
}
@keyframes scanline {
  0% { transform: translateY(-100%); }
  100% { transform: translateY(100%); }
}
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
@keyframes radar-sweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes dots {
  0% { content: ''; }
  25% { content: '.'; }
  50% { content: '..'; }
  75% { content: '...'; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulseRed {
  0%, 100% { border-color: rgba(255, 23, 68, 0.3); }
  50% { border-color: rgba(255, 23, 68, 0.8); }
}

.scanline-overlay {
  position: relative;
  overflow: hidden;
}
.scanline-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 229, 255, 0.015) 2px,
    rgba(0, 229, 255, 0.015) 4px
  );
  animation: scanline 8s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.grid-bg {
  background-image: 
    linear-gradient(rgba(26, 39, 68, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(26, 39, 68, 0.3) 1px, transparent 1px);
  background-size: 30px 30px;
}

.glow-border {
  border: 1px solid #1a2744;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.glow-border:hover, .glow-border:focus-within {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.1);
}

.pulse-border {
  animation: pulse-glow 2s ease-in-out infinite;
}

.cursor-block {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: #00e5ff;
  animation: blink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

.toast-enter {
  animation: slideInRight 0.3s ease-out forwards;
}

.hostile-pulse {
  animation: pulseRed 2s ease-in-out infinite;
}

.btn-glow {
  transition: all 0.2s;
}
.btn-glow:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 15px rgba(0, 229, 255, 0.3);
  transform: scale(1.02);
}
.btn-glow:active {
  transform: scale(0.98);
}

textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: rgba(0, 229, 255, 0.5) !important;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.15);
}

.markdown-output h1 { font-size: 1.4em; font-weight: 700; color: #00e5ff; margin: 12px 0 6px; }
.markdown-output h2 { font-size: 1.2em; font-weight: 600; color: #00e5ff; margin: 10px 0 5px; }
.markdown-output h3 { font-size: 1.1em; font-weight: 600; color: #80d8ff; margin: 8px 0 4px; }
.markdown-output strong { color: #ffffff; font-weight: 600; }
.markdown-output em { color: #ffab00; font-style: italic; }
.markdown-output ul { list-style-type: disc; padding-left: 20px; margin: 6px 0; }
.markdown-output ol { list-style-type: decimal; padding-left: 20px; margin: 6px 0; }
.markdown-output li { margin: 3px 0; }
.markdown-output p { margin: 6px 0; }
.markdown-output code { background: rgba(0,229,255,0.1); padding: 1px 4px; border-radius: 3px; font-family: 'JetBrains Mono', monospace; font-size: 0.9em; }
.markdown-output blockquote { border-left: 3px solid #00e5ff; padding-left: 12px; color: #8aa4c8; margin: 8px 0; }
.markdown-output hr { border: none; border-top: 1px solid #1a2744; margin: 12px 0; }

.mobile-scroll { -webkit-overflow-scrolling: touch; }