/* =========================
   BASE / SWIPER LAYOUT
   ========================= */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #000;
}

.swiper { width: 100%; height: 100%; }
.swiper-slide { display:flex; justify-content:center; height:100%; }

@media (max-width: 574px) {
  #rightPanel { right: 10px !important; }
  #swipeHint  { right: 16px !important; }
  #likeHint   { right: 16px !important; }
}

:root { --safe-bottom: env(safe-area-inset-bottom, 0px); }
:root { --bottom-ui: 64px; }

.safe-offset-16 { bottom: calc(var(--bottom-ui) + 16px); }

.safe-bottom { bottom:0; padding-bottom:12px; }
@supports (padding: max(0px)) {
  .safe-bottom { padding-bottom:max(var(--safe-bottom),12px); }
}

.bottom-bar {
  display:flex; align-items:center; justify-content:center;
  gap: 40px;
  min-height:56px;
  padding-top:8px;
  padding-bottom:max(env(safe-area-inset-bottom,0px),8px);
}
.bottom-bar a, .bottom-bar button {
  min-width:44px; min-height:44px;
  display:flex; align-items:center; justify-content:center;
  background: transparent;
  border: 0;
}

.progress-wrapper { bottom: var(--bottom-ui); margin-bottom: 1px; }

/* =========================
   TOP LOGO PANEL
   ========================= */
#upPanel {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 575px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 50;
}
#upPanel a { pointer-events: auto; }

/* =========================
   PERSONALIZED BANNER
   ========================= */
#personalizedBanner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  background: rgba(15,15,15,0.96);
  border-radius: 9999px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.7);
  border: 1px solid rgba(244,114,182,0.7);
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transform-origin: top center;
}

#personalizedBannerIcon {
  width: 20px;
  height: 20px;
  border-radius: 9999px;
  background: radial-gradient(circle at 30% 20%, #fde68a, #fb7185);
  display:flex;
  align-items:center;
  justify-content:center;
}

#personalizedBanner.show { animation: bannerIn 0.4s ease-out forwards; }
#personalizedBanner.hide { animation: bannerOut 0.4s ease-in forwards; }

@keyframes bannerIn {
  0%   { transform: translateX(-50%) translateY(-10px) scale(0.95); opacity: 0; }
  60%  { transform: translateX(-50%) translateY(0) scale(1.02); opacity: 1; }
  100% { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
}
@keyframes bannerOut {
  0%   { transform: translateX(-50%) translateY(0) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-10px) scale(0.95); opacity: 0; }
}

/* =========================
   SWIPE HINT
   ========================= */
#swipeHint {
  position: fixed;
  right: calc(50% - 260px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
}

#swipeHintCircle {
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  border: 2px solid #ec4899;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: swipePulse 1.2s infinite ease-in-out;
  box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.7);
}
#swipeHint svg { width: 26px; height: 26px; fill: #ffffff; }

/* =========================
   LIKE HINT
   ========================= */
#likeHint {
  position: fixed;
  right: calc(50% - 260px);
  bottom: 190px;
  z-index: 65;
}

#likeHintInner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 9999px;
  background: rgba(0,0,0,0.85);
  border: 1px solid #f97373;
  box-shadow: 0 8px 20px rgba(0,0,0,0.6);
  cursor: pointer;
}

#likeHintHeart {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  background: #ef4444;
  display:flex;
  align-items:center;
  justify-content:center;
  animation: swipePulse 1.2s infinite ease-in-out;
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.8);
}

#likeHintHeart svg { width: 16px; height: 16px; fill: #fff; }
#likeHintText { font-size: 12px; white-space: nowrap; }

@keyframes swipePulse {
  0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.7); }
  70%  { transform: scale(1.08); box-shadow: 0 0 0 14px rgba(236, 72, 153, 0); }
  100% { transform: scale(1);    box-shadow: 0 0 0 0 rgba(236, 72, 153, 0); }
}

/* =========================
   CONFETTI
   ========================= */
#confettiContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 45vh;
  overflow: visible;
  pointer-events: none;
  z-index: 79;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall 1.6s ease-out forwards;
}

@keyframes confettiFall {
  0%   { transform: translate3d(0,-30px,0) rotateZ(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate3d(0,180px,0) rotateZ(360deg); opacity: 0; }
}

/* =========================
   VPN MODAL (iOS only)
   ========================= */
#vpnOverlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(8px);
}

