/* EP09 Player Styling - Lumi's Cosmic Crossroad (If - Else Condition) */

body.ep09-mode #ep1StartBtn,
body.ep09-mode #ep1RocketFx,
body.ep09-mode #ep1CompleteWrap,
body.ep09-mode #ep2InteractiveLayer,
body.ep09-mode #ep2CompleteWrap,
body.ep09-mode #ep3InteractiveLayer,
body.ep09-mode #ep3CompleteWrap,
body.ep09-mode #ep4InteractiveLayer,
body.ep09-mode #ep4CompleteWrap,
body.ep09-mode #ep5InteractiveLayer,
body.ep09-mode #ep5CompleteWrap,
body.ep09-mode #ep6InteractiveLayer,
body.ep09-mode #ep6CompleteWrap,
body.ep09-mode #ep7InteractiveLayer,
body.ep09-mode #ep7CompleteWrap,
body.ep09-mode #ep8InteractiveLayer,
body.ep09-mode #ep8CompleteWrap {
  display: none !important;
}

#ep9InteractiveLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: clip;
}

body:not(.ep09-mode) #ep9InteractiveLayer {
  display: none !important;
}

/* Condition Decision Card - Bottom-Right corner to protect center dashboard & Lumi */
#ep9DecisionWrap {
  position: absolute;
  bottom: 16px;
  right: 24px;
  left: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(250, 204, 21, 0.4);
  border-radius: 20px;
  padding: 12px 18px;
  pointer-events: auto;
  box-shadow: 0 12px 32px rgba(234, 179, 8, 0.35);
  z-index: 25;
  max-width: 380px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#ep9DecisionWrap.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

.ep9-sensor-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fef08a;
  background: rgba(234, 179, 8, 0.2);
  padding: 4px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(250, 204, 21, 0.4);
}

.ep9-sensor-bulb {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #facc15;
  box-shadow: 0 0 10px #fde047;
  animation: ep9PulseBulb 1.2s infinite ease-in-out;
}

@keyframes ep9PulseBulb {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 16px #fef08a; }
}

.ep9-btn-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ep9-choice-btn {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  min-height: 48px;
}

.ep9-btn-gold {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #713f12;
  box-shadow: 0 4px 14px rgba(234, 179, 8, 0.4);
}

.ep9-btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(234, 179, 8, 0.6);
  border-color: #fef08a;
}

.ep9-btn-rainbow {
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.ep9-btn-rainbow:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.6);
  border-color: #bae6fd;
}

.ep9-btn-hint {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
}

/* Turn Animation Sparkles */
.ep9-sparkle {
  position: absolute;
  pointer-events: none;
  font-size: 1.8rem;
  animation: ep9SparkleAnim 0.8s ease-out forwards;
}

@keyframes ep9SparkleAnim {
  0% { transform: scale(0.4); opacity: 1; }
  100% { transform: scale(1.6) translate(var(--tx, 0), var(--ty, -60px)); opacity: 0; }
}

/* Completion Card - Positioned Below Screen */
#ep9CompleteWrap {
  display: none !important;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 27, 75, 0.95));
  border: 2px solid #facc15;
  border-radius: 20px;
  padding: 18px 24px;
  margin: 14px auto 0;
  max-width: 580px;
  width: 92%;
  box-shadow: 0 12px 32px rgba(234, 179, 8, 0.25);
  text-align: center;
  z-index: 30;
}

#ep9CompleteWrap.active {
  display: flex !important;
  animation: ep9SlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ep9SlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.ep9-complete-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: #fef08a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ep9-complete-desc {
  font-size: 0.92rem;
  color: #cbd5e1;
  line-height: 1.5;
}

.ep9-complete-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.ep9-btn-primary {
  background: linear-gradient(135deg, #facc15, #eab308);
  color: #713f12;
  border: none;
  border-radius: 9999px;
  padding: 10px 24px;
  font-size: 0.94rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ep9-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(234, 179, 8, 0.5);
}

.ep9-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ep9-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

/* Mobile responsive query */
@media (max-width: 640px) {
  #ep9InteractiveLayer {
    position: static;
    pointer-events: auto;
    height: auto;
  }
  #ep9DecisionWrap {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    margin: 10px auto 0;
    box-sizing: border-box;
    padding: 10px 14px;
  }
  #ep9DecisionWrap.hidden {
    display: none;
  }
  .ep9-choice-btn {
    padding: 8px 14px;
    font-size: 0.88rem;
    min-height: 44px;
  }
}
