/* director.css */
/* Styles for Director Mode: speech bubbles, transitions, UI */

/* ---- Speech Bubbles ---- */
.director-speech-bubble {
  position: absolute;
  z-index: 200;
  pointer-events: none;
  max-width: 320px;
  min-width: 60px;
}

.director-speech-content {
  background: #fff;
  color: #000;
  font-family: 'Press Start', monospace;
  font-size: 14px;
  line-height: 1.5;
  padding: 10px 14px;
  border: 3px solid #000;
  border-radius: 6px;
  text-align: left;
  word-wrap: break-word;
  -webkit-font-smoothing: none;
  image-rendering: pixelated;
}

.director-speech-tail {
  position: absolute;
  bottom: -12px;
  left: 50%;
  margin-left: -8px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid #000;
}
.director-speech-tail::after {
  content: "";
  position: absolute;
  top: -14px;
  left: -6px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid #fff;
}

/* ---- Transition Overlay ---- */
.director-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 500;
  background: black;
  display: none;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* ---- Life Count Screen ---- */
.director-life-screen {
  background: #000;
  gap: 8px;
}
.director-life-container {
  display: flex;
  align-items: center;
  gap: 16px;
}
.director-life-sprite canvas {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}
.director-life-text {
  font-family: 'Press Start', monospace;
  font-size: 28px;
  color: #fff;
  -webkit-font-smoothing: none;
}
.director-life-x {
  font-size: 20px;
  margin-right: 8px;
}
.director-life-count {
  font-size: 28px;
}
.director-life-world {
  font-family: 'Press Start', monospace;
  font-size: 18px;
  color: #fff;
  margin-bottom: 24px;
  -webkit-font-smoothing: none;
}

/* ---- Title Card ---- */
.director-title-card {
  background: #000;
}
.director-title-text {
  font-family: 'Press Start', monospace;
  font-size: 28px;
  color: #fff;
  text-align: center;
  -webkit-font-smoothing: none;
}
.director-subtitle-text {
  font-family: 'Press Start', monospace;
  font-size: 16px;
  color: #aaa;
  text-align: center;
  margin-top: 16px;
  -webkit-font-smoothing: none;
}

/* ---- Text Screen ---- */
.director-text-screen {
  background: #000;
}
.director-screen-text {
  font-family: 'Press Start', monospace;
  font-size: 18px;
  color: #fff;
  text-align: center;
  padding: 0 40px;
  line-height: 2;
  -webkit-font-smoothing: none;
}

/* ---- Director UI Controls ---- */
.director-controls {
  position: fixed;
  bottom: 15px;
  left: 0;
  right: 0;
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.85);
  border-top: 2px solid #444;
}
.director-controls button {
  font-family: 'Press Start', monospace;
  font-size: 12px;
  color: #fff;
  background: #333;
  border: 2px solid #666;
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 4px;
  -webkit-font-smoothing: none;
}
.director-controls button:hover {
  background: #555;
  border-color: #999;
}
.director-controls button:active {
  background: #222;
}
.director-controls button.primary {
  background: #1a6b1a;
  border-color: #2a9a2a;
}
.director-controls button.primary:hover {
  background: #228b22;
}
.director-controls button.danger {
  background: #6b1a1a;
  border-color: #9a2a2a;
}
.director-controls button.danger:hover {
  background: #8b2222;
}

/* ---- Director Footer ---- */
.director-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 600;
  text-align: center;
  padding: 6px;
  background: rgba(0, 0, 0, 0.85);
  color: #888;
  font-family: 'Press Start', monospace;
  font-size: 9px;
  -webkit-font-smoothing: none;
}

