/* ============================================================================
   WOBBLE FORGE — components.css
   File 4/6 (part A). Buttons, icon glyphs, HUD plates, panels, gauges,
   badges and in-game callouts (objective / coach / intro).
   Every surface is chunky, navy-outlined and hard-shadowed so it reads as a
   physical arcade cabinet, not a web dashboard.
   ========================================================================== */

/* ==========================================================================
   BUTTONS
   A single --wf-btn-* variable set drives colour + shadow depth, so hover /
   press / disabled only have to change the depth number.
   ========================================================================== */
.wf-btn {
  --wf-btn-sh: 4px;
  --wf-btn-bg: var(--wf-surface);
  --wf-btn-fg: var(--wf-navy);
  --wf-btn-edge: var(--wf-navy);
  --wf-btn-line: var(--wf-navy);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  min-height: var(--wf-btn-h);
  min-width: var(--wf-tap-min);
  padding: 0 var(--wf-btn-pad-x);
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-lg);
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--wf-btn-fg);
  background: var(--wf-btn-bg);
  border: var(--wf-line-w) solid var(--wf-btn-line);
  border-radius: var(--wf-r-md);
  box-shadow: 0 var(--wf-btn-sh) 0 var(--wf-btn-edge);
  transform: translateY(0) scale(1);
  transition:
    transform var(--wf-dur-fast) var(--wf-ease-out),
    box-shadow var(--wf-dur-fast) var(--wf-ease-out),
    background-color var(--wf-dur-fast) linear,
    border-color var(--wf-dur-fast) linear,
    filter var(--wf-dur-fast) linear;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  /* Slow idle breathing (uses `translate`, so it composes with transform). */
  animation: wf-breathe var(--wf-dur-float) var(--wf-ease-out) infinite;
}

.wf-btn__label {
  pointer-events: none;
  display: inline-block;
  transform: translateY(-0.02em);
}

.wf-btn__icon {
  position: relative;
  display: inline-block;
  width: 1.05em;
  height: 1.05em;
  flex: 0 0 auto;
  pointer-events: none;
}

/* Play triangle glyph for the two hero buttons + reward icon. */
.wf-btn__icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-34%, -50%);
  border-top: 0.36em solid transparent;
  border-bottom: 0.36em solid transparent;
  border-left: 0.6em solid currentColor;
}

/* Idle micro-highlight so surfaces read as lit from above. */
.wf-btn::before {
  content: "";
  position: absolute;
  inset: 3px 3px auto 3px;
  height: 32%;
  border-radius: calc(var(--wf-r-md) - 4px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0));
  pointer-events: none;
}

/* ---- Button states ------------------------------------------------------ */
@media (hover: hover) {
  .wf-btn:hover {
    --wf-btn-sh: 7px;
    transform: translateY(-3px);
  }
}

.wf-btn:active {
  --wf-btn-sh: 2px;
  transform: translateY(3px) scale(0.98);
  transition-duration: var(--wf-dur-instant);
}

.wf-btn:focus-visible {
  outline: none;
  box-shadow:
    0 var(--wf-btn-sh) 0 var(--wf-btn-edge),
    var(--wf-sh-ring);
  z-index: 3;
}

.wf-btn[disabled],
.wf-btn:disabled,
.wf-btn.is-disabled {
  --wf-btn-sh: 0;
  --wf-btn-bg: var(--wf-grey-600);
  --wf-btn-fg: rgba(20, 24, 41, 0.6);
  --wf-btn-edge: transparent;
  --wf-btn-line: rgba(20, 24, 41, 0.35);
  box-shadow: none;
  transform: none;
  filter: saturate(0.25);
  opacity: 0.7;
  cursor: not-allowed;
  animation: none;
  pointer-events: none;
}

.wf-btn[disabled]::before,
.wf-btn.is-disabled::before { display: none; }

/* ---- Variants ----------------------------------------------------------- */
.wf-btn--primary {
  --wf-btn-bg: var(--wf-gold);
  --wf-btn-fg: var(--wf-navy-ink);
  --wf-btn-edge: var(--wf-gold-800);
  --wf-btn-line: var(--wf-navy);
}

.wf-btn--secondary {
  --wf-btn-bg: var(--wf-surface-2);
  --wf-btn-fg: var(--wf-navy);
  --wf-btn-edge: var(--wf-navy);
  --wf-btn-line: var(--wf-navy);
  font-size: var(--wf-fs-md);
}

.wf-btn--ghost {
  --wf-btn-bg: transparent;
  --wf-btn-fg: var(--wf-cream);
  --wf-btn-edge: rgba(20, 24, 41, 0.5);
  --wf-btn-line: rgba(255, 243, 220, 0.72);
  font-size: var(--wf-fs-md);
}

.wf-btn--ghost::before { display: none; }

@media (hover: hover) {
  .wf-btn--ghost:hover { --wf-btn-bg: rgba(255, 243, 220, 0.14); }
}

.wf-btn--danger {
  --wf-btn-bg: var(--wf-red);
  --wf-btn-fg: var(--wf-cream);
  --wf-btn-edge: var(--wf-red-800);
  --wf-btn-line: var(--wf-navy-ink);
}

.wf-btn--reward {
  --wf-btn-bg: var(--wf-cyan);
  --wf-btn-fg: var(--wf-navy-ink);
  --wf-btn-edge: var(--wf-cyan-800);
  --wf-btn-line: var(--wf-navy);
  font-size: var(--wf-fs-md);
}

/* Optional rewarded-ad button gets a soft attention pulse only when idle. */
.wf-btn--reward:not(:disabled) {
  animation:
    wf-breathe var(--wf-dur-float) var(--wf-ease-out) infinite,
    wf-pulse 2.6s var(--wf-ease-out) infinite;
}

.wf-btn--icon {
  --wf-btn-bg: var(--wf-surface);
  --wf-btn-fg: var(--wf-navy);
  --wf-btn-edge: var(--wf-navy);
  width: var(--wf-btn-h);
  height: var(--wf-btn-h);
  min-width: var(--wf-btn-h);
  padding: 0;
  border-radius: var(--wf-r-md);
}

