/* EP08 Player Styles - Grand Finale & Mini-Missions */
.screen-container.ep08-group-screen .cinema-cut.active {
  animation: none;
  transform: none;
}
.ep08-mode #screenContainer {
  position: relative;
  overflow: hidden;
}

#ep8InteractiveLayer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  padding-bottom: 16px;
  padding-right: 20px;
  pointer-events: none;
  z-index: 20;
}

.ep8-mission-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  width: auto;
  max-width: 440px;
  background: rgba(13, 18, 34, 0.9);
  backdrop-filter: blur(14px);
  border: 2px solid rgba(99, 102, 241, 0.5);
  border-radius: 18px;
  padding: 16px 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  animation: ep8SlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ep8SlideUp {
  0% { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.ep8-mission-badge {
  font-size: 11.5px;
  font-weight: 800;
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.2);
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.ep8-mission-title {
  font-size: 15.5px;
  font-weight: 800;
  color: #fff;
  text-align: center;
}

/* Step 1: Color Choice */
.ep8-color-row {
  display: flex;
  gap: 12px;
}
.ep8-chip-btn {
  min-height: 52px;
  padding: 10px 22px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #1e293b;
  color: #f8fafc;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.ep8-chip-btn:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
}
.ep8-chip-pink {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(219, 39, 119, 0.4));
  border-color: #f472b6;
}
.ep8-chip-yellow {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(202, 138, 4, 0.4));
  border-color: #facc15;
}

/* Step 2: Debug Wing */
.ep8-wing-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1.5px dashed #38bdf8;
  border-radius: 12px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.ep8-wing-btn {
  min-height: 50px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 2px solid #fbbf24;
  background: #d97706;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s;
}
.ep8-wing-btn.fixed {
  background: #10b981;
  border-color: #34d399;
}

/* Step 3: Sequence Button */
.ep8-seq-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #cbd5e1;
  font-weight: 700;
}
.ep8-btn-seq-done {
  min-height: 52px;
  padding: 10px 24px;
  border-radius: 99px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(249, 115, 22, 0.4);
}

/* Step 4: Big START button */
.ep8-btn-start {
  min-height: 58px;
  padding: 12px 36px;
  font-size: 19px;
  font-weight: 900;
  border-radius: 99px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 8px 30px rgba(34, 197, 94, 0.6);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  animation: ep8PulseStart 2s infinite;
}
@keyframes ep8PulseStart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Rocket Visual Layer */
.ep8-rocket-container {
  position: absolute;
  top: 40%;
  left: 10%;
  width: 90px;
  height: 90px;
  z-index: 10;
  pointer-events: none;
  transition: transform 0.1s linear;
}
.ep8-rocket-container.flying {
  animation: ep8RocketFlight 5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
@keyframes ep8RocketFlight {
  0% { transform: translate(0, 0) scale(1) rotate(25deg); opacity: 1; }
  25% { transform: translate(180px, -60px) scale(1.15) rotate(35deg); }
  50% { transform: translate(360px, -20px) scale(1.1) rotate(20deg); }
  75% { transform: translate(520px, -80px) scale(1.2) rotate(40deg); }
  100% { transform: translate(680px, -50px) scale(1.25) rotate(30deg); opacity: 1; }
}
.ep8-rocket-body {
  width: 70px;
  height: 70px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.6));
}

/* Completion Certificate Wrap */
#ep8CompleteWrap {
  display: none;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95), rgba(15, 23, 42, 0.98));
  border: 2px solid #818cf8;
  border-radius: 20px;
  padding: 24px;
  margin-top: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8);
  text-align: center;
}
#ep8CompleteWrap.active {
  display: block !important;
  animation: ep8CertFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ep8CertFadeIn {
  0% { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

/* Printable Certificate Frame */
.ep8-cert-card {
  background: #ffffff;
  color: #0f172a;
  border: 6px double #d97706;
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 580px;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  position: relative;
}
.ep8-cert-ribbon {
  font-size: 32px;
  margin-bottom: 8px;
}
.ep8-cert-title {
  font-size: 23px;
  font-weight: 900;
  color: #b45309;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.ep8-cert-recipient {
  font-size: 17px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #e2e8f0;
}
.ep8-cert-text {
  font-size: 14.5px;
  line-height: 1.6;
  color: #334155;
  font-weight: 600;
  margin-bottom: 18px;
}
.ep8-cert-date-sign {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
}

.ep8-cert-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ep8-btn-cert-print {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border: none;
  padding: 12px 26px;
  border-radius: 99px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.4);
  transition: all 0.2s;
}
.ep8-btn-cert-print:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(217, 119, 6, 0.6);
}
.ep8-btn-cert-sub {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 12px 20px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.ep8-btn-cert-sub:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Print Media Query */
@media print {
  body * {
    visibility: hidden;
  }
  #ep8CompleteWrap, #ep8CompleteWrap * {
    visibility: visible;
  }
  #ep8CompleteWrap {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
  }
  .ep8-cert-actions {
    display: none !important;
  }
  .ep8-cert-card {
    max-width: 100%;
    border-width: 4px;
    box-shadow: none;
  }
}

@media screen and (max-width: 640px) {
  #ep8InteractiveLayer {
    position: static;
    pointer-events: auto;
    height: auto;
    padding: 0;
    align-items: center;
  }
  .ep8-mission-wrap {
    width: 100%;
    max-width: 100%;
    margin: 10px auto 0;
    box-sizing: border-box;
    padding: 12px 14px;
  }
  .ep8-color-btn, .ep8-seq-chip {
    padding: 8px 12px;
    font-size: 13px;
  }
  .ep8-seq-btn, .ep8-launch-btn {
    padding: 10px 18px;
    font-size: 14.5px;
    min-height: 48px;
  }
}
