/* ═══════════════════════════════════════════════════════════
   SCENE 06 — Lightning strikes again
═══════════════════════════════════════════════════════════ */

#scene-06 {
  background: #06060f;
  z-index: 40;
}

/* Enable pointer-events once the scene is live (needed for continue button) */
body.scene6-active #stage #scene-06 {
  pointer-events: auto;
}

body.scene6-active #stage #scene-06 {
  animation: s6FadeIn 1.2s both;
}
@keyframes s6FadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Text lines ─────────────────────────────────────────── */
.s6-text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  max-width: 580px;
  width: 88%;
  text-align: center;
  font-family: 'Georgia', serif;
  font-size: 21px;
  color: #f0ede8;
  line-height: 1.75;
  margin: 0;
}

#s6-line-1 { top: 52px;    z-index: 25; }
#s6-line-2 { bottom: 185px; z-index: 25; }

.s6-text.typing::after {
  content: '|';
  color: #f0ede8;
  animation: s6Blink 0.65s step-end infinite;
}
@keyframes s6Blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Zeus ───────────────────────────────────────────────── */
#s6-zeus {
  position: absolute;
  top: 12px;
  right: 20px;
  opacity: 0;
  transform: translateX(80px) scale(0.6) rotate(12deg);
  z-index: 15;
}
#s6-zeus.active {
  animation: zeusLand 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes zeusLand {
  from { opacity: 0; transform: translateX(80px) scale(0.6) rotate(12deg); }
  to   { opacity: 1; transform: translateX(0)    scale(1)   rotate(0deg);  }
}
#s6-zeus.idle {
  animation: zeusIdle 0.7s ease-in-out infinite;
}
@keyframes zeusIdle {
  0%, 100% { transform: translateY(0)    rotate(0deg); }
  50%       { transform: translateY(-6px) rotate(-2deg); }
}
#s6-zeus.throwing {
  animation: zeusThrow 0.35s ease-in-out forwards;
}
@keyframes zeusThrow {
  0%   { transform: rotate(0deg)  scale(1);    }
  40%  { transform: rotate(-12deg) scale(1.08); }
  100% { transform: rotate(6deg)  scale(0.96); }
}
#s6-zeus.done {
  animation: zeusBye 0.7s 0.4s ease-in forwards;
}
@keyframes zeusBye {
  to { opacity: 0; transform: translateX(80px) scale(0.6) rotate(12deg); }
}

/* ── Lightning bolt ─────────────────────────────────────── */
#s6-bolt-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
  opacity: 0;
}
#s6-bolt-container.active { opacity: 1; }
#s6-bolt-container.done   { opacity: 0; transition: opacity 0.3s; }

/* Both SVGs fill the container */
.s6-bolt-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Portrait bolt hidden by default (landscape is default) */
.s6-bolt-portrait { display: none; }

/* Bolt draws itself via stroke-dashoffset — landscape paths */
#s6-bolt-path, #s6-bolt-glow {
  stroke-dasharray: 1100;
  stroke-dashoffset: 1100;
}
#s6-bolt-container.active #s6-bolt-path,
#s6-bolt-container.active #s6-bolt-glow {
  animation: boltDraw 0.45s ease-out forwards;
}

/* Portrait paths */
#s6-bolt-path-p, #s6-bolt-glow-p {
  stroke-dasharray: 850;
  stroke-dashoffset: 850;
}
#s6-bolt-container.active #s6-bolt-path-p,
#s6-bolt-container.active #s6-bolt-glow-p {
  animation: boltDraw 0.45s ease-out forwards;
}

@keyframes boltDraw { to { stroke-dashoffset: 0; } }

/* ── Screen flash on impact ─────────────────────────────── */
#s6-flash {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  z-index: 18;
}
#s6-flash.active {
  animation: flashBang 0.7s ease-out forwards;
}
@keyframes flashBang {
  0%   { opacity: 0.9; }
  25%  { opacity: 0.5; }
  100% { opacity: 0;   }
}