.wf-btn--hero {
  --wf-btn-sh: 6px;
  --wf-btn-bg: var(--wf-gold);
  --wf-btn-fg: var(--wf-navy-ink);
  --wf-btn-edge: var(--wf-gold-800);
  min-height: calc(var(--wf-btn-h) * 1.34);
  padding: 0 calc(var(--wf-btn-pad-x) * 1.5);
  font-size: clamp(var(--wf-fs-xl), 4.4vw, var(--wf-fs-3xl));
  letter-spacing: 0.08em;
  border-width: var(--wf-line-w);
  border-radius: var(--wf-r-lg);
  box-shadow:
    0 var(--wf-btn-sh) 0 var(--wf-btn-edge),
    0 calc(var(--wf-btn-sh) + 6px) 22px rgba(255, 201, 60, 0.28);
  animation:
    wf-breathe var(--wf-dur-float) var(--wf-ease-out) infinite,
    wf-pulse 3.4s var(--wf-ease-out) infinite;
}

/* Oversized hero gets one controlled highlight sweep. */
.wf-btn--hero::after {
  content: "";
  position: absolute;
  top: -40%;
  left: -30%;
  width: 42%;
  height: 180%;
  background: linear-gradient(
    105deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.5) 50%,
    rgba(255, 255, 255, 0) 100%);
  transform: translateX(-140%) skewX(-14deg);
  animation: wf-sheen 4.6s var(--wf-ease-out) infinite;
  pointer-events: none;
}

@media (hover: hover) {
  .wf-btn--hero:hover {
    --wf-btn-sh: 9px;
    transform: translateY(-3px);
  }
}

.wf-btn--hero:active {
  --wf-btn-sh: 3px;
  transform: translateY(3px) scale(0.98);
}

.wf-btn--block { display: flex; width: 100%; }

/* ==========================================================================
   ICON GLYPHS — drawn entirely in CSS (no image requests)
   ========================================================================== */
.wf-icon {
  position: relative;
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  color: currentColor;
  pointer-events: none;
}

/* Pause: two chunky bars */
.wf-icon--pause::before,
.wf-icon--pause::after {
  content: "";
  position: absolute;
  top: 12%;
  height: 76%;
  width: 24%;
  background: currentColor;
  border-radius: 2px;
}
.wf-icon--pause::before { left: 18%; }
.wf-icon--pause::after  { right: 18%; }

/* Back: chunky chevron */
.wf-icon--back::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  width: 0.62em;
  height: 0.62em;
  border-left: 0.24em solid currentColor;
  border-bottom: 0.24em solid currentColor;
  border-radius: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* Left / right arrows */
.wf-icon--left::before,
.wf-icon--right::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 0.44em solid transparent;
  border-bottom: 0.44em solid transparent;
}
.wf-icon--left::before {
  transform: translate(-38%, -50%);
  border-right: 0.64em solid currentColor;
}
.wf-icon--right::before {
  transform: translate(-62%, -50%);
  border-left: 0.64em solid currentColor;
}

/* Rotate: open ring with an arrow head */
.wf-icon--rotate::before {
  content: "";
  position: absolute;
  inset: 12%;
  border: 0.22em solid currentColor;
  border-radius: 50%;
  border-top-color: transparent;
  transform: rotate(-52deg);
}
.wf-icon--rotate::after {
  content: "";
  position: absolute;
  top: 6%;
  left: 12%;
  width: 0;
  height: 0;
  border-top: 0.2em solid transparent;
  border-bottom: 0.2em solid transparent;
  border-left: 0.34em solid currentColor;
  transform: rotate(28deg);
}

/* Drop: arrow down into a ground line */
.wf-icon--drop::before {
  content: "";
  position: absolute;
  top: 6%;
  left: 50%;
  width: 0.52em;
  height: 0.52em;
  border-right: 0.22em solid currentColor;
  border-bottom: 0.22em solid currentColor;
  transform: translateX(-50%) rotate(45deg);
  border-radius: 0 0 2px 0;
}
.wf-icon--drop::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 10%;
  height: 0.2em;
  background: currentColor;
  border-radius: var(--wf-r-pill);
}

/* ==========================================================================
   PLATES — HUD readouts
   ========================================================================== */
.wf-plate {
  --wf-plate-bg: var(--wf-surface);
  --wf-plate-fg: var(--wf-navy);
  --wf-plate-line: var(--wf-navy);
  --wf-plate-edge: var(--wf-navy);

  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  min-height: var(--wf-plate-min);
  padding: var(--wf-plate-pad);
  background: var(--wf-plate-bg);
  color: var(--wf-plate-fg);
  border: var(--wf-line-w) solid var(--wf-plate-line);
  border-radius: var(--wf-r-md);
  box-shadow: 0 3px 0 var(--wf-plate-edge);
  pointer-events: none;
}

.wf-plate__key {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--wf-ls-wide);
  font-size: var(--wf-fs-nano);
  opacity: 0.78;
}

.wf-plate__val {
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-xl);
  line-height: 1;
  letter-spacing: 0;
}

.wf-plate--score .wf-plate__val { font-size: clamp(var(--wf-fs-xl), 3.4vw, var(--wf-fs-3xl)); }

.wf-plate--score { --wf-plate-bg: var(--wf-navy); --wf-plate-fg: var(--wf-cream); --wf-plate-line: var(--wf-navy-ink); --wf-plate-edge: var(--wf-navy-ink); }
.wf-plate--score .wf-plate__key { color: var(--wf-gold); opacity: 1; }
.wf-plate--score .wf-plate__val { color: var(--wf-gold); }

.wf-plate--combo {
  --wf-plate-bg: var(--wf-gold);
  --wf-plate-fg: var(--wf-navy-ink);
  --wf-plate-edge: var(--wf-gold-800);
  animation: wf-pop-in var(--wf-dur-base) var(--wf-ease-spring) both;
}
.wf-plate--combo .wf-plate__val { font-size: clamp(var(--wf-fs-lg), 3vw, var(--wf-fs-2xl)); }

.wf-plate--best {
  --wf-plate-bg: rgba(255, 243, 220, 0.16);
  --wf-plate-fg: var(--wf-cream);
  --wf-plate-line: rgba(255, 243, 220, 0.5);
  --wf-plate-edge: rgba(20, 24, 41, 0.45);
}
.wf-plate--best .wf-plate__val { font-size: var(--wf-fs-lg); }

.wf-plate--mode {
  --wf-plate-bg: var(--wf-navy-800);
  --wf-plate-fg: var(--wf-cream);
  --wf-plate-edge: var(--wf-navy-ink);
}
.wf-plate--mode .wf-plate__val {
  font-size: var(--wf-fs-sm);
  letter-spacing: var(--wf-ls-wider);
}

