/* ============================================================
 * SMAU OS — smau-lock.css
 * Path: css/smau-lock.css
 * Owns: Lock screen visual layer ONLY
 *   - Layout, typography, effects, animations
 *   - Effect variants via data-lock-effect on #screen-lock
 *   - Does NOT touch routing truth, pointer-events logic, or z-index stacking
 *
 * Effect variants (set data-lock-effect="X" on #screen-lock):
 *   "none"      — clean minimal glass (default)
 *   "aurora"    — animated northern lights gradient blobs
 *   "rain"      — CSS-only falling rain shimmer
 *   "pulse"     — slow breathing glow from wallpaper palette
 *   "prism"     — light refraction / rainbow edge effects
 *   "static"    — analog TV static noise grain
 *   "frosted"   — deep frosted glass with bokeh circles
 *   "neon"      — cyberpunk neon edge glow
 * ============================================================ */

/* ─── Reset / Base ────────────────────────────────────────── */
#screen-lock {
  position: absolute;
  inset: 0;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;

  /* Tokens */
  --lock-font-time: "SF Pro Display", "Helvetica Neue", system-ui, sans-serif;
  --lock-font-date: "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  --lock-font-body: "SF Pro Text", system-ui, sans-serif;

  --lock-text-primary:   rgba(255, 255, 255, 0.97);
  --lock-text-secondary: rgba(255, 255, 255, 0.66);
  --lock-text-tertiary:  rgba(255, 255, 255, 0.40);

  --lock-glass-bg:       rgba(255, 255, 255, 0.075);
  --lock-glass-bg-2:     rgba(255, 255, 255, 0.055);
  --lock-glass-border:   rgba(255, 255, 255, 0.16);
  --lock-glass-border-2: rgba(255, 255, 255, 0.10);
  --lock-glass-shadow:   0 10px 36px rgba(0, 0, 0, 0.42), 0 2px 10px rgba(0, 0, 0, 0.22);

  --lock-blur-base:      18px;
  --lock-blur-heavy:     42px;

  --lock-accent-1: #a78bfa; /* violet */
  --lock-accent-2: #60a5fa; /* blue   */
  --lock-accent-3: #f472b6; /* pink   */
  --lock-accent-4: #34d399; /* teal   */

  /* Timing */
  --lock-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --lock-ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Safe areas */
  --lock-safe-top: env(safe-area-inset-top, 0px);
  --lock-safe-bottom: env(safe-area-inset-bottom, 0px);

  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  cursor: default;

  font-family: var(--lock-font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Wallpaper Layer ─────────────────────────────────────── */
#screen-lock::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--lock-wallpaper, var(--home-wallpaper-image, none));
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  transform: scale(1.06);
  transform-origin: center;
  transition: transform 9s ease-in-out;
  z-index: 0;
}

/* Darken + vignette + subtle color separation */
#screen-lock::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 120% 90% at 50% 18%, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.00) 55%),
    radial-gradient(ellipse 120% 85% at 50% 72%, rgba(96,165,250,0.06) 0%, rgba(96,165,250,0.00) 55%),
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.16) 0%,
      rgba(0, 0, 0, 0.26) 34%,
      rgba(0, 0, 0, 0.54) 72%,
      rgba(0, 0, 0, 0.74) 100%
    );
  z-index: 1;
}

/* Everything inside the lock is above these layers.
   IMPORTANT: do NOT force position here, or it will override absolute children like .lock-bottom. */
#screen-lock > * {
  z-index: 2;
}

/* ─── Baseline effect layer (present even in default/none) ─── */
#screen-lock .lock-effect-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;

  /* default subtle glass haze and micro grain */
  background:
    radial-gradient(ellipse 70% 50% at 50% 30%, rgba(255,255,255,0.035) 0%, rgba(255,255,255,0.00) 62%),
    radial-gradient(ellipse 55% 35% at 30% 78%, rgba(96,165,250,0.030) 0%, rgba(96,165,250,0.00) 70%);
}

/* Subtle grain overlay without “noisy floor” look. Only on lock. */
#screen-lock .lock-effect-layer::before {
  content: "";
  position: absolute;
  inset: -6%;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* Optional extra haze line */
