/* Styles for the authentic WeDo blocks drawn by shared/wedo-blocks.js.
   All sizes are the artwork's 1x pixel sizes; @2x images keep it sharp on iPad. */

.wedo-block {
  position: relative; flex: 0 0 auto;
  background-repeat: no-repeat;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}

.wedo-block-icon {
  position: absolute; left: 0; top: 4px; width: 91px; height: 81px;
  background: center / contain no-repeat;
  pointer-events: none;
}
.wedo-block[data-shape="start"] .wedo-block-icon { left: 22px; top: 12px; width: 66px; height: 66px; }
.wedo-block[data-shape="loop"]  .wedo-block-icon { left: auto; right: 26px; top: 50px; width: 54px; height: 54px; }

/* Loops stretch in the middle only, so the rounded right end keeps its shape. */
.wedo-loop-body {
  position: absolute; inset: 0; box-sizing: border-box;
  border-style: solid; border-color: transparent;
  border-width: 0 105px 0 30px;
  border-image-slice: 0 210 0 60 fill;
  border-image-width: 0 105px 0 30px;
  border-image-repeat: stretch;
}

/* Parameter chip: its top bump nests into the block's notch. */
.wedo-chip {
  position: absolute; top: 80px; left: 0; width: 91px; height: 65px;
  background: 0 0 / 91px 65px no-repeat;
}
.wedo-chip.blue   { background-image: url(../assets/blocks/ParameterBlueWhite@2x.png); }
.wedo-chip.orange { background-image: url(../assets/blocks/ParameterOrange@2x.png); }
.wedo-chip.tappable { cursor: pointer; }
.wedo-block[data-shape="start"] .wedo-chip { left: 8px; }
.wedo-block[data-shape="loop"]  .wedo-chip { left: auto; right: 14px; top: 110px; }

.wedo-chip-sensor { position: absolute; inset: 0; background: center / 91px 65px no-repeat; }

.wedo-chip-face {
  position: absolute; left: 10px; top: 19px; width: 71px; height: 28px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font: 800 19px/1 'Nunito', system-ui, sans-serif; color: #333;
  overflow: hidden; white-space: nowrap;
}
.wedo-chip-face input {
  width: 100%; height: 100%; border: 0; padding: 0; margin: 0;
  background: transparent; color: inherit; font: inherit; text-align: center;
  -moz-appearance: textfield;
}
.wedo-chip-face input::-webkit-inner-spin-button,
.wedo-chip-face input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.wedo-chip-face input[type=text] { font-size: 15px; }
.wedo-chip-dot { width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 1.5px #333; flex: 0 0 auto; }

/* Running-step highlight */
.wedo-block.active { filter: drop-shadow(0 0 6px rgba(45,74,48,.9)) brightness(1.08); }

/* Static program picture */
.wedo-program { position: relative; flex: 0 0 auto; }
.wedo-program-scroll { overflow-x: auto; padding: 6px 4px 10px; }

/* Scaled thumbnails (palette, legend) */
.wedo-thumb { position: relative; flex: 0 0 auto; }

/* Legend */
.wedo-ref { display: grid; grid-template-columns: 1fr; gap: 18px 14px; padding: 10px 4px; }
@media (min-width: 640px) { .wedo-ref { grid-template-columns: 1fr 1fr; } }
.wedo-ref-row { display: flex; align-items: flex-start; gap: 14px; }
.wedo-ref-exp { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--text); padding-top: 8px; }
