html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #c7dfe8;
}

body {
  min-width: 0;
}

#activity-root {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

#fx-layer {
  position: fixed;
  z-index: 60;
  inset: 0;
  overflow: hidden;
  contain: strict;
  pointer-events: none;
}

#fx-layer,
#fx-layer * {
  pointer-events: none;
}

#fx-layer .fx-particle,
#fx-layer .fx-ripple {
  position: absolute;
  display: block;
  pointer-events: none;
  will-change: transform, opacity;
}

#fx-layer .fx-particle {
  transform: translate3d(0, 0, 0);
}

#fx-layer .fx-streak {
  border-radius: 999px;
}

#fx-layer .fx-flake {
  border-radius: 50% 42% 55% 45%;
}

#fx-layer .fx-flake::before,
#fx-layer .fx-flake::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 145%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.72;
  transform-origin: center;
}

#fx-layer .fx-flake::before {
  transform: translate(-50%, -50%) rotate(58deg);
}

#fx-layer .fx-flake::after {
  transform: translate(-50%, -50%) rotate(122deg);
}

#fx-layer .fx-ripple {
  border: 2px solid rgba(205, 242, 250, 0.78);
  border-radius: 50%;
}

.nb-board {
  --nb-navy: #174a7e;
  --nb-cream: #fff3d4;
  --nb-wood-dark: #7a4928;
  --nb-warm: #b66a32;
  --nb-actor: clamp(90px, 18vmin, 130px);
  --nb-choice: clamp(56px, 12vmin, 96px);
  position: relative;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: visible;
  border: 0;
  border-image: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--nb-navy);
  outline: none;
}

.nb-board,
.nb-board * {
  box-sizing: border-box;
}

.nb-board-head {
  position: absolute;
  z-index: 8;
  top: 6px;
  right: 7px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.nb-label {
  display: none;
}

.nb-board .nb-skip {
  min-width: clamp(78px, 12vmin, 112px);
  min-height: 56px;
  padding: 8px 13px;
  border: 2px solid rgba(122, 73, 40, 0.78);
  border-radius: 999px;
  background: rgba(255, 248, 229, 0.9);
  box-shadow: 0 3px 8px rgba(41, 58, 66, 0.22);
  color: var(--nb-wood-dark);
  cursor: pointer;
  font: inherit;
  font-size: clamp(15px, 2vmin, 19px);
  font-weight: 600;
}

.nb-board .nb-skip:focus-visible {
  outline: 3px solid var(--nb-cream);
  outline-offset: 3px;
}

.nb-skip:active {
  transform: translateY(2px);
}

.nb-sequence {
  position: absolute;
  z-index: 3;
  top: 50%;
  right: 3%;
  left: 3%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(2px, 0.5vw, 4px);
  height: var(--nb-row-height, 72px);
  min-width: 0;
}

.nb-plank,
.nb-gap-zone {
  position: relative;
  min-width: 0;
  min-height: 56px;
}

.nb-board .nb-plank {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: clamp(10px, 2.2vmin, 18px);
  background: transparent url("assets/bridge-deck.webp") center / 100% 100% no-repeat;
  filter:
    drop-shadow(0 4px 4px rgba(35, 55, 65, 0.32))
    drop-shadow(0 1px 1px rgba(53, 39, 27, 0.2));
  color: var(--nb-navy);
  font-family: Fredoka, system-ui, sans-serif;
  font-size: clamp(32px, 6.3vmin, 64px);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 248, 230, 0.55);
}

.nb-gap-zone {
  display: grid;
  place-items: stretch;
}

.nb-board .nb-gap {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-width: 56px;
  min-height: 56px;
  padding: 0;
  border: 0;
  border-radius: clamp(10px, 2.2vmin, 18px);
  background: rgba(222, 244, 250, 0.46);
  box-shadow: inset 0 0 0 1px rgba(151, 197, 213, 0.52);
  color: var(--nb-navy);
  cursor: pointer;
  font-family: Fredoka, system-ui, sans-serif;
  font-size: clamp(32px, 6vmin, 58px);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1;
  outline: 1px solid rgba(142, 190, 207, 0.76);
  outline-offset: -4px;
  text-shadow: 0 1px 0 rgba(255, 248, 230, 0.55);
}