#vpnOverlay.show { display:flex; animation: vpnFadeIn .22s ease-out both; }
@keyframes vpnFadeIn { from { opacity: 0; } to { opacity: 1; } }

#vpnModal {
  width: min(560px, 94vw);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 90px rgba(0,0,0,0.65);
  overflow: hidden;
  position: relative;

  background:
    radial-gradient(1200px 260px at 50% -60px, rgba(236,72,153,0.58), transparent 62%),
    radial-gradient(900px 320px at 20% 120%, rgba(56,189,248,0.22), transparent 55%),
    linear-gradient(180deg, rgba(20,20,20,0.92), rgba(10,10,10,0.92));
}

#vpnModal::before{
  content:'';
  position:absolute; inset:-2px;
  background: linear-gradient(90deg,
    rgba(236,72,153,0.0),
    rgba(236,72,153,0.55),
    rgba(168,85,247,0.55),
    rgba(56,189,248,0.35),
    rgba(236,72,153,0.0)
  );
  filter: blur(18px);
  opacity: 0.55;
  pointer-events:none;
}

#vpnModalInner{
  position: relative;
  padding: 26px 22px 22px;
}

#vpnCloseBtn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.9);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
  position: absolute;
  top: 16px;
  right: 16px;
  user-select: none;
  z-index: 3;
}
#vpnCloseBtn.disabled { opacity: .55; cursor: not-allowed; }
#vpnCloseBtn svg { width: 18px; height: 18px; fill: rgba(255,255,255,0.92); }

#vpnCloseCountdown{
  position:absolute;
  right: -6px;
  top: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 9999px;
  background: rgba(0,0,0,0.55);
  border: 1px solid rgba(255,255,255,0.16);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size: 12px;
  color: rgba(255,255,255,0.92);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

#vpnModalTop{
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding-top: 6px;
}

#vpnTopLeft{
  width: 100%;
  display:flex;
  flex-direction: column;
  align-items:center;
  text-align:center;
  gap: 14px;
  padding: 4px 56px 0 56px;
}

#vpnLogoWrap{
  display:flex;
  align-items:center;
  justify-content:center;
}

#vpnLogoImg{
  display:block;
  width: 108px;
  height: 108px;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 16px 45px rgba(0,0,0,0.55);
}

#vpnText{ width:100%; max-width: 480px; }

#vpnTitle{
  font-size: 20px;
  font-weight: 900;
  line-height: 1.18;
  margin: 0;
  letter-spacing: .2px;
}

#vpnSub{
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(255,255,255,0.84);
}

#vpnBadges{
  display:flex;
  flex-wrap: wrap;
  justify-content:center;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 18px;
}

.vpnBadge{
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.90);
  backdrop-filter: blur(6px);
}

#vpnInstallBtn{
  width: 100%;
  height: 56px;
  border-radius: 18px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.25px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 0;
  color: rgba(255,255,255,0.96);
  cursor: pointer;

  background: linear-gradient(90deg,
    rgba(236,72,153,1),
    rgba(168,85,247,1),
    rgba(56,189,248,1),
    rgba(236,72,153,1)
  );
  background-size: 240% 240%;
  animation: vpnBtnFlow 2.2s ease-in-out infinite, vpnBtnPulse 1.6s ease-in-out infinite;
  box-shadow: 0 18px 55px rgba(236,72,153,0.28);
  position: relative;
  overflow: hidden;
}

#vpnInstallBtn::after{
  content:'';
  position:absolute;
  top:-40%;
  left:-30%;
  width: 60%;
  height: 180%;
  transform: rotate(25deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  animation: vpnShine 2.0s ease-in-out infinite;
  pointer-events:none;
}

@keyframes vpnBtnFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes vpnBtnPulse {
  0%   { transform: translateZ(0) scale(1);    box-shadow: 0 18px 55px rgba(236,72,153,0.26); }
  50%  { transform: translateZ(0) scale(1.02); box-shadow: 0 22px 70px rgba(168,85,247,0.32); }
  100% { transform: translateZ(0) scale(1);    box-shadow: 0 18px 55px rgba(236,72,153,0.26); }
}
@keyframes vpnShine {
  0%   { transform: translateX(-60%) rotate(25deg); opacity: 0; }
  20%  { opacity: 1; }
  60%  { opacity: 1; }
  100% { transform: translateX(260%) rotate(25deg); opacity: 0; }
}

