/* tutorial.css - Animated Scenarios */

.tutorialOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999;
}

.tutorialOverlay.isOpen {
  opacity: 1;
  pointer-events: auto;
}

.tutorialCard {
  width: min(420px, 92vw);
  background: #141c2f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
}

/* --- Scenario Header --- */
.tutorialTop {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tutorialTitle {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.tutorialBtns button {
  background: transparent;
  border: none;
  color: #9fb0c6;
  cursor: pointer;
  font-size: 13px;
}

.tutorialBtns button:hover {
  color: #fff;
}

/* --- Scenario Stage (Mini Board) --- */
.tutorialStage {
  width: 100%;
  aspect-ratio: 1/1;
  /* Square board */
  background: #1e293b;
  /* Dark Board Bg */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.tutScenarioWrap {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.tutScenarioTitle {
  width: 100%;
  text-align: center;
  padding: 8px;
  font-size: 15px;
  color: #88aadd;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.tutBoard {
  display: grid;
  gap: 2px;
  width: 80%;
  aspect-ratio: 1/1;
  margin: 10px auto;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: #1e293b;
  position: relative;
}

.tutMsg {
  margin-top: auto;
  width: 90%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px;
  color: #fff;
  text-align: center;
  font-weight: 600;
  min-height: 44px;
  margin-bottom: 10px;
  transform: scale(1);
  transition: transform 0.2s;
}

.tutMsg.pop {
  transform: scale(1.05);
}

/* Mini Pieces */
.sq {
  position: relative;
  border-radius: 4px;
}

.sq.light {
  background: rgba(255, 255, 255, .07);
}

.sq.dark {
  background: rgba(0, 0, 0, .2);
}

.piece {
  width: 90%;
  height: 90%;
  margin: 5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.piece.p-h {
  background: linear-gradient(135deg, rgba(50, 240, 180, .4), rgba(20, 120, 90, .8));
  border: 1px solid rgba(100, 255, 200, 0.6);
}

.piece.p-c {
  background: linear-gradient(135deg, rgba(255, 100, 100, .4), rgba(180, 40, 40, .8));
  border: 1px solid rgba(255, 120, 120, 0.6);
}

.insEnemy {
  font-size: 20px;
  filter: drop-shadow(0 0 5px red);
}

.insBadge {
  background: #222;
  padding: 2px 4px;
  border-radius: 4px;
  color: #fff;
  font-size: 9px;
}

/* Keep original insignia styles from style.css but mapped here implicitly or shared. 
   For independent look, we add basic ones. */
.insigniaWrap {
  width: 100%;
  display: flex;
  justify-content: center;
}

.insStripes {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.insStripes .bar {
  width: 12px;
  height: 2px;
  background: #fff;
}


/* --- Footer --- */
.tutorialFooter {
  padding: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tutorialCheck {
  font-size: 13px;
  color: #9fb0c6;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

#btnTutorialNext {
  background: #3ddc97;
  color: #0b1220;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

#btnTutorialNext:hover {
  background: #5efdba;
}

/* --- Boom Effect --- */
/* --- Boom Effect --- */
.tutBoom {
  position: absolute;
  pointer-events: none;
  z-index: 9999;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* transform set by JS */
  animation: popBoom 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes popBoom {
  0% {
    transform: translate(-50%, -50%) scale(0) rotate(var(--rot, 0deg));
    opacity: 0;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.4) rotate(var(--rot, 0deg));
    opacity: 1;
  }

  80% {
    transform: translate(-50%, -50%) scale(1.0) rotate(var(--rot, 0deg));
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(1.1) rotate(var(--rot, 0deg));
    opacity: 0;
  }
}