.wf-plate--timer {
  --wf-plate-bg: var(--wf-navy);
  --wf-plate-fg: var(--wf-gold);
  --wf-plate-edge: var(--wf-navy-ink);
}
.wf-plate--timer.is-danger { --wf-plate-bg: var(--wf-red); --wf-plate-fg: var(--wf-cream); }

.wf-plate--wind {
  --wf-plate-bg: var(--wf-cyan);
  --wf-plate-fg: var(--wf-navy-ink);
  --wf-plate-edge: var(--wf-cyan-800);
}
.wf-plate--wind .wf-plate__val { font-size: var(--wf-fs-sm); letter-spacing: var(--wf-ls-wide); }

.wf-plate--block { gap: 0.7em; padding-right: var(--wf-sp-4); }
.wf-plate--block .wf-plate__val { font-size: var(--wf-fs-md); }
.wf-plate--block .wf-plate__key { color: var(--wf-wood-dark); opacity: 1; }

.wf-block-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}
.wf-block-meta .wf-plate__val { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }

.wf-block-chip {
  width: calc(var(--wf-plate-min) * 0.7);
  height: calc(var(--wf-plate-min) * 0.7);
  flex: 0 0 auto;
  border: 2px solid var(--wf-navy);
  border-radius: var(--wf-r-sm);
  background:
    linear-gradient(160deg, var(--wf-wood) 0%, var(--wf-wood) 58%, var(--wf-wood-dark) 58%, var(--wf-wood-dark) 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35), inset 0 -4px 0 rgba(20, 24, 41, 0.22);
}

/* Material modifier hooks for the current-block chip (JS sets data-material). */
.wf-block-chip[data-material="wood"]   { background: linear-gradient(160deg, var(--wf-wood) 58%, var(--wf-wood-dark) 58%); }
.wf-block-chip[data-material="stone"]  { background: linear-gradient(160deg, var(--wf-stone) 58%, var(--wf-stone-dark) 58%); }
.wf-block-chip[data-material="metal"]  { background: linear-gradient(160deg, var(--wf-metal) 58%, var(--wf-metal-dark) 58%); }
.wf-block-chip[data-material="ice"]    { background: linear-gradient(160deg, var(--wf-ice) 58%, var(--wf-ice-dark) 58%); }
.wf-block-chip[data-material="rubber"] { background: linear-gradient(160deg, var(--wf-rubber) 58%, var(--wf-rubber-dark) 58%); }
.wf-block-chip[data-material="sticky"] { background: linear-gradient(160deg, var(--wf-sticky) 58%, var(--wf-sticky-dark) 58%); }

/* ==========================================================================
   PANELS — pause / results / confirm dialogs
   ========================================================================== */
.wf-panel {
  position: relative;
  width: min(100%, var(--wf-panel-w));
  max-height: calc(100% - (var(--wf-pad-edge) * 2));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--wf-sp-6);
  display: flex;
  flex-direction: column;
  gap: var(--wf-sp-4);
  background: var(--wf-surface);
  color: var(--wf-navy);
  border: var(--wf-line-w) solid var(--wf-line);
  border-radius: var(--wf-r-xl);
  box-shadow: var(--wf-sh-panel);
  pointer-events: auto;
  touch-action: pan-y;
}

/* Top banner accent so panels feel forged, not floating. */
.wf-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  border-bottom: 3px solid var(--wf-navy);
  border-radius: var(--wf-r-xl) var(--wf-r-xl) 0 0;
  background: var(--wf-gold);
}

.wf-panel--pause::before   { background: var(--wf-cyan); }
.wf-panel--results::before { background: var(--wf-gold); }
.wf-panel--confirm::before { background: var(--wf-red); }

.wf-panel__title {
  font-family: var(--wf-font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: clamp(var(--wf-fs-xl), 4.6vw, var(--wf-fs-3xl));
  letter-spacing: var(--wf-ls-tight);
  color: var(--wf-navy);
  text-align: center;
  margin-top: var(--wf-sp-2);
}

.wf-panel__sub {
  text-align: center;
  font-size: var(--wf-fs-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--wf-ink-soft);
}

.wf-panel__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--wf-sp-3);
  margin-top: var(--wf-sp-2);
}
.wf-panel__actions .wf-btn { width: 100%; }

.wf-panel__actions--results .wf-row { width: 100%; }
.wf-panel__actions--results .wf-row .wf-btn { flex: 1 1 0; min-width: 0; }

/* ==========================================================================
   GAUGES — stability / height / forge
   ========================================================================== */
.wf-gauge {
  --wf-gauge-c: var(--wf-green);
  display: flex;
  align-items: center;
  gap: var(--wf-sp-3);
  padding: var(--wf-plate-pad);
  min-height: var(--wf-plate-min);
  background: rgba(20, 24, 41, 0.62);
  border: 2px solid rgba(255, 243, 220, 0.28);
  border-radius: var(--wf-r-md);
  color: var(--wf-cream);
  pointer-events: none;
}

.wf-gauge__label {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--wf-ls-wide);
  font-size: var(--wf-fs-nano);
  opacity: 0.85;
}

.wf-gauge__num {
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-xl);
  line-height: 1;
}

.wf-gauge__body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.wf-gauge__track {
  position: relative;
  width: 100%;
  height: 12px;
  background: rgba(20, 24, 41, 0.85);
  border: 2px solid rgba(20, 24, 41, 0.9);
  border-radius: var(--wf-r-pill);
  overflow: hidden;
}

.wf-gauge__fill {
  height: 100%;
  width: 0%;
  border-radius: var(--wf-r-pill);
  background: var(--wf-gauge-c);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.3);
  transition: width var(--wf-dur-base) var(--wf-ease-out),
              background-color var(--wf-dur-base) linear;
}

.wf-gauge--stability .wf-gauge__fill,
.wf-gauge--forge .wf-gauge__fill { background: var(--wf-gauge-c); }

/* State hooks set by JS on the gauge frame. */
.wf-gauge.is-ok       { --wf-gauge-c: var(--wf-green); }
.wf-gauge.is-warn     { --wf-gauge-c: var(--wf-gold); }
.wf-gauge.is-danger   { --wf-gauge-c: var(--wf-red); }
.wf-gauge.is-critical { --wf-gauge-c: var(--wf-red); }

