/* ============================================================
   POPUP & CAROUSEL — Entry modal + Achievement slider
   ============================================================ */

/* ═══════════════════════════════════════════════════════════
   ENTRY POPUP
═══════════════════════════════════════════════════════════ */
.entry-popup {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.entry-popup.open {
  opacity: 1;
  pointer-events: all;
}

.popup-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.80);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ── Card — wide two-column layout ──────────────────────── */
.popup-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 780px;
  border-radius: 24px;
  background: linear-gradient(145deg, #040e28 0%, #0a1e44 60%, #0d1060 100%);
  border: 1px solid rgba(0, 229, 255, 0.25);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05) inset,
    0 40px 100px rgba(0,0,0,0.75),
    0 0 80px rgba(0,80,255,0.15);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  max-height: 96vh;
}
.entry-popup.open .popup-card { transform: translateY(0) scale(1); }

/* Top cyan glow line */
.popup-card::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

/* ── Close button ────────────────────────────────────────── */
.popup-close {
  position: absolute;
  top: 14px; right: 14px;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  color: rgba(255,255,255,0.55);
  font-size: 0.9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
  z-index: 10;
}
.popup-close:hover { background: rgba(255,255,255,0.18); color: #fff; }

/* ── Sparkles ────────────────────────────────────────────── */
.sparkles { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.sp {
  position: absolute;
  color: var(--cyan);
  opacity: 0;
  animation: sparkle 3s ease-in-out infinite;
  font-size: 1rem;
}
.sp1 { top: 8%;  left: 5%;   animation-delay: 0.0s; font-size: 0.7rem; }
.sp2 { top: 15%; right: 8%;  animation-delay: 0.6s; }
.sp3 { top: 60%; left: 3%;   animation-delay: 1.2s; font-size: 0.8rem; }
.sp4 { top: 75%; right: 6%;  animation-delay: 0.4s; font-size: 0.65rem; }
.sp5 { top: 88%; left: 15%;  animation-delay: 1.8s; }
.sp6 { top: 45%; right: 3%;  animation-delay: 0.9s; font-size: 0.75rem; }

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0.5) rotate(0deg); }
  50%       { opacity: 0.8; transform: scale(1.3) rotate(180deg); }
}

/* ── Two-column inner layout ─────────────────────────────── */
.popup-inner {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  min-height: 460px;
}

/* ── Left: poster slider ─────────────────────────────────── */
.popup-poster-side {
  position: relative;
  background: #000;
  border-radius: 24px 0 0 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.pcs-track {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 360px;
}
.pcs-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.pcs-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.pcs-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.pcs-slide-name {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.90), transparent);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  text-align: center;
  letter-spacing: 0.03em;
}

.pcs-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  background: rgba(0,0,0,0.6);
  flex-shrink: 0;
}
.pcs-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: background 0.3s, width 0.3s;
  cursor: pointer;
  border: none;
  padding: 0;
}
.pcs-dot.active {
  background: var(--cyan);
  width: 18px;
  border-radius: 3px;
}

/* ── Right: content side ─────────────────────────────────── */
.popup-content-side {
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
  position: relative;
  z-index: 1;
}

.popup-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  background: rgba(0, 229, 255, 0.12);
  border: 1px solid rgba(0, 229, 255, 0.30);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 16px;
  width: fit-content;
}

.popup-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 10px;
}
.popup-title span {
  background: linear-gradient(90deg, #00b4d8, #00e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.popup-sub {
  font-size: 0.84rem;
  color: var(--white-60);
  line-height: 1.6;
  margin-bottom: 18px;
}
.popup-sub strong { color: var(--white-80); }

/* Bullet list */
.popup-bullets {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}
.popup-bullet {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--white-80);
  font-weight: 500;
}
.popup-bullet span { font-size: 0.9rem; }

.popup-cta {
  width: 100%;
  justify-content: center;
  font-size: 0.95rem;
  padding: 14px 24px;
  box-shadow: 0 0 30px rgba(0,229,255,0.35);
  margin-bottom: 12px;
}

.popup-later {
  background: none;
  border: none;
  color: var(--white-60);
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--transition-fast);
  display: block;
  width: 100%;
  text-align: center;
}
.popup-later:hover { color: var(--white); }