/* ── Electrocuted guy ───────────────────────────────────── */
#s6-zap-guy {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  /* Simple block layout — flex was causing SVG not to paint */
  text-align: center;
  opacity: 0;
  z-index: 20;
}
#s6-zap-guy.active {
  opacity: 1;
  animation: zapShake 0.09s linear infinite;
}
#s6-zap-guy.done {
  animation: zapFall 0.7s ease-in forwards;
}
@keyframes zapShake {
  0%   { transform: translate(-50%, -50%) rotate(0deg);  }
  25%  { transform: translate(-52%, -50%) rotate(-3deg); }
  50%  { transform: translate(-50%, -51%) rotate(0deg);  }
  75%  { transform: translate(-48%, -50%) rotate(3deg);  }
  100% { transform: translate(-50%, -50%) rotate(0deg);  }
}
@keyframes zapFall {
  0%   { opacity: 1; transform: translate(-50%, -50%) rotate(0deg)   scale(1);   }
  40%  {             transform: translate(-50%, -48%) rotate(-18deg) scale(1);   }
  100% { opacity: 0; transform: translate(-50%, -42%) rotate(-30deg) scale(0.85); }
}

/* BZZZT! text */
.s6-bzzzt {
  font-family: 'Bangers', 'Impact', cursive;
  font-size: 52px;
  letter-spacing: 3px;
  color: #FFD700;
  -webkit-text-stroke: 3px #333;
  text-shadow:
    0 0 18px #FFD700,
    0 0 36px #FF8C00;
  opacity: 0;
}
#s6-zap-guy.active .s6-bzzzt {
  opacity: 1;
  animation: bzzztWiggle 0.12s linear infinite;
}
@keyframes bzzztWiggle {
  0%, 100% { transform: rotate(-3deg) scale(1);    }
  50%       { transform: rotate( 3deg) scale(1.06); }
}

/* SVG block so it centres properly under BZZZT */
.s6-zap-svg {
  display: block;
  margin: 6px auto 0;
}

/* Electricity sparks and arcs pulse */
#s6-zap-guy.active .s6-zap-svg path[stroke="#FFD700"] {
  animation: sparkPulse 0.18s linear infinite alternate;
}
@keyframes sparkPulse {
  from { opacity: 0.5; }
  to   { opacity: 1;   }
}

/* Body aura breathes */
#s6-zap-guy.active .s6-zap-svg ellipse[fill="#FFD700"] {
  animation: auraPulse 0.2s ease-in-out infinite alternate;
}
@keyframes auraPulse {
  from { opacity: 0.12; }
  to   { opacity: 0.28; }
}

/* ── Continue button ────────────────────────────────────── */
.s6-continue-btn {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 44px;
  background: #e53935;
  color: white;
  font-family: 'Bangers', 'Impact', cursive;
  font-size: 38px;
  letter-spacing: 3px;
  border: 3px solid #000;
  border-radius: 6px;
  box-shadow: 5px 5px 0 #000;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  transition: opacity 0.7s ease, transform 0.7s ease,
              box-shadow 0.08s, background 0.08s;
  pointer-events: none;
  z-index: 22;
}
.s6-continue-btn.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}
.s6-continue-btn:hover  { background: #ef5350; box-shadow: 7px 7px 0 #000; }
.s6-continue-btn:active { background: #b71c1c; box-shadow: 2px 2px 0 #000; }

/* ── Portrait adjustments ───────────────────────────────── */
@media (orientation: portrait) {
  .s6-text    { font-size: 17px; }
  #s6-line-1  { top: 40px; }
  #s6-line-2  { bottom: 160px; }
  #s6-zeus    { transform: translateX(60px) scale(0.5) rotate(12deg); }
  #s6-zeus svg { width: 105px; height: 131px; }
  .s6-bzzzt   { font-size: 38px; }
}