.wf-gauge.is-unstable { --wf-gauge-c: var(--wf-gold); }
.wf-gauge.is-stable   { --wf-gauge-c: var(--wf-green); }

.wf-gauge__orb {
  width: calc(var(--wf-plate-min) * 0.62);
  height: calc(var(--wf-plate-min) * 0.62);
  flex: 0 0 auto;
  border-radius: 50%;
  border: 3px solid var(--wf-navy-ink);
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0) 60%),
    var(--wf-gauge-c);
  box-shadow: 0 3px 0 rgba(20, 24, 41, 0.55);
  transition: background-color var(--wf-dur-base) linear;
}

.wf-gauge--stability.is-danger .wf-gauge__orb,
.wf-gauge--stability.is-critical .wf-gauge__orb {
  animation: wf-pulse 0.7s var(--wf-ease-out) infinite;
}

.wf-gauge--height { gap: var(--wf-sp-2); }
.wf-gauge--height .wf-gauge__num { font-size: clamp(var(--wf-fs-lg), 2.6vw, var(--wf-fs-2xl)); }

.wf-gauge--forge { --wf-gauge-c: var(--wf-violet); }
.wf-gauge--forge .wf-gauge__body { min-width: 92px; }

/* ==========================================================================
   BADGES
   ========================================================================== */
.wf-badge {
  --wf-tint: var(--wf-grey-600);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 5px 12px;
  font-family: var(--wf-font-sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--wf-ls-wide);
  font-size: var(--wf-fs-nano);
  color: var(--wf-navy-ink);
  background: var(--wf-tint);
  border: 2px solid var(--wf-navy);
  border-radius: var(--wf-r-pill);
  box-shadow: 0 3px 0 rgba(20, 24, 41, 0.45);
  pointer-events: none;
  white-space: nowrap;
}

.wf-badge--gold   { --wf-tint: var(--wf-gold); }
.wf-badge--cyan   { --wf-tint: var(--wf-cyan); }
.wf-badge--green  { --wf-tint: var(--wf-green); }
.wf-badge--violet { --wf-tint: var(--wf-violet); color: var(--wf-cream); }
.wf-badge--red    { --wf-tint: var(--wf-red); color: var(--wf-cream); }
.wf-badge--locked {
  --wf-tint: var(--wf-grey);
  color: rgba(20, 24, 41, 0.65);
  filter: saturate(0.4);
}
.wf-badge--reward {
  --wf-tint: var(--wf-cyan);
  animation: wf-pulse 2.4s var(--wf-ease-out) infinite;
}

.wf-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--wf-sp-2);
  justify-content: center;
  min-height: 0;
}

/* ==========================================================================
   CALLOUTS — objective / coach / intro
   Centred, compact, and authored so they sit above the tower base rather than
   covering the centre of the play column.
   ========================================================================== */
.wf-objective {
  left: 50%;
  top: 17%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--wf-sp-3) var(--wf-sp-5);
  text-align: center;
  background: var(--wf-navy);
  color: var(--wf-cream);
  border: var(--wf-line-w) solid var(--wf-navy-ink);
  border-radius: var(--wf-r-lg);
  box-shadow: var(--wf-sh-2);
  animation: wf-pop-in var(--wf-dur-base) var(--wf-ease-spring) both;
}

.wf-objective__key {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--wf-ls-wider);
  font-size: var(--wf-fs-nano);
  color: var(--wf-cyan);
}

.wf-objective__val {
  font-family: var(--wf-font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: var(--wf-fs-xl);
  line-height: 1;
  color: var(--wf-gold);
}

.wf-objective__sub {
  font-size: var(--wf-fs-xs);
  font-weight: 600;
  opacity: 0.85;
}

.wf-coach {
  left: 50%;
  top: 26%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: var(--wf-sp-3);
  padding: var(--wf-sp-3) var(--wf-sp-5);
  background: var(--wf-cream);
  color: var(--wf-navy);
  border: var(--wf-line-w) solid var(--wf-navy);
  border-radius: var(--wf-r-pill);
  box-shadow: var(--wf-sh-2);
  animation: wf-pop-in var(--wf-dur-base) var(--wf-ease-spring) both,
             wf-pulse 3s var(--wf-ease-out) infinite;
}

.wf-coach__icon {
  position: relative;
  width: 1.4em;
  height: 1.4em;
  flex: 0 0 auto;
  color: var(--wf-navy);
}
.wf-coach__icon::before {
  content: "";
  position: absolute;
  inset: 18%;
  border: 3px solid currentColor;
  border-radius: var(--wf-r-sm);
  border-top-color: transparent;
}

.wf-coach__text {
  font-family: var(--wf-font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: var(--wf-ls-wide);
  font-size: var(--wf-fs-md);
}

.wf-coach__sub {
  font-size: var(--wf-fs-xs);
  font-weight: 600;
  opacity: 0.75;
}
.wf-coach__sub:empty { display: none; }

.wf-intro {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(88%, 380px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wf-sp-3);
  padding: var(--wf-sp-6);
  text-align: center;
  background: var(--wf-cream);
  color: var(--wf-navy);
  border: var(--wf-line-w) solid var(--wf-navy);
  border-radius: var(--wf-r-xl);
  box-shadow: var(--wf-sh-panel);
  pointer-events: auto;
  animation: wf-pop-in var(--wf-dur-base) var(--wf-ease-spring) both;
}

.wf-intro__icon {
  position: relative;
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  border: 3px solid var(--wf-navy);
  border-radius: var(--wf-r-md);
  background: var(--wf-gold);
  box-shadow: var(--wf-sh-inset);
}
.wf-intro__icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: translate(-34%, -50%);
  border-top: 0.5em solid transparent;
  border-bottom: 0.5em solid transparent;
  border-left: 0.78em solid var(--wf-navy);
}

.wf-intro__title {
  font-family: var(--wf-font-display);
  font-weight: 900;
  text-transform: uppercase;
  font-size: var(--wf-fs-2xl);
  letter-spacing: var(--wf-ls-tight);
  line-height: 1;
}

.wf-intro__sub {
  font-size: var(--wf-fs-sm);
  font-weight: 600;
  color: var(--wf-ink-soft);
}
.wf-intro__sub:empty { display: none; }

.wf-intro .wf-btn { align-self: stretch; }
.wf-intro .wf-btn--ghost {
  --wf-btn-fg: var(--wf-navy);
  --wf-btn-line: rgba(35, 42, 74, 0.45);
  --wf-btn-edge: rgba(35, 42, 74, 0.3);
  min-height: calc(var(--wf-btn-h) * 0.72);
  font-size: var(--wf-fs-sm);
}

/* ============================================================================
   COMPONENTS.CSS — part B
   Mode cards, next-block frame, hazard list, feed + floating feedback,
   toasts, touch controls, and list/collection/settings widgets.
   ========================================================================== */

/* ==========================================================================
   MODE CARDS
   ========================================================================== */
.wf-modes {
  flex: 1 1 auto;
  display: grid;
  gap: var(--wf-sp-3);
  padding: var(--wf-sp-3) var(--wf-pad-edge) var(--wf-pad-edge);
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.wf-mode-card {
  --wf-card-bg: var(--wf-cream);
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--wf-sp-3);
  padding: var(--wf-sp-3) var(--wf-sp-4);
  text-align: left;
  color: var(--wf-navy);
  background: var(--wf-card-bg);
  border: var(--wf-line-w) solid var(--wf-navy);
  border-radius: var(--wf-r-lg);
  box-shadow: var(--wf-sh-3);
  pointer-events: auto;
  transition: transform var(--wf-dur-fast) var(--wf-ease-out),
              box-shadow var(--wf-dur-fast) var(--wf-ease-out),
              background-color var(--wf-dur-fast) linear;
}

@media (hover: hover) {
  .wf-mode-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 9px 0 rgba(20, 24, 41, 0.55);
  }
}
.wf-mode-card:active {
  transform: translateY(2px) scale(0.99);
  box-shadow: 0 2px 0 rgba(20, 24, 41, 0.5);
}
.wf-mode-card:focus-visible {
  box-shadow: 0 3px 0 rgba(20, 24, 41, 0.55), var(--wf-sh-ring);
}

