/* Frog Night mobile boot intro — mirrors desktop boot phases */

html.wfts-boot-lock body { overflow: hidden; }
html.wfts-boot-loading:not(.wfts-boot-done) body.wfts-boot-fixed {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

#app-sky-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: #000010;
  z-index: 0;
  transition: opacity 1.15s ease-out;
}
#app-sky-bg iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
html.wfts-boot-loading:not(.wfts-boot-phase-sky) #app-sky-bg { opacity: 0; }
html.wfts-boot-loading.wfts-boot-phase-sky #app-sky-bg { opacity: 1; }
html.wfts-boot-loading:not(.wfts-boot-phase-sky) body {
  background-color: #000010 !important;
}

.m-boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  pointer-events: auto;
  background: rgba(0, 0, 16, 0.94);
  transition: opacity 0.55s ease, visibility 0.55s ease, background 0.45s ease;
}
html.wfts-boot-loading.wfts-boot-phase-sky .m-boot-overlay {
  background: rgba(0, 0, 16, 0.82);
}
html.wfts-boot-done .m-boot-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: transparent;
  display: none !important;
}

/* Hide app chrome for the full intro — avoids blank forecast UI bleeding through */
html.wfts-boot-loading:not(.wfts-boot-done) .m-header,
html.wfts-boot-loading:not(.wfts-boot-done) #m-main {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
html.wfts-boot-done .m-header,
html.wfts-boot-done #m-main {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity 0.5s ease;
}

#m-main {
  position: relative;
  z-index: 1;
  min-height: calc(100dvh - var(--header-h) - var(--safe-bottom));
}

/* Intro loading indicator — fills logo slot before frames are ready */
.predictor-countdown-card .pcc-boot-seq {
  position: relative;
}
.m-boot-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 3;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.m-boot-loader.m-boot-loader--hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.m-boot-loader-ring {
  position: relative;
  width: clamp(72px, 22vw, 96px);
  height: clamp(72px, 22vw, 96px);
  border-radius: 50%;
  border: 1px solid rgba(212, 168, 90, 0.22);
  background: radial-gradient(circle at 50% 42%, rgba(212, 136, 58, 0.14), rgba(14, 13, 10, 0.5));
  box-shadow: 0 0 28px rgba(212, 136, 58, 0.12), inset 0 0 20px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-boot-loader-ring::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--amber2);
  border-right-color: rgba(212, 168, 90, 0.35);
  animation: mBootLoaderSpin 1.1s cubic-bezier(0.45, 0.1, 0.35, 0.9) infinite;
}
.m-boot-loader-frog {
  position: relative;
  z-index: 1;
  width: clamp(36px, 11vw, 48px);
  height: clamp(36px, 11vw, 48px);
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  animation: mBootLoaderPulse 2.2s ease-in-out infinite;
}
.m-boot-loader-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
@keyframes mBootLoaderSpin {
  to { transform: rotate(360deg); }
}
@keyframes mBootLoaderPulse {
  0%, 100% { opacity: 0.55; transform: scale(0.94); }
  50% { opacity: 1; transform: scale(1); }
}

/* Countdown card */
.predictor-countdown-float {
  width: 100%;
  max-width: min(100%, 520px);
  margin: 0 auto;
  transform-origin: center center;
  animation: mPccDriftX 44s ease-in-out infinite;
}
.predictor-countdown-float-inner {
  transform-origin: center center;
  animation: mPccDriftY 34s ease-in-out infinite reverse;
}
@keyframes mPccDriftX {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(4px, -2px, 0); }
}
@keyframes mPccDriftY {
  0%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  50% { transform: translate3d(0, 5px, 0) rotate(0.06deg); }
}

.predictor-countdown-card {
  position: relative;
  width: 100%;
  max-width: min(520px, 92vw);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 24px);
  box-sizing: border-box;
  isolation: isolate;
}
.predictor-countdown-card > .pcc-boot-seq { z-index: 0; }
.predictor-countdown-card > .pcc-boot-copy { z-index: 2; position: relative; }

.predictor-countdown-card .pcc-boot-seq {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: clamp(96px, 28vw, 130px);
  min-height: clamp(96px, 28vw, 130px);
  margin: 0 auto 14px;
}
.predictor-countdown-card .pcc-boot-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

html.wfts-boot-loading body:not(.loaded) #predictor-countdown-card .pcc-logo-wrap {
  opacity: 0;
  transition: opacity 0.95s cubic-bezier(0.25, 0.85, 0.3, 1), transform 1.15s cubic-bezier(0.25, 0.85, 0.3, 1);
}
html.wfts-boot-loading.wfts-boot-phase-logo body:not(.loaded) #predictor-countdown-card .pcc-logo-wrap {
  opacity: 1;
}
html.wfts-boot-loading.wfts-boot-phase-logo body:not(.loaded) #predictor-countdown-card .pcc-logo-wrap.pcc-logo-wrap--seq-active {
  opacity: 1;
}

