/* ==========================================================================
   DualSub (دوآل‌ساب) - Gaming & Cyberpunk Animations
   Glitch Effects, CRT Scanlines, Neon Pulses & Typewriters
   ========================================================================== */

/* Glitch Text Effect */
.glitch-text {
  position: relative;
  display: inline-block;
  color: #ffffff;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

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

.glitch-text::after {
  left: -2px;
  text-shadow: -2px 0 #f43f5e, 2px 2px #7000ff;
  animation: glitch-anim-2 2.8s infinite linear alternate-reverse;
}

@keyframes glitch-anim-1 {
  0% { clip: rect(24px, 9999px, 85px, 0); transform: skew(0.3deg); }
  5% { clip: rect(65px, 9999px, 11px, 0); transform: skew(0.5deg); }
  10% { clip: rect(10px, 9999px, 78px, 0); transform: skew(0deg); }
  15% { clip: rect(0, 0, 0, 0); }
  45% { clip: rect(0, 0, 0, 0); }
  50% { clip: rect(42px, 9999px, 33px, 0); transform: skew(-0.4deg); }
  55% { clip: rect(89px, 9999px, 95px, 0); transform: skew(0.2deg); }
  60% { clip: rect(0, 0, 0, 0); }
  90% { clip: rect(0, 0, 0, 0); }
  95% { clip: rect(12px, 9999px, 50px, 0); transform: skew(0.6deg); }
  100% { clip: rect(70px, 9999px, 92px, 0); transform: skew(0deg); }
}

@keyframes glitch-anim-2 {
  0% { clip: rect(80px, 9999px, 90px, 0); transform: skew(-0.3deg); }
  5% { clip: rect(12px, 9999px, 45px, 0); transform: skew(0.4deg); }
  10% { clip: rect(0, 0, 0, 0); }
  40% { clip: rect(0, 0, 0, 0); }
  45% { clip: rect(50px, 9999px, 20px, 0); transform: skew(-0.5deg); }
  50% { clip: rect(95px, 9999px, 85px, 0); transform: skew(0.3deg); }
  55% { clip: rect(0, 0, 0, 0); }
  85% { clip: rect(0, 0, 0, 0); }
  90% { clip: rect(35px, 9999px, 75px, 0); transform: skew(0.2deg); }
  100% { clip: rect(5px, 9999px, 30px, 0); transform: skew(-0.2deg); }
}

/* CRT Screen Scanline Overlay (Light & Non-Intrusive, Fixed to Viewport) */
.scanline-overlay {
  position: relative;
}

.scanline-overlay::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.22) 50%);
  background-size: 100% 4px;
  z-index: 99;
  pointer-events: none;
  opacity: 0.55;
}

/* Subtle moving scan beam */
.scan-beam::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.8), transparent);
  box-shadow: 0 0 10px var(--neon-cyan);
  animation: scan-down 6s linear infinite;
  z-index: 3;
  pointer-events: none;
}

@keyframes scan-down {
  0% { top: -5%; opacity: 0; }
  10% { opacity: 0.8; }
  90% { opacity: 0.8; }
  100% { top: 105%; opacity: 0; }
}

/* Neon Glow Border Animation */
.glow-border {
  position: relative;
}

.glow-border::before {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(90deg, #00f0ff, #7000ff, #f43f5e, #00f0ff);
  background-size: 300% 300%;
  border-radius: inherit;
  z-index: -1;
  animation: border-rotate 6s ease infinite;
  opacity: 0.7;
}

@keyframes border-rotate {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Floating Animation */
.float-subtle {
  animation: float-anim 4s ease-in-out infinite;
}

@keyframes float-anim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Hologram Flicker */
@keyframes holo-flicker {
  0%, 100% { opacity: 1; }
  3% { opacity: 0.85; }
  6% { opacity: 1; }
  7% { opacity: 0.9; }
  8% { opacity: 1; }
  9% { opacity: 0.7; }
  10% { opacity: 1; }
  89% { opacity: 1; }
  90% { opacity: 0.8; }
  91% { opacity: 1; }
}

.hologram-glow {
  animation: holo-flicker 5s infinite;
}

/* Card Hover Scale and Glow */
.game-card {
  transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.game-card:hover {
  transform: translateY(-6px) scale(1.015);
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.8), 0 0 25px rgba(0, 240, 255, 0.25);
}

/* Sound Wave Animation for dubbing status */
.sound-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.sound-bar {
  width: 3px;
  background-color: var(--neon-cyan);
  border-radius: 1px;
  animation: sound-bounce 1s ease-in-out infinite alternate;
}

.sound-bar:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.sound-bar:nth-child(2) { height: 90%; animation-delay: 0.3s; }
.sound-bar:nth-child(3) { height: 60%; animation-delay: 0.2s; }
.sound-bar:nth-child(4) { height: 100%; animation-delay: 0.4s; }

@keyframes sound-bounce {
  0% { height: 20%; }
  100% { height: 100%; }
}

/* ==========================================================================
   Shattered Glass & Dimensional Rift (Cyber Neon meets Ancient Empires)
   ========================================================================== */
.shatter-crack-line {
  stroke-dasharray: 600;
  stroke-dashoffset: 600;
  animation: crack-draw 2.5s ease-out forwards;
}

@keyframes crack-draw {
  to {
    stroke-dashoffset: 0;
  }
}

.glass-shard {
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
}

.glass-shard:hover {
  transform: scale(1.03) translate(-2px, -2px);
  filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.8)) brightness(1.2);
}

.pulse-crack {
  animation: pulse-crack-glow 4s infinite alternate;
}

@keyframes pulse-crack-glow {
  0% { filter: drop-shadow(0 0 2px #00f0ff) drop-shadow(0 0 5px rgba(245, 158, 11, 0.4)); opacity: 0.75; }
  50% { filter: drop-shadow(0 0 8px #00f0ff) drop-shadow(0 0 15px rgba(245, 158, 11, 0.8)); opacity: 1; }
  100% { filter: drop-shadow(0 0 3px #00f0ff) drop-shadow(0 0 4px rgba(245, 158, 11, 0.5)); opacity: 0.8; }
}

/* Ancient Tactical Compass Rotating */
.compass-rotate {
  animation: slow-compass-spin 70s linear infinite;
}

@keyframes slow-compass-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