.wf-mode-card__art {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border: 3px solid var(--wf-navy);
  border-radius: var(--wf-r-md);
  background:
    linear-gradient(180deg, var(--wf-cyan) 0 30%, var(--wf-navy) 30% 34%, var(--wf-cream) 34% 100%);
  box-shadow: var(--wf-sh-inset);
}

.wf-mode-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wf-mode-card__name {
  font-family: var(--wf-font-display);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: var(--wf-ls-wide);
  font-size: var(--wf-fs-lg);
  line-height: 1;
}

.wf-mode-card__desc {
  font-size: var(--wf-fs-xs);
  font-weight: 600;
  color: var(--wf-ink-soft);
}

.wf-mode-card__best {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-xs);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  padding: 5px 10px;
  color: var(--wf-navy);
  background: var(--wf-gold);
  border: 2px solid var(--wf-navy);
  border-radius: var(--wf-r-pill);
  white-space: nowrap;
}

.wf-mode-card.is-selected,
.wf-mode-card.is-active {
  --wf-card-bg: var(--wf-gold);
  box-shadow: 0 6px 0 var(--wf-gold-800), var(--wf-sh-ring);
}

.wf-mode-card.is-locked,
.wf-mode-card[disabled] {
  --wf-card-bg: var(--wf-grey);
  filter: saturate(0.35);
  opacity: 0.8;
  cursor: not-allowed;
  box-shadow: var(--wf-sh-1);
}

/* ==========================================================================
   NEXT-BLOCK FRAME (right rail)
   ========================================================================== */
.wf-next {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wf-sp-2);
  width: var(--wf-next-size);
  padding: var(--wf-sp-2) var(--wf-sp-2) var(--wf-sp-3);
  background: rgba(20, 24, 41, 0.6);
  border: 2px solid rgba(255, 243, 220, 0.3);
  border-radius: var(--wf-r-lg);
  color: var(--wf-cream);
  pointer-events: none;
}

.wf-next__key {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: var(--wf-ls-wider);
  font-size: var(--wf-fs-nano);
  color: var(--wf-cyan);
}

.wf-next__art {
  width: calc(var(--wf-next-size) * 0.52);
  height: calc(var(--wf-next-size) * 0.52);
  border: 3px solid var(--wf-navy-ink);
  border-radius: var(--wf-r-sm);
  background:
    linear-gradient(160deg, var(--wf-wood) 0 58%, var(--wf-wood-dark) 58% 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.34), inset 0 -4px 0 rgba(20, 24, 41, 0.2);
  animation: wf-wobble-soft 3.2s var(--wf-ease-out) infinite;
}

.wf-next__name {
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   HAZARDS (rail list)
   ========================================================================== */
.wf-hazards {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--wf-sp-1);
  margin-top: var(--wf-sp-2);
}

.wf-hazards > li,
.wf-hazard {
  --wf-tint: var(--wf-gold);
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 4px 10px;
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  color: var(--wf-navy-ink);
  background: var(--wf-tint);
  border: 2px solid var(--wf-navy-ink);
  border-radius: var(--wf-r-pill);
  box-shadow: 0 2px 0 rgba(20, 24, 41, 0.5);
  animation: wf-pop-in var(--wf-dur-fast) var(--wf-ease-spring) both;
  pointer-events: none;
}

.wf-hazard--wind    { --wf-tint: var(--wf-cyan); color: var(--wf-navy-ink); }
.wf-hazard--quake   { --wf-tint: var(--wf-wood); }
.wf-hazard--ice,
.wf-hazard--slippery{ --wf-tint: var(--wf-ice); }
.wf-hazard--sticky  { --wf-tint: var(--wf-sticky); color: var(--wf-cream); }
.wf-hazard--danger  { --wf-tint: var(--wf-red); color: var(--wf-cream); animation: wf-pulse 1.2s var(--wf-ease-out) infinite; }

/* ==========================================================================
   FEED + FLOATING FEEDBACK
   Trajectory is CSS-variable driven (--dx / --dy), so JS can vary the arc.
   ========================================================================== */
.wf-feed {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.wf-float {
  --dx: 0px;
  --dy: -68px;
  --wf-float-c: var(--wf-gold);
  position: absolute;
  left: 50%;
  top: 34%;
  margin: 0;
  transform: translate(-50%, -50%);
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: clamp(var(--wf-fs-lg), 3.4vw, var(--wf-fs-2xl));
  line-height: 1;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--wf-float-c);
  white-space: nowrap;
  text-shadow:
    0 3px 0 var(--wf-navy),
    3px 0 0 var(--wf-navy),
    -3px 0 0 var(--wf-navy),
    0 -3px 0 var(--wf-navy),
    0 6px 14px rgba(20, 24, 41, 0.5);
  animation: wf-float-rise 900ms var(--wf-ease-out) forwards;
  will-change: transform, opacity;
  pointer-events: none;
}