/* ---- JSON Input Area ---- */
.director-input-area {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 60px;
  z-index: 700;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.director-input-area h2 {
  font-family: 'Press Start', monospace;
  font-size: 16px;
  color: #fff;
  margin: 0 0 5px 0;
  -webkit-font-smoothing: none;
}
.director-input-area textarea {
  flex: 1;
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: #0f0;
  background: #111;
  border: 2px solid #444;
  padding: 12px;
  resize: none;
  border-radius: 4px;
  tab-size: 2;
}
.director-input-area textarea:focus {
  outline: none;
  border-color: #0a0;
}
.director-input-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}
.director-input-buttons button {
  font-family: 'Press Start', monospace;
  font-size: 11px;
  color: #fff;
  background: #333;
  border: 2px solid #666;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 4px;
  -webkit-font-smoothing: none;
}
.director-input-buttons button:hover {
  background: #555;
  border-color: #999;
}
.director-input-buttons button:active {
  background: #222;
}
.director-input-buttons button.primary {
  background: #1a6b1a;
  border-color: #2a9a2a;
}
.director-input-buttons button.primary:hover {
  background: #228b22;
}

/* ---- Yoshi Egg Sprite ---- */
.yoshiegg {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

/* ---- Transformation Flash ---- */
.director-transform-flash {
  position: fixed;
  width: 0;
  height: 0;
  z-index: 300;
  pointer-events: none;
}

.director-transform-flash::before {
  content: "";
  position: absolute;
  width: 40px;
  height: 40px;
  left: -20px;
  top: -20px;
  background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(255,255,150,0.8) 30%, transparent 70%);
  border-radius: 50%;
  animation: transform-flash-pulse 0.4s ease-out forwards;
}

@keyframes transform-flash-pulse {
  0% { transform: scale(0.3); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.8; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ---- Transformation Particles ---- */
.director-transform-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: transform-particle-fly 0.5s ease-out forwards;
}

@keyframes transform-particle-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}

/* ---- Score Popup ---- */
.director-score-popup {
  position: fixed;
  z-index: 350;
  pointer-events: none;
  font-family: 'Press Start', monospace;
  font-size: 16px;
  color: #fff;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000;
  -webkit-font-smoothing: none;
  animation: score-float-up 1s ease-out forwards;
}

@keyframes score-float-up {
  0% { transform: translateY(0); opacity: 1; }
  60% { opacity: 1; }
  100% { transform: translateY(-60px); opacity: 0; }
}

/* ---- Egg Bounce Effect ---- */
.director-egg-bounce {
  position: fixed;
  z-index: 310;
  pointer-events: none;
  animation: egg-pop 0.7s ease-out forwards;
}

.director-egg-icon {
  width: 32px;
  height: 32px;
  background: url("Theme/yoshiegg.png") no-repeat center center;
  background-size: contain;
  filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.5));
  image-rendering: pixelated;
}

@keyframes egg-pop {
  0% { transform: translateY(0) scale(0.3); opacity: 0; }
  20% { transform: translateY(-30px) scale(1.3); opacity: 1; }
  40% { transform: translateY(-15px) scale(0.9); opacity: 1; }
  60% { transform: translateY(-20px) scale(1.1); opacity: 1; }
  100% { transform: translateY(-5px) scale(1.1); opacity: 0; }
}

/* ---- Persistent Egg Overlay ---- */
.director-persistent-egg {
  position: fixed;
  z-index: 290;
  pointer-events: none;
  width: 28px;
  height: 28px;
  background: url("Theme/yoshiegg.png") no-repeat center center;
  background-size: contain;
  filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.4));
  image-rendering: pixelated;
  animation: egg-appear 0.3s ease-out;
  transform: translate(-50%, -50%);
}

@keyframes egg-appear {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* ---- Screen Shake ---- */
@keyframes screen-shake {
  0%, 100% { transform: translate(0); }
  10% { transform: translate(-3px, 2px); }
  20% { transform: translate(3px, -2px); }
  30% { transform: translate(-2px, 3px); }
  40% { transform: translate(2px, -3px); }
  50% { transform: translate(-3px, -2px); }
  60% { transform: translate(3px, 2px); }
  70% { transform: translate(-2px, -3px); }
  80% { transform: translate(2px, 3px); }
  90% { transform: translate(-3px, 2px); }
}

/* ---- Narration Box ---- */
.director-narration {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 250;
  background: rgba(0,0,0,0.85);
  border: 2px solid #FFD700;
  border-radius: 6px;
  padding: 14px 24px;
  max-width: 600px;
  font-family: 'Press Start', monospace;
  font-size: 13px;
  color: #FFD700;
  text-align: center;
  line-height: 1.8;
  -webkit-font-smoothing: none;
  animation: narration-in 0.3s ease-out;
}

@keyframes narration-in {
  0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================
   NEW EFFECTS FOR YOSHI EGG STORY
   ============================================ */

/* Smoke/Poof Effects */
@keyframes smoke-puff-expand {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--dest-x, 50px), var(--dest-y, -30px)) scale(2);
    opacity: 0;
  }
}