.nb-gap.is-filled {
  border-radius: clamp(10px, 2.2vmin, 18px);
  background: transparent url("assets/bridge-deck.webp") center / 100% 100% no-repeat;
  color: var(--nb-navy);
  filter:
    drop-shadow(0 4px 4px rgba(35, 55, 65, 0.32))
    drop-shadow(0 1px 1px rgba(53, 39, 27, 0.2));
  outline: 0;
  text-shadow: 0 1px 0 rgba(255, 248, 230, 0.55);
}

.nb-gap.is-success {
  filter:
    drop-shadow(0 0 5px rgba(255, 226, 112, 0.96))
    drop-shadow(0 5px 7px rgba(123, 82, 23, 0.42));
}

.nb-gap:focus-visible {
  outline: 4px solid #fff;
  outline-offset: 2px;
}

.nb-gap-hit {
  position: absolute;
  z-index: 5;
  inset: -24%;
  border-radius: 28px;
  pointer-events: none;
}

.nb-board.is-dragging .nb-gap-hit {
  pointer-events: auto;
}

.nb-board.is-dragging .nb-gap-zone {
  filter: drop-shadow(0 0 5px rgba(211, 241, 250, 0.9));
}

.nb-board.is-dragging .nb-gap-zone.is-near-target {
  filter: drop-shadow(0 0 3px rgba(155, 214, 232, 0.95));
}

.nb-steps {
  position: absolute;
  z-index: 6;
  top: 11%;
  right: auto;
  box-sizing: border-box;
  display: none;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: max-content;
  align-items: center;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(145, 190, 207, 0.52);
  border-radius: 16px;
  background: rgba(250, 254, 255, 0.96);
  box-shadow: 0 4px 12px rgba(23, 74, 126, 0.14);
  list-style: none;
  pointer-events: none;
}

.nb-steps.has-relation {
  display: grid;
}

.nb-step {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--nb-navy);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.12;
  text-align: center;
  white-space: nowrap;
}

.nb-step.is-live {
  padding: 1px 6px;
  border: 1px solid rgba(145, 190, 207, 0.62);
  border-radius: 999px;
  background: rgba(222, 242, 248, 0.9);
}

.nb-step.is-relation {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 431px) {
  .nb-step {
    font-size: clamp(22px, 3vmin, 28px);
  }
}

.nb-tray {
  position: absolute;
  z-index: 4;
  right: 3%;
  left: 3%;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vmin, 18px);
  min-width: 0;
  min-height: var(--nb-choice);
  padding: 0;
  border: 0;
}

.nb-board .nb-candidate {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: var(--nb-choice);
  min-width: 56px;
  height: var(--nb-choice);
  min-height: 56px;
  padding: 0;
  border: 0;
  border-radius: clamp(11px, 2.4vmin, 19px);
  background: transparent url("assets/bridge-deck.webp") center / 100% 100% no-repeat;
  filter:
    drop-shadow(0 4px 5px rgba(38, 54, 64, 0.3))
    drop-shadow(0 1px 1px rgba(53, 39, 27, 0.2));
  color: var(--nb-navy);
  cursor: grab;
  font-family: Fredoka, system-ui, sans-serif;
  font-size: clamp(32px, 5.8vmin, 54px);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1;
  touch-action: none;
}

.nb-candidate[aria-pressed="true"] {
  outline: 3px solid rgba(255, 211, 144, 0.98);
  outline-offset: 3px;
  transform: translateY(-3px);
}

.nb-candidate:focus-visible {
  outline: 3px solid var(--nb-cream);
  outline-offset: 3px;
}

.nb-candidate:active {
  cursor: grabbing;
}

.nb-drag-ghost {
  position: fixed;
  z-index: 80;
  display: grid;
  place-items: center;
  width: var(--nb-choice, 72px);
  height: var(--nb-choice, 72px);
  border: 0;
  border-radius: 15px;
  background: transparent url("assets/bridge-deck.webp") center / 100% 100% no-repeat;
  color: #174a7e;
  filter: drop-shadow(0 7px 7px rgba(41, 50, 56, 0.34));
  font: 600 clamp(32px, 5.8vmin, 54px) / 1 Fredoka, system-ui, sans-serif;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(3deg);
  transition: left 1000ms cubic-bezier(0.3, 0.65, 0.35, 1),
    top 1000ms cubic-bezier(0.3, 0.65, 0.35, 1);
}

.nb-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  white-space: nowrap;
}

#activity-root .nb-help-demo {
  margin: 0 auto 10px;
  font-size: clamp(18px, 2.2vmin, 21px);
}