.wf-float--perfect { --wf-float-c: var(--wf-gold); font-size: clamp(var(--wf-fs-xl), 4vw, var(--wf-fs-3xl)); }
.wf-float--combo   { --wf-float-c: var(--wf-cyan); }
.wf-float--risk    { --wf-float-c: var(--wf-red); }
.wf-float--warn    { --wf-float-c: var(--wf-gold); }
.wf-float--good    { --wf-float-c: var(--wf-green); }

.wf-float--big { font-size: clamp(var(--wf-fs-2xl), 5vw, var(--wf-fs-4xl)); }

/* ==========================================================================
   TOASTS / NOTICES
   ========================================================================== */
.wf-toasts {
  position: absolute;
  left: 50%;
  bottom: calc(var(--wf-pad-edge) + var(--wf-safe-b));
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wf-sp-2);
  z-index: var(--wf-z-toast);
  pointer-events: none;
  width: max-content;
  max-width: 92vw;
}

.wf-toast {
  --wf-toast-c: var(--wf-navy);
  display: inline-flex;
  align-items: center;
  gap: var(--wf-sp-2);
  max-width: 92vw;
  padding: var(--wf-sp-3) var(--wf-sp-5);
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-sm);
  letter-spacing: 0.02em;
  color: var(--wf-cream);
  background: var(--wf-toast-c);
  border: 2px solid var(--wf-navy-ink);
  border-radius: var(--wf-r-pill);
  box-shadow: 0 4px 0 rgba(20, 24, 41, 0.55), 0 12px 26px rgba(0, 0, 0, 0.3);
  animation: wf-toast-in var(--wf-dur-base) var(--wf-ease-spring) both;
  pointer-events: auto;
}

.wf-toast--info { --wf-toast-c: var(--wf-navy-800); }
.wf-toast--ok   { --wf-toast-c: var(--wf-green-800); }
.wf-toast--warn { --wf-toast-c: var(--wf-gold-800); }
.wf-toast--error{ --wf-toast-c: var(--wf-red-800); }
.wf-toast--reward { --wf-toast-c: var(--wf-cyan-800); }

.wf-toast.is-leaving { animation: wf-toast-in var(--wf-dur-fast) var(--wf-ease-in) reverse both; }

.wf-ad-notice {
  position: absolute;
  left: 50%;
  top: calc(var(--wf-safe-t) + var(--wf-sp-4));
  transform: translateX(-50%);
  z-index: var(--wf-z-toast);
  padding: var(--wf-sp-2) var(--wf-sp-4);
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-xs);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  color: var(--wf-navy-ink);
  background: var(--wf-gold);
  border: 2px solid var(--wf-navy-ink);
  border-radius: var(--wf-r-pill);
  box-shadow: 0 3px 0 rgba(20, 24, 41, 0.5);
  pointer-events: none;
  animation: wf-toast-in var(--wf-dur-base) var(--wf-ease-spring) both;
}

/* ==========================================================================
   TOUCH CONTROLS
   ========================================================================== */
.wf-controls {
  left: 50%;
  bottom: calc(var(--wf-pad-edge) + var(--wf-safe-b));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--wf-ctl-gap);
  z-index: 4;
}

.wf-ctl {
  --wf-ctl-bg: var(--wf-cream);
  --wf-ctl-fg: var(--wf-navy);
  --wf-ctl-edge: var(--wf-navy);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  width: var(--wf-ctl-size);
  height: var(--wf-ctl-size);
  min-width: var(--wf-tap-min);
  min-height: var(--wf-tap-min);
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-md);
  color: var(--wf-ctl-fg);
  background: var(--wf-ctl-bg);
  border: var(--wf-line-w) solid var(--wf-navy);
  border-radius: var(--wf-r-lg);
  box-shadow: 0 5px 0 var(--wf-ctl-edge);
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--wf-dur-fast) var(--wf-ease-out),
              box-shadow var(--wf-dur-fast) var(--wf-ease-out),
              background-color var(--wf-dur-fast) linear;
}

.wf-ctl .wf-icon { width: 1.45em; height: 1.45em; }

.wf-ctl--drop {
  --wf-ctl-bg: var(--wf-gold);
  --wf-ctl-fg: var(--wf-navy-ink);
  --wf-ctl-edge: var(--wf-gold-800);
  width: auto;
  padding: 0 var(--wf-sp-5);
  flex-direction: column;
  gap: 1px;
}

.wf-ctl__label {
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wide);
}

.wf-ctl:active,
.wf-ctl.is-pressed {
  transform: translateY(4px) scale(0.97);
  box-shadow: 0 1px 0 var(--wf-ctl-edge);
}

.wf-ctl:focus-visible {
  box-shadow: 0 5px 0 var(--wf-ctl-edge), var(--wf-sh-ring);
}

.wf-ctl[disabled] {
  filter: saturate(0.25);
  opacity: 0.55;
  box-shadow: 0 2px 0 rgba(20, 24, 41, 0.35);
}

/* ==========================================================================
   LISTS — best scores, stats, records, res-hero, empty state
   ========================================================================== */
.wf-best {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--wf-sp-2);
}

.wf-best__item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  padding: 6px 14px;
  background: rgba(20, 24, 41, 0.5);
  border: 2px solid rgba(255, 243, 220, 0.28);
  border-radius: var(--wf-r-pill);
}

.wf-best__key {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wider);
  text-transform: uppercase;
  color: var(--wf-cream);
  opacity: 0.75;
}

.wf-best__val {
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-lg);
  color: var(--wf-gold);
  font-variant-numeric: tabular-nums;
}

.wf-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--wf-sp-2);
}

.wf-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wf-sp-2);
  padding: 8px 12px;
  background: var(--wf-surface-2);
  border: 2px solid rgba(35, 42, 74, 0.5);
  border-radius: var(--wf-r-sm);
}

.wf-stat__key {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  color: var(--wf-ink-soft);
}

.wf-stat__val {
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-md);
  color: var(--wf-navy);
  font-variant-numeric: tabular-nums;
}

