/* === Enhanced 3D Scene & Advanced Effects === */

/* 3D Rotating showcase for hero */
.showcase-3d {
  perspective: 1200px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem 0;
}
.showcase-ring {
  position: relative;
  width: 300px; height: 200px;
  transform-style: preserve-3d;
  animation: ring-rotate 20s linear infinite;
}
.showcase-ring .ring-item {
  position: absolute;
  width: 120px; height: 160px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: .8rem;
  backface-visibility: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.4);
  left: 50%; top: 50%;
  margin-left: -60px; margin-top: -80px;
}
.showcase-ring .ring-item:nth-child(1) { transform: rotateY(0deg) translateZ(200px); }
.showcase-ring .ring-item:nth-child(2) { transform: rotateY(51deg) translateZ(200px); }
.showcase-ring .ring-item:nth-child(3) { transform: rotateY(102deg) translateZ(200px); }
.showcase-ring .ring-item:nth-child(4) { transform: rotateY(153deg) translateZ(200px); }
.showcase-ring .ring-item:nth-child(5) { transform: rotateY(204deg) translateZ(200px); }
.showcase-ring .ring-item:nth-child(6) { transform: rotateY(255deg) translateZ(200px); }
.showcase-ring .ring-item:nth-child(7) { transform: rotateY(306deg) translateZ(200px); }
@keyframes ring-rotate {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}
.ring-item .ring-tier {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem; font-weight: 900;
  margin-bottom: .3rem;
}
.ring-item .ring-name {
  font-size: .85rem; color: var(--text-primary);
  text-align: center; font-weight: 600;
}
.ring-item .ring-role {
  font-size: .7rem; color: var(--text-muted);
  margin-top: .2rem;
}

/* Floating lanterns background */
.lanterns-bg {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; overflow: hidden; z-index: 0;
}
.lantern {
  position: absolute;
  width: 8px; height: 12px;
  background: radial-gradient(circle, rgba(212,168,67,0.8), rgba(196,30,58,0.4));
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  box-shadow: 0 0 15px rgba(212,168,67,0.4), 0 0 30px rgba(212,168,67,0.2);
  animation: lantern-float var(--dur, 12s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0.6;
}
@keyframes lantern-float {
  0% { transform: translateY(100vh) translateX(0) scale(0.5); opacity: 0; }
  10% { opacity: 0.6; }
  90% { opacity: 0.6; }
  100% { transform: translateY(-20vh) translateX(var(--drift, 30px)) scale(1); opacity: 0; }
}

/* Ink splash transition */
.ink-splash {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 9999; pointer-events: none;
}
.ink-splash circle {
  fill: var(--bg-primary);
  transform-origin: center;
}

/* Creepy eye that follows cursor */
.watching-eye {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at var(--eye-x, 50%) var(--eye-y, 50%),
    var(--accent-red) 3px, #1a1a2e 4px, #1a1a2e 12px, var(--accent-gold) 13px, transparent 14px);
  border: 2px solid rgba(212,168,67,0.3);
  z-index: 100;
  opacity: 0.4;
  transition: opacity 0.3s;
  pointer-events: none;
}
.watching-eye:hover { opacity: 0.8; }

/* Morse code loading dots */
.morse-loading {
  display: flex; gap: 4px; align-items: center;
}
.morse-dot {
  width: 6px; height: 6px;
  background: var(--accent-red);
  border-radius: 50%;
  animation: morse 1.5s ease-in-out infinite;
}
.morse-dot:nth-child(2) { animation-delay: 0.2s; width: 14px; border-radius: 3px; }
.morse-dot:nth-child(3) { animation-delay: 0.4s; }
.morse-dot:nth-child(4) { animation-delay: 0.6s; width: 14px; border-radius: 3px; }
@keyframes morse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Scratched/damaged card variant */
.card-damaged {
  position: relative;
}
.card-damaged::after {
  content: '';
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: 
    linear-gradient(135deg, transparent 40%, rgba(196,30,58,0.03) 41%, transparent 42%),
    linear-gradient(225deg, transparent 60%, rgba(196,30,58,0.02) 61%, transparent 62%),
    linear-gradient(315deg, transparent 30%, rgba(196,30,58,0.02) 31%, transparent 32%);
  pointer-events: none;
  border-radius: inherit;
}

/* Countdown/timer style numbers */
.countdown-num {
  font-family: 'Cinzel', serif;
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(180deg, var(--accent-gold) 0%, var(--accent-red) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  position: relative;
}
.countdown-num::after {
  content: '';
  position: absolute;
  bottom: -5px; left: 0; width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
}

/* Radar/sonar ping effect */
.radar-ping {
  position: relative;
}
.radar-ping::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  border: 2px solid var(--accent-red);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: radar 2s ease-out infinite;
  opacity: 0;
}
@keyframes radar {
  0% { width: 10px; height: 10px; opacity: 0.8; }
  100% { width: 80px; height: 80px; opacity: 0; }
}

/* Page transition wipe */
.page-wipe {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: var(--bg-primary);
  z-index: 9998;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(.77,0,.175,1);
}
.page-wipe.active {
  transform: scaleX(1);
}

@media (max-width: 768px) {
  .showcase-ring { width: 200px; height: 150px; }
  .showcase-ring .ring-item { width: 80px; height: 110px; margin-left: -40px; margin-top: -55px; }
  .showcase-ring .ring-item:nth-child(1) { transform: rotateY(0deg) translateZ(120px); }
  .showcase-ring .ring-item:nth-child(2) { transform: rotateY(51deg) translateZ(120px); }
  .showcase-ring .ring-item:nth-child(3) { transform: rotateY(102deg) translateZ(120px); }
  .showcase-ring .ring-item:nth-child(4) { transform: rotateY(153deg) translateZ(120px); }
  .showcase-ring .ring-item:nth-child(5) { transform: rotateY(204deg) translateZ(120px); }
  .showcase-ring .ring-item:nth-child(6) { transform: rotateY(255deg) translateZ(120px); }
  .showcase-ring .ring-item:nth-child(7) { transform: rotateY(306deg) translateZ(120px); }
  .watching-eye { display: none; }
}
