
/* =========================================================
   ELIZANUDI LOCK SCREEN — COMPLETE POSITIONING FIX
   Full-screen background + PIN dots + keypad + animations
   ========================================================= */

#xLockScreen {
  position: fixed;
  inset: 0;
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100vw;
  height: 100vh;
  height: 100dvh;

  overflow: hidden;
  background: #c5b8a8;

  transition: opacity 0.65s ease, visibility 0.65s ease;
}

#xLockScreen.xlock-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.xlock-active {
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}

/* ---------- FULL-SCREEN BACKGROUND ---------- */

.xlock-stage {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  max-width: none;
  max-height: none;

  overflow: hidden;
  flex-shrink: 0;
}

.xlock-bg {
  position: absolute;
  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center center;

  display: block;
  user-select: none;
  -webkit-user-drag: none;

  z-index: 1;
  pointer-events: none;
}

/* ---------- SOFT FLOATING PARTICLES ---------- */

.xlock-particles {
  position: absolute;
  inset: 0;

  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.xlock-p {
  position: absolute;

  border-radius: 50%;
  opacity: 0;

  background: radial-gradient(
    circle,
    rgba(255, 200, 220, 0.85),
    rgba(255, 180, 210, 0.15)
  );

  box-shadow: 0 0 5px rgba(255, 190, 210, 0.4);

  animation: xlock-drift linear infinite;
}

@keyframes xlock-drift {
  0% {
    transform: translateY(8px) scale(0.6);
    opacity: 0;
  }

  15% {
    opacity: 0.55;
  }

  50% {
    opacity: 0.35;
  }

  85% {
    opacity: 0.2;
  }

  100% {
    transform: translateY(-105vh) scale(1);
    opacity: 0;
  }
}

/* ---------- PIN DOTS — INSIDE BEIGE TAG ---------- */

.xlock-pin-area {
  position: absolute;
  z-index: 5;

  /* Updated: dots moved right */
  left: 48%;
  width: 20%;

  /* Updated: dots moved slightly upward */
  top: 47.8%;
  height: 2.6%;

  display: flex;
  align-items: center;
  justify-content: center;

  pointer-events: none;
  box-sizing: border-box;
}

.xlock-dots {
  display: flex;

  width: 100%;
  height: 100%;

  gap: clamp(5px, 1.6vw, 10px);

  justify-content: center;
  align-items: center;
}

.xlock-slot {
  width: clamp(9px, 2.3vw, 14px);
  height: clamp(9px, 2.3vw, 14px);

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  flex-shrink: 0;
}

.xlock-slot .num {
  font-size: clamp(0.65rem, 2.2vw, 0.85rem);
  font-weight: 700;

  color: #5a3a4a;

  position: absolute;
  opacity: 0;

  transition:
    opacity 0.18s ease,
    transform 0.24s ease;

  line-height: 1;
}

.xlock-slot .num.show {
  opacity: 1;
  transform: scale(1);
}

.xlock-slot .num.to-dot {
  opacity: 0;
  transform: scale(0.2);
}

.xlock-slot .dot {
  width: clamp(7px, 1.7vw, 11px);
  height: clamp(7px, 1.7vw, 11px);

  border-radius: 50%;

  background: #c45a7a;
  border: 1px solid #a04060;

  opacity: 0;
  transform: scale(0.25);

  transition:
    opacity 0.2s ease 0.08s,
    transform 0.24s cubic-bezier(0.34, 1.4, 0.64, 1) 0.06s;
}

.xlock-slot .dot.on {
  opacity: 1;
  transform: scale(1);
}

/* ---------- KEYPAD — INSIDE WHITE FABRIC AREA ---------- */

.xlock-keypad {
  position: absolute;
  z-index: 5;

  /* Updated: keypad moved right */
  left: 41%;
  width: 34%;

  /* Updated: keypad moved upward */
  top: 53.2%;
  height: 21.5%;

  display: grid;

  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));

  column-gap: 4%;
  row-gap: 3%;

  align-items: center;
  justify-items: center;

  box-sizing: border-box;
  padding: 0;
}

/* ---------- INDIVIDUAL BUTTONS ---------- */

.xlock-key {
  appearance: none;
  border: none;
  background: transparent;

  padding: 0;
  margin: 0;

  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  width: 100%;
  height: 100%;

  max-width: 100%;
  max-height: 100%;

  aspect-ratio: 1;
  border-radius: 50%;

  -webkit-tap-highlight-color: transparent;
  user-select: none;

  transition:
    transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.xlock-key img {
  width: 100%;
  height: 100%;

  object-fit: contain;
  display: block;

  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;

  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.12));
}

/* ---------- JELLY PRESS ---------- */

.xlock-key:active,
.xlock-key.jelly {
  transform: scale(0.82);
}

.xlock-key.jelly-bounce {
  animation: xlock-bounce 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes xlock-bounce {
  0% {
    transform: scale(0.82);
  }

  55% {
    transform: scale(1.08);
  }

  100% {
    transform: scale(1);
  }
}

.xlock-key:hover:not(:active):not(.jelly) {
  transform: translateY(-1px) scale(1.03);
}

.xlock-key:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* ---------- WRONG / SUCCESS OVERLAY ---------- */

.xlock-overlay {
  position: fixed;
  inset: 0;

  z-index: 100000;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(28, 14, 22, 0.58);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.45s ease,
    visibility 0.45s ease;

  padding: 16px;
}

.xlock-overlay.show {
  opacity: 1;
  visibility: visible;
}

.xlock-overlay video,
.xlock-overlay img.xlock-success {
  max-width: min(92vw, 480px);
  max-height: min(72vh, 500px);

  border-radius: 14px;

  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  background: #111;
}

.xlock-overlay img.xlock-success {
  background: transparent;
  object-fit: contain;
}

/* ---------- MOBILE RESPONSIVENESS ---------- */

@media (max-width: 480px) {
  .xlock-stage {
    inset: 0;
    width: 100%;
    height: 100%;
  }

  /* Keep the updated PIN position on mobile */
  .xlock-pin-area {
    left: 48%;
    width: 20%;

    top: 47.8%;
    height: 2.6%;
  }

  /* Keep the updated keypad position on mobile */
  .xlock-keypad {
    left: 41%;
    width: 34%;

    top: 53.2%;
    height: 21.5%;
  }
}

/* ---------- REDUCED MOTION ---------- */

@media (prefers-reduced-motion: reduce) {
  .xlock-p {
    animation: none !important;
    opacity: 0 !important;
  }

  .xlock-key.jelly-bounce {
    animation: none !important;
  }

  .xlock-key,
  .xlock-slot .dot,
  .xlock-slot .num {
    transition: none !important;
  }
}
