/*
  Fast Money Advance Overlay (contestant screen)
  Shown when a family crosses 300 points and is advancing to Fast Money.
*/

#fastMoneyAdvanceOverlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(rgba(0, 0, 20, 0.12), rgba(0, 0, 0, 0.58)),
    url("./assets/fm-advance-stage.png") center / cover no-repeat;
}

#fastMoneyAdvanceOverlay.show {
  display: flex;
  animation: fmaFadeIn 0.45s ease forwards;
}

.fma-stage-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 215, 80, 0.18), transparent 24%),
    linear-gradient(90deg, rgba(0, 33, 120, 0.15), transparent 34%, transparent 66%, rgba(0, 33, 120, 0.15));
  pointer-events: none;
}

.fma-light-sweep {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 227, 120, 0.32), transparent 18%),
    radial-gradient(circle at 80% 25%, rgba(0, 170, 255, 0.28), transparent 20%),
    radial-gradient(circle at 50% 85%, rgba(255, 255, 255, 0.18), transparent 18%);
  mix-blend-mode: screen;
  animation: fmaLightsMove 5s ease-in-out infinite alternate;
  pointer-events: none;
}

.fma-glitter {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255, 221, 93, 0.8) 0 1px, transparent 1.5px);
  background-size: 80px 80px, 110px 110px;
  background-position: 0 0, 35px 50px;
  opacity: 0.24;
  animation: fmaSparkle 2.5s linear infinite;
  pointer-events: none;
}

.fma-message-box {
  position: relative;
  max-width: 1120px;
  width: 88%;
  padding: 48px 54px;
  text-align: center;
  border-radius: 30px;
  border: 6px solid #ffd76a;
  background:
    linear-gradient(135deg, rgba(5, 18, 74, 0.95), rgba(0, 70, 155, 0.92)),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.15), transparent 62%);
  box-shadow:
    0 0 28px rgba(255, 219, 100, 0.95),
    0 0 76px rgba(0, 140, 255, 0.75),
    inset 0 0 36px rgba(255, 255, 255, 0.18);
  transform: scale(0.92);
  animation: fmaPopIn 0.65s cubic-bezier(.18, .89, .32, 1.28) forwards;
}

.fma-bulb-border {
  position: absolute;
  inset: -17px;
  border-radius: 38px;
  pointer-events: none;
  background:
    radial-gradient(circle, #fff6cc 0 4px, #ffd347 4px 7px, transparent 8px) top left / 46px 46px repeat-x,
    radial-gradient(circle, #fff6cc 0 4px, #ffd347 4px 7px, transparent 8px) bottom left / 46px 46px repeat-x,
    radial-gradient(circle, #fff6cc 0 4px, #ffd347 4px 7px, transparent 8px) top left / 46px 46px repeat-y,
    radial-gradient(circle, #fff6cc 0 4px, #ffd347 4px 7px, transparent 8px) top right / 46px 46px repeat-y;
  filter: drop-shadow(0 0 7px rgba(255, 221, 85, 0.9));
  animation: fmaBulbPulse 1.2s ease-in-out infinite alternate;
}

.fma-header {
  position: relative;
  font-size: clamp(1.4rem, 3vw, 2.6rem);
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 18px;
  text-shadow:
    0 0 8px #0077ff,
    0 0 16px #0077ff;
}

.fma-main-message {
  position: relative;
  font-size: clamp(2.25rem, 6vw, 5.7rem);
  font-weight: 1000;
  line-height: 1.05;
  color: #ffd84d;
  text-transform: uppercase;
  text-shadow:
    -3px -3px 0 #003b91,
     3px -3px 0 #003b91,
    -3px  3px 0 #003b91,
     3px  3px 0 #003b91,
     0 0 14px rgba(255, 238, 130, 0.95),
     0 0 28px rgba(255, 190, 40, 0.85);
}

.fma-family-name {
  color: #ffffff;
  white-space: nowrap;
  text-shadow:
    -3px -3px 0 #003b91,
     3px -3px 0 #003b91,
    -3px  3px 0 #003b91,
     3px  3px 0 #003b91,
     0 0 20px rgba(255, 255, 255, 0.95);
}

.fma-fast-money {
  color: #fff7bf;
}

@keyframes fmaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fmaPopIn {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fmaLightsMove {
  from {
    transform: translateX(-3%) rotate(-2deg);
    opacity: 0.72;
  }
  to {
    transform: translateX(3%) rotate(2deg);
    opacity: 1;
  }
}

@keyframes fmaSparkle {
  from { background-position: 0 0, 35px 50px; }
  to { background-position: 80px 80px, 145px 160px; }
}

@keyframes fmaBulbPulse {
  from {
    opacity: 0.62;
    filter: drop-shadow(0 0 4px rgba(255, 221, 85, 0.65));
  }
  to {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(255, 221, 85, 1));
  }
}

@media (max-width: 700px) {
  .fma-message-box {
    padding: 34px 24px;
    width: 91%;
  }

  .fma-main-message {
    text-shadow:
      -2px -2px 0 #003b91,
       2px -2px 0 #003b91,
      -2px  2px 0 #003b91,
       2px  2px 0 #003b91,
       0 0 14px rgba(255, 238, 130, 0.95);
  }
}