@keyframes poof-text-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -150%) scale(1);
  }
}

.director-smoke-puff {
  border-radius: 50%;
  pointer-events: none;
}

.director-poof-text {
  font-family: 'Press Start 2P', 'Press Start', monospace;
  font-weight: bold;
  text-shadow: 2px 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  pointer-events: none;
}

/* Egg Wobble Animation */
@keyframes egg-wobble {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-15deg);
  }
  75% {
    transform: rotate(15deg);
  }
}

@keyframes thing-wobble {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-10deg);
  }
  75% {
    transform: rotate(10deg);
  }
}

.director-wobble-effect {
  pointer-events: none;
  animation: egg-wobble 1s ease-in-out infinite;
}

/* Prop Wobble */
@keyframes prop-wobble {
  0%, 100% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(10deg);
  }
}

/* Crack Effects */
@keyframes crack-appear {
  0% {
    opacity: 0;
    transform: translate(-50%, -100%) scale(0);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
  }
}

.director-crack-effect {
  pointer-events: none;
}

/* Shimmer Effect */
@keyframes shimmer-sweep {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.director-shimmer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  background-size: 50% 100%;
  pointer-events: none;
  z-index: 9999;
  animation: shimmer-sweep 2s ease-in-out;
}

/* Flash Effect */
@keyframes flash-fade {
  0% {
    opacity: var(--flash-opacity, 0.5);
  }
  100% {
    opacity: 0;
  }
}

.director-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  animation: flash-fade 0.3s ease-out forwards;
}

/* Body Part Styles */
.director-body-part {
  position: absolute;
  pointer-events: none;
  image-rendering: pixelated;
  background-size: contain;
  background-repeat: no-repeat;
}

/* Prop Styles */
.director-prop {
  position: absolute;
  pointer-events: none;
  image-rendering: pixelated;
  background-size: contain;
  background-repeat: no-repeat;
}

/* Special Egg Types */
.director-spiky-egg {
  filter: contrast(1.5) brightness(0.8);
}

.director-running-egg {
  animation: egg-wobble 0.5s ease-in-out infinite;
}

/* Shell Break Pieces */
@keyframes shell-piece-fly {
  0% {
    transform: rotate(0deg) translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: rotate(var(--rotation, 45deg)) translate(var(--tx, 30px), var(--ty, -30px));
    opacity: 0;
  }
}

/* Group Look Indicator (subtle highlight when looking at target) */
@keyframes look-pulse {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}

/* Mustache Yoshi Style */
.director-mustache-yoshi {
  filter: sepia(0.3) contrast(1.1);
}

/* Cap Yoshi Style */
.director-cap-yoshi {
  filter: hue-rotate(200deg) brightness(1.3);
}

/* Dizzy Effect */
@keyframes dizzy-sway {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(-5deg);
  }
  75% {
    transform: rotate(5deg);
  }
}

/* Scene Transitions */
@keyframes scene-fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes scene-fade-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Particle Colors */
.director-particle-gold {
  background: radial-gradient(circle, #fbbf24 0%, transparent 70%);
}

.director-particle-purple {
  background: radial-gradient(circle, #9333ea 0%, transparent 70%);
}

.director-particle-green {
  background: radial-gradient(circle, #22c55e 0%, transparent 70%);
}

/* Responsive Adjustments */
@media (max-width: 600px) {
  .director-smoke-container {
    transform: scale(0.7);
  }
  
  .director-body-part,
  .director-prop {
    transform: scale(0.8);
  }
}
