:root {
  color-scheme: dark;
  --ink: #f7efce;
  --leaf-dark: #286b38;
  --leaf-light: #57a44a;
  --gold: #f5b51f;
  --paper: #121527;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow: hidden;
  background: #070b1d;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

#bloomCanvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

.lock-screen {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(255, 208, 103, 0.12), transparent 32%),
    rgba(4, 7, 20, 0.72);
  backdrop-filter: blur(12px);
  transition:
    opacity 520ms ease,
    visibility 520ms ease;
  z-index: 2;
}

.stage.unlocked .lock-screen {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.lock-card {
  width: min(360px, 100%);
  padding: 28px 24px 24px;
  border: 1px solid rgba(255, 221, 137, 0.2);
  border-radius: 8px;
  background: rgba(11, 17, 35, 0.74);
  box-shadow:
    0 26px 70px rgba(0, 0, 0, 0.42),
    0 0 44px rgba(255, 190, 74, 0.1);
  text-align: center;
}

.lock-card h1 {
  margin: 0;
  color: #fff3c9;
  font-size: 1.58rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.code-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 24px 0 10px;
}

.code-dots span {
  width: 13px;
  height: 13px;
  border: 1px solid rgba(255, 226, 152, 0.68);
  border-radius: 999px;
  background: rgba(255, 226, 152, 0);
  box-shadow: 0 0 0 rgba(255, 203, 93, 0);
  transition:
    background 160ms ease,
    box-shadow 160ms ease;
}

.code-dots span.filled {
  background: #ffe098;
  box-shadow: 0 0 18px rgba(255, 203, 93, 0.8);
}

.lock-error {
  min-height: 20px;
  margin: 0 0 14px;
  color: #ffb9a8;
  font-size: 0.86rem;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.keypad button {
  min-height: 48px;
  border: 1px solid rgba(255, 224, 152, 0.16);
  border-radius: 8px;
  background: rgba(255, 240, 198, 0.08);
  color: #fff4cf;
  cursor: pointer;
  font: inherit;
  font-size: 1.05rem;
  letter-spacing: 0;
  transition:
    transform 140ms ease,
    background 140ms ease,
    border-color 140ms ease;
}

.keypad button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 224, 152, 0.34);
  background: rgba(255, 240, 198, 0.14);
}

.keypad button:focus-visible {
  outline: 3px solid rgba(255, 203, 93, 0.38);
  outline-offset: 2px;
}

.keypad button[data-action] {
  color: #dfcda8;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lock-card.shake {
  animation: shake 360ms ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-8px);
  }

  50% {
    transform: translateX(7px);
  }

  75% {
    transform: translateX(-4px);
  }
}

@media (max-width: 420px) {
  .lock-card {
    padding: 24px 18px 18px;
  }

  .lock-card h1 {
    font-size: 1.36rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lock-screen,
  .code-dots span,
  .keypad button {
    transition: none;
  }

  .lock-card.shake {
    animation: none;
  }
}