#screen-lock .lock-effect-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(255,255,255,0.02), rgba(255,255,255,0.00) 40%, rgba(0,0,0,0.06));
  opacity: 0.55;
  pointer-events: none;
}

/* ─── Entry Animation ─────────────────────────────────────── */
@keyframes lockEntrance {
  from {
    opacity: 0;
    transform: scale(1.02) translateY(-10px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

#screen-lock[data-state="open"] {
  animation: lockEntrance 0.45s var(--lock-ease-smooth) both;
}

#screen-lock[data-state="open"]::before {
  transform: scale(1.035);
}

/* ─── Status Bar Area ─────────────────────────────────────── */
.lock-status-bar {
  width: 100%;
  padding: var(--lock-safe-top) 20px 0;
  height: calc(44px + var(--lock-safe-top));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-shrink: 0;
}

/* ─── Clock Block ─────────────────────────────────────────── */
.lock-clock-block {
  position: relative; /* needed for ::before highlight anchoring */

  margin-top: 34px;
  padding: 18px 22px 16px;
  border-radius: 26px;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

  background:
    linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.06) 100%),
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.00) 55%);
  border: 1px solid var(--lock-glass-border-2);
  box-shadow: var(--lock-glass-shadow);

  backdrop-filter: blur(var(--lock-blur-base)) saturate(175%);
  -webkit-backdrop-filter: blur(var(--lock-blur-base)) saturate(175%);

  animation: lockEntrance 0.5s 0.05s var(--lock-ease-smooth) both;
}

/* Gentle top highlight line */
.lock-clock-block::before {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  top: 10px;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.22), transparent);
  opacity: 0.9;
  pointer-events: none;
}

#lock-time {
  position: relative;
  overflow: hidden;

  font-family: var(--lock-font-time);
  font-size: clamp(74px, 18vw, 98px);
  font-weight: 260;
  letter-spacing: -0.04em;
  color: var(--lock-text-primary);
  line-height: 1;

  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.34),
    0 0 64px rgba(255, 255, 255, 0.06);

  will-change: contents;
  transition: opacity 0.3s ease;
}

#lock-time::after {
  content: "";
  position: absolute;
  inset: -30% -40%;
  background: linear-gradient(
    120deg,
    transparent 38%,
    rgba(255, 255, 255, 0.06) 50%,
    transparent 62%
  );
  transform: translateX(-18%);
  opacity: 0.75;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes lockTimeSheen {
  0%   { transform: translateX(-22%) rotate(0.001deg); opacity: 0.35; }
  45%  { opacity: 0.60; }
  100% { transform: translateX(22%) rotate(0.001deg); opacity: 0.35; }
}

#screen-lock[data-state="open"] #lock-time::after {
  animation: lockTimeSheen 7.5s ease-in-out infinite;
}

#lock-date {
  font-family: var(--lock-font-date);
  font-size: clamp(14px, 3.8vw, 18px);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--lock-text-secondary);
  text-transform: uppercase;

  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.34);
  margin-top: 2px;
}

/* ─── Notification Preview ────────────────────────────────── */
#lock-notify {
  position: relative; /* safe anchoring for any future pseudo elements */

  width: calc(100% - 32px);
  max-width: 420px;
  margin: 18px auto 0;

  border-radius: 20px;
  background: var(--lock-glass-bg);
  border: 1px solid var(--lock-glass-border);
  box-shadow: var(--lock-glass-shadow);

  backdrop-filter: blur(var(--lock-blur-base)) saturate(175%);
  -webkit-backdrop-filter: blur(var(--lock-blur-base)) saturate(175%);

  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;

  transition:
    opacity 0.25s ease,
    transform 0.28s var(--lock-ease-spring),
    background 0.18s ease;

  animation: lockEntrance 0.5s 0.12s var(--lock-ease-smooth) both;
}

/* IMPORTANT: default hidden unless explicitly open */
#lock-notify:not([data-state="open"]) {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px) scale(0.975);
  visibility: hidden;
}

#lock-notify[data-state="open"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
}

#lock-notify:active {
  transform: translateY(0) scale(0.985);
  background: rgba(255, 255, 255, 0.11);
}

.lock-notify-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}

.lock-notify-content {
  flex: 1;
  min-width: 0;
}

