.pipe-layout {
  display: grid;
  grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.pipe-panel,
.pipe-stage {
  padding: 18px;
}

.pipe-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.hint {
  margin: 0;
  color: #405363;
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.55;
}

.pipe-stage {
  background: linear-gradient(160deg, rgba(188, 232, 214, 0.9), rgba(255, 253, 245, 0.92));
}

.endpoint-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #405363;
  font-weight: 950;
}

.pipe-board {
  --size: 4;
  display: grid;
  grid-template-columns: repeat(var(--size), minmax(0, 1fr));
  gap: 10px;
  width: min(100%, 680px);
  margin: 0 auto;
}

.pipe-tile {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  background: #fffdf5;
  box-shadow: 0 12px 22px rgba(71, 85, 105, 0.13);
  cursor: pointer;
}

.pipe-tile.is-water {
  background: #dff6ff;
  border-color: rgba(77, 163, 199, 0.7);
}

.pipe-tile.is-start {
  background: #ffe089;
}

.pipe-tile.is-goal {
  background: #ffd1b8;
}

.pipe-stub,
.pipe-joint {
  position: absolute;
  background: #4da3c7;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.32);
}

.pipe-stub.up,
.pipe-stub.down {
  left: 39%;
  width: 22%;
  height: 50%;
}

.pipe-stub.left,
.pipe-stub.right {
  top: 39%;
  width: 50%;
  height: 22%;
}

.pipe-stub.up {
  top: 0;
}

.pipe-stub.down {
  bottom: 0;
}

.pipe-stub.left {
  left: 0;
}

.pipe-stub.right {
  right: 0;
}

.pipe-joint {
  left: 34%;
  top: 34%;
  width: 32%;
  height: 32%;
  border-radius: 50%;
}

.pipe-icon {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42%;
  height: 42%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  font-size: clamp(1.2rem, 3vw, 2rem);
  box-shadow: 0 8px 16px rgba(71, 85, 105, 0.13);
}

.pipe-icon.start {
  left: 8%;
  top: 8%;
}

.pipe-icon.goal {
  right: 8%;
  bottom: 8%;
}

@media (max-width: 820px) {
  .pipe-layout {
    grid-template-columns: 1fr;
  }

  .pipe-board {
    gap: 7px;
  }

  .pipe-tile {
    border-radius: 15px;
  }
}
