:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: #000;
  color: #595959;
}
* { box-sizing: border-box; }
body { margin: 0; }
.lock-screen {
  --lift: 0px;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) 18px max(12px, env(safe-area-inset-bottom));
  overflow: clip;
  touch-action: none;
}
.pin { position: relative; width: min(100%, 16rem); }
.controls {
  display: grid;
  grid-template-rows: 34px auto 38px;
  justify-items: center;
  gap: clamp(14px, 4svh, 32px);
  transform: translateY(var(--lift));
  transition: transform 260ms cubic-bezier(.2, .8, .3, 1);
}
.lock-screen[data-dragging] .controls { transition: none; }
.dots {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
}
.dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #777;
}
.keypad {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(4px, 1.6svh, 14px) 8px;
}
.keypad button {
  --exit-delay: 0ms;
  display: grid;
  place-items: center;
  height: clamp(44px, 9svh, 68px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: 350 clamp(1.875rem, 4.7svh, 2.375rem)/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  cursor: pointer;
  user-select: none;
  transition: color 150ms, transform 150ms;
}
.keypad button:active { color: #929292; transform: scale(.9); }
.keypad button:nth-child(n + 4) { --exit-delay: 55ms; }
.keypad button:nth-child(n + 7) { --exit-delay: 110ms; }
.keypad button:nth-child(n + 10) { --exit-delay: 165ms; }
.keypad .zero { grid-column: 2; }
.delete svg { width: 23px; height: 23px; }
#message {
  margin: 0;
  color: #a0a0a0;
  font-size: .875rem;
  line-height: 1.3;
  text-align: center;
}
.visually-hidden, .keyboard-unlock:not(:focus-visible) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.keyboard-unlock:focus-visible {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  border: 0;
  border-radius: 6px;
  color: #ddd;
  background: #161616;
  font: inherit;
}
button:focus-visible { outline: 2px solid #aaa; outline-offset: 3px; }
.lock-screen[data-opening] .controls {
  animation: lift-off 590ms cubic-bezier(.35, .08, .26, 1) both;
}
.lock-screen[data-opening] .keypad button {
  animation: disperse 385ms cubic-bezier(.35, .04, .37, 1) var(--exit-delay) both;
}
.lock-screen[data-opening] .dots {
  animation: converge 440ms cubic-bezier(.32, .03, .36, 1) both;
}
@keyframes lift-off {
  from { transform: translateY(var(--lift)); }
  to { transform: translateY(calc(var(--lift) - 14svh)); }
}
@keyframes disperse {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  25% { opacity: 1; transform: translateY(-7px) scale(1.09); }
  100% { opacity: 0; transform: translateY(-92px) scale(.25); filter: blur(5px); }
}
@keyframes converge {
  0% { opacity: 1; transform: scale(1); }
  40% { opacity: .8; transform: translateY(-12px) scale(.34, .7); }
  100% { opacity: 0; transform: translateY(-65px) scale(.1, .4); }
}
@media (prefers-reduced-motion: reduce) {
  .controls, .keypad button { transition: none; }
  .lock-screen[data-opening] .controls, .lock-screen[data-opening] .keypad button,
  .lock-screen[data-opening] .dots { animation: none; }
}