.lock-notify-app {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--lock-text-tertiary);
  margin-bottom: 3px;
}

.lock-notify-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--lock-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lock-notify-body {
  font-size: 13px;
  font-weight: 450;
  color: var(--lock-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Count badge */
[data-lock-notify-count]:not(:empty) {
  background: rgba(255, 255, 255, 0.22);
  color: var(--lock-text-primary);
  font-size: 11px;
  font-weight: 800;
  border-radius: 99px;
  padding: 2px 7px;
  flex-shrink: 0;
}

/* Optional expanded notification state (visual only) */
#lock-notify[data-expanded="true"] {
  max-width: 520px;
  padding: 16px 18px;
  border-radius: 22px;
  background: rgba(255,255,255,0.085);
}
#lock-notify[data-expanded="true"] .lock-notify-title,
#lock-notify[data-expanded="true"] .lock-notify-body {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* ─── Bottom Area: Hint + Shortcuts ──────────────────────── */
.lock-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;

  width: 100%;

  padding-bottom: calc(var(--lock-safe-bottom) + 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 3;
}

/* Unlock hint text */
#lock-hint {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--lock-text-secondary);
  text-transform: uppercase;

  text-align: center;
  padding: 10px 0 14px;
  min-height: 36px;

  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.42);
  transition: opacity 0.25s ease, color 0.25s ease;
}

#lock-hint:empty::before {
  content: "Swipe up to unlock";
  color: var(--lock-text-tertiary);
}

/* Shortcut row */
.lock-shortcuts {
  width: 100%;
  padding: 0 28px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: lockEntrance 0.5s 0.2s var(--lock-ease-smooth) both;
}

/* If the DOM uses .lock-shortcut buttons, keep them aligned and sized too */
.lock-shortcut,
[data-lock-action] {
  width: 54px;
  height: 54px;
  border-radius: 50%;

  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0.10) 45%, rgba(255,255,255,0.06) 100%);
  border: 1px solid rgba(255, 255, 255, 0.20);

  backdrop-filter: blur(12px) saturate(165%);
  -webkit-backdrop-filter: blur(12px) saturate(165%);

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

  cursor: pointer;
  transition:
    transform 0.18s var(--lock-ease-spring),
    background 0.15s ease;

  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 10px 22px rgba(0,0,0,0.28);
}

.lock-shortcut:active,
[data-lock-action]:active {
  transform: scale(0.88);
  background: rgba(255, 255, 255, 0.22);
}

.lock-shortcut svg,
.lock-shortcut .lock-action-icon,
[data-lock-action] svg,
[data-lock-action] .lock-action-icon {
  width: 22px;
  height: 22px;
  color: var(--lock-text-primary);
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.34));
}

/* Swipe pill indicator (the real one at the bottom) */
.lock-home-indicator {
  width: 132px;
  height: 5px;
  background: rgba(255, 255, 255, 0.34);
  border-radius: 99px;
  margin: 0 auto 10px;
  transition: background 0.2s ease, transform 0.15s ease;
}

#screen-lock:active .lock-home-indicator {
  background: rgba(255, 255, 255, 0.52);
  transform: scaleX(0.94);
}

/* ─── HARD FIX: remove the mid-screen “pill” ────────────────
   Your elementFromPoint stack shows the pill is:
   BUTTON#btn-lock-unlock.lock-unlock
   So we remove it by default. If you ever want it back:
   <section id="screen-lock" data-lock-unlock-button="on"> ... */
#btn-lock-unlock,
#screen-lock .lock-unlock {
  display: none !important;
}

/* Opt-in: show unlock button only when explicitly enabled */
#screen-lock[data-lock-unlock-button="on"] #btn-lock-unlock {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* When opted-in, style it like a real button (kept from your original) */
#screen-lock[data-lock-unlock-button="on"] #btn-lock-unlock {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 99px;
  padding: 12px 32px;
  color: var(--lock-text-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 0.18s var(--lock-ease-spring),
    background 0.15s ease;
  margin-bottom: 16px;
}

#screen-lock[data-lock-unlock-button="on"] #btn-lock-unlock:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.20);
}

