/* Bogyóka Puzzle - public styles */
.bogyoka-puzzle-wrapper {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.bogyoka-puzzle-board {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 1;
  gap: 0px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
  background: #f2f2f2;
}

.bogyoka-piece {
  background-repeat: no-repeat;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .08s ease, outline .08s ease;
}

.bogyoka-piece:hover {
  transform: scale(1.01);
}

.bogyoka-piece.selected {
  outline: 3px solid #2ea3f2;
  outline-offset: -3px;
}

.bogyoka-piece.empty {
  background: #eee;
  cursor: default;
}

/* Result Card & Animations */
.bogyoka-puzzle-message {
  margin-top: 20px;
  position: relative;
  z-index: 10;
}

.bogyoka-result-card {
  background: white;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  animation: bogyoka-popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  max-width: 400px;
  margin: 0 auto;
  border: 1px solid #eef2f7;
}

.bogyoka-result-title {
  font-size: 1.5rem;
  margin: 0 0 10px 0;
  color: #2d3748;
}

.bogyoka-code-box {
  background: #f7fafc;
  border: 2px dashed #cbd5e0;
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 1.2rem;
  color: #2b6cb0;
  margin: 15px 0;
  display: inline-block;
  letter-spacing: 1px;
}

.bogyoka-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  font-size: 0.95rem;
}

.bogyoka-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 14px rgba(0, 0, 0, 0.15);
}

.bogyoka-btn:active {
  transform: translateY(1px);
}

.bogyoka-btn:disabled {
  background: #cbd5e0;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.bogyoka-timer {
  margin-top: 15px;
  font-size: 0.9rem;
  color: #718096;
}

@keyframes bogyoka-popIn {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes bogyoka-shake {
  0% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(0.4deg);
  }

  50% {
    transform: rotate(-0.4deg);
  }

  75% {
    transform: rotate(0.4deg);
  }

  100% {
    transform: rotate(0deg);
  }
}

/* Kártya mozgás "pop" effekt */
.bogyoka-piece.just-moved {
  animation: bogyoka-pop-piece 0.3s ease-out;
  z-index: 5;
  filter: brightness(1.1);
}

@keyframes bogyoka-pop-piece {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  }

  100% {
    transform: scale(1);
  }
}

/* Keverés animáció (darabonként is) */
.bogyoka-puzzle-board.shuffling .bogyoka-piece {
  animation: bogyoka-jitter 0.15s infinite;
}

@keyframes bogyoka-jitter {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }

  25% {
    transform: translate(1px, 1px) rotate(1deg);
  }

  50% {
    transform: translate(-1px, -1px) rotate(-1deg);
  }

  75% {
    transform: translate(-1px, 1px) rotate(0deg);
  }

  100% {
    transform: translate(0, 0);
  }
}

.bogyoka-piece {
  width: 100%;
  height: 100%;
}

.bogyoka-puzzle-board {
  grid-auto-rows: 1fr;
}