#grid {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  background-color: white;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
}

@media (max-width: 640px) {
  #grid {
    max-width: 100%;
  }
}

.grid-line {
  position: absolute;
  background-color: #e5e7eb;
}

.grid-line.vertical {
  width: 1px;
  height: 100%;
}

.grid-line.horizontal {
  height: 1px;
  width: 100%;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dot.coral {
  background: linear-gradient(135deg, #ff6b4a 0%, #ff5233 100%);
}

.dot.azure {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.highlight {
  box-shadow: 0 0 12px 4px #fbbf24, 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ghost-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: absolute;
  transform: translate(-50%, -50%);
  opacity: 0.5;
  border: 2px solid transparent;
  pointer-events: none;
}

.ghost-dot.coral {
  border-color: #ff6b4a;
  background-color: rgba(255, 107, 74, 0.1);
}

.ghost-dot.azure {
  border-color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.1);
}

.ghost-dot.invalid {
  border-color: #ef4444;
  background-color: rgba(239, 68, 68, 0.15);
}

.square-box {
  position: absolute;
  border: 3px solid;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: 2px;
  animation: squareAppear 0.3s ease-out;
}

@keyframes squareAppear {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.score-label {
  position: absolute;
  font-weight: bold;
  font-size: 16px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  background: white;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-line {
  position: absolute;
  height: 3px;
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.4s ease-out;
  border-radius: 1px;
}