.pattern-lock-grid {
  position: relative;
  width: 260px;
  height: 260px;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  margin: 8px auto;
  touch-action: none;
  user-select: none;
  cursor: pointer;
}

.pattern-lock-grid.dragging {
  cursor: grabbing;
}

.pattern-lock-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.pattern-lock-line {
  stroke: #2e7d32;
  stroke-width: 5;
  stroke-linecap: round;
}

.pattern-lock-line-live {
  stroke: #6fbf73;
  stroke-dasharray: 2 10;
}

.pattern-lock-dot {
  position: absolute;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  margin-top: -11px;
  border-radius: 50%;
  border: 3px solid #b7c4bb;
  background: #fff;
  box-sizing: border-box;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.pattern-lock-dot.active {
  background: #2e7d32;
  border-color: #2e7d32;
  transform: scale(1.25);
  box-shadow: 0 0 0 6px rgba(46, 125, 50, 0.15);
}

.pattern-lock-error {
  animation: pattern-lock-shake 0.4s ease-in-out;
}

.pattern-lock-error .pattern-lock-dot.active {
  background: #c62828;
  border-color: #c62828;
  box-shadow: 0 0 0 6px rgba(198, 40, 40, 0.15);
}

.pattern-lock-error .pattern-lock-line {
  stroke: #c62828;
}

@keyframes pattern-lock-shake {
  10%, 90% { transform: translateX(-3px); }
  20%, 80% { transform: translateX(5px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