/* ─── OPTIONAL FIX (opt-in): hide bottom pill unless notify preview is open ───
   Enable by setting:  <div id="screen-lock" data-lock-pill="auto"> ... */
#screen-lock[data-lock-pill="auto"] .lock-home-indicator {
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scaleX(0.92);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0s linear 0.22s,
    background 0.2s ease;
}

#screen-lock[data-lock-pill="auto"] #lock-notify[data-state="open"] ~ .lock-bottom .lock-home-indicator {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scaleX(1);
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    visibility 0s,
    background 0.2s ease;
}

/* Active feedback only when visible in auto mode */
#screen-lock[data-lock-pill="auto"]:active #lock-notify[data-state="open"] ~ .lock-bottom .lock-home-indicator {
  background: rgba(255, 255, 255, 0.52);
  transform: translateY(0) scaleX(0.94);
}

/* ─── Optional lock “dim” state (visual only) ─────────────── */
#screen-lock[data-lock-dim="true"]::after {
  background:
    radial-gradient(ellipse 120% 90% at 50% 18%, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.00) 60%),
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.30) 0%,
      rgba(0, 0, 0, 0.44) 40%,
      rgba(0, 0, 0, 0.70) 100%
    );
}

#screen-lock[data-lock-dim="true"] .lock-clock-block,
#screen-lock[data-lock-dim="true"] #lock-notify {
  opacity: 0.92;
  filter: saturate(0.95);
}

/* ─── Optional: Now Playing widget hook (if DOM exists) ───── */
.lock-nowplaying {
  width: calc(100% - 32px);
  max-width: 420px;
  margin: 14px auto 0;
  border-radius: 20px;
  background: var(--lock-glass-bg-2);
  border: 1px solid var(--lock-glass-border-2);
  box-shadow: 0 10px 28px rgba(0,0,0,0.32);
  backdrop-filter: blur(var(--lock-blur-base)) saturate(165%);
  -webkit-backdrop-filter: blur(var(--lock-blur-base)) saturate(165%);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.lock-nowplaying .np-art {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.14);
  flex-shrink: 0;
}

.lock-nowplaying .np-meta {
  min-width: 0;
  flex: 1;
}
.lock-nowplaying .np-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--lock-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lock-nowplaying .np-sub {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--lock-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Optional: Incoming call overlay hook (if DOM exists) ─── */
.lock-incoming {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px 16px calc(var(--lock-safe-bottom) + 26px);
}

.lock-incoming .call-card {
  pointer-events: auto;
  border-radius: 26px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(var(--lock-blur-heavy)) saturate(170%);
  -webkit-backdrop-filter: blur(var(--lock-blur-heavy)) saturate(170%);
  box-shadow: 0 16px 44px rgba(0,0,0,0.50);
  padding: 16px 16px 14px;
}

.lock-incoming .call-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--lock-text-tertiary);
  font-weight: 800;
}
.lock-incoming .call-name {
  margin-top: 6px;
  font-size: 22px;
  font-weight: 750;
  color: var(--lock-text-primary);
}
.lock-incoming .call-actions {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.lock-incoming .call-actions button {
  pointer-events: auto;
  flex: 1;
  height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.08);
  color: var(--lock-text-primary);
  font-weight: 750;
  letter-spacing: 0.02em;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}

/* ─── Focus styles (keyboard/accessibility) ───────────────── */
#screen-lock a:focus-visible,
#screen-lock button:focus-visible,
#screen-lock [role="button"]:focus-visible,
#screen-lock [tabindex]:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.85);
  outline-offset: 3px;
  box-shadow:
    0 0 0 6px rgba(167, 139, 250, 0.18),
    0 10px 24px rgba(0,0,0,0.28);
}

/* Avoid double rings on iOS */
#screen-lock a:focus,
#screen-lock button:focus {
  outline: none;
}

/* ─── EFFECT SYSTEM ───────────────────────────────────────── */

