/* ============================================================================
   WOBBLE FORGE — screens.css
   File 5/6. Per-screen composition plus the shared staggered enter/exit
   transition for every .wf-screen, and the WOBBLE FORGE branding pieces
   (logo, tagline, loading bar).
   ========================================================================== */

/* ==========================================================================
   SCREEN TRANSITIONS
   Hidden by default; .is-active fades + slides in (~200ms). Exit is fast
   (~130ms) because the base rule owns the shorter duration.
   ========================================================================== */
.wf-screen {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.995);
  transition:
    opacity var(--wf-dur-fast) var(--wf-ease-in),
    transform var(--wf-dur-fast) var(--wf-ease-in),
    visibility 0s linear var(--wf-dur-fast);
  will-change: opacity, transform;
}

.wf-screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition:
    opacity var(--wf-dur-base) var(--wf-ease-out),
    transform var(--wf-dur-base) var(--wf-ease-out),
    visibility 0s linear 0s;
}

/* Explicit exit hook (JS may apply before removing .is-active). */
.wf-screen.is-exiting {
  opacity: 0;
  transform: translateY(-6px) scale(0.995);
  transition:
    opacity var(--wf-dur-fast) var(--wf-ease-in),
    transform var(--wf-dur-fast) var(--wf-ease-in);
}

/* Interactive screens must swallow clicks so the canvas never steals them. */
.wf-screen--pause.is-active,
.wf-screen--results.is-active,
.wf-screen--confirm.is-active,
.wf-screen--menu.is-active,
.wf-screen--modes.is-active,
.wf-screen--collection.is-active,
.wf-screen--records.is-active,
.wf-screen--settings.is-active,
.wf-screen--loading.is-active {
  pointer-events: auto;
}

/* ==========================================================================
   BRANDING — logo, tagline, loading bar
   ========================================================================== */
.wf-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--wf-sp-3);
}

.wf-logo__text {
  display: inline-block;
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: clamp(var(--wf-fs-3xl), 9vw, var(--wf-fs-5xl));
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--wf-cream);
  -webkit-text-stroke: 2px var(--wf-navy-ink);
  paint-order: stroke fill;
  text-shadow: 0 5px 0 rgba(20, 24, 41, 0.6);
  white-space: nowrap;
}

.wf-logo__text em {
  font-style: normal;
  color: var(--wf-gold);
}

/* Symmetric block stacks flanking the wordmark. */
.wf-logo__decor {
  position: relative;
  width: calc(var(--wf-fs-3xl) * 0.9);
  height: calc(var(--wf-fs-3xl) * 0.9);
  flex: 0 0 auto;
  animation: wf-bob 3.4s var(--wf-ease-out) infinite;
}

.wf-logo__decor::before,
.wf-logo__decor::after {
  content: "";
  position: absolute;
  border: 2px solid var(--wf-navy-ink);
  border-radius: 4px;
}

.wf-logo__decor::before {
  left: 6%;
  bottom: 8%;
  width: 60%;
  height: 26%;
  background: var(--wf-gold);
}

.wf-logo__decor::after {
  right: 6%;
  bottom: 34%;
  width: 46%;
  height: 26%;
  background: var(--wf-cyan);
}

.wf-logo__decor--r { animation-delay: -1.7s; }
.wf-logo__decor--r::before { background: var(--wf-red); }
.wf-logo__decor--r::after  { background: var(--wf-green); }

.wf-logo--boot .wf-logo__text { font-size: clamp(var(--wf-fs-2xl), 7vw, var(--wf-fs-4xl)); }

/* Menu wordmark is the largest type in the game. */
.wf-logo--menu .wf-logo__text {
  font-size: clamp(var(--wf-fs-4xl), 10vw, var(--wf-fs-5xl));
}

/* Left decor block set (right set is re-tinted above). */
.wf-logo__decor--l { animation-delay: 0s; }
.wf-logo__decor--l::before { background: var(--wf-wood); }
.wf-logo__decor--l::after  { background: var(--wf-ice); }

.wf-tagline {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-xs);
  letter-spacing: var(--wf-ls-wider);
  text-transform: uppercase;
  color: rgba(255, 243, 220, 0.82);
  text-align: center;
}

