/* Splash FX: full-viewport WebGL + bottom fold-up dock. Load only on the racing home splash. */

body.nemesis-page--fx #fx-root {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: #0b0c0d;
}

body.nemesis-page--fx #fx-root canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  animation: fx-fade-in 0.9s ease forwards;
}

@keyframes fx-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

body.nemesis-page--fx .nemesis-hero--fx {
  background: transparent;
}

body.nemesis-page--fx .nemesis-hero--fx .nemesis-hero__bg {
  display: none;
}

.fx-dock {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fx-fold {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
  width: min(max-content, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
}

.fx-fold-inner {
  overflow: hidden;
  min-height: 0;
}

.fx-dock:hover .fx-fold,
.fx-dock:focus-within .fx-fold,
.fx-dock.is-open .fx-fold {
  grid-template-rows: 1fr;
}

.fx-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.8rem 0.35rem;
  background: transparent;
  border: 0;
}

.fx-views {
  flex: 1 0 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.fx-view {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.fx-view[data-fx-view="main"],
.fx-view.is-active {
  display: flex;
}

.fx-effect-name {
  flex: 1 0 100%;
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: Inter, sans-serif;
  line-height: 1.2;
  text-align: center;
  -webkit-text-size-adjust: 100%;
  text-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
}

.fx-dock.is-disabled .fx-effect-name {
  opacity: 0.5;
}

.fx-btn {
  appearance: none;
  background-color: rgba(5, 5, 5, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 8px 14px;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  font-family: Inter, sans-serif;
  cursor: pointer;
  white-space: nowrap;
  border-radius: var(--bs-border-radius, 0.375rem);
}

.fx-btn-icon {
  padding: 7px 10px;
  min-width: 2.45rem;
  letter-spacing: 0;
  font-size: 1.05rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fx-dice {
  display: block;
  width: 34px;
  height: 16px;
}

.fx-shuffle {
  display: block;
  width: 15px;
  height: 15px;
}

.fx-btn:hover:not(:disabled) {
  background: #fff;
  color: #000;
}

.fx-btn.is-on {
  background: #fff;
  color: #000;
}

.fx-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.fx-lock {
  display: block;
  width: 14px;
  height: 14px;
}

.fx-eye {
  display: block;
  width: 15px;
  height: 15px;
}

.fx-eye-on {
  display: none;
}

.fx-dock.is-disabled .fx-eye-off {
  display: none;
}

.fx-dock.is-disabled .fx-eye-on {
  display: block;
}

.fx-color-tools {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
}

.fx-swatches {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0.35rem;
}

.fx-swatch {
  appearance: none;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.28rem;
  cursor: pointer;
  background: #222;
}

.fx-swatch-wild {
  background: linear-gradient(90deg, #ff6a3d, #e0b85a, #7dffb3, #2ee6d6, #9fd8ff, #c89bff);
}

.fx-swatch:hover:not(:disabled) {
  transform: scale(1.12);
}

.fx-swatch.is-active {
  box-shadow: 0 0 0 2px #fff;
}

.fx-swatch:disabled {
  opacity: 0.35;
  cursor: default;
  transform: none;
}

.fx-grip {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 10px 28px 12px;
  cursor: pointer;
}

.fx-grip-bar {
  display: block;
  width: 42px;
  height: 2px;
  background: rgba(255, 255, 255, 0.38);
}

.fx-dock.is-disabled .fx-grip-bar {
  opacity: 0.45;
}

@media (max-width: 640px) {
  .fx-fold {
    width: calc(100vw - 1rem);
    max-width: calc(100vw - 1rem);
  }

  .fx-panel {
    width: 100%;
    min-width: 0;
    gap: 0.35rem;
    padding: 0.5rem 0.45rem 0.28rem;
  }

  .fx-views {
    gap: 0.35rem;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .fx-view {
    flex-wrap: nowrap;
    justify-content: center;
    justify-content: safe center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .fx-view::-webkit-scrollbar {
    display: none;
  }

  .fx-btn {
    padding: 6px 10px;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }

  .fx-btn-icon {
    min-width: 2.05rem;
    padding: 6px 8px;
  }

  .fx-dice {
    width: 28px;
    height: 14px;
  }

  .fx-color-tools {
    flex: 0 0 auto;
    gap: 0.3rem;
  }

  .fx-swatches {
    flex-wrap: nowrap;
  }

  .fx-swatch {
    width: 1.05rem;
    height: 1.05rem;
    flex: 0 0 auto;
  }

  .fx-effect-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.nemesis-page--fx #fx-root canvas,
  .fx-fold {
    animation: none;
    transition: none;
  }

  body.nemesis-page--fx #fx-root canvas {
    opacity: 1;
  }
}
