/**
 * R+G TCG Hero Diorama - Styles
 */

.rg-diorama-hero {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: clamp(420px, 65vw, min(860px, calc(100vh - 100px)));
  background: #05070d;
}

.rg-diorama-hero__fallback,
.rg-diorama-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.rg-diorama-hero__fallback {
  object-fit: cover;
  object-position: center;
  z-index: 1;
  display: block;
  transition: opacity 700ms ease;
}

.rg-diorama-hero__canvas {
  z-index: 2;
  opacity: 0;
  visibility: hidden; /* Completely hide until ready */
  transition:
    opacity 700ms ease,
    visibility 0s 700ms; /* Delay visibility change until after fade */
  pointer-events: none; /* Allow clicks to pass through */
}

/* Fade in canvas when scene is ready */
.rg-diorama-hero.is-ready .rg-diorama-hero__canvas {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 700ms ease,
    visibility 0s 0s; /* Show immediately, fade in over time */
}

/* Hide fallback image when canvas is ready */
.rg-diorama-hero.is-ready .rg-diorama-hero__fallback {
  opacity: 0;
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .rg-diorama-hero {
    min-height: clamp(400px, 80vw, 600px);
  }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .rg-diorama-hero {
    min-height: clamp(400px, 70vw, 700px);
  }
}

/* ========================================
   Kickstarter CTA Panel
   ======================================== */

.rg-hero-cta {
  position: absolute;
  bottom: 0;
  left: 0;
  border-top-right-radius: 50px;
  z-index: 10;
  pointer-events: none;
  border-top: 2px solid rgba(0, 245, 255, 0.6);
  border-right: 2px solid rgba(0, 245, 255, 0.6);
  overflow: hidden;
}

.rg-hero-cta__panel {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(0.5rem, 2vw, 1rem) 2rem clamp(0.5rem, 2vw, 1rem)
    clamp(0.5rem, 3vw, 1rem);
  background: rgba(0, 245, 255, 0.08);
  overflow: hidden;
  pointer-events: auto;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);

  /* Subtle scanline grid */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 50%, transparent 50%),
    linear-gradient(90deg, rgba(0, 245, 255, 0.05) 50%, transparent 50%);
  background-size:
    100% 4px,
    4px 100%;

  animation: ctaFlicker 4s infinite alternate;
}

.rg-hero-cta__content {
  flex: 1;
  width: max-content;
  text-align: left;
  position: relative;
  z-index: 2;
}

/* Animated gradient overlay */
.rg-hero-cta__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 245, 255, 0.15) 0%,
    rgba(0, 229, 255, 0.1) 50%,
    rgba(0, 245, 255, 0.15) 100%
  );
  pointer-events: none;
  animation: ctaScan 6s linear infinite;
  opacity: 0.65;
}

/* Radial highlight */
.rg-hero-cta__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 30% 20%,
    rgba(255, 255, 255, 0.15),
    transparent 60%
  );
  pointer-events: none;
  z-index: 1;
}

.rg-hero-cta__title {
  color: #fff;
  text-shadow:
    0 0 10px rgba(0, 245, 255, 0.7),
    0 0 20px rgba(0, 245, 255, 0.5),
    0 0 40px rgba(0, 229, 255, 0.3);
  font-size: clamp(1rem, 3vw, 1.5rem);
  font-weight: 700;
  margin: 0 0 4px 0 !important;
  text-transform: uppercase;
  letter-spacing: 1.85px;
  line-height: 1.1;
}

.rg-hero-cta__text {
  color: #e0ffff;
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.7);
  font-size: clamp(0.75rem, 2vw, 0.9rem);
  line-height: 1.2;
  margin: 0 !important;
  font-weight: 600;
}

.rg-hero-cta__dates {
  color: #00f5ff;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.8);
  font-size: clamp(0.8rem, 2.5vw, 0.95rem);
  font-weight: 600;
  margin: 0 !important ;
  position: relative;
  z-index: 2;
}

.rg-hero-cta__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  background-color: rgba(0, 245, 255, 0.15);
  color: #fff;
  font-weight: 700;
  font-size: clamp(0.9rem, 2.5vw, 1.1rem);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-radius: 50px;
  border: 1px solid rgba(0, 245, 255, 0.3);
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.8);
  backdrop-filter: blur(4px);
  transform: translateY(0);
  transition: all 0.3s ease-in-out;
}