/* ─── Effect: AURORA ─────────────────────────────────────── */
@keyframes auroraDrift1 {
  0%   { transform: translate(0%,    0%) scale(1)    rotate(0deg); }
  33%  { transform: translate(8%,  -10%) scale(1.08) rotate(12deg); }
  66%  { transform: translate(-5%,   6%) scale(0.95) rotate(-8deg); }
  100% { transform: translate(0%,    0%) scale(1)    rotate(0deg); }
}
@keyframes auroraDrift2 {
  0%   { transform: translate(0%,  0%) scale(1)    rotate(0deg); }
  40%  { transform: translate(-9%, 8%) scale(1.12) rotate(-15deg); }
  80%  { transform: translate(6%, -4%) scale(0.92) rotate(10deg); }
  100% { transform: translate(0%,  0%) scale(1)    rotate(0deg); }
}
@keyframes auroraDrift3 {
  0%   { transform: translate(0%,  0%) scale(1); }
  50%  { transform: translate(4%, 10%) scale(1.06); }
  100% { transform: translate(0%,  0%) scale(1); }
}

#screen-lock[data-lock-effect="aurora"] .lock-effect-layer {
  /* keep baseline styles, add stronger aurora visuals on top */
}

#screen-lock[data-lock-effect="aurora"] .lock-effect-layer::before,
#screen-lock[data-lock-effect="aurora"] .lock-effect-layer::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(82px);
  opacity: 0.28;
  mix-blend-mode: screen;
  pointer-events: none;
}

#screen-lock[data-lock-effect="aurora"] .lock-effect-layer::before {
  width: 72%;
  height: 72%;
  top: -22%;
  left: -12%;
  background: radial-gradient(ellipse, var(--lock-accent-1) 0%, transparent 70%);
  animation: auroraDrift1 14s ease-in-out infinite;
}

#screen-lock[data-lock-effect="aurora"] .lock-effect-layer::after {
  width: 66%;
  height: 66%;
  bottom: -18%;
  right: -12%;
  background: radial-gradient(ellipse, var(--lock-accent-2) 0%, transparent 70%);
  animation: auroraDrift2 18s ease-in-out infinite;
}

#screen-lock[data-lock-effect="aurora"] .lock-aurora-blob-3 {
  position: absolute;
  width: 56%;
  height: 56%;
  top: 30%;
  left: 25%;
  background: radial-gradient(ellipse, var(--lock-accent-3) 0%, transparent 70%);
  filter: blur(72px);
  opacity: 0.18;
  mix-blend-mode: screen;
  border-radius: 50%;
  pointer-events: none;
  animation: auroraDrift3 22s ease-in-out infinite;
  z-index: 1;
}

/* ─── Effect: RAIN ────────────────────────────────────────── */
@keyframes rainFall {
  from { transform: translateY(-8%) scaleX(0.9); opacity: 0.7; }
  to   { transform: translateY(110%) scaleX(0.9); opacity: 0; }
}

#screen-lock[data-lock-effect="rain"] .lock-effect-layer {
  background:
    radial-gradient(ellipse 60% 30% at 30% 80%, rgba(255,255,255,0.04) 0%, transparent 100%),
    radial-gradient(ellipse 40% 20% at 70% 90%, rgba(255,255,255,0.03) 0%, transparent 100%);
}

#screen-lock[data-lock-effect="rain"] .lock-effect-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 8px,
    rgba(255,255,255,0.045) 8px,
    rgba(255,255,255,0.045) 9px
  );
  background-size: 3px 48px;
  animation: rainFall 0.9s linear infinite;
  opacity: 0.9;
  pointer-events: none;
}

#screen-lock[data-lock-effect="rain"] .lock-effect-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 12px,
    rgba(255,255,255,0.025) 12px,
    rgba(255,255,255,0.025) 13px
  );
  background-size: 5px 72px;
  animation: rainFall 1.4s 0.3s linear infinite;
  opacity: 0.9;
  pointer-events: none;
}

/* ─── Effect: PULSE ───────────────────────────────────────── */
@keyframes lockPulse {
  0%   { opacity: 0.12; transform: scale(1); }
  50%  { opacity: 0.22; transform: scale(1.04); }
  100% { opacity: 0.12; transform: scale(1); }
}

#screen-lock[data-lock-effect="pulse"] .lock-effect-layer::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(
    ellipse 70% 50% at 50% 50%,
    var(--lock-accent-1) 0%,
    var(--lock-accent-2) 40%,
    transparent 70%
  );
  filter: blur(60px);
  mix-blend-mode: screen;
  animation: lockPulse 5s ease-in-out infinite;
  border-radius: 50%;
  pointer-events: none;
}

