/* EP05 Player Styling - Starry's Prompt Magic (AI Prompt) */

body.ep05-mode #ep1StartBtn,
body.ep05-mode #ep1RocketFx,
body.ep05-mode #ep1CompleteWrap,
body.ep05-mode #ep2InteractiveLayer,
body.ep05-mode #ep2CompleteWrap,
body.ep05-mode #ep3InteractiveLayer,
body.ep05-mode #ep3CompleteWrap,
body.ep05-mode #ep4InteractiveLayer,
body.ep05-mode #ep4CompleteWrap {
  display: none !important;
}

#ep5InteractiveLayer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  overflow: clip;
}

body:not(.ep05-mode) #ep5InteractiveLayer {
  display: none !important;
}

/* Prompt Builder Overlay (Positioned at bottom-right corner to protect Starry) */
#ep5PromptCardWrap {
  position: absolute;
  bottom: 14px;
  right: 20px;
  left: auto;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(192, 132, 252, 0.4);
  border-radius: 20px;
  padding: 10px 18px;
  pointer-events: auto;
  box-shadow: 0 12px 32px rgba(147, 51, 234, 0.35);
  z-index: 25;
  max-width: 360px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#ep5PromptCardWrap.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
}

.ep5-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.ep5-row-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e9d5ff;
}

.ep5-chip {
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.ep5-chip:hover {
  background: rgba(192, 132, 252, 0.25);
  transform: translateY(-2px);
}

.ep5-chip.active {
  background: linear-gradient(135deg, #c084fc, #9333ea);
  border-color: #f3e8ff;
  box-shadow: 0 0 12px rgba(192, 132, 252, 0.6);
}

.ep5-submit-btn {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  border: 2px solid #ffffff;
  border-radius: 9999px;
  padding: 8px 24px;
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(126, 34, 206, 0.5);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
  min-height: 46px;
}

.ep5-submit-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(168, 85, 247, 0.7);
}

.ep5-submit-btn:active {
  transform: scale(0.96);
}

.ep5-prompt-preview {
  font-size: 0.8rem;
  color: #fef08a;
  font-weight: 600;
  text-align: center;
}

/* Cosmic Constellation Overlay */
.ep5-constellation-fx {
  position: absolute;
  top: 15%;
  right: 15%;
  font-size: 3rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.8s ease;
}

.ep5-constellation-fx.active {
  opacity: 1;
  transform: scale(1.2) translateY(-10px);
  filter: drop-shadow(0 0 20px rgba(253, 224, 71, 0.9));
}

.ep5-creature-display {
  position: absolute;
  top: auto;
  left: auto;
  right: 4%;
  bottom: 5%;
  transform: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(250, 204, 21, 0.7);
  border-radius: 22px;
  padding: 7px 12px;
  max-width: 220px;
  box-shadow: 0 0 30px rgba(234, 179, 8, 0.45), inset 0 0 16px rgba(192, 132, 252, 0.35);
  z-index: 24;
  animation: ep5FloatCorner 3s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ep5-creature-display.active {
  opacity: 1;
}

@keyframes ep5FloatCorner {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.ep5-creature-icon {
  font-size: 2.2rem;
  line-height: 1.1;
  filter: drop-shadow(0 0 18px rgba(253, 224, 71, 0.95));
}

.ep5-creature-art {
  width: min(180px, 32vw);
  height: min(135px, 24vw);
  max-height: 135px;
  filter: drop-shadow(0 0 14px rgba(253, 224, 71, .55));
}
.ep5-creature-art svg { width: 100%; height: 100%; display: block; }

.ep5-creature-title {
  font-size: 0.85rem;
  font-weight: 800;
  color: #fef08a;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  letter-spacing: -0.02em;
}

/* EP05 Completion Card */
#ep5CompleteWrap {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(250, 245, 255, 0.96), rgba(243, 232, 255, 0.96));
  border: 2px solid #c084fc;
  border-radius: 20px;
  padding: 16px 24px;
  margin: 12px auto;
  max-width: 580px;
  width: 92%;
  box-shadow: 0 12px 28px rgba(147, 51, 234, 0.2);
  text-align: center;
  z-index: 30;
}

#ep5CompleteWrap.active {
  display: flex !important;
  animation: ep5SlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ep5SlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.ep5-complete-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #6b21a8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ep5-complete-desc {
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.4;
}

.ep5-complete-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.ep5-btn-secondary {
  background: #ffffff;
  color: #7e22ce;
  border: 1.5px solid #c084fc;
  border-radius: 9999px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ep5-btn-secondary:hover {
  background: #faf5ff;
  transform: translateY(-2px);
}

.ep5-btn-primary {
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  color: #ffffff;
  border: none;
  border-radius: 9999px;
  padding: 8px 22px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(147, 51, 234, 0.4);
  transition: all 0.2s ease;
}

.ep5-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(147, 51, 234, 0.55);
}

@media (max-width: 640px) {
  .ep5-creature-display {
    right: 2%;
    bottom: 4%;
    max-width: 42%;
    padding: 5px 7px;
    border-radius: 12px;
  }
  .ep5-creature-icon { font-size: 1.55rem; }
  .ep5-creature-title { font-size: 0.68rem; line-height: 1.15; }
  #ep5InteractiveLayer {
    position: static;
    pointer-events: auto;
    height: auto;
  }
  #ep5PromptCardWrap {
    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;
    gap: 8px;
  }
  #ep5PromptCardWrap.hidden {
    display: none;
  }
  .ep5-chip {
    padding: 6px 12px;
    font-size: 0.82rem;
    min-height: 40px;
  }
  .ep5-submit-btn {
    padding: 8px 20px;
    font-size: 0.92rem;
    min-height: 44px;
  }
}