.rg-hero-cta__button:active,
.rg-hero-cta__button:hover,
.rg-hero-cta__button:focus {
  background-color: rgba(48, 248, 255, 0.25);
  border-color: rgba(150, 252, 255, 0.5);
  box-shadow: 0 0 20px rgba(104, 250, 255, 0.4);
  text-shadow: 0 0 15px rgb(130, 251, 255);
  color: #fff;
  transform: translateY(-2px);
  transition: all 0.3s ease-in-out;
}

.rg-hero-cta__button-text,
.rg-hero-cta__button-arrow {
  position: relative;
  z-index: 1;
}

.rg-hero-cta__button-arrow {
  font-size: 1.4em;
  transition: transform 0.3s ease;
}

.rg-hero-cta__button:hover .rg-hero-cta__button-arrow {
  transform: translateX(4px);
}

/* Countdown Timer */
.rg-hero-cta__countdown {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  background-color: rgba(150, 150, 150, 0.307);
  padding: 0.55rem;
  border-radius: 8px;
  border: rgba(36, 233, 255, 0.105) 1px solid;
  /* box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2); */
}

.rg-hero-cta__countdown-label {
  color: #00f5ff;
  font-size: clamp(0.75rem, 1.6vw, 0.85rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.8);
  white-space: nowrap;
  line-height: 1;
}

.rg-hero-cta__countdown-display {
  display: flex;
  align-items: center;
  gap: clamp(4px, 1.5vw, 8px);
}

.rg-hero-cta__countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.rg-hero-cta__countdown-value {
  font-size: clamp(1.15rem, 3.2vw, 1.75rem);
  font-weight: 700;
  color: #fff;
  text-shadow:
    0 0 10px rgba(0, 245, 255, 0.9),
    0 0 20px rgba(0, 245, 255, 0.7),
    0 0 30px rgba(0, 229, 255, 0.5);
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
  text-align: center;
  line-height: 1;
}

.rg-hero-cta__countdown-unit-label {
  font-size: clamp(0.45rem, 1.1vw, 0.6rem);
  color: #e0ffff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.5);
  line-height: 1;
}

.rg-hero-cta__countdown-separator {
  font-size: clamp(1.15rem, 3.2vw, 1.75rem);
  font-weight: 700;
  color: #00f5ff;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.8);
  opacity: 0.6;
  user-select: none;
  line-height: 1;
}

/* Countdown states */
[data-countdown-state="active"] .rg-hero-cta__countdown-label {
  color: #00ff88;
  animation: pulseGreen 2s ease-in-out infinite;
}

[data-countdown-state="ended"] .rg-hero-cta__countdown-display {
  opacity: 0.5;
}

@keyframes pulseGreen {
  0%,
  100% {
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.8);
  }
  50% {
    text-shadow: 0 0 20px rgba(0, 255, 136, 1);
  }
}

/* Animations */
@keyframes ctaFlicker {
  0% {
    opacity: 0.95;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.97;
  }
}

@keyframes ctaScan {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(300%);
  }
}

/** Mobile adjustments */
@media (max-width: 768px) {
  .rg-hero-cta {
    position: absolute;
    top: 0;
    bottom: auto;
    left: 0;
    border-top-right-radius: 0px;
    border-bottom-right-radius: 50px;
    z-index: 10;
    pointer-events: none;
    border-top: none;
    border-bottom: 2px solid rgba(0, 245, 255, 0.6);
    border-right: 2px solid rgba(0, 245, 255, 0.6);
    overflow: hidden;
  }
  .rg-hero-cta__panel {
    padding: 0.5rem 0.75rem 0.75rem 0.5rem;
    flex-direction: column;
    align-items: flex-start;
    align-items: center;
    gap: 5px;
  }
  .rg-hero-cta__text {
    text-align: center;
  }

  .rg-hero-cta__button {
    padding: 2px 14px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .rg-hero-cta__panel {
    animation: none;
  }

  .rg-hero-cta__panel::before {
    animation: none;
  }

  .rg-hero-cta__button {
    transition: none;
  }

  .rg-hero-cta__button:hover {
    transform: none;
  }

  [data-countdown-state="active"] .rg-hero-cta__countdown-label {
    animation: none;
  }
}