#screen-lock[data-lock-effect="pulse"] .lock-effect-layer::after {
  content: "";
  position: absolute;
  inset: -10%;
  background: radial-gradient(
    ellipse 50% 60% at 50% 50%,
    var(--lock-accent-3) 0%,
    transparent 65%
  );
  filter: blur(82px);
  mix-blend-mode: screen;
  animation: lockPulse 7s 2.5s ease-in-out infinite;
  border-radius: 50%;
  pointer-events: none;
}

/* ─── Effect: PRISM ───────────────────────────────────────── */
@keyframes prismShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

#screen-lock[data-lock-effect="prism"] .lock-effect-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 0, 128,  0.06) 0%,
    rgba(0,  128, 255, 0.06) 20%,
    rgba(0,  255, 128, 0.06) 40%,
    rgba(255, 255, 0,  0.06) 60%,
    rgba(255, 0,  255, 0.06) 80%,
    rgba(0,  255, 255, 0.06) 100%
  );
  background-size: 400% 400%;
  animation: prismShift 12s ease infinite;
  mix-blend-mode: screen;
  pointer-events: none;
}

#screen-lock[data-lock-effect="prism"] .lock-effect-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(255, 0, 120, 0.09) 0%, transparent 15%),
    linear-gradient(to left,  rgba(0, 150, 255, 0.09) 0%, transparent 15%),
    linear-gradient(to bottom, rgba(255, 200, 0, 0.06) 0%, transparent 12%);
  mix-blend-mode: screen;
  pointer-events: none;
}

/* ─── Effect: STATIC ──────────────────────────────────────── */
@keyframes staticNoise {
  0%   { transform: translate(0, 0); }
  10%  { transform: translate(-1%, 1%); }
  20%  { transform: translate(2%, -1%); }
  30%  { transform: translate(-2%, 2%); }
  40%  { transform: translate(1%, -2%); }
  50%  { transform: translate(-1%, 1%); }
  60%  { transform: translate(2%, 1%); }
  70%  { transform: translate(-1%, -1%); }
  80%  { transform: translate(1%, 2%); }
  90%  { transform: translate(-2%, -1%); }
  100% { transform: translate(0, 0); }
}

#screen-lock[data-lock-effect="static"] .lock-effect-layer {
  opacity: 0.33;
}

#screen-lock[data-lock-effect="static"] .lock-effect-layer::before {
  content: "";
  position: absolute;
  inset: -5%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  animation: staticNoise 0.08s steps(1) infinite;
  mix-blend-mode: overlay;
  opacity: 0.42;
  pointer-events: none;
}

#screen-lock[data-lock-effect="static"] .lock-effect-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.06) 2px,
    rgba(0, 0, 0, 0.06) 3px
  );
  pointer-events: none;
}

/* ─── Effect: FROSTED ─────────────────────────────────────── */
@keyframes bokehFloat {
  0%   { transform: translateY(0) scale(1); opacity: 0.22; }
  50%  { transform: translateY(-12%) scale(1.1); opacity: 0.38; }
  100% { transform: translateY(0) scale(1); opacity: 0.22; }
}

#screen-lock[data-lock-effect="frosted"] .lock-effect-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(2px) saturate(120%);
  -webkit-backdrop-filter: blur(2px) saturate(120%);
  pointer-events: none;
}

#screen-lock[data-lock-effect="frosted"] .lock-bokeh-1,
#screen-lock[data-lock-effect="frosted"] .lock-bokeh-2,
#screen-lock[data-lock-effect="frosted"] .lock-bokeh-3,
#screen-lock[data-lock-effect="frosted"] .lock-bokeh-4 {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