.wf-res-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--wf-sp-3);
  padding: var(--wf-sp-4);
  background:
    linear-gradient(180deg, rgba(255, 201, 60, 0.16), rgba(255, 201, 60, 0));
  border: 3px solid var(--wf-navy);
  border-radius: var(--wf-r-lg);
}

.wf-res-hero__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  text-align: center;
}

.wf-res-hero__key {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wider);
  text-transform: uppercase;
  color: var(--wf-ink-soft);
}

.wf-res-hero__val {
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: clamp(var(--wf-fs-3xl), 7vw, var(--wf-fs-5xl));
  line-height: 0.95;
  color: var(--wf-navy);
  font-variant-numeric: tabular-nums;
  animation: wf-pop var(--wf-dur-slow) var(--wf-ease-spring) both;
}

.wf-res-hero__unit {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  color: var(--wf-ink-soft);
}

.wf-res-hero__unit--best {
  color: var(--wf-gold-800);
}
.wf-res-hero__unit--best em {
  font-style: normal;
  color: var(--wf-navy);
}

.wf-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--wf-sp-3);
  padding: var(--wf-sp-8) var(--wf-sp-4);
  text-align: center;
  color: var(--wf-cream);
}

.wf-empty__icon {
  position: relative;
  width: 76px;
  height: 76px;
  border: 3px dashed rgba(255, 243, 220, 0.55);
  border-radius: var(--wf-r-lg);
}
.wf-empty__icon::before {
  content: "";
  position: absolute;
  inset: 26%;
  border: 3px solid rgba(255, 243, 220, 0.6);
  border-radius: var(--wf-r-sm);
}

.wf-empty__text {
  font-family: var(--wf-font-sans);
  font-weight: 700;
  font-size: var(--wf-fs-sm);
  line-height: 1.5;
  letter-spacing: 0.02em;
}

/* ==========================================================================
   GHOST / PERSONAL-BEST BAR
   ========================================================================== */
.wf-ghost-bar {
  left: 50%;
  top: 12%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: var(--wf-sp-2);
  padding: 5px 12px;
  background: rgba(20, 24, 41, 0.55);
  border: 2px solid rgba(53, 196, 232, 0.5);
  border-radius: var(--wf-r-pill);
  pointer-events: none;
}

.wf-ghost-bar__key,
.wf-ghost-bar__val {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  color: var(--wf-cyan);
}

.wf-ghost-bar__track {
  position: relative;
  width: 108px;
  height: 8px;
  background: rgba(20, 24, 41, 0.85);
  border-radius: var(--wf-r-pill);
  overflow: hidden;
}

.wf-ghost-bar__fill {
  height: 100%;
  width: 0%;
  background: var(--wf-cyan);
  border-radius: var(--wf-r-pill);
  transition: width var(--wf-dur-base) var(--wf-ease-out);
}

/* ==========================================================================
   COLLECTION
   ========================================================================== */
.wf-collect {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: var(--wf-sp-4);
  padding: var(--wf-sp-2) var(--wf-pad-edge) var(--wf-pad-edge);
  pointer-events: auto;
}

.wf-collect__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wf-sp-2);
  padding: var(--wf-sp-4);
  text-align: center;
  background: rgba(20, 24, 41, 0.55);
  border: 2px solid rgba(255, 243, 220, 0.26);
  border-radius: var(--wf-r-xl);
  overflow: hidden;
}

.wf-collect__preview {
  width: 100%;
  min-height: 120px;
  flex: 1 1 auto;
  border: 3px solid var(--wf-navy-ink);
  border-radius: var(--wf-r-lg);
  background:
    radial-gradient(70% 60% at 50% 34%, rgba(255, 201, 60, 0.28), rgba(255, 201, 60, 0) 70%),
    repeating-linear-gradient(0deg, rgba(255, 243, 220, 0.05) 0 22px, rgba(255, 243, 220, 0) 22px 44px);
  animation: wf-wobble-soft 4s var(--wf-ease-out) infinite;
}

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

.wf-collect__desc {
  font-size: var(--wf-fs-xs);
  font-weight: 600;
  color: rgba(255, 243, 220, 0.8);
  max-width: 34ch;
}

.wf-collect__req {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  color: var(--wf-gold);
}
.wf-collect__req:empty { display: none; }

.wf-collect__actions {
  display: flex;
  align-items: center;
  gap: var(--wf-sp-2);
  flex-wrap: wrap;
  justify-content: center;
  margin-top: auto;
}

.wf-collect__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr));
  gap: var(--wf-sp-3);
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px;
}

.wf-set {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--wf-sp-2);
  padding: var(--wf-sp-3);
  background: var(--wf-cream);
  border: var(--wf-line-w) solid var(--wf-navy);
  border-radius: var(--wf-r-lg);
  box-shadow: 0 4px 0 rgba(20, 24, 41, 0.5);
  color: var(--wf-navy);
  pointer-events: auto;
  transition: transform var(--wf-dur-fast) var(--wf-ease-out),
              box-shadow var(--wf-dur-fast) var(--wf-ease-out);
  animation: wf-set-in var(--wf-dur-base) var(--wf-ease-spring) both;
}

@media (hover: hover) {
  .wf-set:hover { transform: translateY(-3px); box-shadow: 0 7px 0 rgba(20, 24, 41, 0.5); }
}
.wf-set:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(20, 24, 41, 0.5); }

.wf-set__art {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--wf-navy);
  border-radius: var(--wf-r-md);
  background: linear-gradient(160deg, var(--wf-wood) 0 58%, var(--wf-wood-dark) 58% 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.34);
}

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

.wf-set.is-locked { filter: saturate(0.3); opacity: 0.8; }
.wf-set.is-locked .wf-set__art { background: var(--wf-grey); }
.wf-set.is-equipped {
  box-shadow: 0 4px 0 rgba(20, 24, 41, 0.5), var(--wf-sh-ring);
  background: var(--wf-gold);
}
.wf-set.is-selected { outline: 3px solid var(--wf-gold); outline-offset: 2px; }

/* ==========================================================================
   RECORDS
   ========================================================================== */
.wf-records {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: var(--wf-sp-2) var(--wf-pad-edge) var(--wf-pad-edge);
  pointer-events: auto;
}

.wf-records__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--wf-sp-2);
}