.vpnPopIn { animation: vpnPop .26s ease-out both; }
@keyframes vpnPop {
  from { transform: translateY(14px) scale(0.985); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* =========================
   PWA INSTALL ICON (BOTTOM)
   ========================= */
#pwaInstallIcon{
  position: relative;
  border-radius: 9999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(236,72,153,0.35);
  box-shadow: 0 10px 30px rgba(0,0,0,0.55);
}
#pwaInstallIcon .pwa-ic{
  width: 22px;
  height: 22px;
  fill: rgba(255,255,255,0.95);
  position: relative;
  z-index: 2;
}
#pwaInstallIcon .pwa-ring{
  position:absolute;
  inset: -6px;
  border-radius: 9999px;
  border: 2px solid rgba(236,72,153,0.75);
  box-shadow: 0 0 0 0 rgba(236,72,153,0.55);
  animation: pwaPulse 1.25s ease-in-out infinite;
  z-index: 1;
}
@keyframes pwaPulse {
  0%   { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(236,72,153,0.55); opacity: 0.95; }
  70%  { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(236,72,153,0); opacity: 1; }
  100% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(236,72,153,0); opacity: 0.95; }
}

/* =========================
   PWA MODAL (non-iOS)
   ========================= */
#pwaOverlay {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px 14px;
  background: rgba(0,0,0,0.58);
  backdrop-filter: blur(8px);
}
#pwaOverlay.show { display:flex; animation: pwaFadeIn .22s ease-out both; }
@keyframes pwaFadeIn { from { opacity: 0; } to { opacity: 1; } }

#pwaModal {
  width: min(560px, 94vw);
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 24px 90px rgba(0,0,0,0.65);
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(1200px 260px at 50% -60px, rgba(236,72,153,0.58), transparent 62%),
    radial-gradient(900px 320px at 20% 120%, rgba(56,189,248,0.22), transparent 55%),
    linear-gradient(180deg, rgba(20,20,20,0.92), rgba(10,10,10,0.92));
}
#pwaModal::before{
  content:'';
  position:absolute; inset:-2px;
  background: linear-gradient(90deg,
    rgba(236,72,153,0.0),
    rgba(236,72,153,0.55),
    rgba(168,85,247,0.55),
    rgba(56,189,248,0.35),
    rgba(236,72,153,0.0)
  );
  filter: blur(18px);
  opacity: 0.55;
  pointer-events:none;
}
#pwaModalInner{
  position: relative;
  padding: 26px 22px 22px;
}
#pwaCloseBtn{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.35);
  color: rgba(255,255,255,0.9);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor: pointer;
  position: absolute;
  top: 16px;
  right: 16px;
  user-select: none;
  z-index: 3;
}
#pwaCloseBtn svg { width: 18px; height: 18px; fill: rgba(255,255,255,0.92); }

#pwaTop{
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding-top: 6px;
}
#pwaTopInner{
  width: 100%;
  display:flex;
  flex-direction: column;
  align-items:center;
  text-align:center;
  gap: 14px;
  padding: 4px 56px 0 56px;
}
#pwaLogo{
  width: 108px;
  height: 108px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 16px 45px rgba(0,0,0,0.55);
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(0,0,0,0.25);
}
#pwaLogo img{
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: 22px;
}
#pwaTitle{
  font-size: 20px;
  font-weight: 900;
  line-height: 1.18;
  margin: 0;
}
#pwaSub{
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(255,255,255,0.84);
}
#pwaHowto{
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.35;
  color: rgba(255,255,255,0.72);
  max-width: 480px;
}
#pwaBadges{
  display:flex;
  flex-wrap: wrap;
  justify-content:center;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 18px;
}
.pwaBadge{
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.90);
  backdrop-filter: blur(6px);
}
#pwaInstallBtn{
  width: 100%;
  height: 56px;
  border-radius: 18px;
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.25px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 0;
  color: rgba(255,255,255,0.96);
  cursor: pointer;
  background: linear-gradient(90deg,
    rgba(236,72,153,1),
    rgba(168,85,247,1),
    rgba(56,189,248,1),
    rgba(236,72,153,1)
  );
  background-size: 240% 240%;
  animation: vpnBtnFlow 2.2s ease-in-out infinite, vpnBtnPulse 1.6s ease-in-out infinite;
  box-shadow: 0 18px 55px rgba(236,72,153,0.28);
  position: relative;
  overflow: hidden;
}