/* ---- Loading bar -------------------------------------------------------- */
.wf-load-bar {
  position: relative;
  width: min(74vw, 360px);
  height: 22px;
  padding: 3px;
  background: rgba(20, 24, 41, 0.72);
  border: 3px solid var(--wf-navy-ink);
  border-radius: var(--wf-r-pill);
  box-shadow: 0 4px 0 rgba(20, 24, 41, 0.45);
  overflow: hidden;
}

.wf-load-bar__fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: var(--wf-r-pill);
  background: linear-gradient(180deg, var(--wf-gold) 0%, var(--wf-gold-600) 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.42);
  transition: width var(--wf-dur-base) var(--wf-ease-out);
}

.wf-load-bar__fill::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.55) 50%, rgba(255, 255, 255, 0) 100%);
  animation: wf-sheen 1.4s var(--wf-ease-out) infinite;
}

/* ==========================================================================
   LOADING SCREEN
   ========================================================================== */
.wf-screen--loading {
  align-items: center;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 12%, var(--wf-bg-a) 0%, var(--wf-bg-b) 80%);
}

.wf-load-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wf-sp-4);
  padding: var(--wf-sp-6) var(--wf-sp-7);
  width: min(92vw, 560px);
  text-align: center;
}

.wf-load-text {
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-sm);
  letter-spacing: var(--wf-ls-wider);
  text-transform: uppercase;
  color: var(--wf-cream);
}

.wf-load-hint {
  font-size: var(--wf-fs-xs);
  font-weight: 700;
  color: var(--wf-red);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   MAIN MENU
   ========================================================================== */
.wf-screen--menu {
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(20, 24, 41, 0.42) 0%, rgba(20, 24, 41, 0.72) 100%);
}

.wf-menu__head {
  display: flex;
  justify-content: center;
  padding: var(--wf-sp-4) var(--wf-pad-edge) 0;
}

.wf-menu__body {
  flex: 1 1 auto;
  width: min(100%, 440px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: var(--wf-sp-4);
  padding: var(--wf-sp-4) var(--wf-pad-edge) var(--wf-sp-6);
}

.wf-menu__body .wf-btn--hero { align-self: center; min-width: min(100%, 300px); }

.wf-menu__nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--wf-sp-3);
  margin-top: var(--wf-sp-2);
}

.wf-menu__nav .wf-btn { width: 100%; }

/* ==========================================================================
   MODE SELECT
   ========================================================================== */
.wf-screen--modes {
  justify-content: flex-start;
  background:
    linear-gradient(180deg, rgba(20, 24, 41, 0.6) 0%, rgba(20, 24, 41, 0.85) 100%);
}

/* ==========================================================================
   GAMEPLAY
   HUD grid is defined in layout.css; here we only add the game screen's own
   full-bleed backdrop handling and let the canvas show through untouched.
   ========================================================================== */
.wf-screen--game {
  background: transparent;
  justify-content: flex-start;
}

/* ==========================================================================
   PAUSE / RESULTS / CONFIRM — centred modal panels
   ========================================================================== */
.wf-screen--pause,
.wf-screen--results,
.wf-screen--confirm {
  align-items: center;
  justify-content: center;
  padding: var(--wf-pad-edge);
  background: var(--wf-scrim);
}

.wf-screen--confirm { z-index: var(--wf-z-overlay); }
.wf-screen--pause   { z-index: var(--wf-z-overlay); }

.wf-screen--results .wf-panel--results { width: min(100%, var(--wf-panel-w)); }

/* ==========================================================================
   COLLECTION / RECORDS / SETTINGS
   ========================================================================== */
.wf-screen--collection,
.wf-screen--records,
.wf-screen--settings {
  justify-content: flex-start;
  background:
    linear-gradient(180deg, rgba(20, 24, 41, 0.6) 0%, rgba(20, 24, 41, 0.86) 100%);
}

/* ==========================================================================
   RESPECT REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .wf-screen {
    transform: none;
    transition: opacity var(--wf-dur-fast) linear, visibility 0s linear var(--wf-dur-fast);
  }
  .wf-screen.is-active {
    transform: none;
    transition: opacity var(--wf-dur-base) linear, visibility 0s linear 0s;
  }
  .wf-screen.is-exiting { transform: none; }
}
