/* ============================================
   Jigsaw Puzzle Scene
   ============================================ */

/* ---- Character / Difficulty Select ---- */
.char-select-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 24px 16px;
  width: 100%;
  z-index: 2;
}

.char-card {
  background: var(--bg-card);
  border: 1px solid rgba(180, 74, 255, 0.3);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.char-card:hover,
.char-card:active {
  border-color: var(--neon-pink);
  box-shadow: var(--glow-pink);
  transform: translateY(-2px);
}

.char-card.locked {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.char-card img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 8px;
}

.char-card .char-name {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  color: var(--neon-gold);
  margin-top: 6px;
  letter-spacing: 1px;
}

.diff-select-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 32px;
  width: 100%;
  z-index: 2;
}

.diff-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid rgba(180, 74, 255, 0.3);
  border-radius: 12px;
  padding: 14px 20px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.diff-card:hover,
.diff-card:active {
  border-color: var(--neon-pink);
  box-shadow: var(--glow-pink);
}

.diff-card.locked {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.diff-card.cleared {
  border-color: var(--neon-gold);
}

.diff-name {
  font-family: 'Cinzel', serif;
  font-size: 16px;
  color: var(--text-primary);
  letter-spacing: 2px;
}

.diff-stars {
  color: var(--neon-gold);
  font-size: 14px;
  letter-spacing: 2px;
}

.diff-lock {
  color: var(--text-muted);
  font-size: 18px;
}

.diff-best-time {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---- Jigsaw Play ---- */
.jigsaw-hud {
  position: relative;
  z-index: 5;
  width: 100%;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 10, 20, 0.8);
}

.jigsaw-timer {
  font-family: 'Cinzel', serif;
  font-size: 24px;
  color: var(--neon-cyan);
  letter-spacing: 2px;
}

.jigsaw-pieces {
  font-size: 14px;
  color: var(--text-secondary);
}

.jigsaw-area {
  position: relative;
  z-index: 2;
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

#jigsaw-canvas {
  background: rgba(10, 10, 20, 0.5);
  border: 1px solid rgba(180, 74, 255, 0.2);
  border-radius: 8px;
  touch-action: none;
}

/* ---- Clear Screen ---- */
.clear-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 20, 0.9);
  animation: fade-in 0.5s ease-out;
  overflow-y: auto;
  padding: 24px 0;
}

.clear-image {
  width: 50%;
  max-width: 240px;
  aspect-ratio: 9/16;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  border: 2px solid var(--neon-gold);
  box-shadow: var(--glow-gold);
  flex-shrink: 0;
}

.clear-info {
  text-align: center;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.clear-title {
  font-family: 'Cinzel', serif;
  font-size: 28px;
  color: var(--neon-gold);
  text-shadow: var(--glow-gold);
  letter-spacing: 4px;
  animation: pulse-glow 2s ease-in-out infinite;
}

.clear-time {
  font-size: 18px;
  color: var(--neon-cyan);
}

.clear-notification {
  font-size: 14px;
  color: var(--neon-pink);
  animation: slide-up 0.5s ease-out 0.5s both;
}

.clear-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 8px;
}
