/* ============================================================
   CANDLE-MIC — styles for the blow-the-candles-out stage.
   Namespace: .mic-*     z-index band: 500-599
   Loads after css/stylesheet.css.
   ============================================================ */

.mic-layer {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 500;
  pointer-events: none;
}

/* ---------------------------------------------------------- prompt card */

.mic-prompt {
  position: fixed;
  left: 50%;
  bottom: 6vh;
  transform: translateX(-50%) translateY(12px);
  width: 90%;
  max-width: 360px;
  padding: 22px 24px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.22);
  text-align: center;
  font-family: 'Lato', sans-serif;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 520;
  transition: opacity .35s ease, transform .35s ease, visibility .35s;
}

.mic-prompt.mic-visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.mic-text {
  margin: 10px 0 14px;
  font-size: 16px;
  font-weight: 400;
  font-style: italic;
  color: #4a3b32;
  line-height: 1.4;
}

.mic-prompt.mic-done .mic-text {
  font-weight: 700;
  font-style: normal;
  color: #D14D39;
  animation: mic-pop .5s ease;
}

/* ---------------------------------------------------------- mic icon */

.mic-icon-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  --mic-level: 0;
}

.mic-icon-svg {
  position: relative;
  width: 30px;
  height: 30px;
  fill: #D14D39;
  z-index: 2;
  filter: drop-shadow(0 0 calc(4px + var(--mic-level, 0) * 10px) rgba(209, 77, 57, 0.55));
}

.mic-pulse-ring,
.mic-pulse-ring-2 {
  position: absolute;
  top: 50%; left: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  border: 2px solid rgba(242, 179, 0, 0.65);
  animation: mic-pulse 1.8s ease-out infinite;
}

.mic-pulse-ring-2 {
  animation-delay: 0.9s;
}

.mic-prompt.mic-done .mic-pulse-ring,
.mic-prompt.mic-done .mic-pulse-ring-2 {
  animation: none;
  opacity: 0;
}

@keyframes mic-pulse {
  0%   { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.9); opacity: 0; }
}

@keyframes mic-pop {
  0%   { transform: scale(0.85); }
  50%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ---------------------------------------------------------- level meter */

.mic-meter {
  display: none;
  width: 100%;
  height: 8px;
  margin: 14px 0 4px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.mic-prompt.mic-has-meter .mic-meter {
  display: block;
}

.mic-meter-fill {
  width: 100%;
  height: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: 6px;
  background: linear-gradient(90deg, #8FAD00, #F2B300, #D14D39);
  transition: transform 60ms linear;
}

/* ---------------------------------------------------------- fallback button */

.mic-fallback-btn {
  display: none;
  margin-top: 12px;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: #F2B300;
  color: #3a2c1c;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(242, 179, 0, 0.45);
  transition: transform .15s ease, box-shadow .15s ease;
}

.mic-fallback-btn:hover,
.mic-fallback-btn:focus {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(242, 179, 0, 0.55);
}

.mic-fallback-btn:active {
  transform: translateY(0);
}

/* ---------------------------------------------------------- smoke puffs */

.mic-smoke-host {
  position: fixed;
  top: 0; left: 0;
  width: 0; height: 0;
  pointer-events: none;
}

.mic-smoke {
  position: fixed;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180, 178, 174, 0.6) 0%, rgba(180, 178, 174, 0) 72%);
  pointer-events: none;
  z-index: 550;
  animation: mic-smoke-rise 950ms ease-out forwards;
  will-change: transform, opacity;
}

@keyframes mic-smoke-rise {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 0.6;
  }
  100% {
    transform: translate(var(--mic-smoke-dx, 0px), -70px) scale(2.2);
    opacity: 0;
  }
}

/* ---------------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  .mic-prompt {
    transition: opacity .35s ease;
  }
  .mic-pulse-ring,
  .mic-pulse-ring-2 {
    animation-duration: 3.2s;
  }
  .mic-smoke {
    animation-duration: 600ms;
  }
  @keyframes mic-smoke-rise {
    0% { transform: translate(0, 0) scale(0.6); opacity: 0.5; }
    100% { transform: translate(0, -30px) scale(1.3); opacity: 0; }
  }
}

/* ---------------------------------------------------------- small screens */

@media (max-width: 480px) {
  .mic-prompt {
    width: 92%;
    padding: 18px 16px 16px;
    bottom: 4vh;
  }
  .mic-text {
    font-size: 14px;
  }
}