/* ── Mobile only (≤768px) ────────────────────────────────── */
@media (max-width: 768px) {
  /* Card scrolls if content overflows — no flex height chains */
  .popup-card {
    max-height: 92vh;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 20px;
    display: block;
    height: auto;
  }

  /* Simple block stack */
  .popup-inner {
    display: flex;
    flex-direction: column;
    min-height: unset;
  }

  .popup-poster-side {
    width: 100%;
    flex-shrink: 0;
    display: block;
    border-radius: 20px 20px 0 0;
    background: #0a1532;
    overflow: hidden;
  }

  /*
   * Explicit height = modal width × A4 ratio.
   * position:absolute children fill content-box height — padding-bottom
   * tricks don't work here (absolute children skip the padding area).
   * calc() gives a real, measurable height that inset:0 can fill.
   * min() caps it at 68vh so it doesn't overwhelm wide/landscape phones.
   */
  .pcs-track {
    position: relative;
    width: 100%;
    height: min(calc((100vw - 32px) * 1.414), 68vh);
    min-height: unset;
    max-height: unset;
    aspect-ratio: unset;
    flex: none;
    overflow: hidden;
  }

  /* Slide bg matches modal — blends any empty edges if image is letterboxed */
  .pcs-slide {
    background: #0a1532;
  }

  /* Full A4 image — contain keeps everything visible, nothing cropped */
  .pcs-slide img {
    object-fit: contain;
    object-position: top center;
    width: 100%;
    height: 100%;
  }

  .pcs-slide-name { display: none; }

  /* Dots sit flush below image */
  .pcs-dots {
    display: flex;
    background: #0a1532;
    padding: 8px 0;
  }

  .popup-content-side {
    padding: 20px 20px 24px;
    text-align: center;
    justify-content: flex-start;
  }

  .popup-badge   { margin: 0 auto 14px; }
  .popup-title   { font-size: 1.4rem; margin-bottom: 8px; }
  .popup-sub     { font-size: 0.82rem; margin-bottom: 14px; }
  .popup-bullets { align-items: flex-start; padding-left: 8px; text-align: left; margin-bottom: 18px; }
  .popup-cta     { margin-bottom: 10px; }
}


/* ═══════════════════════════════════════════════════════════
   ACHIEVEMENT CAROUSEL
═══════════════════════════════════════════════════════════ */
.carousel-section {
  position: relative;
  z-index: 1;
  padding: 80px var(--space-xl) 60px;
  background: rgba(0, 10, 30, 0.40);
  border-top: 1px solid var(--white-06);
  border-bottom: 1px solid var(--white-06);
}

.carousel-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 44px;
}

/* Prev / Next buttons */
.carousel-btn {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(0, 229, 255, 0.10);
  border: 1px solid rgba(0, 229, 255, 0.28);
  color: var(--cyan);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast), transform var(--transition-fast);
  z-index: 2;
}
.carousel-btn:hover { background: rgba(0, 229, 255, 0.22); transform: scale(1.08); }

/* Track container hides overflow */
.carousel-track-outer {
  overflow: hidden;
  flex: 1;
  border-radius: var(--radius-md);
}

/* Sliding track */
.carousel-track {
  display: flex;
  gap: 20px;
  transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* Achievement card */
.achievement-card {
  flex: 0 0 calc(25% - 15px);   /* 4 visible on desktop */
  min-width: 0;
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  transition: border-color var(--transition-normal), transform var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.achievement-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.05) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--transition-normal);
}
.achievement-card:hover {
  border-color: rgba(0, 229, 255, 0.30);
  transform: translateY(-6px);
}
.achievement-card:hover::before { opacity: 1; }

.ach-icon {
  font-size: 2.4rem;
  margin-bottom: 14px;
  display: block;
  filter: drop-shadow(0 0 10px rgba(0, 229, 255, 0.40));
}

.ach-num {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.2rem;
  background: linear-gradient(135deg, #0070f3, #00e5ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  margin-bottom: 6px;
}

.ach-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--white);
  margin-bottom: 10px;
}

.ach-desc {
  font-size: 0.80rem;
  color: var(--white-60);
  line-height: 1.6;
}

/* Dot indicators */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 28px;
}
.carousel-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.20);
  border: none;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast), width var(--transition-fast);
}
.carousel-dot.active {
  background: var(--cyan);
  width: 24px;
  border-radius: 4px;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.50);
}

/* ── Carousel responsive ───────────────────────────────────── */
@media (max-width: 1100px) {
  .achievement-card { flex: 0 0 calc(33.333% - 14px); } /* 3 visible */
}
@media (max-width: 768px) {
  .achievement-card { flex: 0 0 calc(50% - 10px); }     /* 2 visible */
  .carousel-section { padding-left: 20px; padding-right: 20px; }
  .carousel-btn { width: 36px; height: 36px; font-size: 1.3rem; }
}
@media (max-width: 480px) {
  .achievement-card { flex: 0 0 calc(100% - 0px); }     /* 1 visible */
  .carousel-wrapper { gap: 8px; }
}