#screen-lock[data-lock-effect="frosted"] .lock-bokeh-1 {
  width: 140px; height: 140px;
  top: 10%; left: 5%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.6) 0%, transparent 70%);
  filter: blur(28px);
  animation: bokehFloat 9s 0s ease-in-out infinite;
}
#screen-lock[data-lock-effect="frosted"] .lock-bokeh-2 {
  width: 100px; height: 100px;
  top: 60%; right: 8%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.5) 0%, transparent 70%);
  filter: blur(22px);
  animation: bokehFloat 11s 2s ease-in-out infinite;
}
#screen-lock[data-lock-effect="frosted"] .lock-bokeh-3 {
  width: 80px; height: 80px;
  bottom: 25%; left: 20%;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.5) 0%, transparent 70%);
  filter: blur(18px);
  animation: bokehFloat 7s 4s ease-in-out infinite;
}
#screen-lock[data-lock-effect="frosted"] .lock-bokeh-4 {
  width: 60px; height: 60px;
  top: 40%; left: 60%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.45) 0%, transparent 70%);
  filter: blur(14px);
  animation: bokehFloat 13s 1s ease-in-out infinite;
}

/* ─── Effect: NEON ────────────────────────────────────────── */
@keyframes neonPulse {
  0%   { opacity: 0.5; }
  50%  { opacity: 0.82; }
  100% { opacity: 0.5; }
}
@keyframes neonScan {
  0%   { transform: translateY(-100%); }
  100% { transform: translateY(100vh); }
}

#screen-lock[data-lock-effect="neon"] .lock-effect-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right, rgba(var(--neon-r, 167), var(--neon-g, 139), var(--neon-b, 250), 0.15) 0%, transparent 6%),
    linear-gradient(to left,  rgba(var(--neon-r, 167), var(--neon-g, 139), var(--neon-b, 250), 0.12) 0%, transparent 6%),
    linear-gradient(to bottom, rgba(var(--neon-r, 167), var(--neon-g, 139), var(--neon-b, 250), 0.1) 0%, transparent 8%),
    linear-gradient(to top,    rgba(var(--neon-r, 167), var(--neon-g, 139), var(--neon-b, 250), 0.1) 0%, transparent 8%);
  animation: neonPulse 3s ease-in-out infinite;
  pointer-events: none;
}

#screen-lock[data-lock-effect="neon"] .lock-effect-layer::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(to right,
    transparent,
    rgba(167, 139, 250, 0.5) 30%,
    rgba(96, 165, 250, 0.7) 50%,
    rgba(167, 139, 250, 0.5) 70%,
    transparent
  );
  box-shadow:
    0 0 8px rgba(167, 139, 250, 0.6),
    0 0 20px rgba(96, 165, 250, 0.4);
  animation: neonScan 6s linear infinite;
  pointer-events: none;
}

#screen-lock[data-lock-effect="neon"] #lock-time {
  text-shadow:
    0 0 10px rgba(167, 139, 250, 0.8),
    0 0 30px rgba(167, 139, 250, 0.4),
    0 0 60px rgba(96, 165, 250, 0.2),
    0 2px 20px rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.96);
}

#screen-lock[data-lock-effect="neon"] #lock-date {
  color: var(--lock-accent-1);
  text-shadow:
    0 0 8px rgba(167, 139, 250, 0.6),
    0 0 20px rgba(167, 139, 250, 0.3);
}

/* ─── Screen state management ────────────────────────────── */
#screen-lock[data-state="closed"] {
  pointer-events: none;
  visibility: hidden;
}

/* ─── Passcode Pad (when enabled via data-lock-passcode) ──── */
.lock-passcode-wrap {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
  animation: lockEntrance 0.4s var(--lock-ease-spring) both;
}

#screen-lock[data-lock-passcode-mode="active"] .lock-passcode-wrap {
  display: flex;
}

#screen-lock[data-lock-passcode-mode="active"] .lock-clock-block {
  margin-top: 18px;
}

/* Dots row */
.lock-passcode-dots {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
}

.lock-passcode-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: transparent;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s var(--lock-ease-spring);
}

.lock-passcode-dot[data-filled="true"] {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.92);
  transform: scale(1.1);
}