.nb-crossing {
  position: absolute;
  z-index: 5;
  height: var(--nb-actor);
  pointer-events: none;
}

.nb-board.is-paused .nb-crossing {
  visibility: hidden;
}

.nb-crossing img {
  position: absolute;
  bottom: 0;
  left: 0;
  display: block;
  width: var(--nb-actor);
  max-width: none;
  height: var(--nb-actor);
  max-height: none;
  object-fit: contain;
  opacity: 1;
  filter:
    brightness(1.04)
    drop-shadow(0 0 2px rgba(255, 249, 228, 0.95))
    drop-shadow(0 0 8px rgba(211, 240, 248, 0.58))
    drop-shadow(0 5px 5px rgba(28, 50, 61, 0.32));
  transform: none;
}

.nb-crossing.is-active img {
  animation: nb-cross 900ms cubic-bezier(0.32, 0.65, 0.28, 1) forwards;
}

.nb-board.is-paused .nb-crossing img,
.nb-board.is-paused .nb-hand {
  animation-play-state: paused;
}

.nb-hand {
  position: fixed;
  z-index: 90;
  width: clamp(66px, 10vmin, 88px);
  height: auto;
  pointer-events: none;
  transform-origin: 24% 7%;
  filter: drop-shadow(0 4px 5px rgba(38, 27, 19, 0.28));
  transition: left 260ms ease, top 260ms ease, transform 260ms ease;
}

.nb-hand.is-hidden {
  display: none;
}

.nb-board.is-paused .nb-hand,
.nb-board.is-reduced .nb-hand {
  transition: none;
}

.nb-board.is-reduced .nb-crossing.is-active img {
  left: var(--nb-cross-end, calc(100% - var(--nb-actor)));
  animation: none;
}

.nb-drag-ghost.is-reduced {
  transition: none;
}

.nb-success {
  animation: nb-gold-glow 650ms ease-out both;
}

@keyframes nb-cross {
  0% {
    left: 0;
    transform: translateX(0);
  }
  100% {
    left: var(--nb-cross-end, calc(100% - var(--nb-actor)));
    transform: translateX(0);
  }
}

@keyframes nb-gold-glow {
  0% {
    filter:
      drop-shadow(0 0 4px rgba(255, 226, 112, 0.76))
      drop-shadow(0 4px 5px rgba(123, 82, 23, 0.36))
      brightness(1);
  }
  45% {
    filter:
      drop-shadow(0 0 8px rgba(255, 225, 125, 0.96))
      drop-shadow(0 4px 5px rgba(123, 82, 23, 0.36))
      brightness(1.14);
  }
  100% {
    filter:
      drop-shadow(0 0 5px rgba(255, 226, 112, 0.96))
      drop-shadow(0 5px 7px rgba(123, 82, 23, 0.42))
      brightness(1);
  }
}

@media (max-width: 430px) and (max-height: 700px) and (orientation: portrait) {
  .nb-board {
    --nb-actor: 80px;
    --nb-choice: 56px;
  }

  .nb-board .nb-plank,
  .nb-board .nb-gap,
  .nb-board .nb-candidate {
    font-size: 32px;
  }

  .nb-tray {
    gap: 7px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .nb-board {
    --nb-actor: clamp(56px, 15vh, 72px);
    --nb-choice: 56px;
  }

  .nb-board-head {
    top: 2px;
    right: 4px;
  }

  .nb-board .nb-skip {
    min-width: 78px;
    min-height: 56px;
    padding: 5px 10px;
    font-size: 14px;
  }

  .nb-board .nb-plank,
  .nb-board .nb-gap,
  .nb-board .nb-candidate {
    font-size: 32px;
  }

  .nb-step {
    padding: 3px 5px;
    font-size: 22px;
    line-height: 1.1;
  }

  .nb-steps {
    gap: 3px;
    padding: 4px 6px;
  }

  .nb-tray {
    gap: 7px;
  }
}

@media (max-width: 380px) {
  .nb-step {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nb-skip,
  .nb-hand,
  .nb-candidate {
    transition: none;
  }

  .nb-crossing.is-active img {
    left: var(--nb-cross-end, calc(100% - var(--nb-actor)));
    animation: none;
  }

  .nb-success {
    animation: none;
  }
}

@media (forced-colors: active) {
  .nb-gap,
  .nb-plank,
  .nb-candidate,
  .nb-skip {
    forced-color-adjust: auto;
  }
}
