.wm-shell-root.wm-shell-scene .wm-scene-shade {
  background:
    radial-gradient(
      ellipse clamp(82px, 16vw, 225px) clamp(66px, 23vh, 186px)
      at right clamp(40px, 9vw, 135px) bottom clamp(36px, 12vh, 112px),
      #ffebac59, #ffdb8727 55%, transparent 100%
    ),
    linear-gradient(180deg, #0935462e, transparent 22%),
    linear-gradient(0deg, #09354629, transparent 28%);
}

.wm-shell-root.wm-shell-scene.wm-shell-character-natural .wm-play-grid > .wm-hero-image {
  filter: brightness(1.09) drop-shadow(0 8px 10px #19372e80);
}

.sp-bridge-workshop {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3.6fr);
  align-items: end;
  justify-items: center;
  column-gap: clamp(4px, 1.3vw, 16px);
  row-gap: clamp(4px, 1.7cqh, 12px);
  width: min(100%, 920px, max(440px, 180cqh));
  padding: 4px;
  box-sizing: border-box;
  flex: none;
  --r-red: #cf3542;
  --r-orange: #ed832c;
  --r-yellow: #f4c63c;
  --r-green: #4e9c54;
  --r-blue: #3889ce;
  --r-indigo: #49478e;
  --r-violet: #9453b3;
}

.sp-bridge-guide {
  position: relative;
  align-self: center;
  width: min(100%, 190px, max(78px, 37cqh));
  aspect-ratio: 1;
  background: url('assets/ribbon-guide.webp') center / 100% 100% no-repeat;
  filter: drop-shadow(0 5px 5px #29331855);
}

.sp-guide-sheet {
  position: absolute;
  inset: 27% 16% 13%;
  display: grid;
  align-content: center;
  gap: 4%;
}

.sp-guide-marks {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  font-size: clamp(9px, 2.5cqh, 15px);
  font-weight: 600;
  line-height: 1.2;
  color: #59361e;
  text-align: center;
}

.sp-guide-marks span { border-block-start: 2px solid var(--ribbon); }

.sp-bridge-stage {
  position: relative;
  isolation: isolate;
  width: min(100%, 740px, max(180px, 122cqh));
  aspect-ratio: 500 / 270;
  pointer-events: none;
}

.sp-bridge-stage::before {
  content: '';
  position: absolute;
  inset: 65% 4% -1%;
  z-index: -1;
  background: url('assets/ribbon-stream.webp') center / contain no-repeat;
}

.sp-rainbow { display: block; width: 100%; }
.sp-bridge-stage .sp-rainbow { height: 100%; filter: drop-shadow(0 2px 2px #37251755); }
.sp-ribbon-seam { fill: none; stroke: #fff2c989; stroke-width: 1.1; }
.sp-ribbon-chosen { stroke: #fff9d4; stroke-width: 4; }

.sp-bridge-stage > .sp-bridge-deck {
  position: absolute;
  bottom: 3%;
  left: 0;
  width: 100%;
  max-width: none;
  max-height: none;
  filter: drop-shadow(0 5px 4px #30371e70);
}

.sp-ribbons {
  grid-column: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(4px, 1vw, 12px);
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  padding: 5px clamp(5px, 1vw, 16px);
  border-radius: 15px;
  background: linear-gradient(#e2b673, #b0773e 12%, #9e632f 65%, #724322);
  box-shadow: inset 0 1px 2px #ffecc487, 0 4px 8px #2a301f69;
}

.sp-ribbons .sp-piece {
  flex: none;
  position: relative;
  width: clamp(48px, min(11cqh, 8.4vw), 78px);
  height: clamp(48px, 11cqh, 74px);
  background: #66401f;
  border: 0;
  border-radius: 8px;
  padding: 2px;
  box-shadow: 0 2px 3px #45271283;
}

.sp-ribbons .sp-band {
  position: relative;
  display: grid;
  align-items: center;
  justify-items: center;
  color: #4c2d1d;
  border-radius: 6px;
  background:
    linear-gradient(120deg, #fff4d02e, transparent 55%, #351f152d),
    repeating-linear-gradient(88deg, #1d120612 0 1px, transparent 1px 3px),
    var(--ribbon);
  box-shadow: inset 0 0 0 1px #fff8de49, inset 0 -3px 3px #351d123b;
}

.sp-ribbons .sp-band::before {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px dashed #fff7d6a6;
  border-radius: 4px;
}

.sp-ribbons .sp-order {
  display: grid;
  place-items: center;
  position: relative;
  width: 1.45em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff3cf;
  box-shadow: 0 1px 3px #45271284, inset 0 0 0 1px #d9a86b;
  font-size: clamp(18px, 4.4cqh, 27px);
  font-weight: 600;
  line-height: 1;
}

.sp-ribbons .sp-piece[aria-pressed="true"] {
  outline: 3px solid #fff0ad;
  outline-offset: 1px;
  box-shadow: 0 0 0 5px #673b20;
}

.sp-ribbons .sp-piece:focus-visible {
  outline: 3px solid #173e60;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #fff3cf;
}

@media (max-width: 600px) and (orientation: portrait) {
  .sp-bridge-workshop { grid-template-columns: 1fr; gap: 5px; }
  .sp-bridge-guide { justify-self: start; width: clamp(88px, 27vw, 126px); }
  .sp-guide-marks { font-size: 10px; }
  .sp-bridge-stage { width: min(100%, 94cqh); margin-block-start: -9px; }
  .sp-ribbons {
    grid-column: 1;
    width: 254px;
    gap: 4px;
    padding: 5px;
    margin-inline: auto;
  }
  .sp-ribbons .sp-piece { width: 58px; height: clamp(48px, 9.5cqh, 58px); }
}

@media (orientation: landscape) and (max-height: 520px) {
  .sp-bridge-workshop {
    grid-template-columns: minmax(78px, .8fr) minmax(0, 2.4fr) minmax(218px, 1.8fr);
    align-items: center;
    column-gap: 5px;
    width: min(95%, 730px);
  }
  .sp-bridge-stage { width: min(100%, 330px, 153cqh); }
  .sp-ribbons { grid-column: 3; gap: 5px; width: 224px; padding: 5px; }
  .sp-guide-marks { font-size: 9px; }
}

@media (max-height: 700px) and (max-width: 600px) and (orientation: portrait) {
  .sp-bridge-guide { width: 84px; }
  .sp-bridge-stage { width: min(100%, 77cqh); }
}

@media (max-height: 630px) and (max-width: 600px) and (orientation: portrait) {
  .sp-board[data-kind="rainbow-ribbon-bridge"] .sp-task { padding-block-end: 38px; }
  .sp-bridge-workshop { grid-template-columns: 76px minmax(0, 1fr); align-items: center; }
  .sp-bridge-guide { width: 76px; }
  .sp-bridge-stage { width: min(100%, 260px); margin-block-start: 0; }
  .sp-ribbons { grid-column: 1 / -1; }
}