.wf-records__list > li,
.wf-record {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wf-sp-3);
  padding: var(--wf-sp-3) var(--wf-sp-4);
  background: var(--wf-cream);
  border: var(--wf-line-w) solid var(--wf-navy);
  border-radius: var(--wf-r-md);
  box-shadow: 0 4px 0 rgba(20, 24, 41, 0.5);
  color: var(--wf-navy);
  animation: wf-set-in var(--wf-dur-base) var(--wf-ease-spring) both;
}

.wf-record__key,
.wf-records__list > li > span:first-child {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  color: var(--wf-ink-soft);
}

.wf-record__val,
.wf-records__list > li > span:last-child {
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-lg);
  font-variant-numeric: tabular-nums;
}

.wf-record.is-best,
.wf-record--best {
  background: var(--wf-gold);
  box-shadow: 0 4px 0 var(--wf-gold-800);
}

/* ==========================================================================
   SETTINGS
   ========================================================================== */
.wf-settings {
  flex: 1 1 auto;
  min-height: 0;
  width: min(100%, 640px);
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: var(--wf-sp-2) var(--wf-pad-edge) var(--wf-pad-edge);
  display: flex;
  flex-direction: column;
  gap: var(--wf-sp-2);
  pointer-events: auto;
}

.wf-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--wf-sp-4);
  padding: var(--wf-sp-3) var(--wf-sp-4);
  background: var(--wf-cream);
  border: var(--wf-line-w) solid var(--wf-navy);
  border-radius: var(--wf-r-md);
  box-shadow: 0 4px 0 rgba(20, 24, 41, 0.5);
  color: var(--wf-navy);
  min-height: var(--wf-tap-min);
}

.wf-setting__label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-sm);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.wf-setting__hint {
  font-size: var(--wf-fs-nano);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--wf-ink-soft);
}

.wf-setting__control { display: flex; align-items: center; gap: var(--wf-sp-3); }

/* Group heading for the three settings sections. */
.wf-settings__group {
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wider);
  text-transform: uppercase;
  color: var(--wf-gold);
  padding: var(--wf-sp-2) var(--wf-sp-1) 0;
}

/* ---- Toggle switch ------------------------------------------------------ */
.wf-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 68px;
  height: 36px;
  flex: 0 0 auto;
  padding: 0;
  background: var(--wf-grey);
  border: 3px solid var(--wf-navy);
  border-radius: var(--wf-r-pill);
  cursor: pointer;
  transition: background-color var(--wf-dur-fast) linear;
  pointer-events: auto;
}

.wf-toggle__thumb,
.wf-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 26px;
  height: 26px;
  background: var(--wf-cream);
  border: 2px solid var(--wf-navy);
  border-radius: 50%;
  box-shadow: 0 2px 0 rgba(20, 24, 41, 0.4);
  transition: transform var(--wf-dur-base) var(--wf-ease-spring);
}

.wf-toggle.is-on,
.wf-toggle[aria-checked="true"],
.wf-toggle input:checked ~ .wf-toggle__thumb {
  background: var(--wf-green);
}
.wf-toggle.is-on .wf-toggle__thumb,
.wf-toggle.is-on::after,
.wf-toggle[aria-checked="true"]::after,
.wf-toggle input:checked ~ .wf-toggle__thumb {
  transform: translateX(32px);
}

.wf-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.wf-toggle:focus-visible { box-shadow: var(--wf-sh-ring); }

/* ---- Slider ------------------------------------------------------------- */
.wf-slider {
  --wf-slider-c: var(--wf-gold);
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--wf-sp-2);
  min-width: 150px;
  flex: 1 1 auto;
}

.wf-slider__track {
  position: relative;
  flex: 1 1 auto;
  height: 14px;
  background: var(--wf-grey);
  border: 3px solid var(--wf-navy);
  border-radius: var(--wf-r-pill);
  overflow: hidden;
}
.wf-slider__fill {
  height: 100%;
  width: 50%;
  background: var(--wf-slider-c);
  border-radius: var(--wf-r-pill);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.34);
  transition: width var(--wf-dur-instant) linear;
}

.wf-slider__value {
  min-width: 3.2ch;
  text-align: right;
  font-family: var(--wf-font-display);
  font-weight: 900;
  font-size: var(--wf-fs-sm);
  font-variant-numeric: tabular-nums;
}

/* Native range dressed to match the geometric language. */
.wf-slider input[type="range"],
.wf-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 36px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}
.wf-slider input[type="range"]::-webkit-slider-runnable-track,
.wf-range::-webkit-slider-runnable-track {
  height: 14px;
  background: var(--wf-grey);
  border: 3px solid var(--wf-navy);
  border-radius: var(--wf-r-pill);
}
.wf-slider input[type="range"]::-webkit-slider-thumb,
.wf-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  margin-top: -9px;
  background: var(--wf-gold);
  border: 3px solid var(--wf-navy);
  border-radius: 50%;
  box-shadow: 0 2px 0 rgba(20, 24, 41, 0.45);
}
.wf-slider input[type="range"]::-moz-range-track,
.wf-range::-moz-range-track {
  height: 14px;
  background: var(--wf-grey);
  border: 3px solid var(--wf-navy);
  border-radius: var(--wf-r-pill);
}
.wf-slider input[type="range"]::-moz-range-thumb,
.wf-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--wf-gold);
  border: 3px solid var(--wf-navy);
  border-radius: 50%;
}
.wf-slider input[type="range"]:focus-visible,
.wf-range:focus-visible { box-shadow: var(--wf-sh-ring); border-radius: var(--wf-r-pill); }

/* ---- Chips (segmented choices) ----------------------------------------- */
.wf-chips {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--wf-grey);
  border: 3px solid var(--wf-navy);
  border-radius: var(--wf-r-pill);
  pointer-events: auto;
}

.wf-chip {
  padding: 7px 14px;
  font-family: var(--wf-font-sans);
  font-weight: 800;
  font-size: var(--wf-fs-nano);
  letter-spacing: var(--wf-ls-wide);
  text-transform: uppercase;
  color: var(--wf-navy);
  background: transparent;
  border: 0;
  border-radius: var(--wf-r-pill);
  cursor: pointer;
  pointer-events: auto;
  transition: background-color var(--wf-dur-fast) linear, color var(--wf-dur-fast) linear;
  min-height: 34px;
}

.wf-chip.is-active,
.wf-chip[aria-pressed="true"],
.wf-chip[aria-selected="true"] {
  background: var(--wf-navy);
  color: var(--wf-gold);
}

.wf-chip:focus-visible { box-shadow: var(--wf-sh-ring); }