.predictor-countdown-card .pcc-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(96px, 28vw, 130px);
  aspect-ratio: 1;
  margin: 0 auto;
  touch-action: manipulation;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.predictor-countdown-card .pcc-logo-wrap--hold-active .pcc-logo-motion {
  transform: scale(1.07);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}
.predictor-countdown-card .pcc-logo-wrap--hold-active .pcc-logo {
  filter:
    drop-shadow(0 0 14px rgba(212, 168, 90, 0.42))
    drop-shadow(0 5px 14px rgba(0, 0, 0, 0.38));
}
.predictor-countdown-card .pcc-logo-motion {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  transform-origin: center center;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
.predictor-countdown-card .pcc-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 14px rgba(0, 0, 0, 0.38));
}

/* Poem */
.predictor-countdown-card .pcc-boot-poem {
  margin: 0 auto 14px;
  width: 100%;
  max-width: min(34em, calc(100% - 4px));
  pointer-events: none;
  text-align: center;
  position: relative;
  min-height: clamp(96px, 26vw, 150px);
  transition: opacity 0.55s ease, margin 0.45s ease;
}
html.wfts-boot-loading:not(.wfts-boot-phase-poem) .pcc-boot-poem {
  opacity: 0;
  max-height: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
}
html.wfts-boot-loading.wfts-boot-phase-poem .pcc-boot-poem {
  opacity: 1;
  max-height: min(50vh, 28rem);
  overflow: visible;
  visibility: visible;
}
.predictor-countdown-card .pcc-boot-poem-line {
  font-family: 'Playfair Display', serif;
  font-size: clamp(11px, 3.15vw, 22px);
  font-weight: 400;
  font-style: italic;
  line-height: 1.42;
  color: var(--cream);
  letter-spacing: 0.01em;
  margin: 0;
  padding: 0 clamp(10px, 3.5vw, 16px);
  box-sizing: border-box;
  opacity: 0;
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  width: 100%;
  max-width: 100%;
  transform: translateY(-50%);
  display: block;
  text-align: center;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}
body.loaded .pcc-boot-poem { display: none !important; }

/* Title */
.predictor-countdown-card .predictor-page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(26px, 7vw, 36px);
  font-weight: 400;
  color: var(--cream);
  text-align: center;
  margin: 0 0 8px;
  line-height: 1.15;
}
.predictor-countdown-card .pcc-title-brand.wave-words span {
  display: inline-block;
  opacity: 0.35;
  animation: mWordOpacityWaveBoot 6.5s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  animation-delay: calc(var(--i, 0) * 0.55s);
}
html.wfts-boot-loading:not(.wfts-boot-phase-title) .predictor-countdown-card .pcc-title-brand {
  opacity: 0 !important;
}
html.wfts-boot-loading:not(.wfts-boot-phase-title) .predictor-countdown-card .pcc-title-brand.wave-words span {
  animation: none !important;
}
html.wfts-boot-loading.wfts-boot-phase-title .predictor-countdown-card .pcc-title-brand {
  opacity: 1 !important;
}

.predictor-countdown-card .pcc-title-subline {
  margin: 0 0 10px;
  font-family: 'Playfair Display', serif;
  font-size: clamp(12px, 3.4vw, 16px);
  font-style: italic;
  line-height: 1.3;
  color: rgba(92, 90, 88, 0.86);
  text-align: center;
}
.predictor-countdown-card .pcc-title-subline.wave-words span {
  display: inline-block;
  opacity: 0.28;
  animation: mWordOpacityWave 10.5s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 0.28s);
}
html.wfts-boot-loading:not(.wfts-boot-phase-title) .predictor-countdown-card .pcc-title-subline {
  opacity: 0 !important;
}
html.wfts-boot-loading.wfts-boot-phase-title .predictor-countdown-card .pcc-title-subline {
  opacity: 1 !important;
}

@keyframes mWordOpacityWave {
  0%, 100% { opacity: 0.28; }
  45% { opacity: 1; }
}
@keyframes mWordOpacityWaveBoot {
  0%, 100% { opacity: 0.34; }
  50% { opacity: 0.92; }
}

.boot-skip-btn {
  margin-top: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(252, 236, 200, 0.9);
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 8px 4px;
  min-height: 44px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.7s ease, color 0.15s ease;
}
.boot-skip-btn:hover,
.boot-skip-btn:focus-visible { opacity: 1; color: rgba(240, 185, 95, 0.96); }
html.wfts-boot-done .boot-skip-btn,
body.loaded .boot-skip-btn { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .predictor-countdown-float,
  .predictor-countdown-float-inner { animation: none; }
  html.wfts-boot-loading #app-sky-bg { transition-duration: 0.15s; }
  html.wfts-boot-loading body:not(.loaded) #predictor-countdown-card .pcc-logo-wrap { transition-duration: 0.12s; }
  .predictor-countdown-card .pcc-title-brand.wave-words span,
  .predictor-countdown-card .pcc-title-subline.wave-words span { animation: none; opacity: 0.85; }
  .m-boot-loader-ring::after { animation-duration: 1.6s; }
  .m-boot-loader-frog { animation: none; opacity: 0.92; }
}