@keyframes passcodeFail {
  0%   { transform: translateX(0); }
  15%  { transform: translateX(-8px); }
  30%  { transform: translateX(8px); }
  45%  { transform: translateX(-6px); }
  60%  { transform: translateX(6px); }
  75%  { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.lock-passcode-dots[data-state="fail"] {
  animation: passcodeFail 0.4s ease;
}

/* Number pad */
.lock-numpad {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  grid-template-rows: repeat(4, 72px);
  gap: 10px;
}

.lock-numpad-key {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px) saturate(140%);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.14s var(--lock-ease-spring),
    background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  color: var(--lock-text-primary);
  line-height: 1;
}

.lock-numpad-key:active {
  transform: scale(0.88);
  background: rgba(255, 255, 255, 0.28);
}

.lock-numpad-key[data-key="empty"] {
  background: transparent;
  border-color: transparent;
  pointer-events: none;
}

.lock-numpad-digit {
  font-family: var(--lock-font-time);
  font-size: 26px;
  font-weight: 300;
  line-height: 1;
}

.lock-numpad-sub {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lock-text-tertiary);
  margin-top: 2px;
}

.lock-numpad-key[data-key="delete"] .lock-numpad-digit {
  font-size: 18px;
  font-weight: 450;
}

/* Emergency / SOS alternate keypad hook (visual only) */
#screen-lock[data-lock-keypad="emergency"] .lock-passcode-wrap {
  gap: 14px;
}
.lock-emergency {
  width: calc(100% - 32px);
  max-width: 420px;
  border-radius: 20px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  padding: 12px 14px;
  text-align: center;
  color: var(--lock-text-secondary);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ─── Responsive: short screens ──────────────────────────── */
@media (max-height: 680px) {
  .lock-clock-block { margin-top: 18px; padding: 16px 20px 14px; }
  #lock-time { font-size: 64px; }
  #lock-notify { margin-top: 12px; }
  .lock-shortcuts { padding-bottom: 14px; }
}

@media (max-height: 580px) {
  #lock-time { font-size: 54px; }
  .lock-clock-block { margin-top: 12px; padding: 14px 18px 12px; }
  .lock-home-indicator { margin-bottom: 8px; }
}

/* ─── Responsive: very tall screens ───────────────────────── */
@media (min-height: 860px) {
  .lock-clock-block { margin-top: 52px; }
  #lock-notify { margin-top: 22px; }
  .lock-shortcuts { padding-bottom: 22px; }
}

/* ─── Landscape support ───────────────────────────────────── */
@media (orientation: landscape) and (max-height: 520px) {
  #screen-lock {
    align-items: center;
    justify-content: center;
  }

  .lock-status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
  }

  .lock-clock-block {
    margin-top: 0;
    transform: scale(0.92);
  }

  #lock-notify {
    margin-top: 10px;
    transform: scale(0.94);
  }

  .lock-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
  }
}

/* ─── Forced colors (high contrast) ───────────────────────── */
@media (forced-colors: active) {
  #screen-lock::before,
  #screen-lock::after,
  #screen-lock .lock-effect-layer,
  #screen-lock .lock-effect-layer::before,
  #screen-lock .lock-effect-layer::after {
    forced-color-adjust: none;
    background: Canvas;
  }

  #lock-time,
  #lock-date,
  #lock-hint,
  .lock-notify-title,
  .lock-notify-body {
    color: CanvasText;
    text-shadow: none;
  }

  .lock-clock-block,
  #lock-notify,
  .lock-shortcut,
  [data-lock-action] {
    background: Canvas;
    border: 1px solid CanvasText;
    box-shadow: none;
  }

  #screen-lock a:focus-visible,
  #screen-lock button:focus-visible,
  #screen-lock [role="button"]:focus-visible,
  #screen-lock [tabindex]:focus-visible {
    outline: 2px solid Highlight;
    box-shadow: none;
  }
}

/* ─── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #screen-lock[data-state="open"],
  .lock-clock-block,
  #lock-notify,
  .lock-shortcuts {
    animation: none;
  }

  #screen-lock[data-state="open"] #lock-time::after {
    animation: none;
  }

  #screen-lock[data-lock-effect] .lock-effect-layer::before,
  #screen-lock[data-lock-effect] .lock-effect-layer::after,
  #screen-lock[data-lock-effect="frosted"] .lock-bokeh-1,
  #screen-lock[data-lock-effect="frosted"] .lock-bokeh-2,
  #screen-lock[data-lock-effect="frosted"] .lock-bokeh-3,
  #screen-lock[data-lock-effect="frosted"] .lock-bokeh-4 {
    animation: none;
  }
}