/* miya · iOS-style lock screen */

.miya-lockscreen {
  --lk-time: clamp(64px, 18vw, 88px);
  --lk-ink: rgba(255, 255, 255, 0.97);
  --lk-muted: rgba(255, 255, 255, 0.78);
  --lk-key: rgba(255, 255, 255, 0.14);
  --lk-key-active: rgba(255, 255, 255, 0.24);
  position: fixed;
  inset: 0;
  z-index: 8800;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", "PingFang SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.miya-lockscreen:not([hidden]) {
  visibility: visible;
}

.miya-lockscreen.is-show {
  opacity: 1;
  pointer-events: auto;
}

body.miya-lock-active {
  overflow: hidden;
}

.miya-lockscreen__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.06) 0%, transparent 55%),
    linear-gradient(180deg, #22262e 0%, #12151a 52%, #090a0d 100%);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 0.4s ease, filter 0.35s ease;
}

.miya-lockscreen__bg.has-wallpaper {
  background-color: #0a0a0a;
}

.miya-lockscreen.is-passcode .miya-lockscreen__bg {
  transform: scale(1.06);
  filter: blur(24px) brightness(0.5);
}

.miya-lockscreen__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.22) 0%, transparent 32%, transparent 68%, rgba(0, 0, 0, 0.38) 100%);
  pointer-events: none;
}

.miya-lockscreen__main {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  transition: opacity 0.32s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.miya-lockscreen.is-passcode .miya-lockscreen__main {
  opacity: 0;
  transform: translateY(-16px);
  pointer-events: none;
}

.miya-lockscreen__clock {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(env(safe-area-inset-top, 0px) + min(14vh, 104px)) 28px 0;
  text-align: center;
  color: var(--lk-ink);
}

.miya-lockscreen__time {
  margin: 0;
  font-size: var(--lk-time);
  font-weight: 200;
  letter-spacing: -0.045em;
  line-height: 1;
  text-shadow: 0 6px 28px rgba(0, 0, 0, 0.32);
}

.miya-lockscreen__date {
  margin: 12px 0 0;
  font-size: clamp(18px, 4.5vw, 22px);
  font-weight: 500;
  letter-spacing: 0.015em;
  color: var(--lk-muted);
  text-shadow: 0 3px 16px rgba(0, 0, 0, 0.26);
}

.miya-lockscreen__swipe {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 0 24px calc(env(safe-area-inset-bottom, 0px) + 22px);
  cursor: pointer;
}

.miya-lockscreen__hint {
  margin: 0;
  color: var(--lk-muted);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.miya-lockscreen__home-bar {
  width: 132px;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.18);
}

.miya-lockscreen__pass {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + min(16vh, 108px))
    24px
    calc(env(safe-area-inset-bottom, 0px) + 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.32s ease;
}

.miya-lockscreen.is-passcode .miya-lockscreen__pass {
  opacity: 1;
  pointer-events: auto;
}

.miya-lockscreen__pass-head {
  text-align: center;
}

.miya-lockscreen__pass-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--lk-ink);
  letter-spacing: 0.01em;
}

.miya-lockscreen__dots {
  display: flex;
  gap: 20px;
  margin-top: 24px;
  justify-content: center;
}

.miya-lock__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: transparent;
  transition: background 0.16s ease, transform 0.16s ease;
}

.miya-lock__dot.is-filled {
  background: rgba(255, 255, 255, 0.96);
  transform: scale(1.06);
}

.miya-lockscreen.is-shake .miya-lockscreen__dots {
  animation: miya-lock-shake 0.48s ease;
}

@keyframes miya-lock-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
}

.miya-lockscreen__keypad {
  width: min(100%, 320px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 3.2vw, 20px);
}

.miya-lockscreen__key {
  width: 100%;
  aspect-ratio: 1;
  max-width: 76px;
  max-height: 76px;
  margin: 0 auto;
  border: none;
  border-radius: 50%;
  background: var(--lk-key);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--lk-ink);
  font-size: clamp(28px, 7.5vw, 34px);
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.12s ease;
}

.miya-lockscreen__key:active {
  background: var(--lk-key-active);
  transform: scale(0.94);
}

.miya-lockscreen__key--blank {
  visibility: hidden;
  pointer-events: none;
}

.miya-lockscreen__key--delete {
  font-size: 24px;
  font-weight: 400;
  background: transparent;
}

.miya-lockscreen__key--delete:active {
  background: rgba(255, 255, 255, 0.1);
}

/* ── Beautify · lock settings ── */
.ins-atelier-lock-card {
  margin-bottom: 28px;
  padding: 22px 20px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 246, 242, 0.88) 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.04);
}

.ins-atelier-lock-card + .ins-atelier-showcase {
  margin-top: 8px;
}

.ins-atelier-lock-preview {
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #111;
}

.ins-atelier-lock-preview__screen {
  position: relative;
  aspect-ratio: 9 / 16;
  max-height: 200px;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, transparent 40%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(180deg, #2a2f38 0%, #12151a 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.ins-atelier-lock-preview__screen.has-image .ins-atelier-lock-preview__placeholder {
  opacity: 0;
}

.ins-atelier-lock-preview__time {
  font-size: 36px;
  font-weight: 200;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.ins-atelier-lock-preview__date {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  opacity: 0.78;
}

.ins-atelier-lock-preview__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.55);
  transition: opacity 0.25s ease;
}

.ins-atelier-lock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ins-atelier-lock-pass-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ins-atelier-lock-note {
  margin: 14px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(201, 169, 98, 0.08);
  border: 1px solid rgba(201, 169, 98, 0.18);
  font-size: 12px;
  line-height: 1.55;
  color: rgba(0, 0, 0, 0.58);
}

.ins-atelier-splash-pill--lock {
  margin-top: 14px;
}

.ins-atelier-splash-pill--lock:first-of-type {
  margin-top: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .miya-lockscreen,
  .miya-lockscreen__bg,
  .miya-lockscreen__main,
  .miya-lockscreen__pass {
    transition-duration: 0.01ms !important;
  }
}
